Skip to content

ci: exclude test-fixture dirs from secret scanning - #750

Open
remyluslosius wants to merge 1 commit into
mainfrom
ci/secret-scanning-ignore-testdata
Open

ci: exclude test-fixture dirs from secret scanning#750
remyluslosius wants to merge 1 commit into
mainfrom
ci/secret-scanning-ignore-testdata

Conversation

@remyluslosius

Copy link
Copy Markdown
Contributor

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 literally fake)
  • three archived Python test fixtures (fake JWT, base64(user:pass), an SSH-validation fixture) — history-only, already out of the repo
  • security/…/mongodb/mongodb.pemalready rotated + untracked + MongoDB removed (PR feat: remove MongoDB legacy code #295); history-only dead blob

Change

Add .github/secret_scanning.yml with a narrow paths-ignore for **/testdata/**, so the deliberately-committed test keys stop recurring as false positives. Also add a !.github/secret_scanning.yml negation 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.go are not excluded, so a real credential accidentally committed anywhere still gets flagged.

Note

paths-ignore applies 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

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant