forked from cubefs/cubefs
-
Notifications
You must be signed in to change notification settings - Fork 2
/
.semgrep.yml
21 lines (21 loc) · 995 Bytes
/
.semgrep.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
rules:
- id: rfc-5737-ip-address
languages:
- go
message: Where a real IPv4 address isn't needed, use IPv4 addresses from RFC5737.
paths:
include:
- '*.go'
patterns:
- pattern-regex: '(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)'
- pattern-not-regex: '10\.\d+\.\d+.\d+'
- pattern-not-regex: '172\.\d+\.\d+.\d+'
- pattern-not-regex: '169\.\d+\.\d+.\d+'
- pattern-not-regex: '192\.168\.\d+.\d+'
- pattern-not-regex: '127\.0\.0\.\d+'
- pattern-not-regex: '0\.0\.0\.\d+'
- pattern-not-regex: '255\.255\.255\.\d+'
- pattern-not-regex: '192\.0\.2\.\d+' # 192.0.2.0/24 (TEST-NET-1, rfc5737)
- pattern-not-regex: '198\.51\.100\.\d+' # 198.51.100.0/24 (TEST-NET-2, rfc5737)
- pattern-not-regex: '203\.0\.113\.\d+' # 203.0.113.0/24 (TEST-NET-3, rfc5737)
severity: WARNING