Repository navigation
fix: block temporary AWS credentials in URL DLP - #10013
Conversation
Block ASIA-prefixed AWS STS access-key IDs in URL DLP alongside existing AKIA credentials. Add regression coverage for both formats. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3ff85e54-1b44-4e0a-aaa6-13902f233ed7
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (4 files)
Coverage comparison generated by |
There was a problem hiding this comment.
🔵 Needs a closer look
Case-insensitive matching introduces benign-URL false positives that require maintainer acceptance.
1 open finding
What changed in this PR
Extends AWF’s URL credential filtering to detect temporary AWS access-key IDs.
Changes:
- Adds
ASIAdetection alongsideAKIA. - Adds regression coverage for temporary keys.
- Updates documented AWS credential coverage.
| File | Description |
|---|---|
| src/types/security-options.ts | Documents both AWS prefixes. |
| src/squid-config-dlp.test.ts | Checks the expanded generated ACL. |
| src/dlp.ts | Extends the AWS credential pattern. |
| src/dlp.test.ts | Tests both AWS key formats. |
🧠 Review effort: Max
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| description: 'AWS access key ID (AKIA)', | ||
| regex: 'AKIA[0-9A-Z]{16}', | ||
| description: 'AWS access key ID (AKIA or ASIA)', | ||
| regex: '(AKIA|ASIA)[0-9A-Z]{16}', |
|
@copilot address review feedback |
Made the AWS DLP ACL case-sensitive, kept uppercase AKIA/ASIA detection, and added regression tests for the lowercase false-positive URLs. Targeted tests and type-check pass. Commit: |
|
✅ Copilot review passed with no inline comments. @lpcox Add the |

Summary
AKIAto bothAKIAandASIAAKIAand temporaryASIAformats are detectedSecurity impact
Before this change, an
ASIA-prefixed temporary AWS access-key ID could bypass the Squid URL DLP ACL even though equivalentAKIAcredentials were blocked. The generated POSIX ERE now matches(AKIA|ASIA)[0-9A-Z]{16}without broadening unrelated credential patterns.Validation
npm test -- --runTestsByPath src/dlp.test.ts src/squid-config-dlp.test.ts --runInBand— 37 tests passednpm run type-check— passedsrc/dlp.test.ts)