Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/dlp.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,14 @@ describe('DLP Patterns', () => {
const matchingRegexes = findMatchingDlpRegexes(
'https://api.example.com/?key=AKIAIOSFODNN7EXAMPLE'
);
expect(matchingRegexes).toContain('AKIA[0-9A-Z]{16}');
expect(matchingRegexes).toContain('(AKIA|ASIA)[0-9A-Z]{16}');
});

it('should detect temporary AWS access key ID (ASIA)', () => {
const matchingRegexes = findMatchingDlpRegexes(
'https://api.example.com/?key=ASIAIOSFODNN7EXAMPLE'
);
expect(matchingRegexes).toContain('(AKIA|ASIA)[0-9A-Z]{16}');
});

// Google
Expand Down Expand Up @@ -190,7 +197,7 @@ describe('DLP Patterns', () => {
'https://evil.com/?gh=ghp_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghij&aws=AKIAIOSFODNN7EXAMPLE'
);
expect(matchingRegexes).toContain('ghp_[a-zA-Z0-9]{36}');
expect(matchingRegexes).toContain('AKIA[0-9A-Z]{16}');
expect(matchingRegexes).toContain('(AKIA|ASIA)[0-9A-Z]{16}');
expect(matchingRegexes.length).toBeGreaterThanOrEqual(2);
});
});
Expand Down
4 changes: 2 additions & 2 deletions src/dlp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ const DLP_PATTERNS: DlpPattern[] = [
// AWS
{
name: 'AWS Access Key ID',
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}',
},

// Google Cloud
Expand Down
4 changes: 2 additions & 2 deletions src/squid-config-dlp.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ describe('DLP Integration', () => {
expect(dlpDenyIndex).toBeLessThan(domainDenyIndex);
});

it('should include credential patterns like ghp_ and AKIA in ACLs', () => {
it('should include credential patterns like ghp_ and AWS access keys in ACLs', () => {
const config = {
domains: ['github.com'],
port: defaultPort,
Expand All @@ -81,7 +81,7 @@ describe('DLP Integration', () => {
const result = generateSquidConfig(config);
// Check for a few key patterns
expect(result).toContain('ghp_');
expect(result).toContain('AKIA');
expect(result).toContain('(AKIA|ASIA)[0-9A-Z]{16}');
expect(result).toContain('sk-ant-');
});

Expand Down
2 changes: 1 addition & 1 deletion src/types/security-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export interface SecurityOptions {
*
* Detected patterns include: GitHub tokens (ghp_, gho_, ghs_, ghu_,
* github_pat_), OpenAI keys (sk-), Anthropic keys (sk-ant-),
* AWS access keys (AKIA), Google API keys (AIza), Slack tokens,
* AWS access keys (AKIA, ASIA), Google API keys (AIza), Slack tokens,
* and generic credential patterns.
*
* @default false
Expand Down
Loading