-
Notifications
You must be signed in to change notification settings - Fork 0
/
CA5400.yaml
49 lines (48 loc) · 1.35 KB
/
CA5400.yaml
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
rules:
- id: CA5400
patterns:
- pattern-inside: |
using System.Net.Http;
...
- pattern-either:
- pattern: |
$T $F($Y){
...
WinHttpHandler $V = new WinHttpHandler();
...
$V.CheckCertificateRevocationList = $Y;
...
HttpClient $X = new HttpClient($V);
...
}
- pattern: |
$T $F(){
...
bool $Y =...;
...
WinHttpHandler $V = new WinHttpHandler();
...
$V.CheckCertificateRevocationList = $Y;
...
HttpClient $X = new HttpClient($V);
...
}
- pattern: |
$T $F(){
...
WinHttpHandler $V = new WinHttpHandler();
...
bool $Y =...;
...
$V.CheckCertificateRevocationList = $Y;
...
HttpClient $X = new HttpClient($V);
...
}
message: Ensure HttpClient certificate revocation list check is not disabled
languages: [csharp]
metadata:
cwe: 'CWE-299: Improper Check for Certificate Revocation'
references:
- https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca5400
severity: WARNING