ci: exclude test-fixture dirs from secret scanning - #750
Open
remyluslosius wants to merge 1 commit into
Open
Conversation
Add .github/secret_scanning.yml with a narrow paths-ignore for **/testdata/**,
so deliberately-committed test keys stop recurring as generic secret-scanning
false positives — e.g. internal/{license,policy}/testdata/*-privkey-test.pem,
the Ed25519 signing test keys whose real counterparts live in the operator
vault and are build-time guarded against equalling the testdata key.
The repo's blanket `*secret*` .gitignore rule would drop this config (GitHub
needs it committed to read it), so a `!.github/secret_scanning.yml` negation is
added alongside it.
Deliberately narrow: source and *_test.go are NOT excluded, so a real
credential accidentally committed anywhere still gets flagged. Applies to future
commits only; the existing open alerts (all test fixtures + one already-rotated,
already-removed MongoDB cert) are dismissed separately in the UI.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Reviewed the 7 open generic secret-scanning alerts — all are test fixtures or an already-remediated key, no real leaks:
internal/{license,policy}/testdata/*-privkey-test.pem(Ed25519 signing test keys; real keys live in the operator vault, build-guarded against equalling these)internal/credential/credential_test.go(OpenSSH key whose body is literallyfake)base64(user:pass), an SSH-validation fixture) — history-only, already out of the reposecurity/…/mongodb/mongodb.pem— already rotated + untracked + MongoDB removed (PR feat: remove MongoDB legacy code #295); history-only dead blobChange
Add
.github/secret_scanning.ymlwith a narrowpaths-ignorefor**/testdata/**, so the deliberately-committed test keys stop recurring as false positives. Also add a!.github/secret_scanning.ymlnegation to.gitignore— the repo's blanket*secret*rule was dropping the config, and GitHub needs it committed to read it.Deliberately narrow: source and
*_test.goare not excluded, so a real credential accidentally committed anywhere still gets flagged.Note
paths-ignoreapplies to future commits only. The 7 existing open alerts still need a one-time dismissal in the UI (Used in tests / Revoked) — that's a separate manual step (not doable via the API from this token).🤖 Generated with Claude Code