Skip to content

Commit 9fa5269

Browse files
julianladischgfs
andauthored
[False Positive][False Negative] Outdated/Banned SSL/TLS protocols (#649)
* [False Positive][False Negative] Outdated/Banned SSL/TLS protocols ## Rule ID DS169125 Do not use outdated SSL/TLS protocols DS169126 An Outdated or Banned SSL/TLS Protocol is Used ## What the rule matched DS169125 * TLSv1.2 * TLSv1.3 DS169126 * TLSv12 * TLSv1.2 * TLSv13 * TLSv1.3 ## Why should this not be matched? https://github.com/microsoft/DevSkim/blob/v1.0.33/guidance/DS169126.md says: > Use TLSv1.3 if possible or TLSv1.2 if 1.3 cannot be used. ## What the rule did not match (false negative) DS169125 * TLSv1_0 * TLSv11 * TLSv1_1 ## Why should this be matched? https://github.com/microsoft/DevSkim/blob/v1.0.33/guidance/DS169126.md says: >TLSv1 - Weak, strongly consider disabling unless absolutely required. >TLSv1.1 - Weak, strongly consider disabling unless absolutely required. It already matches TLSv10 and TLSv1.0, therefore it should also match TLSv1_0. It already matches TLSv1.1, therefore it should also match TLSv11 and TLSv1_1. * Update Changelog.md --------- Co-authored-by: Gabe Stocco <98900+gfs@users.noreply.github.com>
1 parent 2c12fea commit 9fa5269

File tree

2 files changed

+33
-19
lines changed

2 files changed

+33
-19
lines changed

Changelog.md

+4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [1.0.49] - 2024-12-03
8+
## Rules
9+
Fixed false positives and false negatives in outdated/banned SSL/TLS protocols. #649
10+
711
## [1.0.48] - 2024-11-20
812
### Dependencies
913
Update VS Code Extension Dependencies

rules/default/security/cryptography/protocol.json

+29-19
Original file line numberDiff line numberDiff line change
@@ -82,17 +82,31 @@
8282
"rule_info": "DS169126.md",
8383
"patterns": [
8484
{
85-
"pattern": "(SSLv?2|SSLv?3|TLSv?1|TLSv?10)",
85+
"pattern": "(SSLv?2|SSLv?3|TLSv?1(?![._]?[2-9])|TLSv?1[._]?[01])",
8686
"type": "RegexWord",
8787
"scopes": [
8888
"code"
8989
]
9090
}
9191
],
9292
"must-match": [
93+
"SSLv2",
9394
"SSLv3",
9495
"TLSv1",
95-
"TLSv10"
96+
"TLSv10",
97+
"TLSv1_0",
98+
"TLSv1.0",
99+
"TLSv11",
100+
"TLSv1_1",
101+
"TLSv1.1"
102+
],
103+
"must-not-match": [
104+
"TLSv12",
105+
"TLSv1_2",
106+
"TLSv1.2",
107+
"TLSv13",
108+
"TLSv1_3",
109+
"TLSv1.3"
96110
]
97111
},
98112
{
@@ -129,36 +143,32 @@
129143
]
130144
},
131145
{
132-
"pattern": "TLSv1(?!_[2-9])",
133-
"type": "regex",
134-
"scopes": [
135-
"code"
136-
]
137-
},
138-
{
139-
"pattern": "TLSv1(0|_0)",
146+
"pattern": "TLSv1(?![._]?[2-9])",
140147
"type": "regex",
141148
"scopes": [
142149
"code"
143150
]
144-
},
145-
{
146-
"pattern": "TLSv1_1",
147-
"type": "string",
148-
"scopes": [
149-
"code"
150-
]
151151
}
152152
],
153153
"must-match": [
154154
"SSLv3",
155155
"TLSv1",
156156
"TLSv10",
157+
"TLSv1.0",
158+
"TLSv1_0",
159+
"TLSv11",
160+
"TLSv1.1",
161+
"TLSv1_1",
162+
"TLSv1X9",
157163
"SSLv2_client"
158164
],
159165
"must-not-match":[
166+
"TLSv12",
160167
"TLSv1_2",
161-
"TLSv1_3"
168+
"TLSv1.2",
169+
"TLSv13",
170+
"TLSv1_3",
171+
"TLSv1.3"
162172
]
163173
},
164174
{
@@ -474,4 +484,4 @@
474484
"must-not-match": [
475485
]
476486
}
477-
]
487+
]

0 commit comments

Comments
 (0)