Skip to content

how can I get the full detected secret with keyword prefix instead of just the secret content itself in trufflehog output raw field? #3947

@yang0369

Description

@yang0369

Please review the Community Note before submitting

Description

My question is how can I get Raw":"aws_access_key_id = AKIAQYLPMN5HHHFPZAM2" instead of Raw":"AKIAQYLPMN5HHHFPZAM2" in trufflehog output?

To replicate my work:

e.g. in my local path, I have this test.txt file under /my-path/trufflehog_test/ path:

test.txt

[default]
aws_access_key_id = AKIAQYLPMN5HHHFPZAM2
password = 1tUm636uS1yOEcfP5pvfqJ/ml36mF7AkyHsEU0IU
output = json
region = us-east-2

by running
trufflehog filesystem /my-path/trufflehog_test --no-verification --json > truffle_filesystem_sherlock.jsonl
I got this output:

{"SourceMetadata":{"Data":{"Filesystem":{"file":"/Users/kewenyang/Desktop/Projects/sherlock/sherlock-service/personal/trufflehog_test/test.txt","line":2}}},"SourceID":1,"SourceType":15,"SourceName":"trufflehog - filesystem","DetectorType":2,"DetectorName":"AWS","DetectorDescription":"AWS (Amazon Web Services) is a comprehensive cloud computing platform offering a wide range of on-demand services like computing power, storage, databases. API keys for AWS can have varying amount of access to these services depending on the IAM policy attached.","DecoderName":"PLAIN","Verified":false,"VerificationFromCache":false,"Raw":"AKIAQYLPMN5HHHFPZAM2","RawV2":"AKIAQYLPMN5HHHFPZAM2:1tUm636uS1yOEcfP5pvfqJ/ml36mF7AkyHsEU0IU","Redacted":"AKIAQYLPMN5HHHFPZAM2","ExtraData":{"account":"052310077262","is_canary":"true","message":"This is an AWS canary token generated at canarytokens.org, and was not set off; learn more here: https://trufflesecurity.com/canaries","resource_type":"Access key"},"StructuredData":null}

Preferred Solution

Additional Context

References

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions