Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trufflehog not reporting secrets in docker metadata file #3007

Open
venkatasandeeplade opened this issue Jun 24, 2024 · 2 comments
Open

Trufflehog not reporting secrets in docker metadata file #3007

venkatasandeeplade opened this issue Jun 24, 2024 · 2 comments
Labels

Comments

@venkatasandeeplade
Copy link

venkatasandeeplade commented Jun 24, 2024

Please review the Community Note before submitting

TruffleHog Version

└─$ trufflehog --version
trufflehog 3.78.2

Trace Output

Sorry to say , we can't share as per organisation policy
Command used
trufflehog docker --image=xxxxx.dkr.ecr.us-west-2.amazonaws.com/xx/aiops-pii-mask:1234_abcd_1234

Expected Behavior

Trufflehog should report the secrets exposed in docker config.json/metadata file

Actual Behavior

We have some JFROG passwords in docker metadata / layer information. Trufflehog not reporting them

Environment

@v3gard
Copy link

v3gard commented Aug 13, 2024

Related to #2940

@AlfredBerg
Copy link

I'm facing the same issue. The current implementation seems to only scan the created_by field of the config metadata and e.g. not the envs

Data: []byte(historyInfo.entry.CreatedBy),

Trufflehog seems to already be using https://github.com/google/go-containerregistry/, which has a tool called crane that can get this docker config data, so should not be impossible to scan the whole config instead. Might have a go at creating a pull request.

https://github.com/google/go-containerregistry/tree/main/cmd/crane

$ crane config nginx | jq
{
  "architecture": "amd64",
  "config": {
    "ExposedPorts": {
      "80/tcp": {}
    },
    "Env": [
      "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
      "NGINX_VERSION=1.27.1",
      "NJS_VERSION=0.8.5",
      "NJS_RELEASE=1~bookworm",
      "PKG_RELEASE=1~bookworm",
      "DYNPKG_RELEASE=2~bookworm"
    ],
    "Entrypoint": [
      "/docker-entrypoint.sh"
    ],
    "Cmd": [
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants