fix(tests): replace AWS example fixtures w/ synthetic strings (secret scanning false positive)#9
Merged
Conversation
… scanning fp) GitHub Secret Scanning flagged tests/test_secrets_redactor.py for "publicly leaked" Amazon AWS Temporary Access Key ID — but the string ASIAY34FZKBOKMUTVV7A is AWS's own well-known example key, used in their docs and reproduced in dozens of public repos. False positive: it's a fixture, not a real key. Same applies to AKIAIOSFODNN7EXAMPLE. Problem with using AWS's published examples: every secret scanner has those exact strings in its leak fingerprint database, so the alert re-fires on every new repo that copies the fixtures. Fix: replace with synthetic strings that still match the redactor's regex (AKIA/ASIA prefix + 16 uppercase alphanumerics) but aren't in any leak database. AKIAIOSFODNN7EXAMPLE -> AKIATESTFIXTUREXYZ12 ASIAY34FZKBOKMUTVV7A -> ASIATESTFIXTUREABC56 Tests still pass — these strings have the same shape, just different characters. The fixture pattern is preserved. Verified - pytest tests/test_secrets_redactor.py -> 29 passed - ruff format --check -> clean Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
GitHub Secret Scanning flagged
tests/test_secrets_redactor.pyfor "publicly leaked" AWS keys. The strings used wereAKIAIOSFODNN7EXAMPLE+ASIAY34FZKBOKMUTVV7A— AWS's published example keys. They appear in dozens of other public repos' leak fingerprint databases.Replaced with synthetic strings that match the regex shape but aren't in any leak database. Tests still pass.
🤖 Generated with Claude Code