Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
26 changes: 26 additions & 0 deletions patterns/ci-cd.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,32 @@
"description": "CircleCI personal or project API token",
"risk": "Can trigger builds, access build artifacts, and read environment variables.",
"fix": "Use CIRCLECI_TOKEN environment variable."
},
{
"id": "sentry-auth-token",
"name": "Sentry Auth Token",
"severity": "critical",
"regex": "sntrys_[A-Za-z0-9_\\-/+]{60,}",
"description": "Sentry authentication token (sntrys_ prefix)",
"risk": "Can create/modify Sentry projects, access issue data, and manage org settings depending on scopes.",
"fix": "Use SENTRY_AUTH_TOKEN environment variable. Rotate immediately if exposed.",
"rotation_url": "https://sentry.io/settings/account/api/auth-tokens/",
"false_positive_hints": [
"Ignore clearly truncated or placeholder values in docs"
]
},
{
"id": "sentry-dsn",
"name": "Sentry DSN",
"severity": "warning",
"regex": "https://[a-f0-9]{32}@[a-z0-9.-]+\\.[a-z]+/[0-9]+",
"description": "Sentry Data Source Name (DSN) used by SDKs to submit events",
"risk": "Attackers can inject fake error events into your Sentry project (noise/DoS of quotas).",
"fix": "Use SENTRY_DSN environment variable.",
"rotation_url": "https://docs.sentry.io/product/sentry-basics/dsn-explainer/",
"false_positive_hints": [
"Ignore localhost or example DSN placeholders in docs"
]
}
]
}
8 changes: 8 additions & 0 deletions tests/test-patterns.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ function fail(msg) {
}

const TEST_CASES = {
'sentry-auth-token': {
shouldMatch: [ 'sntrys_' + 'A'.repeat(60) ],
shouldNotMatch: [ 'sntrys_short', 'not_a_sentry_token' ],
},
'sentry-dsn': {
shouldMatch: [ 'https://' + 'a'.repeat(32) + '@o0.ingest.sentry.io/123456' ],
shouldNotMatch: [ 'https://example.com/123', 'https://short@host/1' ],
},
'datadog-api-key': {
shouldMatch: [
"DD_API_KEY=" + "a".repeat(32),
Expand Down
Loading