-
Notifications
You must be signed in to change notification settings - Fork 1
/
patterns.yml
42 lines (40 loc) · 1.2 KB
/
patterns.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
name: Configuration Secrets
patterns:
- name: Django Secret Key
type: django_secret_key
regex:
version: 0.1
# required
pattern: |
[^\s"'(${{)][^\r\n'"]*
# optional, will default to the default used in secret scanning
start: |
(?:\A|[^0-9A-Za-z])SECRET_KEY\s*=\s*["']?
# optional, will default to the default used in secret scanning
end: |
\z|[\r\n'"]
# optional, additional_match is also an option
additional_not_match:
- ^TEST$
# optional
comments:
- |
Django secret key is used to provide cryptographic signing, and should be kept secret.
See: https://docs.djangoproject.com/en/1.11/ref/settings/#secret-key
# optional
test:
data: SECRET_KEY=1fsjdgvbdsjfksdgfjslfhwuefldhsfksdfhj
# optional, defaults to 0
start_offset: 11
# optional, defaults to -1 (the end of the string)
end_offset: -1
# optional
expected:
- name: django_key.txt
# optional, defaults to 0
start_offset: 11
# optional, defaults to -1 (the end of the file)
end_offset: 48
- name: django_key.txt
start_offset: 60
end_offset: 97