Repository navigation
feat(security): extend secret detection coverage (GitLab/Doppler/Google) #797
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -106,6 +106,8 @@ PATTERNS["Supabase Key"]="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9\\.[a-zA-Z0-9_-]+\ | |
| # Note: Vercel Token pattern removed (too broad, causes false positives) | ||
| PATTERNS["Linear API Key"]="lin_api_[a-zA-Z0-9]{43}" | ||
| PATTERNS["Sentry DSN"]="https://[a-f0-9]{32}@[a-z0-9]+\\.ingest\\.sentry\\.io/[0-9]+" | ||
| PATTERNS["GitLab PAT"]="glpat-[a-zA-Z0-9_-]{20}" | ||
| PATTERNS["Doppler Token"]="dp\\.(pt|st|sa|ct|scim|audit)\\.[a-zA-Z0-9]{40,}" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Doppler service tokens include the config name between Useful? React with 👍 / 👎. |
||
|
|
||
| # Generic Patterns | ||
| PATTERNS["Private Key"]="-----BEGIN.*PRIVATE KEY-----" | ||
|
|
@@ -222,6 +224,8 @@ record_finding() { | |
| [[ "$pattern_name" == *"Stripe"* ]] || \ | ||
| [[ "$pattern_name" == *"Supabase"* ]] || \ | ||
| [[ "$pattern_name" == *"Slack Token"* ]] || \ | ||
| [[ "$pattern_name" == *"GitLab"* ]] || \ | ||
| [[ "$pattern_name" == *"Doppler"* ]] || \ | ||
| [[ "$pattern_name" == *"Database URL"* ]]; then | ||
| severity="CRITICAL" | ||
| CRITICAL_COUNT=$((CRITICAL_COUNT + 1)) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -142,6 +142,18 @@ describe('Claude Code command-safety hooks', () => { | |
| expect(content).toContain('sk-ant-'); | ||
| }); | ||
|
|
||
| test('should detect Google API keys', () => { | ||
| expect(content).toContain('AIza'); | ||
| }); | ||
|
|
||
| test('should detect GitLab personal access tokens', () => { | ||
| expect(content).toContain('glpat-'); | ||
| }); | ||
|
|
||
| test('should detect Doppler tokens', () => { | ||
| expect(content).toContain('Doppler token'); | ||
| }); | ||
|
Comment on lines
+153
to
+155
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Assert the Doppler regex marker, not only the label text. Line 154 validates 💡 Suggested test hardening test('should detect Doppler tokens', () => {
- expect(content).toContain('Doppler token');
+ expect(content).toContain('dp\\.(pt|st|sa|ct|scim|audit)\\.');
});🤖 Prompt for AI Agents |
||
|
|
||
| test('should detect private key blocks', () => { | ||
| expect(content).toContain('PRIVATE KEY'); | ||
| }); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For inline command blocking, this has the same service-token gap: Doppler service tokens are shaped like
dp.st.<config>.<secret>(for example the docs usedp.st.prd.xxxx), but the regex requires the secret material immediately afterdp.st.. Inline commands such asexport DOPPLER_TOKEN='dp.st.prd....'can therefore be approved and persisted to settings even though service tokens are the documented production path.Useful? React with 👍 / 👎.