Repository navigation
Secret-scan hygiene: canary values and scanner policy - #15
Merged
Merged
Conversation
The redaction tests and docs used hunter2, hunter22 and s3cr3t, which secret scanners report as leaked credentials. They now use redaction-canary-not-a-secret, which no scanner mistakes for a key. SecretRedactor masks passwords in URLs, so its tests need a credentialed URL. The unit test and the ThrowCommand fixture now assemble it from a variable, so no URL-with-password literal sits in the source; the assertions are unchanged. The docs describe the shape with template syntax (scheme://<user>:<password>@host), and the one redacted-output example that must show the mask carries an inline gitleaks:allow marker.
Both allowlist tests/Fixtures only, so a fixture's fake value does not fail a scan while src/, docs and the rest of tests stay fully scanned. The GitGuardian GitHub App ignores .gitguardian.yaml; its exclusions live in the GitGuardian dashboard.
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.
hunter2,hunter22ands3cr3tdummies in tests and docs withredaction-canary-not-a-secret.SecretRedactorTestand theThrowCommandfixture from a variable at run time, so no URL-with-password literal is in the source. Assertions are unchanged.scheme://<user>:<password>@host; the one redacted-output example indocs/tools/output.mdcarries an inlinegitleaks:allowcomment..gitleaks.tomland.gitguardian.yaml, both allowlistingtests/Fixtures/only.Verified locally:
secret_scan.py check --worktreeexits 0; pest 253 passed (667 assertions); phpstan, pint--testand rector--dry-runclean.