Repository navigation
fix(sanitizer): redact whole Azure AccountKey and SAS sig values (TSK-011) - #110
Merged
Merged
Conversation
…-011) AccountKey was not a secret-assignment name, so only the first alphanumeric run of a base64 storage key was caught by the opaque-id rule and the rest (after / or +, plus the trailing ==) leaked. Add account[_-]?key to the secret-assignment names, and redact the sig query parameter of Azure SAS URLs, including URL-encoded characters such as %2B and %3D. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
|
🤖 hustle review: approve — Sanitizer change redacts whole AccountKey and SAS sig values as claimed, with a narrowly anchored sig rule, regression and guard tests, and updated docs and backlog. Only cosmetic backlog nits remain. |
Contributor
|
🎉 This PR is included in version 4.1.8 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
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.
Problem (TSK-011, from RPT-011)
Azure Storage secrets were only partly redacted:
AccountKey=<key>came out asAccountKey=[REDACTED_ID]/K1SZFPTOtr/KBHBeksoGMGw==.AccountKeywas not a secret-assignment name, so only the opaque-id rule ran. That rule cannot start after=and stops at the first/or+.sig=AbCdEf%2B…%3Dcame out assig=AbCdEf%[REDACTED_ID]%3D.What changed
src/core/sanitizer.tsaccount[_-]?keyto the secret-assignment names (otherName). The existing unquoted-value rule now takes the whole key, including/,+and==, up to;,&,,,), a quote or whitespace. Result:AccountKey=[REDACTED_SECRET];BlobEndpoint=….([?&]sig=)…that redacts the SAS signature up to&,#, whitespace, a quote,,,;or). URL-encoded characters such as%2Band%3Dare included. Result:&sig=[REDACTED_SECRET]&spr=https.sighas its own rule anchored on?/&and is not inotherName: there, the[A-Za-z0-9_-]*affixes would matchdesign=andsignature=.src/core/sanitizer.test.ts: newAzure Storage credentialsblock with 6 tests.docs/SPECS.md: the redaction list now mentionsAccountKey=and the SASsig..backlog: TSK-011 moved to complete with evidence. Added learning LRN-009.Acceptance criteria and evidence
redacts the whole AccountKey of an Azurite connection stringandredacts an AccountKey containing + and quoted in a commandpass.AccountKey=[REDACTED_SECRET];…and that no fragment of the key (Eby8vd,K1SZFPTOtr,KBHBeksoGMGw,==,ab+CD, …) remains.redacts the whole URL-encoded sig of a SAS URLandredacts a sig that ends the URLpass.&sig=[REDACTED_SECRET]&spr=https, no%2B/%3Dleft, and the other SAS parameters (sv,ss) kept.Azure Storage credentialsblock covers both.keeps punctuation that closes a SAS URL in proseandleaves words that merely contain sig alone(design=flat config=signature=onis unchanged).pnpm checkexited 0.pnpm test: 26 files, 495/495 tests passed.pnpm buildexited 0.Verification
Test first: the 4 redaction tests failed on
main(Tests 4 failed | 158 passedinsanitizer.test.ts). They pass after the change, and the full check, test and build gates pass as listed above.🤖 Generated with Claude Code