deepscan-cli 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +419 -0
- package/dist/bin/deepscan.d.ts +1 -0
- package/dist/bin/deepscan.js +393 -0
- package/dist/bin/deepscan.js.map +1 -0
- package/dist/chunk-OSYJXVNF.js +7268 -0
- package/dist/chunk-OSYJXVNF.js.map +1 -0
- package/dist/index.d.ts +470 -0
- package/dist/index.js +21 -0
- package/dist/index.js.map +1 -0
- package/package.json +68 -0
- package/rules/built-in/converted-semgrep.yml +37 -0
- package/rules/built-in/default-config.yml +59 -0
- package/rules/built-in/quality.yml +117 -0
- package/rules/built-in/security.yml +383 -0
- package/rules/built-in/semgrep-apex.yml +336 -0
- package/rules/built-in/semgrep-bash.yml +362 -0
- package/rules/built-in/semgrep-c.yml +429 -0
- package/rules/built-in/semgrep-clojure.yml +166 -0
- package/rules/built-in/semgrep-csharp.yml +1260 -0
- package/rules/built-in/semgrep-dart.yml +21 -0
- package/rules/built-in/semgrep-dockerfile.yml +874 -0
- package/rules/built-in/semgrep-elixir.yml +146 -0
- package/rules/built-in/semgrep-generic.yml +2945 -0
- package/rules/built-in/semgrep-go.yml +2898 -0
- package/rules/built-in/semgrep-hcl.yml +8181 -0
- package/rules/built-in/semgrep-html.yml +94 -0
- package/rules/built-in/semgrep-java.yml +4219 -0
- package/rules/built-in/semgrep-javascript.yml +6243 -0
- package/rules/built-in/semgrep-json.yml +360 -0
- package/rules/built-in/semgrep-kotlin.yml +540 -0
- package/rules/built-in/semgrep-lua.yml +46 -0
- package/rules/built-in/semgrep-ocaml.yml +773 -0
- package/rules/built-in/semgrep-php.yml +1638 -0
- package/rules/built-in/semgrep-python.yml +11240 -0
- package/rules/built-in/semgrep-regex.yml +6444 -0
- package/rules/built-in/semgrep-ruby.yml +2687 -0
- package/rules/built-in/semgrep-rust.yml +278 -0
- package/rules/built-in/semgrep-scala.yml +807 -0
- package/rules/built-in/semgrep-sh.yml +46 -0
- package/rules/built-in/semgrep-solidity.yml +1046 -0
- package/rules/built-in/semgrep-swift.yml +200 -0
- package/rules/built-in/semgrep-terraform.yml +147 -0
- package/rules/built-in/semgrep-typescript.yml +6212 -0
- package/rules/built-in/semgrep-xml.yml +31 -0
- package/rules/built-in/semgrep-yaml.yml +2785 -0
- package/rules/examples/custom-api-security.yml +66 -0
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
rules:
|
|
2
|
+
- id: contains-bidirectional-characters
|
|
3
|
+
name: contains-bidirectional-characters
|
|
4
|
+
description: >-
|
|
5
|
+
This code contains bidirectional (bidi) characters. While this is useful for support of right-to-left languages
|
|
6
|
+
such as Arabic or Hebrew, it can also be used to trick language parsers into executing code in a manner that is
|
|
7
|
+
different from how it is displayed in code editing and review tools. If this is not what you were expecting,
|
|
8
|
+
please review this code in an editor that can reveal hidden Unicode characters.
|
|
9
|
+
category: security
|
|
10
|
+
severity: medium
|
|
11
|
+
confidence: medium
|
|
12
|
+
languages:
|
|
13
|
+
- bash
|
|
14
|
+
- c
|
|
15
|
+
- csharp
|
|
16
|
+
- go
|
|
17
|
+
- java
|
|
18
|
+
- javascript
|
|
19
|
+
- json
|
|
20
|
+
- kotlin
|
|
21
|
+
- lua
|
|
22
|
+
- ocaml
|
|
23
|
+
- php
|
|
24
|
+
- python
|
|
25
|
+
- ruby
|
|
26
|
+
- rust
|
|
27
|
+
- scala
|
|
28
|
+
- sh
|
|
29
|
+
- typescript
|
|
30
|
+
- yaml
|
|
31
|
+
patterns:
|
|
32
|
+
- regex: .*
|
|
33
|
+
message: >-
|
|
34
|
+
This code contains bidirectional (bidi) characters. While this is useful for support of right-to-left
|
|
35
|
+
languages such as Arabic or Hebrew, it can also be used to trick language parsers into executing code in a
|
|
36
|
+
manner that is different from how it is displayed in code editing and review tools. If this is not what you
|
|
37
|
+
were expecting, please review this code in an editor that can reveal hidden Unicode characters.
|
|
38
|
+
cwe:
|
|
39
|
+
- CWE-94
|
|
40
|
+
owasp:
|
|
41
|
+
- A03:2021
|
|
42
|
+
- A05:2025
|
|
43
|
+
references:
|
|
44
|
+
- https://trojansource.codes/
|
|
45
|
+
tags:
|
|
46
|
+
- unicode
|
|
47
|
+
- id: public-s3-bucket
|
|
48
|
+
name: public-s3-bucket
|
|
49
|
+
description: >-
|
|
50
|
+
Detected public S3 bucket. This policy allows anyone to have some kind of access to the bucket. The exact level of
|
|
51
|
+
access and types of actions allowed will depend on the configuration of bucket policy and ACLs. Please review the
|
|
52
|
+
bucket configuration to make sure they are set with intended values.
|
|
53
|
+
category: security
|
|
54
|
+
severity: medium
|
|
55
|
+
confidence: medium
|
|
56
|
+
languages:
|
|
57
|
+
- json
|
|
58
|
+
patterns:
|
|
59
|
+
- regex: .*
|
|
60
|
+
message: >-
|
|
61
|
+
Detected public S3 bucket. This policy allows anyone to have some kind of access to the bucket. The exact
|
|
62
|
+
level of access and types of actions allowed will depend on the configuration of bucket policy and ACLs.
|
|
63
|
+
Please review the bucket configuration to make sure they are set with intended values.
|
|
64
|
+
cwe:
|
|
65
|
+
- CWE-264
|
|
66
|
+
owasp:
|
|
67
|
+
- A01:2021
|
|
68
|
+
- A01:2025
|
|
69
|
+
references:
|
|
70
|
+
- https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-control-block-public-access.html
|
|
71
|
+
tags:
|
|
72
|
+
- aws
|
|
73
|
+
- id: public-s3-policy-statement
|
|
74
|
+
name: public-s3-policy-statement
|
|
75
|
+
description: >-
|
|
76
|
+
Detected public S3 bucket policy. This policy allows anyone to access certain properties of or items in the
|
|
77
|
+
bucket. Do not do this unless you will never have sensitive data inside the bucket.
|
|
78
|
+
category: security
|
|
79
|
+
severity: medium
|
|
80
|
+
confidence: medium
|
|
81
|
+
languages:
|
|
82
|
+
- json
|
|
83
|
+
patterns:
|
|
84
|
+
- pattern: |
|
|
85
|
+
{
|
|
86
|
+
"Effect": "Allow",
|
|
87
|
+
"Principal": "*",
|
|
88
|
+
"Resource": [
|
|
89
|
+
..., "=~/arn:aws:s3.*/", ...
|
|
90
|
+
],
|
|
91
|
+
...
|
|
92
|
+
}
|
|
93
|
+
message: >-
|
|
94
|
+
Detected public S3 bucket policy. This policy allows anyone to access certain properties of or items in the
|
|
95
|
+
bucket. Do not do this unless you will never have sensitive data inside the bucket.
|
|
96
|
+
cwe:
|
|
97
|
+
- CWE-264
|
|
98
|
+
owasp:
|
|
99
|
+
- A01:2021
|
|
100
|
+
- A01:2025
|
|
101
|
+
references:
|
|
102
|
+
- https://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteAccessPermissionsReqd.html
|
|
103
|
+
tags:
|
|
104
|
+
- aws
|
|
105
|
+
- id: wildcard-assume-role
|
|
106
|
+
name: wildcard-assume-role
|
|
107
|
+
description: >-
|
|
108
|
+
Detected wildcard access granted to sts:AssumeRole. This means anyone with your AWS account ID and the name of the
|
|
109
|
+
role can assume the role. Instead, limit to a specific identity in your account, like this:
|
|
110
|
+
`arn:aws:iam::<account_id>:root`.
|
|
111
|
+
category: security
|
|
112
|
+
severity: high
|
|
113
|
+
confidence: medium
|
|
114
|
+
languages:
|
|
115
|
+
- json
|
|
116
|
+
patterns:
|
|
117
|
+
- pattern: |
|
|
118
|
+
"Principal": {..., "AWS": "*", ...}
|
|
119
|
+
message: >-
|
|
120
|
+
Detected wildcard access granted to sts:AssumeRole. This means anyone with your AWS account ID and the name of
|
|
121
|
+
the role can assume the role. Instead, limit to a specific identity in your account, like this:
|
|
122
|
+
`arn:aws:iam::<account_id>:root`.
|
|
123
|
+
cwe:
|
|
124
|
+
- CWE-250
|
|
125
|
+
owasp:
|
|
126
|
+
- A06:2017
|
|
127
|
+
- A05:2021
|
|
128
|
+
- A02:2025
|
|
129
|
+
references:
|
|
130
|
+
- https://rhinosecuritylabs.com/aws/assume-worst-aws-assume-role-enumeration/
|
|
131
|
+
tags:
|
|
132
|
+
- aws
|
|
133
|
+
- id: package-dependencies-check
|
|
134
|
+
name: package-dependencies-check
|
|
135
|
+
description: >-
|
|
136
|
+
Package dependencies with variant versions may lead to dependency hijack and confusion attacks. Better to specify
|
|
137
|
+
an exact version or use package-lock.json for a specific version of the package.
|
|
138
|
+
category: security
|
|
139
|
+
severity: medium
|
|
140
|
+
confidence: medium
|
|
141
|
+
languages:
|
|
142
|
+
- json
|
|
143
|
+
patterns:
|
|
144
|
+
- regex: .*
|
|
145
|
+
message: >-
|
|
146
|
+
Package dependencies with variant versions may lead to dependency hijack and confusion attacks. Better to
|
|
147
|
+
specify an exact version or use package-lock.json for a specific version of the package.
|
|
148
|
+
cwe:
|
|
149
|
+
- CWE-427
|
|
150
|
+
owasp:
|
|
151
|
+
- A05:2021
|
|
152
|
+
references:
|
|
153
|
+
- https://security.snyk.io/vuln/SNYK-JS-COLORS-2331906
|
|
154
|
+
- https://medium.com/@alex.birsan/dependency-confusion-4a5d60fec610
|
|
155
|
+
- https://cwe.mitre.org/data/definitions/427.html
|
|
156
|
+
tags:
|
|
157
|
+
- npm
|
|
158
|
+
- id: renovate-missing-minimum-release-age
|
|
159
|
+
name: renovate-missing-minimum-release-age
|
|
160
|
+
description: >-
|
|
161
|
+
This Renovate configuration does not set a minimum release age. Newly published packages can be malicious or
|
|
162
|
+
unstable. Add `"minimumReleaseAge": "7 days"` within a `packageRules` entry to wait 7 days before proposing
|
|
163
|
+
updates to newly published package versions. Set `"minimumReleaseAge": false` to set an exception for minimal
|
|
164
|
+
release age for the package rule. Added in: v42
|
|
165
|
+
category: security
|
|
166
|
+
severity: medium
|
|
167
|
+
confidence: medium
|
|
168
|
+
languages:
|
|
169
|
+
- json
|
|
170
|
+
patterns:
|
|
171
|
+
- regex: .*
|
|
172
|
+
message: >-
|
|
173
|
+
This Renovate configuration does not set a minimum release age. Newly published packages can be malicious or
|
|
174
|
+
unstable. Add `"minimumReleaseAge": "7 days"` within a `packageRules` entry to wait 7 days before proposing
|
|
175
|
+
updates to newly published package versions. Set `"minimumReleaseAge": false` to set an exception for minimal
|
|
176
|
+
release age for the package rule. Added in: v42
|
|
177
|
+
cwe:
|
|
178
|
+
- CWE-829
|
|
179
|
+
owasp:
|
|
180
|
+
- A08:2021
|
|
181
|
+
references:
|
|
182
|
+
- https://docs.renovatebot.com/configuration-options/#minimumreleaseage
|
|
183
|
+
tags:
|
|
184
|
+
- renovate
|
|
185
|
+
- id: example-allowed
|
|
186
|
+
name: example-allowed
|
|
187
|
+
description: Example
|
|
188
|
+
category: security
|
|
189
|
+
severity: high
|
|
190
|
+
confidence: medium
|
|
191
|
+
languages:
|
|
192
|
+
- json
|
|
193
|
+
- yaml
|
|
194
|
+
patterns:
|
|
195
|
+
- pattern: ...
|
|
196
|
+
message: Example
|
|
197
|
+
cwe:
|
|
198
|
+
- CWE-257
|
|
199
|
+
owasp: []
|
|
200
|
+
references: []
|
|
201
|
+
tags: []
|
|
202
|
+
- id: example-prohibited
|
|
203
|
+
name: example-prohibited
|
|
204
|
+
description: Example
|
|
205
|
+
category: security
|
|
206
|
+
severity: high
|
|
207
|
+
confidence: medium
|
|
208
|
+
languages:
|
|
209
|
+
- json
|
|
210
|
+
- yaml
|
|
211
|
+
patterns:
|
|
212
|
+
- pattern: ...
|
|
213
|
+
message: Example
|
|
214
|
+
cwe:
|
|
215
|
+
- CWE-320
|
|
216
|
+
owasp: []
|
|
217
|
+
references: []
|
|
218
|
+
tags: []
|
|
219
|
+
- id: example-1
|
|
220
|
+
name: example-1
|
|
221
|
+
description: Example
|
|
222
|
+
category: security
|
|
223
|
+
severity: high
|
|
224
|
+
confidence: medium
|
|
225
|
+
languages:
|
|
226
|
+
- json
|
|
227
|
+
- yaml
|
|
228
|
+
patterns:
|
|
229
|
+
- pattern: ...
|
|
230
|
+
message: Example
|
|
231
|
+
cwe:
|
|
232
|
+
- CWE-123
|
|
233
|
+
owasp: []
|
|
234
|
+
references: []
|
|
235
|
+
tags: []
|
|
236
|
+
- id: example-2
|
|
237
|
+
name: example-2
|
|
238
|
+
description: Example
|
|
239
|
+
category: security
|
|
240
|
+
severity: high
|
|
241
|
+
confidence: medium
|
|
242
|
+
languages:
|
|
243
|
+
- json
|
|
244
|
+
- yaml
|
|
245
|
+
patterns:
|
|
246
|
+
- pattern: ...
|
|
247
|
+
message: Example
|
|
248
|
+
cwe: []
|
|
249
|
+
owasp: []
|
|
250
|
+
references: []
|
|
251
|
+
tags: []
|
|
252
|
+
- id: example-3
|
|
253
|
+
name: example-3
|
|
254
|
+
description: Example
|
|
255
|
+
category: security
|
|
256
|
+
severity: high
|
|
257
|
+
confidence: medium
|
|
258
|
+
languages:
|
|
259
|
+
- json
|
|
260
|
+
- yaml
|
|
261
|
+
patterns:
|
|
262
|
+
- pattern: ...
|
|
263
|
+
message: Example
|
|
264
|
+
cwe:
|
|
265
|
+
- CWE-123
|
|
266
|
+
owasp: []
|
|
267
|
+
references: []
|
|
268
|
+
tags: []
|
|
269
|
+
- id: example-4
|
|
270
|
+
name: example-4
|
|
271
|
+
description: Example
|
|
272
|
+
category: security
|
|
273
|
+
severity: high
|
|
274
|
+
confidence: medium
|
|
275
|
+
languages:
|
|
276
|
+
- json
|
|
277
|
+
- yaml
|
|
278
|
+
patterns:
|
|
279
|
+
- pattern: ...
|
|
280
|
+
message: Example
|
|
281
|
+
cwe:
|
|
282
|
+
- CWE-123
|
|
283
|
+
owasp: []
|
|
284
|
+
references: []
|
|
285
|
+
tags: []
|
|
286
|
+
- id: example-5
|
|
287
|
+
name: example-5
|
|
288
|
+
description: Example
|
|
289
|
+
category: security
|
|
290
|
+
severity: high
|
|
291
|
+
confidence: medium
|
|
292
|
+
languages:
|
|
293
|
+
- json
|
|
294
|
+
- yaml
|
|
295
|
+
patterns:
|
|
296
|
+
- pattern: ...
|
|
297
|
+
message: Example
|
|
298
|
+
cwe: []
|
|
299
|
+
owasp:
|
|
300
|
+
- A05:2021
|
|
301
|
+
- A06:2017
|
|
302
|
+
references: []
|
|
303
|
+
tags: []
|
|
304
|
+
- id: example-6
|
|
305
|
+
name: example-6
|
|
306
|
+
description: Example
|
|
307
|
+
category: security
|
|
308
|
+
severity: high
|
|
309
|
+
confidence: medium
|
|
310
|
+
languages:
|
|
311
|
+
- json
|
|
312
|
+
- yaml
|
|
313
|
+
patterns:
|
|
314
|
+
- pattern: ...
|
|
315
|
+
message: Example
|
|
316
|
+
cwe: []
|
|
317
|
+
owasp:
|
|
318
|
+
- A5:2021
|
|
319
|
+
- A06:2017
|
|
320
|
+
references: []
|
|
321
|
+
tags: []
|
|
322
|
+
- id: metadata-owasp
|
|
323
|
+
name: metadata-owasp
|
|
324
|
+
description: >-
|
|
325
|
+
The `owasp` tag in Semgrep rule metadata should start with the format "A00:YYYY", where A00 is the OWASP top ten
|
|
326
|
+
number and YYYY is the OWASP top ten year.
|
|
327
|
+
category: security
|
|
328
|
+
severity: high
|
|
329
|
+
confidence: medium
|
|
330
|
+
languages:
|
|
331
|
+
- json
|
|
332
|
+
- yaml
|
|
333
|
+
patterns:
|
|
334
|
+
- regex: .*
|
|
335
|
+
message: >-
|
|
336
|
+
The `owasp` tag in Semgrep rule metadata should start with the format "A00:YYYY", where A00 is the OWASP top
|
|
337
|
+
ten number and YYYY is the OWASP top ten year.
|
|
338
|
+
cwe: []
|
|
339
|
+
owasp: []
|
|
340
|
+
references: []
|
|
341
|
+
tags:
|
|
342
|
+
- semgrep
|
|
343
|
+
- id: metadata-references
|
|
344
|
+
name: metadata-references
|
|
345
|
+
description: The references in rule metadata should always be a list, even if there's only one.
|
|
346
|
+
category: security
|
|
347
|
+
severity: high
|
|
348
|
+
confidence: medium
|
|
349
|
+
languages:
|
|
350
|
+
- json
|
|
351
|
+
- yaml
|
|
352
|
+
patterns:
|
|
353
|
+
- pattern: |
|
|
354
|
+
references: ...
|
|
355
|
+
message: The references in rule metadata should always be a list, even if there's only one.
|
|
356
|
+
cwe: []
|
|
357
|
+
owasp: []
|
|
358
|
+
references: []
|
|
359
|
+
tags:
|
|
360
|
+
- semgrep
|