@fabriziosalmi/slopless 1.9.0 → 1.11.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/dist/engine/api.js +1 -1
- package/dist/index.d.ts +16 -1
- package/dist/index.js +140 -139
- package/package.json +1 -1
- package/rules/VBC-001.yaml +14 -1
package/package.json
CHANGED
package/rules/VBC-001.yaml
CHANGED
|
@@ -6,8 +6,13 @@ tags:
|
|
|
6
6
|
- security
|
|
7
7
|
- secrets
|
|
8
8
|
match:
|
|
9
|
+
# Two changes, both measured. An underscore is a word character, so `\bsecret\b`
|
|
10
|
+
# never matched AWS_SECRET_ACCESS_KEY, which is the commonest real case. And a
|
|
11
|
+
# value with a space in it is not a credential, while one with no digit at all
|
|
12
|
+
# is indistinguishable from a placeholder: across 7,179 files this rule fired
|
|
13
|
+
# six times and every one was a test fixture.
|
|
9
14
|
regex: >-
|
|
10
|
-
|
|
15
|
+
(?<![A-Za-z])(api_key|secret|password|passwd|token|bearer|auth[_-]?key|access[_-]?key)(?![A-Za-z])[\w]*\s*[:=]\s*['"\`](?![^'"\`]*(?:secret|password|passwd|token|apikey|api[_-]?key|credential|dummy|example|sample|test|fake|changeme|placeholder|your[_-]|xxx|\.\.\.))(?=[^'"\`]*\d)(?![^'"\`]* )([^'"\`]){8,}
|
|
11
16
|
flags: i
|
|
12
17
|
file_types:
|
|
13
18
|
- js
|
|
@@ -22,10 +27,18 @@ message: >-
|
|
|
22
27
|
a field rather than hold a key.
|
|
23
28
|
tests:
|
|
24
29
|
fire:
|
|
30
|
+
- AWS_SECRET_ACCESS_KEY = "wJalrXUtnFEMI/K7MDENG/bPxRfiCY"
|
|
25
31
|
- const password = "hunter2abc";
|
|
26
32
|
- 'api_key: "A9dK2mQ7xR4vL8nP1sT6wY3z"'
|
|
27
33
|
- token = "ghp_9fK2mQ7xR4vL8nP1sT6wY3zB5cE0"
|
|
28
34
|
quiet:
|
|
35
|
+
# A value with a space is a passphrase in a test, not a credential.
|
|
36
|
+
- PASSWORD = "correct horse battery staple"
|
|
37
|
+
# No digit at all: indistinguishable from a placeholder, and these are the
|
|
38
|
+
# literal strings a local model server asks for.
|
|
39
|
+
- api_key = "lm-studio"
|
|
40
|
+
- secret = "user-message-content-visible-in-trace"
|
|
41
|
+
- const secretary = "Ada Lovelace 1843"
|
|
29
42
|
- const password = process.env.PASSWORD;
|
|
30
43
|
- const token = "";
|
|
31
44
|
- secret = "REAL-HMAC-SECRET"
|