mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-30 21:24:21 +01:00
feat: add Anthropic API key detection (#1910)
Add detection rules for Anthropic API keys:
- anthropic-api-key: detects sk-ant-api03-... keys
- anthropic-admin-api-key: detects sk-ant-admin01-... keys
Both key types follow the pattern sk-ant-{type}-{93 chars}AA
and are detected as separate rules to align with gitleaks
patterns for multi-token providers.
The base regex patterns are aligned with what TruffleHog uses here: https://github.com/trufflesecurity/trufflehog/blob/main/pkg/detectors/anthropic/anthropic.go
This commit is contained in:
1 parent
7b02c98eb4
commit
72977e41b6
3 files changed
+83
No files matched your search
@@ -129,6 +129,18 @@ regex = '''(?i)[\w.-]{0,50}?(?:alibaba)(?:[ \t\w.-]{0,20})[\s'"]{0,3}(?:=|>|:{1,
|
||||
entropy = 2
|
||||
keywords = ["alibaba"]
|
||||
|
||||
[[rules]]
|
||||
id = "anthropic-admin-api-key"
|
||||
description = "Detected an Anthropic Admin API Key, risking unauthorized access to administrative functions and sensitive AI model configurations."
|
||||
regex = '''\b(sk-ant-admin01-[a-zA-Z0-9_\-]{93}AA)(?:[\x60'"\s;]|\\[nr]|$)'''
|
||||
keywords = ["sk-ant-admin01"]
|
||||
|
||||
[[rules]]
|
||||
id = "anthropic-api-key"
|
||||
description = "Identified an Anthropic API Key, which may compromise AI assistant integrations and expose sensitive data to unauthorized access."
|
||||
regex = '''\b(sk-ant-api03-[a-zA-Z0-9_\-]{93}AA)(?:[\x60'"\s;]|\\[nr]|$)'''
|
||||
keywords = ["sk-ant-api03"]
|
||||
|
||||
[[rules]]
|
||||
id = "artifactory-api-key"
|
||||
description = "Detected an Artifactory api key, posing a risk unauthorized access to the central repository."
|
||||
|
||||
Reference in new issue
Block a user