-
Notifications
You must be signed in to change notification settings - Fork 0
/
CA5386.yaml
24 lines (24 loc) · 1.15 KB
/
CA5386.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
rules:
- id: CA5386
languages:
- csharp
message: Avoid hardcoding SecurityProtocolType value
metadata:
cwe: 'CWE-757: Selection of Less-Secure Algorithm During Negotiation ("Algorithm
Downgrade")'
references:
- https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca5386
patterns:
- pattern-inside: |
using System.Net;
...
- pattern-either:
- pattern: ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls;
- pattern: ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls11;
- pattern: ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
- pattern: ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls13;
- pattern: ServicePointManager.SecurityProtocol = (SecurityProtocolType) 192;
- pattern: ServicePointManager.SecurityProtocol = (SecurityProtocolType) 768;
- pattern: ServicePointManager.SecurityProtocol = (SecurityProtocolType) 3072;
- pattern: ServicePointManager.SecurityProtocol = (SecurityProtocolType) 12288;
severity: WARNING