echo-jwt icon indicating copy to clipboard operation
echo-jwt copied to clipboard

Inclusion of example JWT in README.md is being flagged by secret scanning

Open castellotti opened this issue 3 months ago • 6 comments

My employer has a Go repository which uses echo-jwt as a dependency, referenced as part of the vendored files in go.mod. The example JWT included in the README.md (both in a sample call and response) is getting flagged as an issue by secret scanning software. We can add an exclusion for this specific JWT as a work-around, but perhaps a documentation update to a use a placeholder would also be appropriate?

castellotti avatar Oct 13 '25 18:10 castellotti

I assume []byte("secret") is the problematic part? IF you propose something that will pass your checks we probably can change it so.

aldas avatar Oct 13 '25 18:10 aldas

Thanks for the quick reply! The ticket being opened on our side begins:

Finding Name:
HTTP bearer authentication header

Finding Description:
GitHub Advanced security has discovered a secret in the repository "[repository name]" using the secret scanning pattern "HTTP bearer authentication header"

and simply highlights the full JWT text content. I believe more details are here.

I think changing the content of the token to something like YOURTOKEN would resolve the issue.

castellotti avatar Oct 13 '25 19:10 castellotti

Ok, if it is Github then ChatGPT suggets that

If you routinely include such headers in docs, add .github/secret_scanning.yml to auto-close alerts for specific paths (e.g., README or /docs/**):

paths-ignore:
  - "README.md"
  # or, for all docs:
  # - "docs/**"

This will close matching alerts as “ignored by configuration.”

https://docs.github.com/en/code-security/secret-scanning/using-advanced-secret-scanning-and-push-protection-features/excluding-folders-and-files-from-secret-scanning

aldas avatar Oct 13 '25 19:10 aldas

PR for github/secret_scanning.yml would be OK from our side

aldas avatar Oct 13 '25 19:10 aldas

Thanks again, I have created a PR with the suggested change.

castellotti avatar Oct 13 '25 19:10 castellotti

alright, PR is merged, I hope it helps.

aldas avatar Oct 14 '25 07:10 aldas