Skip to content

Commit 36978fb

Browse files
authored
Merge pull request #8 from owasp-noir:patterns/add-new-patterns
Add detection rules for GitHub, GitLab, Discord, and Slack tokens/webhooks
2 parents 15aaa54 + dc5d67a commit 36978fb

File tree

5 files changed

+79
-1
lines changed

5 files changed

+79
-1
lines changed

secrets/aws-s3-key.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ id: s3-access-key
22
info:
33
name: Detect S3_ACCESS_KEY
44
author: [hahwul]
5-
severity: critical
5+
severity: high
66
description: Detects the presence of S3 Access Keys in the code
77
reference: ['']
88
matchers-condition: or

secrets/github-token.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
id: github-token
2+
info:
3+
name: Detect GITHUB_TOKEN
4+
author: [hahwul]
5+
severity: critical
6+
description: Detects the presence of GitHub tokens in the code
7+
reference: ['']
8+
matchers-condition: or
9+
matchers:
10+
- type: word
11+
patterns: ['GITHUB_TOKEN', 'GH_TOKEN', 'github_pat_']
12+
condition: or
13+
- type: regex
14+
patterns:
15+
- 'github_pat_[A-Za-z0-9_]{22}_[A-Za-z0-9]{59}'
16+
- 'ghp_[A-Za-z0-9]{36}'
17+
- 'gho_[A-Za-z0-9]{36}'
18+
- 'ghu_[A-Za-z0-9]{36}'
19+
- 'ghs_[A-Za-z0-9]{36}'
20+
- 'ghr_[A-Za-z0-9]{36}'
21+
condition: or
22+
category: secret
23+
techs: ['*']

secrets/gitlab-token.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
id: gitlab-token
2+
info:
3+
name: Detect GITLAB_TOKEN
4+
author: [hahwul]
5+
severity: critical
6+
description: Detects the presence of GitLab tokens in the code
7+
reference: ['']
8+
matchers-condition: or
9+
matchers:
10+
- type: word
11+
patterns: ['GITLAB_TOKEN', 'GITLAB_API_TOKEN', 'GITLAB_API_PRIVATE_TOKEN']
12+
condition: or
13+
- type: regex
14+
patterns:
15+
- 'glpat-[A-Za-z0-9_-]{20}'
16+
- 'glptt-[A-Za-z0-9_-]{20}'
17+
condition: or
18+
category: secret
19+
techs: ['*']

secrets/webhook-discord.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
id: webhook-discord
2+
info:
3+
name: Detect DISCORD_WEBHOOK
4+
author: [hahwul]
5+
severity: low
6+
description: Detects the presence of Discord webhook URLs in the code
7+
reference: ['']
8+
matchers-condition: or
9+
matchers:
10+
- type: word
11+
patterns: ['https://discord.com/api/webhooks/', 'https://discordapp.com/api/webhooks/']
12+
condition: or
13+
- type: regex
14+
patterns:
15+
- 'https://discord(?:app)?\.com/api/webhooks/[0-9]{17,19}/[A-Za-z0-9_-]{60,68}'
16+
condition: or
17+
category: secret
18+
techs: ['*']

secrets/webhook-slack.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
id: webhook-slack
2+
info:
3+
name: Detect SLACK_WEBHOOK
4+
author: [hahwul]
5+
severity: low
6+
description: Detects the presence of Slack webhook URLs in the code
7+
reference: ['']
8+
matchers-condition: or
9+
matchers:
10+
- type: word
11+
patterns: ['https://hooks.slack.com/services/']
12+
condition: or
13+
- type: regex
14+
patterns:
15+
- 'https://hooks\.slack\.com/services/T[a-zA-Z0-9_]{8}/B[a-zA-Z0-9_]{8}/[a-zA-Z0-9_]{24}'
16+
condition: or
17+
category: secret
18+
techs: ['*']

0 commit comments

Comments
 (0)