securitypasswordsdevopsdevsecops

Trufflehog not finding hard-coded password & secrets


I'm using trufflehog_3.33.0_linux_amd64.tar.gz to detect the passwords and tokens.

Actually i have hard-coded tokens & passwords and committed them into my github repository. But when i tried to scan it is not finding tokens and passwords.

$ ./trufflehog git git@github-company.com:org-demo/test.git --only-verified
2023-05-02T09:57:50+05:30       info-0  trufflehog      loaded decoders {"count": 3}
2023-05-02T09:57:50+05:30       info-0  trufflehog      loaded detectors        {"total": 737, "verification_enabled": 737, "verification_disabled": 0}
2023-05-02T09:57:50+05:30       info-0  trufflehog      possible duplicate detector configured  {"detector": "Square"}
πŸ·πŸ”‘πŸ·  TruffleHog. Unearth your secrets. πŸ·πŸ”‘πŸ·

Above command couldn't find the password & token. But in my repository files i have passwords & tokens like below in few files.

USERNAME="user"
PASSWORD="password"

HTTP_USER="user1"
HTTP_TOKEN="DRFuteQw$#riYhte69AwerDdf-$"

Can I know what is the issue with my command? Why it is not finding custom hard-coded password & token?

Any help would be appreciated


Solution

  • Trufflehog is not meant to detect standalone passwords like const myPass = abc123. You can read about their approach in It’s impossible to find every vulnerability, so we don’t try to.

    Here you can see all the detectors they currently have.

    They can detect for example:

    If Trufflehog still does not detect something for you, try to omit --only-verified or even use --no-verification flag. Trufflehog tries to verify the results to limit false positives (check here how they verify if a private key can be compromised).