Skip to content

fix(tests): replace AWS example fixtures w/ synthetic strings (secret scanning false positive)#9

Merged
avinash-matrixgard merged 1 commit into
mainfrom
claude/fix-test-fixture-secret-scan
Apr 30, 2026
Merged

fix(tests): replace AWS example fixtures w/ synthetic strings (secret scanning false positive)#9
avinash-matrixgard merged 1 commit into
mainfrom
claude/fix-test-fixture-secret-scan

Conversation

@avinash-matrixgard
Copy link
Copy Markdown
Owner

GitHub Secret Scanning flagged tests/test_secrets_redactor.py for "publicly leaked" AWS keys. The strings used were AKIAIOSFODNN7EXAMPLE + 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

… 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>
@avinash-matrixgard avinash-matrixgard merged commit 1801f08 into main Apr 30, 2026
4 checks passed
@avinash-matrixgard avinash-matrixgard deleted the claude/fix-test-fixture-secret-scan branch April 30, 2026 00:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant