pqaudit 0.2.0 → 0.6.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.
Files changed (82) hide show
  1. package/README.md +176 -22
  2. package/dist/cli.js +89 -25
  3. package/dist/cli.js.map +1 -1
  4. package/dist/grammars/tree-sitter-javascript.wasm +0 -0
  5. package/dist/grammars/tree-sitter-tsx.wasm +0 -0
  6. package/dist/grammars/tree-sitter-typescript.wasm +0 -0
  7. package/dist/policy/evaluator.d.ts +11 -0
  8. package/dist/policy/evaluator.d.ts.map +1 -0
  9. package/dist/policy/evaluator.js +75 -0
  10. package/dist/policy/evaluator.js.map +1 -0
  11. package/dist/policy/loader.d.ts +10 -0
  12. package/dist/policy/loader.d.ts.map +1 -0
  13. package/dist/policy/loader.js +55 -0
  14. package/dist/policy/loader.js.map +1 -0
  15. package/dist/reporter/cbom.d.ts.map +1 -1
  16. package/dist/reporter/cbom.js +2 -1
  17. package/dist/reporter/cbom.js.map +1 -1
  18. package/dist/reporter/html.d.ts +7 -0
  19. package/dist/reporter/html.d.ts.map +1 -0
  20. package/dist/reporter/html.js +415 -0
  21. package/dist/reporter/html.js.map +1 -0
  22. package/dist/reporter/sarif.d.ts.map +1 -1
  23. package/dist/reporter/sarif.js +2 -1
  24. package/dist/reporter/sarif.js.map +1 -1
  25. package/dist/reporter/text.d.ts.map +1 -1
  26. package/dist/reporter/text.js +16 -0
  27. package/dist/reporter/text.js.map +1 -1
  28. package/dist/sbom/enricher.d.ts +4 -0
  29. package/dist/sbom/enricher.d.ts.map +1 -0
  30. package/dist/sbom/enricher.js +144 -0
  31. package/dist/sbom/enricher.js.map +1 -0
  32. package/dist/sbom/parser.d.ts +4 -0
  33. package/dist/sbom/parser.d.ts.map +1 -0
  34. package/dist/sbom/parser.js +49 -0
  35. package/dist/sbom/parser.js.map +1 -0
  36. package/dist/scanner/ast-patterns.d.ts +40 -0
  37. package/dist/scanner/ast-patterns.d.ts.map +1 -0
  38. package/dist/scanner/ast-patterns.js +71 -0
  39. package/dist/scanner/ast-patterns.js.map +1 -0
  40. package/dist/scanner/ast-scanner.d.ts +8 -0
  41. package/dist/scanner/ast-scanner.d.ts.map +1 -0
  42. package/dist/scanner/ast-scanner.js +305 -0
  43. package/dist/scanner/ast-scanner.js.map +1 -0
  44. package/dist/scanner/certificate-scanner.d.ts +38 -0
  45. package/dist/scanner/certificate-scanner.d.ts.map +1 -0
  46. package/dist/scanner/certificate-scanner.js +241 -0
  47. package/dist/scanner/certificate-scanner.js.map +1 -0
  48. package/dist/scanner/dependency-scanner.d.ts +4 -0
  49. package/dist/scanner/dependency-scanner.d.ts.map +1 -1
  50. package/dist/scanner/dependency-scanner.js +477 -1
  51. package/dist/scanner/dependency-scanner.js.map +1 -1
  52. package/dist/scanner/engine.d.ts.map +1 -1
  53. package/dist/scanner/engine.js +84 -11
  54. package/dist/scanner/engine.js.map +1 -1
  55. package/dist/scanner/file-scanner.d.ts +16 -1
  56. package/dist/scanner/file-scanner.d.ts.map +1 -1
  57. package/dist/scanner/file-scanner.js +155 -42
  58. package/dist/scanner/file-scanner.js.map +1 -1
  59. package/dist/scanner/network-scanner.d.ts +26 -0
  60. package/dist/scanner/network-scanner.d.ts.map +1 -0
  61. package/dist/scanner/network-scanner.js +500 -0
  62. package/dist/scanner/network-scanner.js.map +1 -0
  63. package/dist/scanner/rules.d.ts +4 -0
  64. package/dist/scanner/rules.d.ts.map +1 -1
  65. package/dist/scanner/rules.js +26 -2
  66. package/dist/scanner/rules.js.map +1 -1
  67. package/dist/scanner/suppress.d.ts +3 -0
  68. package/dist/scanner/suppress.d.ts.map +1 -0
  69. package/dist/scanner/suppress.js +38 -0
  70. package/dist/scanner/suppress.js.map +1 -0
  71. package/dist/types.d.ts +76 -1
  72. package/dist/types.d.ts.map +1 -1
  73. package/dist/types.js.map +1 -1
  74. package/dist/version.d.ts +3 -0
  75. package/dist/version.d.ts.map +1 -0
  76. package/dist/version.js +13 -0
  77. package/dist/version.js.map +1 -0
  78. package/package.json +10 -6
  79. package/policies/cnsa-2.0.yaml +63 -0
  80. package/policies/eu-pqc-roadmap.yaml +48 -0
  81. package/policies/nist-ir-8547.yaml +69 -0
  82. package/rules/crypto-patterns.yaml +517 -143
@@ -5,8 +5,21 @@
5
5
  # critical - Broken by Shor's algorithm (RSA, ECC, DH key exchange/signatures)
6
6
  # high - Weakened by Grover's algorithm (AES-128, small key sizes)
7
7
  # medium - Already weak classically (MD5, SHA-1, 3DES)
8
- # low - Safe but worth documenting for inventory
8
+ # low - Worth reviewing, not an immediate risk (e.g. pre-standard PQC names)
9
9
  # safe - Already quantum-resistant (ML-KEM, ML-DSA, AES-256, SHA-256)
10
+ #
11
+ # Pattern authoring notes
12
+ # - Patterns are case-INsensitive unless the rule sets `caseSensitive: true`.
13
+ # Inside a case-sensitive rule, prefix a single pattern with "(?i)" to make
14
+ # just that pattern case-insensitive.
15
+ # - Bound short tokens with \b or lookarounds. A bare "DES" matched
16
+ # "description" and "destroy" (GitHub issue #12).
17
+ # - Overlapping matches on one line are resolved "most specific wins": a
18
+ # match strictly inside a longer single-token match of another rule is
19
+ # dropped. So "RSA-SHA256" must be matched as a whole by an RSA rule, or
20
+ # SHA256_SAFE will report it as safe (GitHub issue #13). The same mechanism
21
+ # lets hybrid names like "X25519MLKEM768" win over the bare "X25519".
22
+ # - YAML single-quoted strings keep backslashes literal; write '' for a quote.
10
23
 
11
24
  # =============================================================================
12
25
  # CRITICAL: Quantum-vulnerable asymmetric cryptography (Shor's algorithm)
@@ -21,15 +34,29 @@
21
34
  effort: complex
22
35
  languages: []
23
36
  patterns:
24
- - "rsa\\.GenerateKey"
25
- - "RSA\\.generate"
26
- - "rsa_generate_key"
27
- - "generateKeyPair\\s*\\(.*['\"]RSA['\"]"
28
- - "KeyPairGenerator\\.getInstance\\s*\\(.*['\"]RSA['\"]"
29
- - "crypto\\.generateKeyPairSync\\s*\\(.*['\"]rsa['\"]"
30
- - "new\\s+RSAKeyGenParameterSpec"
31
- - "RSA_generate_key_ex"
32
- - "openssl_pkey_new.*RSA"
37
+ - 'rsa\.GenerateKey'
38
+ - 'RSA\.generate\b'
39
+ - 'rsa\.generate_private_key'
40
+ - 'RSA_generate_key'
41
+ - 'generateKeyPair(?:Sync)?\s*\(\s*[''"`]rsa(?:-pss)?[''"`]'
42
+ - 'KeyPairGenerator\.getInstance\s*\(\s*"RSA'
43
+ - 'new\s+RSAKeyGenParameterSpec'
44
+ - 'OPENSSL_KEYTYPE_RSA'
45
+ - 'EVP_PKEY_RSA'
46
+ - '\bRSA\.Create\s*\('
47
+ - 'RSACryptoServiceProvider'
48
+ - '\bRsaPrivateKey::new'
49
+ - '"crypto/rsa"'
50
+ - 'asymmetric\s+import\s+.*\brsa\b'
51
+ - 'asymmetric\.rsa\b'
52
+ - 'Crypto(?:dome)?\.PublicKey\s+import\s+.*\bRSA\b'
53
+ - 'openssl\s+genrsa\b'
54
+ - 'openssl\s+(?:req|genpkey)\b.*(?:-newkey\s+rsa|-algorithm\s+rsa)'
55
+ - 'ssh-keygen\b.*-t\s*rsa\b'
56
+ # Terraform tls_private_key / cloud KMS key specs (AWS KMS, ACM, Azure Key Vault)
57
+ - '\balgorithm\s*=\s*"RSA"'
58
+ - '\bRSA[_-](?:1024|2048|3072|4096)\b'
59
+ - '\bRSA-HSM\b'
33
60
 
34
61
  - id: RSA_ENCRYPT
35
62
  description: "RSA encryption — vulnerable to quantum factoring"
@@ -40,15 +67,19 @@
40
67
  effort: complex
41
68
  languages: []
42
69
  patterns:
43
- - "RSA/ECB/"
44
- - "RSA/NONE/"
45
- - "RSAES-OAEP"
46
- - "RSA_public_encrypt"
47
- - "rsa\\.encrypt"
48
- - "PKCS1_OAEP"
49
- - "PKCS1_v1_5"
50
- - "crypto\\.publicEncrypt"
51
- - "crypto\\.privateDecrypt"
70
+ - 'RSA/ECB/'
71
+ - 'RSA/NONE/'
72
+ - 'RSAES-OAEP'
73
+ - '\bRSA-OAEP'
74
+ - '\bRSA1_5\b'
75
+ - 'RSA_public_encrypt'
76
+ - 'RSA_private_decrypt'
77
+ - '\brsa\.(?:encrypt|decrypt)'
78
+ - 'PKCS1_OAEP'
79
+ - 'PKCS1_v1_5'
80
+ - '\b(?:publicEncrypt|privateDecrypt)\s*\('
81
+ - 'padding\.OAEP\s*\('
82
+ - '\bRSA_DECRYPT_OAEP_\w+'
52
83
 
53
84
  - id: RSA_SIGN
54
85
  description: "RSA signature — vulnerable to quantum factoring"
@@ -59,18 +90,31 @@
59
90
  effort: complex
60
91
  languages: []
61
92
  patterns:
62
- - "SHA256withRSA"
63
- - "SHA384withRSA"
64
- - "SHA512withRSA"
65
- - "RS256"
66
- - "RS384"
67
- - "RS512"
68
- - "PS256"
69
- - "PS384"
70
- - "PS512"
71
- - "RSASSA-PSS"
72
- - "RSA_sign"
73
- - "rsa\\.sign"
93
+ # Node/OpenSSL digest names: createSign('RSA-SHA256'), 'sha256WithRSAEncryption'
94
+ - '\bRSA-(?:SHA|MD5|MD4|RIPEMD|SM3)[\w-]*'
95
+ - '\bSHA-?(?:1|224|256|384|512)with(?:RSA[\w/]*)'
96
+ - '\bRSA-PSS\b'
97
+ - 'RSASSA-PSS'
98
+ - 'RSASSA-PKCS1-v1_5'
99
+ # JWT / JOSE
100
+ - '\b[RP]S(?:256|384|512)\b'
101
+ - 'RSA_(?:sign|verify)\b'
102
+ - '\brsa\.(?:sign|verify)'
103
+ - '\bRSA_SIGN_\w+'
104
+ - 'Signature\.getInstance\s*\(\s*"[^"]*RSA'
105
+ - 'pkcs1_15\.new'
106
+ - 'padding\.PSS\s*\('
107
+
108
+ - id: GENERIC_SIGNATURE
109
+ description: "crypto.createSign/createVerify with a digest-only name — the scheme comes from the key, and Node supports only RSA, DSA and ECDSA here (all vulnerable to Shor's algorithm)"
110
+ severity: critical
111
+ category: signature
112
+ algorithm: RSA/ECDSA/DSA
113
+ replacement: ML-DSA-65 (FIPS 204) — e.g. crypto.sign(null, data, mlDsaKey) on Node 24.7+ / OpenSSL 3.5
114
+ effort: complex
115
+ languages: [javascript, typescript]
116
+ patterns:
117
+ - '\bcreate(?:Sign|Verify)\s*\(\s*[''"`](?![\w-]*(?:rsa|dsa))(?:sha|md|ripemd|sm3)[\w-]*[''"`]'
74
118
 
75
119
  - id: ECDSA_USAGE
76
120
  description: "ECDSA signatures — vulnerable to Shor's algorithm on elliptic curves"
@@ -81,62 +125,54 @@
81
125
  effort: complex
82
126
  languages: []
83
127
  patterns:
84
- - "ECDSA"
85
- - "ES256"
86
- - "ES384"
87
- - "ES512"
88
- - "SHA256withECDSA"
89
- - "ec\\.sign"
90
- - "ec\\.verify"
91
- - "ECDSA_sign"
92
- - "ECDSA_verify"
93
- - "secp256k1"
94
- - "secp256r1"
95
- - "secp384r1"
96
- - "prime256v1"
97
- - "P-256"
98
- - "P-384"
99
- - "P-521"
128
+ - 'ECDSA'
129
+ - '\bES(?:256|384|512)K?\b'
130
+ - '\bSHA-?(?:1|224|256|384|512)with(?:PLAIN-)?ECDSA'
131
+ - 'ecdsa-with-SHA\d+'
132
+ - '\bec\.(?:sign|verify|generate_private_key)\b'
133
+ - 'secp(?:192|224|256|384|521)[rk]1'
134
+ - 'prime(?:192|239|256)v[123]'
135
+ - 'brainpoolP(?:256|320|384|512)[rt]1'
136
+ - '\bP-(?:256|384|521)\b'
137
+ - '(?:^|[^a-z])NIST[_ -]?P-?(?:256|384|521)\b'
138
+ - 'SECG_P256K1'
139
+ - 'KeyPairGenerator\.getInstance\s*\(\s*"EC"'
140
+ - '"crypto/elliptic"'
141
+ - '\belliptic\.P(?:224|256|384|521)\s*\('
100
142
 
101
143
  - id: ED25519_USAGE
102
- description: "Ed25519 signatures — elliptic curve, vulnerable to Shor's algorithm"
144
+ description: "Ed25519/Ed448 signatures — elliptic curve, vulnerable to Shor's algorithm"
103
145
  severity: critical
104
146
  category: signature
105
147
  algorithm: Ed25519
106
- replacement: ML-DSA-65 (FIPS 204) or hybrid Ed25519+ML-DSA-65
148
+ replacement: ML-DSA-65 (FIPS 204) or composite ML-DSA-65+Ed25519
107
149
  effort: moderate
108
150
  languages: []
109
151
  patterns:
110
- - "ed25519"
111
- - "Ed25519"
112
- - "ED25519"
113
- - "@noble/ed25519"
114
- - "ed25519-dalek"
115
- - "crypto\\.sign\\s*\\(.*ed25519"
116
- - "nacl\\.sign"
117
- - "tweetnacl.*sign"
118
- - "sodium.*sign"
119
- - "EdDSA"
152
+ - 'ed25519'
153
+ - 'ed448'
154
+ - 'EdDSA'
155
+ - 'nacl\.sign'
156
+ - 'tweetnacl.*\bsign\b'
157
+ - '\bcrypto_sign_(?:keypair|seed_keypair|detached|verify_detached|open)\b'
158
+ - '\bcrypto_sign\s*\('
120
159
 
121
160
  - id: ECDH_KEY_EXCHANGE
122
161
  description: "ECDH key exchange — vulnerable to Shor's algorithm"
123
162
  severity: critical
124
163
  category: kem
125
164
  algorithm: ECDH
126
- replacement: ML-KEM-768 (FIPS 203) or hybrid X25519+ML-KEM-768
165
+ replacement: ML-KEM-768 (FIPS 203) or hybrid X25519MLKEM768
127
166
  effort: complex
128
167
  languages: []
129
168
  patterns:
130
- - "ECDH"
131
- - "ecdh\\.computeSecret"
132
- - "X25519"
133
- - "x25519"
134
- - "Curve25519"
135
- - "curve25519"
136
- - "createECDH"
137
- - "diffieHellman"
138
- - "DiffieHellman"
139
- - "KeyAgreement.*EC"
169
+ - 'ECDH'
170
+ - 'ECDiffieHellman'
171
+ - '(?<!\d)X25519'
172
+ - '(?<!\d)X448\b'
173
+ - 'curve25519'
174
+ - 'curve448'
175
+ - 'KeyAgreement\.getInstance\s*\(\s*"XDH"'
140
176
 
141
177
  - id: DH_KEY_EXCHANGE
142
178
  description: "Diffie-Hellman key exchange — vulnerable to Shor's algorithm"
@@ -147,12 +183,14 @@
147
183
  effort: complex
148
184
  languages: []
149
185
  patterns:
150
- - "DiffieHellman"
151
- - "createDiffieHellman"
152
- - "DH_generate_key"
153
- - "DHParameterSpec"
154
- - "dh\\.generateKeys"
155
- - "dh\\.computeSecret"
186
+ - 'DiffieHellman'
187
+ - '\bdiffie-hellman'
188
+ - 'DH_generate_key'
189
+ - 'DHParameterSpec'
190
+ - '\bdh\.(?:generateKeys|computeSecret)'
191
+ - 'KeyAgreement\.getInstance\s*\(\s*"DH"'
192
+ - '\bffdhe(?:2048|3072|4096|6144|8192)\b'
193
+ - 'asymmetric\s+import\s+.*\bdh\b'
156
194
 
157
195
  - id: DSA_USAGE
158
196
  description: "DSA signatures — vulnerable to Shor's algorithm"
@@ -163,15 +201,200 @@
163
201
  effort: complex
164
202
  languages: []
165
203
  patterns:
166
- - "DSA\\.generate"
167
- - "KeyPairGenerator.*DSA"
168
- - "SHA256withDSA"
169
- - "DSA_generate_key"
204
+ - '(?<![A-Za-z-])DSA\.generate'
205
+ - 'KeyPairGenerator\.getInstance\s*\(\s*"DSA"'
206
+ - '\bSHA-?(?:1|224|256)withDSA'
207
+ - '\bDSA_(?:generate_key|generate_parameters|sign|verify)'
208
+ - '"crypto/dsa"'
209
+ - '\bssh-dss\b'
210
+ - 'asymmetric\s+import\s+.*\bdsa\b'
211
+
212
+ # --- PEM blocks whose header names a quantum-vulnerable key type -------------
213
+ # Generic "CERTIFICATE" / "PUBLIC KEY" / "PRIVATE KEY" blocks are decoded by
214
+ # the certificate scanner instead (it reports key type, size and expiry).
215
+
216
+ - id: PEM_RSA_KEY
217
+ description: "PEM-encoded RSA key — quantum-vulnerable key material"
218
+ severity: critical
219
+ category: kem
220
+ algorithm: RSA
221
+ replacement: ML-KEM (FIPS 203) / ML-DSA (FIPS 204) keys
222
+ effort: moderate
223
+ languages: []
224
+ patterns:
225
+ - '-----BEGIN RSA (?:PRIVATE|PUBLIC) KEY-----'
226
+
227
+ - id: PEM_EC_KEY
228
+ description: "PEM-encoded EC key — quantum-vulnerable key material"
229
+ severity: critical
230
+ category: signature
231
+ algorithm: ECDSA
232
+ replacement: ML-DSA (FIPS 204) keys
233
+ effort: moderate
234
+ languages: []
235
+ patterns:
236
+ - '-----BEGIN EC (?:PRIVATE KEY|PARAMETERS)-----'
237
+
238
+ - id: PEM_DSA_KEY
239
+ description: "PEM-encoded DSA key — quantum-vulnerable key material"
240
+ severity: critical
241
+ category: signature
242
+ algorithm: DSA
243
+ replacement: ML-DSA (FIPS 204) keys
244
+ effort: moderate
245
+ languages: []
246
+ patterns:
247
+ - '-----BEGIN DSA PRIVATE KEY-----'
248
+
249
+ - id: PEM_DH_PARAMS
250
+ description: "PEM-encoded Diffie-Hellman parameters — quantum-vulnerable key exchange"
251
+ severity: critical
252
+ category: kem
253
+ algorithm: DH
254
+ replacement: ML-KEM-768 (FIPS 203) or hybrid X25519MLKEM768
255
+ effort: moderate
256
+ languages: []
257
+ patterns:
258
+ - '-----BEGIN (?:X9\.42 )?DH PARAMETERS-----'
170
259
 
171
260
  # =============================================================================
172
- # HIGH: Weakened by Grover's algorithm
261
+ # CRITICAL: Protocol & config — quantum-vulnerable key exchange / signatures
173
262
  # =============================================================================
174
263
 
264
+ - id: SSH_RSA_KEY_TYPE
265
+ description: "SSH RSA host/user key — vulnerable to Shor's algorithm"
266
+ severity: critical
267
+ category: kem
268
+ algorithm: RSA
269
+ replacement: SSH keys using ML-DSA or hybrid PQ/traditional algorithms
270
+ effort: moderate
271
+ languages: [config]
272
+ patterns:
273
+ - 'ssh-rsa'
274
+ - 'HostKey.*rsa'
275
+ - 'HostKeyAlgorithms.*ssh-rsa'
276
+ - 'PubkeyAcceptedKeyTypes.*ssh-rsa'
277
+ - 'PubkeyAcceptedAlgorithms.*ssh-rsa'
278
+
279
+ - id: SSH_ECDSA_KEY_TYPE
280
+ description: "SSH ECDSA key type — vulnerable to Shor's algorithm"
281
+ severity: critical
282
+ category: signature
283
+ algorithm: ECDSA
284
+ replacement: SSH keys using ML-DSA or hybrid PQ/traditional algorithms
285
+ effort: moderate
286
+ languages: [config]
287
+ patterns:
288
+ - 'ecdsa-sha2-nistp256'
289
+ - 'ecdsa-sha2-nistp384'
290
+ - 'ecdsa-sha2-nistp521'
291
+ - 'HostKeyAlgorithms.*ecdsa'
292
+ - 'PubkeyAcceptedKeyTypes.*ecdsa'
293
+ - 'PubkeyAcceptedAlgorithms.*ecdsa'
294
+
295
+ - id: SSH_VULNERABLE_KEX
296
+ description: "SSH key exchange using DH or ECDH — vulnerable to harvest-now-decrypt-later"
297
+ severity: critical
298
+ category: kem
299
+ algorithm: DH
300
+ replacement: mlkem768x25519-sha256 (OpenSSH ≥ 9.9, default since 10.0; 10.1+ warns on non-PQ key exchange)
301
+ effort: moderate
302
+ languages: [config]
303
+ patterns:
304
+ - 'KexAlgorithms.*diffie-hellman'
305
+ - 'KexAlgorithms.*ecdh-sha2'
306
+ - 'diffie-hellman-group-exchange'
307
+ - 'diffie-hellman-group14'
308
+ - 'diffie-hellman-group16'
309
+ - 'diffie-hellman-group18'
310
+
311
+ - id: TLS_RSA_KEY_EXCHANGE
312
+ description: "TLS cipher suite with RSA key exchange — no forward secrecy, quantum-vulnerable"
313
+ severity: critical
314
+ category: kem
315
+ algorithm: RSA
316
+ replacement: TLS 1.3 with hybrid X25519MLKEM768 key exchange
317
+ effort: moderate
318
+ languages: [config]
319
+ patterns:
320
+ - '\bTLS_RSA_WITH_\w+'
321
+ # OpenSSL names for static-RSA suites have no key-exchange prefix
322
+ - '(?<![\w-])(?:AES(?:128|256)(?:-GCM)?-SHA(?:256|384)?|DES-CBC3-SHA)(?![\w-])'
323
+
324
+ - id: TLS_ECDHE_CIPHER
325
+ description: "TLS cipher suite with ECDHE key exchange — quantum-vulnerable ephemeral keys"
326
+ severity: critical
327
+ category: kem
328
+ algorithm: ECDH
329
+ replacement: TLS 1.3 with hybrid X25519MLKEM768 key exchange (default in OpenSSL ≥ 3.5, Go ≥ 1.24, Chrome, Firefox)
330
+ effort: moderate
331
+ languages: [config]
332
+ patterns:
333
+ - '\bECDHE-(?:RSA|ECDSA)-[\w-]+'
334
+ - '\bTLS_ECDHE_\w+'
335
+
336
+ - id: K8S_RSA_PRIVATE_KEY
337
+ description: "Kubernetes cert-manager RSA private key — quantum-vulnerable certificates"
338
+ severity: critical
339
+ category: kem
340
+ algorithm: RSA
341
+ replacement: Post-quantum certificate algorithms when supported by cert-manager
342
+ effort: complex
343
+ languages: [config]
344
+ patterns:
345
+ - 'algorithm:\s*RSA'
346
+ - 'privateKey:[\s\S]*algorithm:\s*RSA'
347
+
348
+ # =============================================================================
349
+ # HIGH: Protocol configuration — weakened or outdated
350
+ # =============================================================================
351
+
352
+ - id: TLS_VULNERABLE_PROTOCOL
353
+ description: "TLS 1.0/1.1 or SSLv3 — deprecated protocols with known vulnerabilities"
354
+ severity: high
355
+ category: protocol
356
+ algorithm: TLS
357
+ replacement: TLS 1.3
358
+ effort: moderate
359
+ languages: [config]
360
+ patterns:
361
+ - 'ssl_protocols.*TLSv1(?:[^.]|$)'
362
+ - 'ssl_protocols.*TLSv1\.1'
363
+ - 'SSLProtocol.*SSLv3'
364
+ - 'SSLProtocol.*TLSv1(?:[^.]|$)'
365
+ - 'MinProtocol.*TLSv1\.0'
366
+ - 'MinProtocol.*TLSv1\.1'
367
+ - 'ssl-min-ver.*TLSv1\.0'
368
+ - 'ssl-min-ver.*TLSv1\.1'
369
+ - 'tls_version.*TLSv1(?:\.0|\.1)?(?!\.[2-9])'
370
+
371
+ - id: DOCKER_CRYPTO_INSTALL
372
+ description: "Dockerfile installs crypto library — review for quantum-vulnerable algorithms"
373
+ severity: high
374
+ category: protocol
375
+ algorithm: OpenSSL
376
+ replacement: Ensure installed crypto libraries support post-quantum algorithms (e.g. OpenSSL ≥ 3.5)
377
+ effort: moderate
378
+ languages: [config]
379
+ patterns:
380
+ - '(?:apt-get|apk add|yum|dnf).*(?:install|add).*(?:openssl|libssl|libcrypto|gnutls)'
381
+ - 'pip install.*(?:cryptography|pycryptodome|pyOpenSSL)'
382
+ - 'gem install.*(?:openssl|rbnacl)'
383
+
384
+ - id: K8S_TLS_SECRET
385
+ description: "Kubernetes TLS secret — may contain quantum-vulnerable certificates"
386
+ severity: high
387
+ category: protocol
388
+ algorithm: TLS
389
+ replacement: Rotate TLS certificates to post-quantum algorithms when available
390
+ effort: complex
391
+ languages: [config]
392
+ patterns:
393
+ - 'type:\s*kubernetes\.io/tls'
394
+ - 'secretName:.*tls'
395
+ - 'tls\.crt'
396
+ - 'tls\.key'
397
+
175
398
  - id: AES_128
176
399
  description: "AES-128 — Grover's algorithm reduces effective security to 64 bits"
177
400
  severity: high
@@ -181,11 +404,11 @@
181
404
  effort: trivial
182
405
  languages: []
183
406
  patterns:
184
- - "AES-128"
185
- - "aes-128"
186
- - "AES/.*128"
187
- - "createCipheriv\\s*\\(.*aes-128"
188
- - "Cipher\\.getInstance.*AES.*128"
407
+ - '\bAES-?128(?!\d)'
408
+ - 'AES/.*128'
409
+ - 'createCipheriv\s*\(.*aes-128'
410
+ - 'Cipher\.getInstance.*AES.*128'
411
+ - 'AESGCM\.generate_key\s*\(\s*bit_length\s*=\s*128'
189
412
 
190
413
  # =============================================================================
191
414
  # MEDIUM: Already weak classically
@@ -200,11 +423,10 @@
200
423
  effort: trivial
201
424
  languages: []
202
425
  patterns:
203
- - "md5"
204
- - "MD5"
205
- - "createHash\\s*\\(.*['\"]md5['\"]"
206
- - "MessageDigest.*MD5"
207
- - "hashlib\\.md5"
426
+ - 'md5'
427
+ - 'createHash\s*\(.*[''"]md5[''"]'
428
+ - 'MessageDigest.*MD5'
429
+ - 'hashlib\.md5'
208
430
 
209
431
  - id: SHA1_USAGE
210
432
  description: "SHA-1 — collision attacks known, should migrate regardless of quantum"
@@ -215,11 +437,10 @@
215
437
  effort: trivial
216
438
  languages: []
217
439
  patterns:
218
- - "sha-?1(?!\\d)"
219
- - "SHA-?1(?!\\d)"
220
- - "createHash\\s*\\(.*['\"]sha1['\"]"
221
- - "MessageDigest.*SHA.1"
222
- - "hashlib\\.sha1"
440
+ - 'sha-?1(?!\d)'
441
+ - 'createHash\s*\(.*[''"]sha1[''"]'
442
+ - 'MessageDigest.*SHA.1'
443
+ - 'hashlib\.sha1'
223
444
 
224
445
  - id: DES_3DES
225
446
  description: "DES/3DES — deprecated, 64-bit block size"
@@ -229,20 +450,133 @@
229
450
  replacement: AES-256
230
451
  effort: moderate
231
452
  languages: []
453
+ # Case-sensitive: "des" is an ordinary substring (description, destroy) and
454
+ # an ordinary word in French/Spanish comments. See GitHub issue #12.
455
+ caseSensitive: true
456
+ patterns:
457
+ - '\bDES\b'
458
+ - '\bDES3\b'
459
+ - 'DESede'
460
+ - 'TripleDES'
461
+ - 'DESCryptoServiceProvider'
462
+ - '(?i)\b3des\b'
463
+ - '(?i)\btriple-?des\b'
464
+ - '(?i)\bdes-(?:ede3?|cbc|ecb|cfb\d*|ofb)\b'
465
+ - '(?i)\bdes(?:3|-ede3?)\b'
466
+ - 'EVP_des_\w+'
467
+ - '\bDES_(?:ecb|cbc|ncbc|ede3?|set_key|key_sched)\w*'
468
+ - '\bdes\.New(?:TripleDES)?Cipher'
469
+ - '"crypto/des"'
470
+ - '\bMCRYPT_(?:3?DES|TRIPLEDES)\b'
471
+
472
+ # =============================================================================
473
+ # LOW: Pre-standard post-quantum names — verify against the final FIPS
474
+ # =============================================================================
475
+
476
+ - id: PRE_STANDARD_KYBER
477
+ description: "Kyber — pre-standard (round 3) name for what became ML-KEM (FIPS 203). Round-3 Kyber and draft hybrids such as X25519Kyber768Draft00 are not interoperable with ML-KEM; verify the library implements FIPS 203"
478
+ severity: low
479
+ category: kem
480
+ algorithm: Kyber (pre-standard)
481
+ replacement: ML-KEM-768 (FIPS 203); for TLS use the X25519MLKEM768 hybrid group
482
+ effort: moderate
483
+ languages: []
484
+ patterns:
485
+ - 'X25519Kyber768\w*'
486
+ - 'P256Kyber768\w*'
487
+ - 'kyber'
488
+
489
+ - id: ML_KEM_512
490
+ description: "ML-KEM-512 — smallest ML-KEM parameter set. Not broken, but after the Nov 2026 structured-lattice results the CIRG review recommends choosing the highest security level each application can support"
491
+ severity: low
492
+ category: kem
493
+ algorithm: ML-KEM-512
494
+ replacement: ML-KEM-768 or ML-KEM-1024 (CNSA 2.0 requires ML-KEM-1024)
495
+ effort: trivial
496
+ languages: []
497
+ patterns:
498
+ - '\bml[-_]?kem[-_]?512\b'
499
+
500
+ - id: ML_DSA_44
501
+ description: "ML-DSA-44 — smallest ML-DSA parameter set. Not broken, but after the Nov 2026 structured-lattice results the CIRG review recommends choosing the highest security level each application can support"
502
+ severity: low
503
+ category: signature
504
+ algorithm: ML-DSA-44
505
+ replacement: ML-DSA-65 or ML-DSA-87 (CNSA 2.0 requires ML-DSA-87)
506
+ effort: trivial
507
+ languages: []
508
+ patterns:
509
+ - '\bml[-_]?dsa[-_]?44\b'
510
+
511
+ - id: CLASSIC_MCELIECE
512
+ description: "Classic McEliece — BSI advises against new deployments (Sep 2026) after significant cryptanalytic progress; no practical attack on recommended parameters yet. If kept, use only in a hybrid"
513
+ severity: low
514
+ category: kem
515
+ algorithm: Classic McEliece
516
+ replacement: ML-KEM-768/1024 or FrodoKEM; HQC once standardized
517
+ effort: moderate
518
+ languages: []
232
519
  patterns:
233
- - "DES"
234
- - "3DES"
235
- - "DESede"
236
- - "TripleDES"
237
- - "des-ede3"
238
- - "des-cbc"
520
+ - 'mceliece'
521
+
522
+ - id: PRE_STANDARD_DILITHIUM
523
+ description: "Dilithium — pre-standard name for what became ML-DSA (FIPS 204); round-3 Dilithium signatures do not verify under ML-DSA"
524
+ severity: low
525
+ category: signature
526
+ algorithm: Dilithium (pre-standard)
527
+ replacement: ML-DSA-65 (FIPS 204)
528
+ effort: moderate
529
+ languages: []
530
+ patterns:
531
+ - 'dilithium'
532
+
533
+ - id: PRE_STANDARD_SPHINCS
534
+ description: "SPHINCS+ — pre-standard name for what became SLH-DSA (FIPS 205); verify the library implements FIPS 205"
535
+ severity: low
536
+ category: signature
537
+ algorithm: SPHINCS+ (pre-standard)
538
+ replacement: SLH-DSA (FIPS 205)
539
+ effort: moderate
540
+ languages: []
541
+ patterns:
542
+ - 'sphincs'
239
543
 
240
544
  # =============================================================================
241
545
  # SAFE: Already quantum-resistant (document for inventory)
242
546
  # =============================================================================
243
547
 
548
+ - id: HYBRID_PQ_KEM
549
+ description: "Hybrid post-quantum key exchange (ML-KEM or sntrup761 combined with ECDH) — quantum-resistant"
550
+ severity: safe
551
+ category: kem
552
+ algorithm: Hybrid PQ KEM
553
+ replacement: null
554
+ effort: trivial
555
+ languages: []
556
+ patterns:
557
+ # TLS named groups (draft-ietf-tls-ecdhe-mlkem)
558
+ - 'X25519MLKEM768'
559
+ - 'SecP256r1MLKEM768'
560
+ - 'SecP384r1MLKEM1024'
561
+ # SSH key exchange
562
+ - 'mlkem768x25519-sha256'
563
+ - 'mlkem(?:768|1024)nistp(?:256|384)-sha(?:256|384)'
564
+ - 'sntrup761x25519-sha512(?:@openssh\.com)?'
565
+
566
+ - id: HYBRID_PQ_SIGNATURE
567
+ description: "Composite ML-DSA signature (ML-DSA paired with a classical algorithm) — quantum-resistant"
568
+ severity: safe
569
+ category: signature
570
+ algorithm: Composite ML-DSA
571
+ replacement: null
572
+ effort: trivial
573
+ languages: []
574
+ patterns:
575
+ - 'ML-?DSA-?(?:44|65|87)[-_](?:RSA|ECDSA|Ed25519|Ed448|P256|P384|brainpool)[\w-]*'
576
+ - 'id-MLDSA(?:44|65|87)-\w[\w-]*'
577
+
244
578
  - id: ML_KEM
245
- description: "ML-KEM (Kyber) — NIST FIPS 203 post-quantum key encapsulation"
579
+ description: "ML-KEM — NIST FIPS 203 post-quantum key encapsulation"
246
580
  severity: safe
247
581
  category: kem
248
582
  algorithm: ML-KEM
@@ -250,18 +584,13 @@
250
584
  effort: trivial
251
585
  languages: []
252
586
  patterns:
253
- - "ml.kem"
254
- - "ML-KEM"
255
- - "ML_KEM"
256
- - "mlKem"
257
- - "kyber"
258
- - "KYBER"
259
- - "Kyber768"
260
- - "Kyber1024"
261
- - "@noble/post-quantum.*kem"
587
+ - 'ml.kem'
588
+ - 'mlkem'
589
+ - '@noble/post-quantum.*kem'
590
+ - '\b(?:en|de)capsulate(?:Bits|Key)\b'
262
591
 
263
592
  - id: ML_DSA
264
- description: "ML-DSA (Dilithium) — NIST FIPS 204 post-quantum signatures"
593
+ description: "ML-DSA — NIST FIPS 204 post-quantum signatures"
265
594
  severity: safe
266
595
  category: signature
267
596
  algorithm: ML-DSA
@@ -269,17 +598,12 @@
269
598
  effort: trivial
270
599
  languages: []
271
600
  patterns:
272
- - "ml.dsa"
273
- - "ML-DSA"
274
- - "ML_DSA"
275
- - "mlDsa"
276
- - "dilithium"
277
- - "DILITHIUM"
278
- - "Dilithium"
279
- - "@noble/post-quantum.*dsa"
601
+ - 'ml.dsa'
602
+ - 'mldsa'
603
+ - '@noble/post-quantum.*dsa'
280
604
 
281
605
  - id: SLH_DSA
282
- description: "SLH-DSA (SPHINCS+) — NIST FIPS 205 hash-based post-quantum signatures"
606
+ description: "SLH-DSA — NIST FIPS 205 hash-based post-quantum signatures"
283
607
  severity: safe
284
608
  category: signature
285
609
  algorithm: SLH-DSA
@@ -287,11 +611,59 @@
287
611
  effort: trivial
288
612
  languages: []
289
613
  patterns:
290
- - "slh.dsa"
291
- - "SLH-DSA"
292
- - "SLH_DSA"
293
- - "sphincs"
294
- - "SPHINCS"
614
+ - 'slh.dsa'
615
+ - 'slhdsa'
616
+
617
+ - id: FN_DSA
618
+ description: "FN-DSA (Falcon) — quantum-resistant, but FIPS 206 was still a draft as of late 2026, and its NTRU-type structured lattice was not covered by the Nov 2026 CIRG assessment; prefer ML-DSA in production"
619
+ severity: safe
620
+ category: signature
621
+ algorithm: FN-DSA
622
+ replacement: null
623
+ effort: trivial
624
+ languages: []
625
+ patterns:
626
+ - '\bFN[-_]?DSA'
627
+ - '\bfalcon[-_]?(?:512|1024)\b'
628
+
629
+ - id: HQC_KEM
630
+ description: "HQC — code-based KEM selected by NIST (March 2025) as a backup to ML-KEM; FIPS 207 pending"
631
+ severity: safe
632
+ category: kem
633
+ algorithm: HQC
634
+ replacement: null
635
+ effort: trivial
636
+ languages: []
637
+ patterns:
638
+ - '\bHQC[-_]?(?:128|192|256)\b'
639
+ - '\bHQC[-_]?KEM\b'
640
+
641
+ - id: PQ_KEM_ALTERNATIVE
642
+ description: "Non-NIST post-quantum KEM (FrodoKEM, sntrup761) — quantum-resistant. FrodoKEM's unstructured lattices are unaffected by the Nov 2026 structured-lattice results"
643
+ severity: safe
644
+ category: kem
645
+ algorithm: Alternative PQ KEM
646
+ replacement: null
647
+ effort: trivial
648
+ languages: []
649
+ patterns:
650
+ - 'frodo-?kem'
651
+ - 'sntrup761'
652
+
653
+ - id: STATEFUL_HASH_SIG
654
+ description: "LMS/XMSS — stateful hash-based signatures (NIST SP 800-208), approved in CNSA 2.0 for software/firmware signing. Never reuse signing state"
655
+ severity: safe
656
+ category: signature
657
+ algorithm: LMS/XMSS
658
+ replacement: null
659
+ effort: trivial
660
+ languages: []
661
+ patterns:
662
+ - '\bXMSS(?:MT|\^MT)?\b'
663
+ - '\bHSS[_/-]?LMS\b'
664
+ - '\bLMS_SHA256_M(?:24|32)_H\d+'
665
+ - '\bLMOTS_SHA256'
666
+ - '\bLMS(?:KeyGenParameterSpec|Signer|PrivateKeyParameters|Parameters)\b'
295
667
 
296
668
  - id: AES_256
297
669
  description: "AES-256 — 128-bit post-quantum security, sufficient"
@@ -302,10 +674,8 @@
302
674
  effort: trivial
303
675
  languages: []
304
676
  patterns:
305
- - "AES-256"
306
- - "aes-256"
307
- - "aes-256-gcm"
308
- - "aes-256-cbc"
677
+ - '\bAES-?256(?!\d)'
678
+ - '\bTLS_AES_256_GCM_SHA384\b'
309
679
 
310
680
  - id: CHACHA20
311
681
  description: "ChaCha20-Poly1305 — symmetric AEAD, quantum-resistant"
@@ -316,11 +686,8 @@
316
686
  effort: trivial
317
687
  languages: []
318
688
  patterns:
319
- - "chacha20"
320
- - "ChaCha20"
321
- - "CHACHA20"
322
- - "chacha20-poly1305"
323
- - "xchacha20"
689
+ - 'chacha20(?:-poly1305(?:@openssh\.com)?)?'
690
+ - '\bTLS_CHACHA20_POLY1305_SHA256\b'
324
691
 
325
692
  - id: SHA256_SAFE
326
693
  description: "SHA-256 — quantum-resistant hash (Grover reduces to 128-bit, still safe)"
@@ -331,9 +698,18 @@
331
698
  effort: trivial
332
699
  languages: []
333
700
  patterns:
334
- - "sha-?256"
335
- - "SHA-?256"
336
- - "createHash\\s*\\(.*['\"]sha256['\"]"
701
+ - 'sha-?256'
702
+
703
+ - id: SHA384_SHA512_SAFE
704
+ description: "SHA-384/SHA-512 — quantum-resistant hash (required by CNSA 2.0)"
705
+ severity: safe
706
+ category: hash
707
+ algorithm: SHA-384/512
708
+ replacement: null
709
+ effort: trivial
710
+ languages: []
711
+ patterns:
712
+ - 'sha-?(?:384|512)'
337
713
 
338
714
  - id: SHA3_SAFE
339
715
  description: "SHA-3 — quantum-resistant hash"
@@ -344,7 +720,5 @@
344
720
  effort: trivial
345
721
  languages: []
346
722
  patterns:
347
- - "sha-?3"
348
- - "SHA-?3"
349
- - "keccak"
350
- - "KECCAK"
723
+ - 'sha-?3(?!\d)'
724
+ - 'keccak'