-
Notifications
You must be signed in to change notification settings - Fork 1
/
rules.yml
224 lines (194 loc) · 6.49 KB
/
rules.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
#
# entropy-based rules
#
- id: high-entropy
message: High Entropy
minlen: 20
alphabet: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/="
threshold: 4.5
severity: MEDIUM
- id: high-entropy
message: High Entropy
minlen: 20
alphabet: "0123456789abcdefABCDEF"
threshold: 3.0
severity: MEDIUM
#
# regexes-based rules
#
- id: private.pgp-key
message: PGP Private Key Block
pattern: "-----BEGIN PGP PRIVATE KEY BLOCK-----"
severity: HIGH
- id: private.key
message: Private Key
pattern: "-----BEGIN (RSA|DSA|EC|OPENSSH) PRIVATE KEY-----"
severity: HIGH
- id: amazon.aws-api-key
message: AWS API Key
pattern: "AKIA[0-9A-Z]{16}"
severity: MEDIUM
- id: amazon.mws-auth-token
message: Amazon MWS Auth Token
pattern: "amzn\\.mws\\.[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}"
severity: MEDIUM
- id: facebook.access-token
message: Facebook Access Token
pattern: "EAACEdEose0cBA[0-9A-Za-z]+"
severity: MEDIUM
- id: facebook.oauth-token
message: Facebook OAuth Token
pattern: '[f|F][a|A][c|C][e|E][b|B][o|O][o|O][k|K].*[''|"][0-9a-f]{32}[''|"]'
severity: MEDIUM
# TODO add new github token formats
- id: github.token
message: GitHub Token
pattern: '[g|G][i|I][t|T][h|H][u|U][b|B].*[''|"][0-9a-zA-Z]{35,40}[''|"]'
severity: MEDIUM
- id: google.access-token
message: Google Access Token
pattern: "ya29\\.[0-9A-Za-z\\-_]+"
severity: MEDIUM
- id: google.api-key
message: Google API Key
pattern: "AIza[0-9A-Za-z\\-_]{35}"
severity: MEDIUM
- id: google.oauth-token
message: Google OAuth
pattern: "[0-9]+-[0-9A-Za-z_]{32}\\.apps\\.googleusercontent\\.com"
severity: MEDIUM
- id: google.gcp-service-account
message: Google Cloud Platform Service Account
pattern: '"type": "service_account"'
severity: MEDIUM
- id: heroku.api-key
message: Heroku API Key
pattern: "[h|H][e|E][r|R][o|O][k|K][u|U].*[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}"
severity: MEDIUM
- id: mailchimp.api-key
message: MailChimp API Key
pattern: "[0-9a-f]{32}-us[0-9]{1,2}"
severity: MEDIUM
- id: mailgun.api-key
message: Mailgun API Key
pattern: "key-[0-9a-zA-Z]{32}"
severity: MEDIUM
- id: paypal.braintree-access-token
message: PayPal Braintree Access Token
pattern: "access_token\\$production\\$[0-9a-z]{16}\\$[0-9a-f]{32}"
severity: MEDIUM
- id: picatic.api-key
message: Picatic API Key
pattern: "sk_live_[0-9a-z]{32}"
severity: MEDIUM
- id: slack.token
message: Slack Token
pattern: "xox[p|b|o|a]-[0-9]{12}-[0-9]{12}-[0-9]{12}-[a-z0-9]{32}"
severity: MEDIUM
- id: slack.bot-token
message: Slack Bot Token
pattern: "xox[p|b|o|a]-[0-9]{12}-[0-9]{12}-[a-z0-9]{24}"
severity: MEDIUM
- id: slack.webhook
message: Slack Webhook
pattern: "https://hooks.slack.com/services/T[a-zA-Z0-9_]{8}/B[a-zA-Z0-9_]{8}/[a-zA-Z0-9_]{24}"
severity: MEDIUM
- id: stripe.api-key
message: Stripe API Key
pattern: "sk_live_[0-9a-zA-Z]{24}"
severity: MEDIUM
- id: stripe.restricted-api-key
message: Stripe Restricted API Key
pattern: "rk_live_[0-9a-zA-Z]{24}"
severity: MEDIUM
- id: square.access-token
message: Square Access Token
pattern: "sq0atp-[0-9A-Za-z\\-_]{22}"
severity: MEDIUM
- id: square.oauth-secret
message: Square OAuth Secret
pattern: "sq0csp-[0-9A-Za-z\\-_]{43}"
severity: MEDIUM
- id: twilio.api-key
message: Twilio API Key
pattern: "SK[0-9a-fA-F]{32}"
severity: MEDIUM
- id: twitter.access-token
message: Twitter Access Token
pattern: "[t|T][w|W][i|I][t|T][t|T][e|E][r|R].*[1-9][0-9]+-[0-9a-zA-Z]{40}"
severity: MEDIUM
- id: twitter.oauth-token
message: Twitter OAuth Token
pattern: '[t|T][w|W][i|I][t|T][t|T][e|E][r|R].*[''|"][0-9a-zA-Z]{35,44}[''|"]'
severity: MEDIUM
- id: generic.api-key
message: Generic API Key
pattern: '[a|A][p|P][i|I][_]?[k|K][e|E][y|Y].*[''|"][0-9a-zA-Z]{32,45}[''|"]'
severity: LOW
- id: generic.secret
message: Generic Secret
pattern: '[s|S][e|E][c|C][r|R][e|E][t|T].*[''|"][0-9a-zA-Z]{32,45}[''|"]'
severity: LOW
- id: generic.password-in-url
message: Password in URL
pattern: "[a-zA-Z]{3,10}://[^/\\s:@]{3,20}:[^/\\s:@]{3,20}@.{1,100}[\"'\\s]"
severity: LOW
- id: sql.connection-string
message: SQL Connection String
pattern: "(?:postgresql|mysql):\\/\\/([^:\\/\\s]+):([^@\\/\\s]+)@([^:\\/\\s]+):(\\d+)\\/([^\\/\\s]+)"
severity: HIGH
- id: redis.connection-string
message: Redis Connection String
pattern: "redis:\\/\\/([^:\/\\s]+):([^@\/\\s]+)@([^:\/\\s]+):(\\d+)\\/([^\\/\\s]+)"
severity: HIGH
- id: mongodb.connection-string
message: MongoDB Connection String
pattern: "mongodb:\\/\\/([^:\/\\s]+):([^@\/\\s]+)@([^:\/\\s]+):(\\d+)\\/([^\\/\\s]+)"
severity: HIGH
- id: ftp.connection-string
message: FTP Connection String
pattern: "ftp:\\/\\/([^:\/\\s]+):([^@\/\\s]+)@([^:\/\\s]+):(\\d+)\\/([^\\/\\s]+)"
severity: HIGH
- id: memcached.connection-string
message: Memcached Connection String
pattern: "memcached:\\/\\/([^:\/\\s]+):([^@\/\\s]+)@([^:\/\\s]+):(\\d+)\\/([^\\/\\s]+)"
severity: HIGH
- id: elasticsearch.connection-string
message: Elasticsearch Connection String
pattern: "elasticsearch:\\/\\/([^:\/\\s]+):([^@\/\\s]+)@([^:\/\\s]+):(\\d+)\\/([^\\/\\s]+)"
severity: HIGH
- id: cloudfoundry.vcap-services
message: Cloud Foundry VCAP Services Credentials
pattern: '"VCAP_SERVICES":\s*{[^}]*"credentials":\s*{[^}]*"[^"]+":\s*"[^"]+"[^}]*}[^}]*}'
severity: HIGH
- id: drupal.database-connection
message: Drupal Database Connection String
pattern: "\\$databases\\['default'\\]\\['default'\\] = array\\('driver' => '([^']+)', 'database' => '([^']+)', 'username' => '([^']+)', 'password' => '([^']+)', 'host' => '([^']+)', 'port' => '([^']+)'\\);"
severity: HIGH
- id: drupal.database-connection
message: Drupal Database Connection String
pattern: "\\$databases\\['default'\\]\\['default'\\] = array\\('driver' => '([^']+)', 'database' => '([^']+)', 'username' => '([^']+)', 'password' => '([^']+)', 'host' => '([^']+)', 'port' => '([^']+)'\\);"
severity: HIGH
- id: drupal.api-keys
message: Drupal API Keys
pattern: "\\$config\\['([^']+)\\.settings'\\]\\['api_key'\\] = '([^']+)';"
severity: HIGH
- id: json.sql-hostname
message: MySQL Hostname
pattern: '"hostname":'
severity: MEDIUM
- id: json.sql-port
message: MySQL Port
pattern: '"port":'
severity: MEDIUM
- id: json.sql-username
message: MySQL Username
pattern: '"username":'
severity: HIGH
- id: json.sql-password
message: MySQL Password
pattern: '"password":'
severity: HIGH
- id: json.sql-database
message: MySQL Database
pattern: '"database":'