@quantakrypto/core 0.4.2 → 0.4.4
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 +38 -10
- package/dist/agent-types.js.map +1 -1
- package/dist/baseline.js.map +1 -1
- package/dist/cache.js.map +1 -1
- package/dist/cbom-merge.d.ts +9 -0
- package/dist/cbom-merge.d.ts.map +1 -0
- package/dist/cbom-merge.js +99 -0
- package/dist/cbom-merge.js.map +1 -0
- package/dist/cbom.js.map +1 -1
- package/dist/changed.js.map +1 -1
- package/dist/codemods/config-toggle.js.map +1 -1
- package/dist/codemods/registry.js.map +1 -1
- package/dist/comments.d.ts +29 -2
- package/dist/comments.d.ts.map +1 -1
- package/dist/comments.js +178 -18
- package/dist/comments.js.map +1 -1
- package/dist/config.js.map +1 -1
- package/dist/cwe.js.map +1 -1
- package/dist/dependencies.d.ts +3 -2
- package/dist/dependencies.d.ts.map +1 -1
- package/dist/dependencies.js +138 -2
- package/dist/dependencies.js.map +1 -1
- package/dist/detect-utils.d.ts +19 -4
- package/dist/detect-utils.d.ts.map +1 -1
- package/dist/detect-utils.js +43 -6
- package/dist/detect-utils.js.map +1 -1
- package/dist/detectors/c.d.ts +4 -2
- package/dist/detectors/c.d.ts.map +1 -1
- package/dist/detectors/c.js +382 -3
- package/dist/detectors/c.js.map +1 -1
- package/dist/detectors/cicd.d.ts +27 -0
- package/dist/detectors/cicd.d.ts.map +1 -0
- package/dist/detectors/cicd.js +116 -0
- package/dist/detectors/cicd.js.map +1 -0
- package/dist/detectors/cloud-kms.d.ts +21 -0
- package/dist/detectors/cloud-kms.d.ts.map +1 -0
- package/dist/detectors/cloud-kms.js +57 -0
- package/dist/detectors/cloud-kms.js.map +1 -0
- package/dist/detectors/cloudformation.d.ts +30 -0
- package/dist/detectors/cloudformation.d.ts.map +1 -0
- package/dist/detectors/cloudformation.js +170 -0
- package/dist/detectors/cloudformation.js.map +1 -0
- package/dist/detectors/csharp.d.ts.map +1 -1
- package/dist/detectors/csharp.js +141 -3
- package/dist/detectors/csharp.js.map +1 -1
- package/dist/detectors/database.d.ts +17 -0
- package/dist/detectors/database.d.ts.map +1 -0
- package/dist/detectors/database.js +60 -0
- package/dist/detectors/database.js.map +1 -0
- package/dist/detectors/dnssec.d.ts +55 -0
- package/dist/detectors/dnssec.d.ts.map +1 -0
- package/dist/detectors/dnssec.js +107 -0
- package/dist/detectors/dnssec.js.map +1 -0
- package/dist/detectors/elixir.d.ts +20 -0
- package/dist/detectors/elixir.d.ts.map +1 -0
- package/dist/detectors/elixir.js +195 -0
- package/dist/detectors/elixir.js.map +1 -0
- package/dist/detectors/go.d.ts +5 -3
- package/dist/detectors/go.d.ts.map +1 -1
- package/dist/detectors/go.js +187 -3
- package/dist/detectors/go.js.map +1 -1
- package/dist/detectors/java.d.ts.map +1 -1
- package/dist/detectors/java.js +169 -4
- package/dist/detectors/java.js.map +1 -1
- package/dist/detectors/jose.d.ts +20 -0
- package/dist/detectors/jose.d.ts.map +1 -0
- package/dist/detectors/jose.js +62 -0
- package/dist/detectors/jose.js.map +1 -0
- package/dist/detectors/jwk.d.ts +25 -0
- package/dist/detectors/jwk.d.ts.map +1 -0
- package/dist/detectors/jwk.js +95 -0
- package/dist/detectors/jwk.js.map +1 -0
- package/dist/detectors/k8s.d.ts +17 -0
- package/dist/detectors/k8s.d.ts.map +1 -0
- package/dist/detectors/k8s.js +85 -0
- package/dist/detectors/k8s.js.map +1 -0
- package/dist/detectors/mesh.d.ts +35 -0
- package/dist/detectors/mesh.d.ts.map +1 -0
- package/dist/detectors/mesh.js +109 -0
- package/dist/detectors/mesh.js.map +1 -0
- package/dist/detectors/messaging.d.ts +16 -0
- package/dist/detectors/messaging.d.ts.map +1 -0
- package/dist/detectors/messaging.js +72 -0
- package/dist/detectors/messaging.js.map +1 -0
- package/dist/detectors/pem.d.ts.map +1 -1
- package/dist/detectors/pem.js +50 -2
- package/dist/detectors/pem.js.map +1 -1
- package/dist/detectors/php.d.ts +24 -0
- package/dist/detectors/php.d.ts.map +1 -0
- package/dist/detectors/php.js +167 -0
- package/dist/detectors/php.js.map +1 -0
- package/dist/detectors/python.d.ts.map +1 -1
- package/dist/detectors/python.js +144 -3
- package/dist/detectors/python.js.map +1 -1
- package/dist/detectors/ruby.d.ts +9 -5
- package/dist/detectors/ruby.d.ts.map +1 -1
- package/dist/detectors/ruby.js +122 -2
- package/dist/detectors/ruby.js.map +1 -1
- package/dist/detectors/rust.d.ts +8 -3
- package/dist/detectors/rust.d.ts.map +1 -1
- package/dist/detectors/rust.js +253 -3
- package/dist/detectors/rust.js.map +1 -1
- package/dist/detectors/secrets.d.ts +21 -0
- package/dist/detectors/secrets.d.ts.map +1 -0
- package/dist/detectors/secrets.js +79 -0
- package/dist/detectors/secrets.js.map +1 -0
- package/dist/detectors/source.d.ts.map +1 -1
- package/dist/detectors/source.js +305 -52
- package/dist/detectors/source.js.map +1 -1
- package/dist/detectors/stateful-hbs.d.ts +22 -0
- package/dist/detectors/stateful-hbs.d.ts.map +1 -0
- package/dist/detectors/stateful-hbs.js +142 -0
- package/dist/detectors/stateful-hbs.js.map +1 -0
- package/dist/detectors/terraform.d.ts +21 -0
- package/dist/detectors/terraform.d.ts.map +1 -0
- package/dist/detectors/terraform.js +123 -0
- package/dist/detectors/terraform.js.map +1 -0
- package/dist/detectors/vpn.d.ts +22 -0
- package/dist/detectors/vpn.d.ts.map +1 -0
- package/dist/detectors/vpn.js +99 -0
- package/dist/detectors/vpn.js.map +1 -0
- package/dist/errors.js.map +1 -1
- package/dist/evidence.d.ts +53 -0
- package/dist/evidence.d.ts.map +1 -0
- package/dist/evidence.js +81 -0
- package/dist/evidence.js.map +1 -0
- package/dist/index.d.ts +9 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -2
- package/dist/index.js.map +1 -1
- package/dist/inventory.d.ts +2 -0
- package/dist/inventory.d.ts.map +1 -1
- package/dist/inventory.js +27 -1
- package/dist/inventory.js.map +1 -1
- package/dist/parallel.js.map +1 -1
- package/dist/patch-policy.js.map +1 -1
- package/dist/policy.d.ts +67 -0
- package/dist/policy.d.ts.map +1 -0
- package/dist/policy.js +115 -0
- package/dist/policy.js.map +1 -0
- package/dist/redact.d.ts.map +1 -1
- package/dist/redact.js +39 -0
- package/dist/redact.js.map +1 -1
- package/dist/registry.d.ts +2 -2
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +34 -2
- package/dist/registry.js.map +1 -1
- package/dist/remediate-pipeline.d.ts +3 -0
- package/dist/remediate-pipeline.d.ts.map +1 -1
- package/dist/remediate-pipeline.js +71 -0
- package/dist/remediate-pipeline.js.map +1 -1
- package/dist/remediate-request.js.map +1 -1
- package/dist/remediation.d.ts +9 -3
- package/dist/remediation.d.ts.map +1 -1
- package/dist/remediation.js +17 -5
- package/dist/remediation.js.map +1 -1
- package/dist/report.d.ts +9 -0
- package/dist/report.d.ts.map +1 -1
- package/dist/report.js +38 -0
- package/dist/report.js.map +1 -1
- package/dist/scan-worker.js.map +1 -1
- package/dist/scan.d.ts.map +1 -1
- package/dist/scan.js +8 -1
- package/dist/scan.js.map +1 -1
- package/dist/severity.js.map +1 -1
- package/dist/standards.d.ts +96 -0
- package/dist/standards.d.ts.map +1 -0
- package/dist/standards.js +107 -0
- package/dist/standards.js.map +1 -0
- package/dist/triage.js.map +1 -1
- package/dist/types.d.ts +2 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/verify.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/dist/walk.js.map +1 -1
- package/dist/worktree.js.map +1 -1
- package/package.json +1 -1
- package/src/cbom-merge.ts +116 -0
- package/src/comments.ts +183 -18
- package/src/dependencies.ts +144 -4
- package/src/detect-utils.ts +47 -6
- package/src/detectors/c.ts +411 -5
- package/src/detectors/cicd.ts +158 -0
- package/src/detectors/cloud-kms.ts +87 -0
- package/src/detectors/cloudformation.ts +215 -0
- package/src/detectors/csharp.ts +154 -3
- package/src/detectors/database.ts +88 -0
- package/src/detectors/dnssec.ts +186 -0
- package/src/detectors/elixir.ts +237 -0
- package/src/detectors/go.ts +209 -6
- package/src/detectors/java.ts +191 -4
- package/src/detectors/jose.ts +94 -0
- package/src/detectors/jwk.ts +128 -0
- package/src/detectors/k8s.ts +112 -0
- package/src/detectors/mesh.ts +154 -0
- package/src/detectors/messaging.ts +98 -0
- package/src/detectors/pem.ts +54 -2
- package/src/detectors/php.ts +225 -0
- package/src/detectors/python.ts +153 -3
- package/src/detectors/ruby.ts +138 -7
- package/src/detectors/rust.ts +282 -7
- package/src/detectors/secrets.ts +114 -0
- package/src/detectors/source.ts +382 -72
- package/src/detectors/stateful-hbs.ts +180 -0
- package/src/detectors/terraform.ts +154 -0
- package/src/detectors/vpn.ts +131 -0
- package/src/evidence.ts +135 -0
- package/src/index.ts +15 -1
- package/src/inventory.ts +31 -1
- package/src/policy.ts +180 -0
- package/src/redact.ts +41 -0
- package/src/registry.ts +34 -2
- package/src/remediate-pipeline.ts +78 -0
- package/src/remediation.ts +23 -8
- package/src/report.ts +48 -2
- package/src/scan.ts +13 -1
- package/src/standards.ts +186 -0
- package/src/types.ts +3 -1
- package/src/version.ts +1 -1
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { DOC_EXTENSIONS, eachMatch, findingFromRule, hasExtension } from "../detect-utils.js";
|
|
2
|
+
import { CWE_BROKEN_CRYPTO, CWE_CERT_VALIDATION } from "../cwe.js";
|
|
3
|
+
const RE_PGCRYPTO = /\bpgp_pub_(?:encrypt|decrypt)\b/g;
|
|
4
|
+
const RE_WEAK_SSLMODE = /\bsslmode\s*=\s*["']?(?:disable|allow|prefer|require)\b/gi;
|
|
5
|
+
const RULE_PGCRYPTO = {
|
|
6
|
+
id: "db-pgcrypto-pubkey",
|
|
7
|
+
title: "pgcrypto public-key encryption",
|
|
8
|
+
description: "Postgres pgcrypto pgp_pub_encrypt / pgp_pub_decrypt (RSA/ElGamal) on stored data",
|
|
9
|
+
category: "kem",
|
|
10
|
+
severity: "high",
|
|
11
|
+
confidence: "high",
|
|
12
|
+
algorithm: "RSA",
|
|
13
|
+
hndl: true,
|
|
14
|
+
cwe: CWE_BROKEN_CRYPTO,
|
|
15
|
+
message: "Column data is encrypted with pgcrypto public-key crypto (classical RSA/ElGamal); stored ciphertext is harvest-now-decrypt-later exposed.",
|
|
16
|
+
remediation: "Plan migration to a post-quantum KEM (ML-KEM-768) envelope for at-rest data; re-encrypt long-lived rows.",
|
|
17
|
+
};
|
|
18
|
+
const RULE_WEAK_SSLMODE = {
|
|
19
|
+
id: "db-weak-sslmode",
|
|
20
|
+
title: "Database sslmode without verification",
|
|
21
|
+
description: "libpq sslmode is disable/allow/prefer/require (no certificate verification)",
|
|
22
|
+
category: "tls",
|
|
23
|
+
severity: "medium",
|
|
24
|
+
confidence: "high",
|
|
25
|
+
hndl: false,
|
|
26
|
+
cwe: CWE_CERT_VALIDATION,
|
|
27
|
+
message: "Database sslmode does not verify the server certificate; the classical TLS session is MITM-able and its key exchange is harvestable.",
|
|
28
|
+
remediation: "Use sslmode=verify-full and TLS 1.3; track PQC-hybrid KEX (X25519MLKEM768) for database transport.",
|
|
29
|
+
};
|
|
30
|
+
/** Detects classical database at-rest / transport crypto. */
|
|
31
|
+
export const databaseDetector = {
|
|
32
|
+
id: "database-crypto",
|
|
33
|
+
description: "Classical crypto in database usage (pgcrypto public-key, weak client sslmode)",
|
|
34
|
+
scope: "config",
|
|
35
|
+
language: "any",
|
|
36
|
+
rules: [RULE_PGCRYPTO, RULE_WEAK_SSLMODE],
|
|
37
|
+
// Skip prose/docs: a README showing `sslmode=require` is not a live connection string.
|
|
38
|
+
appliesTo: (f) => !hasExtension(f, DOC_EXTENSIONS),
|
|
39
|
+
detect({ file, content }) {
|
|
40
|
+
const findings = [];
|
|
41
|
+
if (file.toLowerCase().endsWith(".sql") && content.includes("pgp_pub_")) {
|
|
42
|
+
eachMatch(RE_PGCRYPTO, content, (m) => findings.push(findingFromRule(RULE_PGCRYPTO, {
|
|
43
|
+
file,
|
|
44
|
+
content,
|
|
45
|
+
index: m.index,
|
|
46
|
+
matchLength: m[0].length,
|
|
47
|
+
})));
|
|
48
|
+
}
|
|
49
|
+
if (content.includes("sslmode")) {
|
|
50
|
+
eachMatch(RE_WEAK_SSLMODE, content, (m) => findings.push(findingFromRule(RULE_WEAK_SSLMODE, {
|
|
51
|
+
file,
|
|
52
|
+
content,
|
|
53
|
+
index: m.index,
|
|
54
|
+
matchLength: m[0].length,
|
|
55
|
+
})));
|
|
56
|
+
}
|
|
57
|
+
return findings;
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
//# sourceMappingURL=database.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"database.js","sourceRoot":"","sources":["../../src/detectors/database.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAC9F,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAEnE,MAAM,WAAW,GAAG,kCAAkC,CAAC;AACvD,MAAM,eAAe,GAAG,2DAA2D,CAAC;AAEpF,MAAM,aAAa,GAAa;IAC9B,EAAE,EAAE,oBAAoB;IACxB,KAAK,EAAE,gCAAgC;IACvC,WAAW,EAAE,kFAAkF;IAC/F,QAAQ,EAAE,KAAK;IACf,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,MAAM;IAClB,SAAS,EAAE,KAAK;IAChB,IAAI,EAAE,IAAI;IACV,GAAG,EAAE,iBAAiB;IACtB,OAAO,EACL,2IAA2I;IAC7I,WAAW,EACT,0GAA0G;CAC7G,CAAC;AACF,MAAM,iBAAiB,GAAa;IAClC,EAAE,EAAE,iBAAiB;IACrB,KAAK,EAAE,uCAAuC;IAC9C,WAAW,EAAE,6EAA6E;IAC1F,QAAQ,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AE,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM;aACzB,CAAC,CACH,CACF,CAAC;QACJ,CAAC;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF,CAAC","sourcesContent":["/**\n * Config detector: classical crypto in database usage — public-key encryption of\n * stored data (pgcrypto) and weak client TLS posture. Data-at-rest is the sharpest\n * harvest-now-decrypt-later target: a column encrypted to an RSA key today is a\n * time capsule an adversary can hold until key recovery is cheap.\n *\n * Covered:\n * - pgcrypto `pgp_pub_encrypt` / `pgp_pub_decrypt` in `.sql` (RSA/ElGamal public-key\n * encryption of column data) → `hndl:true`.\n * - libpq `sslmode = disable | allow | prefer | require` in any config/connection\n * file — a mode that does NOT verify the server certificate, so the classical\n * TLS session it does (or doesn't) negotiate is both MITM-able and harvestable.\n */\nimport type { Detector, Finding, RuleMeta } from \"../types.js\";\nimport { DOC_EXTENSIONS, eachMatch, findingFromRule, hasExtension } from \"../detect-utils.js\";\nimport { CWE_BROKEN_CRYPTO, CWE_CERT_VALIDATION } from \"../cwe.js\";\n\nconst RE_PGCRYPTO = /\\bpgp_pub_(?:encrypt|decrypt)\\b/g;\nconst RE_WEAK_SSLMODE = /\\bsslmode\\s*=\\s*[\"']?(?:disable|allow|prefer|require)\\b/gi;\n\nconst RULE_PGCRYPTO: RuleMeta = {\n id: \"db-pgcrypto-pubkey\",\n title: \"pgcrypto public-key encryption\",\n description: \"Postgres pgcrypto pgp_pub_encrypt / pgp_pub_decrypt (RSA/ElGamal) on stored data\",\n category: \"kem\",\n severity: \"high\",\n confidence: \"high\",\n algorithm: \"RSA\",\n hndl: true,\n cwe: CWE_BROKEN_CRYPTO,\n message:\n \"Column data is encrypted with pgcrypto public-key crypto (classical RSA/ElGamal); stored ciphertext is harvest-now-decrypt-later exposed.\",\n remediation:\n \"Plan migration to a post-quantum KEM (ML-KEM-768) envelope for at-rest data; re-encrypt long-lived rows.\",\n};\nconst RULE_WEAK_SSLMODE: RuleMeta = {\n id: \"db-weak-sslmode\",\n title: \"Database sslmode without verification\",\n description: \"libpq sslmode is disable/allow/prefer/require (no certificate verification)\",\n category: \"tls\",\n severity: \"medium\",\n confidence: \"high\",\n hndl: false,\n cwe: CWE_CERT_VALIDATION,\n message:\n \"Database sslmode does not verify the server certificate; the classical TLS session is MITM-able and its key exchange is harvestable.\",\n remediation:\n \"Use sslmode=verify-full and TLS 1.3; track PQC-hybrid KEX (X25519MLKEM768) for database transport.\",\n};\n\n/** Detects classical database at-rest / transport crypto. */\nexport const databaseDetector: Detector = {\n id: \"database-crypto\",\n description: \"Classical crypto in database usage (pgcrypto public-key, weak client sslmode)\",\n scope: \"config\",\n language: \"any\",\n rules: [RULE_PGCRYPTO, RULE_WEAK_SSLMODE],\n // Skip prose/docs: a README showing `sslmode=require` is not a live connection string.\n appliesTo: (f) => !hasExtension(f, DOC_EXTENSIONS),\n detect({ file, content }): Finding[] {\n const findings: Finding[] = [];\n if (file.toLowerCase().endsWith(\".sql\") && content.includes(\"pgp_pub_\")) {\n eachMatch(RE_PGCRYPTO, content, (m) =>\n findings.push(\n findingFromRule(RULE_PGCRYPTO, {\n file,\n content,\n index: m.index,\n matchLength: m[0].length,\n }),\n ),\n );\n }\n if (content.includes(\"sslmode\")) {\n eachMatch(RE_WEAK_SSLMODE, content, (m) =>\n findings.push(\n findingFromRule(RULE_WEAK_SSLMODE, {\n file,\n content,\n index: m.index,\n matchLength: m[0].length,\n }),\n ),\n );\n }\n return findings;\n },\n};\n"]}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Config detector: classical DNSSEC signing algorithms in zone files and
|
|
3
|
+
* signer/resolver config (BIND, Knot DNS, PowerDNS, `ldns-signzone` /
|
|
4
|
+
* `dnssec-signzone` invocations recorded in ops config).
|
|
5
|
+
*
|
|
6
|
+
* DNSSEC is "communication between things" infrastructure: resolvers verify
|
|
7
|
+
* DNSKEY/RRSIG chains to authenticate zone data. Unlike a KEM or key-exchange
|
|
8
|
+
* finding, a DNSSEC signing key is not harvest-now-decrypt-later exposed —
|
|
9
|
+
* there is no confidentiality to harvest — but every classical signature it
|
|
10
|
+
* produces becomes FORGEABLE the moment a cryptographically-relevant quantum
|
|
11
|
+
* computer (CRQC) exists. A forged DNSKEY/RRSIG chain lets an attacker spoof
|
|
12
|
+
* DNSSEC-validated records (cache poisoning that a validating resolver would
|
|
13
|
+
* otherwise reject). So these findings are `category: "signature"`,
|
|
14
|
+
* `hndl: false`.
|
|
15
|
+
*
|
|
16
|
+
* RFC 8624 / IANA "DNSSEC Algorithm Numbers" families covered, mapped to
|
|
17
|
+
* {@link AlgorithmFamily}:
|
|
18
|
+
* - RSASHA1 (5), RSASHA1-NSEC3-SHA1 (7), RSASHA256 (8), RSASHA512 (10) → RSA
|
|
19
|
+
* - ECDSAP256SHA256 (13), ECDSAP384SHA384 (14) → ECDSA
|
|
20
|
+
* - ED25519 (15), ED448 (16) → EdDSA
|
|
21
|
+
* - DSA (3), DSA-NSEC3-SHA1 (6) → DSA
|
|
22
|
+
*
|
|
23
|
+
* Two independent match shapes per family, both gated to `.zone` / `.db` /
|
|
24
|
+
* `.conf` files AND to a file-level DNSSEC marker (see `hasDnssecMarker`
|
|
25
|
+
* below) so the algorithm tokens can't fire on unrelated config:
|
|
26
|
+
*
|
|
27
|
+
* 1. NAMED form — the algorithm's mnemonic name, as written in signer/policy
|
|
28
|
+
* config (Knot `algorithm RSASHA256;`, a `dnssec-policy` block, BIND
|
|
29
|
+
* `algorithm: ecdsap256sha256;`) or on an `ldns-signzone -a ECDSAP256SHA256`
|
|
30
|
+
* / `dnssec-signzone -a ECDSAP256SHA256` command line. These mnemonics
|
|
31
|
+
* (`RSASHA256`, `ECDSAP384SHA384`, `ED25519`, …) are distinctive enough to
|
|
32
|
+
* match bare, EXCEPT plain `DSA`, which is too generic a token on its own
|
|
33
|
+
* (used well outside DNSSEC); that one is only matched immediately after
|
|
34
|
+
* an `algorithm` keyword.
|
|
35
|
+
* 2. STRUCTURAL form — the DNSKEY presentation-format RDATA, e.g.
|
|
36
|
+
* `example.com. IN DNSKEY 257 3 8 AwEAAd...`, where the fields after the
|
|
37
|
+
* `DNSKEY` keyword are `flags protocol algorithm public-key` (RFC 4034
|
|
38
|
+
* §2). Anchoring on the literal `DNSKEY` keyword AND the literal
|
|
39
|
+
* protocol value `3` (always 3 for DNSSEC) before a restricted algorithm
|
|
40
|
+
* number keeps this precise despite being numeric. Bare algorithm
|
|
41
|
+
* numbers with no such anchor are deliberately NOT matched anywhere —
|
|
42
|
+
* `algorithm 8;` alone is far too ambiguous to key off of.
|
|
43
|
+
*
|
|
44
|
+
* Fast reject: `detect()` bails unless the file contains `DNSKEY`, `RRSIG`,
|
|
45
|
+
* a case-insensitive `dnssec` substring (present in `dnssec-policy`,
|
|
46
|
+
* `dnssec-signing: on`, etc. in any real signer config), or an
|
|
47
|
+
* `ldns-signzone` / `dnssec-signzone` invocation. This stops the DSA/EdDSA
|
|
48
|
+
* named-form tokens — which are individually generic outside DNSSEC — from
|
|
49
|
+
* firing on, say, an unrelated SSH or TLS `.conf` file that happens to
|
|
50
|
+
* mention `ED25519` or `DSA` for its own reasons.
|
|
51
|
+
*/
|
|
52
|
+
import type { Detector } from "../types.js";
|
|
53
|
+
/** Detects classical DNSSEC signing algorithms in zone files and signer config. */
|
|
54
|
+
export declare const dnssecDetector: Detector;
|
|
55
|
+
//# sourceMappingURL=dnssec.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dnssec.d.ts","sourceRoot":"","sources":["../../src/detectors/dnssec.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAqB,MAAM,aAAa,CAAC;AA+G/D,mFAAmF;AACnF,eAAO,MAAM,cAAc,EAAE,QAsB5B,CAAC"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { eachMatch, findingFromRule, hasExtension } from "../detect-utils.js";
|
|
2
|
+
import { CWE_BROKEN_CRYPTO } from "../cwe.js";
|
|
3
|
+
const DNSSEC_EXTENSIONS = [".zone", ".db", ".conf"];
|
|
4
|
+
// IANA DNSSEC algorithm numbers, grouped by family.
|
|
5
|
+
const NUM_RSA = "5|7|8|10"; // RSASHA1, RSASHA1-NSEC3-SHA1, RSASHA256, RSASHA512
|
|
6
|
+
const NUM_ECDSA = "13|14"; // ECDSAP256SHA256, ECDSAP384SHA384
|
|
7
|
+
const NUM_EDDSA = "15|16"; // ED25519, ED448
|
|
8
|
+
const NUM_DSA = "3|6"; // DSA, DSA-NSEC3-SHA1
|
|
9
|
+
// --- NAMED form: mnemonic algorithm names in signer/policy config or CLI args. ---
|
|
10
|
+
const RE_NAMED_RSA = /\bRSASHA(?:256|512|1(?:-NSEC3-SHA1)?)\b/g;
|
|
11
|
+
const RE_NAMED_ECDSA = /\bECDSAP(?:256SHA256|384SHA384)\b/g;
|
|
12
|
+
const RE_NAMED_EDDSA = /\bED(?:25519|448)\b/g;
|
|
13
|
+
// Bare "DSA" is too generic to key off alone; require it right after an
|
|
14
|
+
// `algorithm` keyword (Knot/BIND config / dnssec-policy style), optionally
|
|
15
|
+
// quoted or separated by `:`/`=`.
|
|
16
|
+
const RE_NAMED_DSA = /\balgorithm\s*[:=]?\s*"?DSA(?:-NSEC3-SHA1)?"?\b/gi;
|
|
17
|
+
// --- STRUCTURAL form: `DNSKEY <flags> 3 <algorithm>` presentation RDATA (RFC 4034 §2). ---
|
|
18
|
+
const RE_DNSKEY_RSA = new RegExp(`\\bDNSKEY\\s+\\d+\\s+3\\s+(?:${NUM_RSA})\\b`, "g");
|
|
19
|
+
const RE_DNSKEY_ECDSA = new RegExp(`\\bDNSKEY\\s+\\d+\\s+3\\s+(?:${NUM_ECDSA})\\b`, "g");
|
|
20
|
+
const RE_DNSKEY_EDDSA = new RegExp(`\\bDNSKEY\\s+\\d+\\s+3\\s+(?:${NUM_EDDSA})\\b`, "g");
|
|
21
|
+
const RE_DNSKEY_DSA = new RegExp(`\\bDNSKEY\\s+\\d+\\s+3\\s+(?:${NUM_DSA})\\b`, "g");
|
|
22
|
+
const RULE_DNSSEC_RSA = {
|
|
23
|
+
id: "dnssec-rsa-sig",
|
|
24
|
+
title: "DNSSEC RSA signing algorithm",
|
|
25
|
+
description: "DNSSEC zone signed with a classical RSA algorithm (RSASHA1/256/512)",
|
|
26
|
+
category: "signature",
|
|
27
|
+
severity: "medium",
|
|
28
|
+
confidence: "high",
|
|
29
|
+
algorithm: "RSA",
|
|
30
|
+
hndl: false,
|
|
31
|
+
cwe: CWE_BROKEN_CRYPTO,
|
|
32
|
+
message: "DNSSEC zone is signed with a classical RSA algorithm (RSASHA1/RSASHA1-NSEC3-SHA1/RSASHA256/RSASHA512); DNSKEY/RRSIG signatures become forgeable once a CRQC exists.",
|
|
33
|
+
remediation: "Track IETF dnsop post-quantum DNSSEC signing work (ML-DSA); plan re-signing with a PQC algorithm once assigned an IANA DNSSEC algorithm number.",
|
|
34
|
+
};
|
|
35
|
+
const RULE_DNSSEC_ECDSA = {
|
|
36
|
+
id: "dnssec-ecdsa-sig",
|
|
37
|
+
title: "DNSSEC ECDSA signing algorithm",
|
|
38
|
+
description: "DNSSEC zone signed with a classical ECDSA algorithm (ECDSAP256SHA256/384SHA384)",
|
|
39
|
+
category: "signature",
|
|
40
|
+
severity: "medium",
|
|
41
|
+
confidence: "high",
|
|
42
|
+
algorithm: "ECDSA",
|
|
43
|
+
hndl: false,
|
|
44
|
+
cwe: CWE_BROKEN_CRYPTO,
|
|
45
|
+
message: "DNSSEC zone is signed with a classical ECDSA algorithm (ECDSAP256SHA256/ECDSAP384SHA384); DNSKEY/RRSIG signatures become forgeable once a CRQC exists.",
|
|
46
|
+
remediation: "Track IETF dnsop post-quantum DNSSEC signing work (ML-DSA); plan re-signing with a PQC algorithm once assigned an IANA DNSSEC algorithm number.",
|
|
47
|
+
};
|
|
48
|
+
const RULE_DNSSEC_EDDSA = {
|
|
49
|
+
id: "dnssec-eddsa-sig",
|
|
50
|
+
title: "DNSSEC EdDSA signing algorithm",
|
|
51
|
+
description: "DNSSEC zone signed with a classical EdDSA algorithm (ED25519/ED448)",
|
|
52
|
+
category: "signature",
|
|
53
|
+
severity: "medium",
|
|
54
|
+
confidence: "high",
|
|
55
|
+
algorithm: "EdDSA",
|
|
56
|
+
hndl: false,
|
|
57
|
+
cwe: CWE_BROKEN_CRYPTO,
|
|
58
|
+
message: "DNSSEC zone is signed with a classical EdDSA algorithm (ED25519/ED448); modern but still classical — DNSKEY/RRSIG signatures become forgeable once a CRQC exists.",
|
|
59
|
+
remediation: "Track IETF dnsop post-quantum DNSSEC signing work (ML-DSA); plan re-signing with a PQC algorithm once assigned an IANA DNSSEC algorithm number.",
|
|
60
|
+
};
|
|
61
|
+
const RULE_DNSSEC_DSA = {
|
|
62
|
+
id: "dnssec-dsa-sig",
|
|
63
|
+
title: "DNSSEC DSA signing algorithm (deprecated)",
|
|
64
|
+
description: "DNSSEC zone signed with the deprecated classical DSA algorithm (DSA/DSA-NSEC3-SHA1)",
|
|
65
|
+
category: "signature",
|
|
66
|
+
severity: "medium",
|
|
67
|
+
confidence: "high",
|
|
68
|
+
algorithm: "DSA",
|
|
69
|
+
hndl: false,
|
|
70
|
+
cwe: CWE_BROKEN_CRYPTO,
|
|
71
|
+
message: "DNSSEC zone is signed with DSA/DSA-NSEC3-SHA1 — deprecated by RFC 8624 (MUST NOT sign) and, independent of that, forgeable once a CRQC exists.",
|
|
72
|
+
remediation: "Re-sign with a non-deprecated algorithm today (RFC 8624); track IETF dnsop post-quantum DNSSEC signing work (ML-DSA) for the eventual PQC migration.",
|
|
73
|
+
};
|
|
74
|
+
/** True when `content` carries some DNSSEC-specific marker (not just a bare algorithm token). */
|
|
75
|
+
function hasDnssecMarker(content) {
|
|
76
|
+
return (content.includes("DNSKEY") ||
|
|
77
|
+
content.includes("RRSIG") ||
|
|
78
|
+
/dnssec/i.test(content) ||
|
|
79
|
+
/ldns-signzone|dnssec-signzone/.test(content));
|
|
80
|
+
}
|
|
81
|
+
const DNSSEC_RULES = [
|
|
82
|
+
{ meta: RULE_DNSSEC_RSA, res: [RE_NAMED_RSA, RE_DNSKEY_RSA] },
|
|
83
|
+
{ meta: RULE_DNSSEC_ECDSA, res: [RE_NAMED_ECDSA, RE_DNSKEY_ECDSA] },
|
|
84
|
+
{ meta: RULE_DNSSEC_EDDSA, res: [RE_NAMED_EDDSA, RE_DNSKEY_EDDSA] },
|
|
85
|
+
{ meta: RULE_DNSSEC_DSA, res: [RE_NAMED_DSA, RE_DNSKEY_DSA] },
|
|
86
|
+
];
|
|
87
|
+
/** Detects classical DNSSEC signing algorithms in zone files and signer config. */
|
|
88
|
+
export const dnssecDetector = {
|
|
89
|
+
id: "dnssec-crypto",
|
|
90
|
+
description: "Classical DNSSEC signing algorithms in zone files / signer config",
|
|
91
|
+
scope: "config",
|
|
92
|
+
language: "any",
|
|
93
|
+
rules: DNSSEC_RULES.map((r) => r.meta),
|
|
94
|
+
appliesTo: (f) => hasExtension(f, DNSSEC_EXTENSIONS),
|
|
95
|
+
detect({ file, content }) {
|
|
96
|
+
if (!hasDnssecMarker(content))
|
|
97
|
+
return [];
|
|
98
|
+
const findings = [];
|
|
99
|
+
for (const { meta, res } of DNSSEC_RULES) {
|
|
100
|
+
for (const re of res) {
|
|
101
|
+
eachMatch(re, content, (m) => findings.push(findingFromRule(meta, { file, content, index: m.index, matchLength: m[0].length })));
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return findings;
|
|
105
|
+
},
|
|
106
|
+
};
|
|
107
|
+
//# sourceMappingURL=dnssec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dnssec.js","sourceRoot":"","sources":["../../src/detectors/dnssec.ts"],"names":[],"mappings":"AAoDA,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EAAE,iB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ACJ,CAAC;QACH,CAAC;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF,CAAC","sourcesContent":["/**\n * Config detector: classical DNSSEC signing algorithms in zone files and\n * signer/resolver config (BIND, Knot DNS, PowerDNS, `ldns-signzone` /\n * `dnssec-signzone` invocations recorded in ops config).\n *\n * DNSSEC is \"communication between things\" infrastructure: resolvers verify\n * DNSKEY/RRSIG chains to authenticate zone data. Unlike a KEM or key-exchange\n * finding, a DNSSEC signing key is not harvest-now-decrypt-later exposed —\n * there is no confidentiality to harvest — but every classical signature it\n * produces becomes FORGEABLE the moment a cryptographically-relevant quantum\n * computer (CRQC) exists. A forged DNSKEY/RRSIG chain lets an attacker spoof\n * DNSSEC-validated records (cache poisoning that a validating resolver would\n * otherwise reject). So these findings are `category: \"signature\"`,\n * `hndl: false`.\n *\n * RFC 8624 / IANA \"DNSSEC Algorithm Numbers\" families covered, mapped to\n * {@link AlgorithmFamily}:\n * - RSASHA1 (5), RSASHA1-NSEC3-SHA1 (7), RSASHA256 (8), RSASHA512 (10) → RSA\n * - ECDSAP256SHA256 (13), ECDSAP384SHA384 (14) → ECDSA\n * - ED25519 (15), ED448 (16) → EdDSA\n * - DSA (3), DSA-NSEC3-SHA1 (6) → DSA\n *\n * Two independent match shapes per family, both gated to `.zone` / `.db` /\n * `.conf` files AND to a file-level DNSSEC marker (see `hasDnssecMarker`\n * below) so the algorithm tokens can't fire on unrelated config:\n *\n * 1. NAMED form — the algorithm's mnemonic name, as written in signer/policy\n * config (Knot `algorithm RSASHA256;`, a `dnssec-policy` block, BIND\n * `algorithm: ecdsap256sha256;`) or on an `ldns-signzone -a ECDSAP256SHA256`\n * / `dnssec-signzone -a ECDSAP256SHA256` command line. These mnemonics\n * (`RSASHA256`, `ECDSAP384SHA384`, `ED25519`, …) are distinctive enough to\n * match bare, EXCEPT plain `DSA`, which is too generic a token on its own\n * (used well outside DNSSEC); that one is only matched immediately after\n * an `algorithm` keyword.\n * 2. STRUCTURAL form — the DNSKEY presentation-format RDATA, e.g.\n * `example.com. IN DNSKEY 257 3 8 AwEAAd...`, where the fields after the\n * `DNSKEY` keyword are `flags protocol algorithm public-key` (RFC 4034\n * §2). Anchoring on the literal `DNSKEY` keyword AND the literal\n * protocol value `3` (always 3 for DNSSEC) before a restricted algorithm\n * number keeps this precise despite being numeric. Bare algorithm\n * numbers with no such anchor are deliberately NOT matched anywhere —\n * `algorithm 8;` alone is far too ambiguous to key off of.\n *\n * Fast reject: `detect()` bails unless the file contains `DNSKEY`, `RRSIG`,\n * a case-insensitive `dnssec` substring (present in `dnssec-policy`,\n * `dnssec-signing: on`, etc. in any real signer config), or an\n * `ldns-signzone` / `dnssec-signzone` invocation. This stops the DSA/EdDSA\n * named-form tokens — which are individually generic outside DNSSEC — from\n * firing on, say, an unrelated SSH or TLS `.conf` file that happens to\n * mention `ED25519` or `DSA` for its own reasons.\n */\nimport type { Detector, Finding, RuleMeta } from \"../types.js\";\nimport { eachMatch, findingFromRule, hasExtension } from \"../detect-utils.js\";\nimport { CWE_BROKEN_CRYPTO } from \"../cwe.js\";\n\nconst DNSSEC_EXTENSIONS: readonly string[] = [\".zone\", \".db\", \".conf\"];\n\n// IANA DNSSEC algorithm numbers, grouped by family.\nconst NUM_RSA = \"5|7|8|10\"; // RSASHA1, RSASHA1-NSEC3-SHA1, RSASHA256, RSASHA512\nconst NUM_ECDSA = \"13|14\"; // ECDSAP256SHA256, ECDSAP384SHA384\nconst NUM_EDDSA = \"15|16\"; // ED25519, ED448\nconst NUM_DSA = \"3|6\"; // DSA, DSA-NSEC3-SHA1\n\n// --- NAMED form: mnemonic algorithm names in signer/policy config or CLI args. ---\nconst RE_NAMED_RSA = /\\bRSASHA(?:256|512|1(?:-NSEC3-SHA1)?)\\b/g;\nconst RE_NAMED_ECDSA = /\\bECDSAP(?:256SHA256|384SHA384)\\b/g;\nconst RE_NAMED_EDDSA = /\\bED(?:25519|448)\\b/g;\n// Bare \"DSA\" is too generic to key off alone; require it right after an\n// `algorithm` keyword (Knot/BIND config / dnssec-policy style), optionally\n// quoted or separated by `:`/`=`.\nconst RE_NAMED_DSA = /\\balgorithm\\s*[:=]?\\s*\"?DSA(?:-NSEC3-SHA1)?\"?\\b/gi;\n\n// --- STRUCTURAL form: `DNSKEY <flags> 3 <algorithm>` presentation RDATA (RFC 4034 §2). ---\nconst RE_DNSKEY_RSA = new RegExp(`\\\\bDNSKEY\\\\s+\\\\d+\\\\s+3\\\\s+(?:${NUM_RSA})\\\\b`, \"g\");\nconst RE_DNSKEY_ECDSA = new RegExp(`\\\\bDNSKEY\\\\s+\\\\d+\\\\s+3\\\\s+(?:${NUM_ECDSA})\\\\b`, \"g\");\nconst RE_DNSKEY_EDDSA = new RegExp(`\\\\bDNSKEY\\\\s+\\\\d+\\\\s+3\\\\s+(?:${NUM_EDDSA})\\\\b`, \"g\");\nconst RE_DNSKEY_DSA = new RegExp(`\\\\bDNSKEY\\\\s+\\\\d+\\\\s+3\\\\s+(?:${NUM_DSA})\\\\b`, \"g\");\n\nconst RULE_DNSSEC_RSA: RuleMeta = {\n id: \"dnssec-rsa-sig\",\n title: \"DNSSEC RSA signing algorithm\",\n description: \"DNSSEC zone signed with a classical RSA algorithm (RSASHA1/256/512)\",\n category: \"signature\",\n severity: \"medium\",\n confidence: \"high\",\n algorithm: \"RSA\",\n hndl: false,\n cwe: CWE_BROKEN_CRYPTO,\n message:\n \"DNSSEC zone is signed with a classical RSA algorithm (RSASHA1/RSASHA1-NSEC3-SHA1/RSASHA256/RSASHA512); DNSKEY/RRSIG signatures become forgeable once a CRQC exists.\",\n remediation:\n \"Track IETF dnsop post-quantum DNSSEC signing work (ML-DSA); plan re-signing with a PQC algorithm once assigned an IANA DNSSEC algorithm number.\",\n};\nconst RULE_DNSSEC_ECDSA: RuleMeta = {\n id: \"dnssec-ecdsa-sig\",\n title: \"DNSSEC ECDSA signing algorithm\",\n description: \"DNSSEC zone signed with a classical ECDSA algorithm (ECDSAP256SHA256/384SHA384)\",\n category: \"signature\",\n severity: \"medium\",\n confidence: \"high\",\n algorithm: \"ECDSA\",\n hndl: false,\n cwe: CWE_BROKEN_CRYPTO,\n message:\n \"DNSSEC zone is signed with a classical ECDSA algorithm (ECDSAP256SHA256/ECDSAP384SHA384); DNSKEY/RRSIG signatures become forgeable once a CRQC exists.\",\n remediation:\n \"Track IETF dnsop post-quantum DNSSEC signing work (ML-DSA); plan re-signing with a PQC algorithm once assigned an IANA DNSSEC algorithm number.\",\n};\nconst RULE_DNSSEC_EDDSA: RuleMeta = {\n id: \"dnssec-eddsa-sig\",\n title: \"DNSSEC EdDSA signing algorithm\",\n description: \"DNSSEC zone signed with a classical EdDSA algorithm (ED25519/ED448)\",\n category: \"signature\",\n severity: \"medium\",\n confidence: \"high\",\n algorithm: \"EdDSA\",\n hndl: false,\n cwe: CWE_BROKEN_CRYPTO,\n message:\n \"DNSSEC zone is signed with a classical EdDSA algorithm (ED25519/ED448); modern but still classical — DNSKEY/RRSIG signatures become forgeable once a CRQC exists.\",\n remediation:\n \"Track IETF dnsop post-quantum DNSSEC signing work (ML-DSA); plan re-signing with a PQC algorithm once assigned an IANA DNSSEC algorithm number.\",\n};\nconst RULE_DNSSEC_DSA: RuleMeta = {\n id: \"dnssec-dsa-sig\",\n title: \"DNSSEC DSA signing algorithm (deprecated)\",\n description:\n \"DNSSEC zone signed with the deprecated classical DSA algorithm (DSA/DSA-NSEC3-SHA1)\",\n category: \"signature\",\n severity: \"medium\",\n confidence: \"high\",\n algorithm: \"DSA\",\n hndl: false,\n cwe: CWE_BROKEN_CRYPTO,\n message:\n \"DNSSEC zone is signed with DSA/DSA-NSEC3-SHA1 — deprecated by RFC 8624 (MUST NOT sign) and, independent of that, forgeable once a CRQC exists.\",\n remediation:\n \"Re-sign with a non-deprecated algorithm today (RFC 8624); track IETF dnsop post-quantum DNSSEC signing work (ML-DSA) for the eventual PQC migration.\",\n};\n\n/** True when `content` carries some DNSSEC-specific marker (not just a bare algorithm token). */\nfunction hasDnssecMarker(content: string): boolean {\n return (\n content.includes(\"DNSKEY\") ||\n content.includes(\"RRSIG\") ||\n /dnssec/i.test(content) ||\n /ldns-signzone|dnssec-signzone/.test(content)\n );\n}\n\ninterface DnssecRule {\n meta: RuleMeta;\n res: readonly RegExp[];\n}\n\nconst DNSSEC_RULES: readonly DnssecRule[] = [\n { meta: RULE_DNSSEC_RSA, res: [RE_NAMED_RSA, RE_DNSKEY_RSA] },\n { meta: RULE_DNSSEC_ECDSA, res: [RE_NAMED_ECDSA, RE_DNSKEY_ECDSA] },\n { meta: RULE_DNSSEC_EDDSA, res: [RE_NAMED_EDDSA, RE_DNSKEY_EDDSA] },\n { meta: RULE_DNSSEC_DSA, res: [RE_NAMED_DSA, RE_DNSKEY_DSA] },\n];\n\n/** Detects classical DNSSEC signing algorithms in zone files and signer config. */\nexport const dnssecDetector: Detector = {\n id: \"dnssec-crypto\",\n description: \"Classical DNSSEC signing algorithms in zone files / signer config\",\n scope: \"config\",\n language: \"any\",\n rules: DNSSEC_RULES.map((r) => r.meta),\n appliesTo: (f) => hasExtension(f, DNSSEC_EXTENSIONS),\n detect({ file, content }): Finding[] {\n if (!hasDnssecMarker(content)) return [];\n\n const findings: Finding[] = [];\n for (const { meta, res } of DNSSEC_RULES) {\n for (const re of res) {\n eachMatch(re, content, (m) =>\n findings.push(\n findingFromRule(meta, { file, content, index: m.index, matchLength: m[0].length }),\n ),\n );\n }\n }\n return findings;\n },\n};\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Source-code detector for classical asymmetric cryptography in Elixir (the BEAM
|
|
3
|
+
* / Phoenix ecosystem), previously uncovered. Handles the three common surfaces:
|
|
4
|
+
*
|
|
5
|
+
* - **Erlang `:crypto`** — `:crypto.generate_key(:rsa|:ecdh|:dh|:eddsa, …)`
|
|
6
|
+
* (the curve atom disambiguates X25519/X448 from a generic ECDH curve) and
|
|
7
|
+
* `:crypto.sign/:crypto.verify(:rsa|:ecdsa|:eddsa, …)`.
|
|
8
|
+
* - **`X509`** (the `x509` hex package) — `X509.PrivateKey.new_rsa` / `new_ec`.
|
|
9
|
+
* - **`JOSE`** (erlang-jose) — `JOSE.JWK.generate_key({:rsa|:ec|:okp, …})`.
|
|
10
|
+
*
|
|
11
|
+
* Lexical, like the other packs; the `:crypto.` atom-module syntax and the
|
|
12
|
+
* `X509.` / `JOSE.` module paths are distinctive, so the false-positive rate is low.
|
|
13
|
+
*
|
|
14
|
+
* HNDL: RSA and (EC/X)DH key agreement are harvest-now-decrypt-later exposed
|
|
15
|
+
* (hndl:true); ECDSA / EdDSA signatures are hndl:false but forgeable.
|
|
16
|
+
*/
|
|
17
|
+
import type { Detector } from "../types.js";
|
|
18
|
+
/** Detects classical asymmetric crypto in Elixir (:crypto, X509, JOSE). */
|
|
19
|
+
export declare const elixirDetector: Detector;
|
|
20
|
+
//# sourceMappingURL=elixir.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elixir.d.ts","sourceRoot":"","sources":["../../src/detectors/elixir.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAmB,QAAQ,EAAqB,MAAM,aAAa,CAAC;AAuIhF,2EAA2E;AAC3E,eAAO,MAAM,cAAc,EAAE,QAoF5B,CAAC"}
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import { ELIXIR_EXTENSIONS, eachMatch, findingFromRule, hasExtension } from "../detect-utils.js";
|
|
2
|
+
import { CWE_BROKEN_CRYPTO } from "../cwe.js";
|
|
3
|
+
const RE_EX_GEN = /:crypto\.generate_key\s*\(\s*:(\w+)/g;
|
|
4
|
+
const RE_EX_SIGN = /:crypto\.(?:sign|verify)\s*\(\s*:(\w+)/g;
|
|
5
|
+
const RE_EX_X509_RSA = /\bX509\.PrivateKey\.new_rsa\s*\(/g;
|
|
6
|
+
const RE_EX_X509_EC = /\bX509\.PrivateKey\.new_ec\s*\(/g;
|
|
7
|
+
const RE_EX_JOSE = /\bJOSE\.JWK\.generate_key\s*\(\s*\{\s*:(\w+)/g;
|
|
8
|
+
const SIG_REM = "ML-DSA-65 (FIPS 204) or SLH-DSA (FIPS 205)";
|
|
9
|
+
const KEX_REM = "hybrid X25519MLKEM768 (ML-KEM-768)";
|
|
10
|
+
const RULE_EX_KEYGEN = {
|
|
11
|
+
id: "elixir-crypto-keygen",
|
|
12
|
+
title: "Elixir :crypto key generation",
|
|
13
|
+
description: ":crypto.generate_key (rsa/ecdh/dh/eddsa)",
|
|
14
|
+
category: "kem",
|
|
15
|
+
severity: "high",
|
|
16
|
+
confidence: "high",
|
|
17
|
+
algorithm: "RSA",
|
|
18
|
+
hndl: true,
|
|
19
|
+
cwe: CWE_BROKEN_CRYPTO,
|
|
20
|
+
message: "Generates a classical key pair via Erlang :crypto (Elixir) — not quantum-safe.",
|
|
21
|
+
};
|
|
22
|
+
const RULE_EX_SIGN = {
|
|
23
|
+
id: "elixir-crypto-sign",
|
|
24
|
+
title: "Elixir :crypto signature",
|
|
25
|
+
description: ":crypto.sign / :crypto.verify (rsa/ecdsa/eddsa)",
|
|
26
|
+
category: "signature",
|
|
27
|
+
severity: "high",
|
|
28
|
+
confidence: "high",
|
|
29
|
+
algorithm: "unknown",
|
|
30
|
+
hndl: false,
|
|
31
|
+
cwe: CWE_BROKEN_CRYPTO,
|
|
32
|
+
message: "Classical signature via Erlang :crypto (Elixir) is forgeable by a quantum attacker.",
|
|
33
|
+
remediation: SIG_REM,
|
|
34
|
+
};
|
|
35
|
+
const RULE_EX_X509 = {
|
|
36
|
+
id: "elixir-x509-keygen",
|
|
37
|
+
title: "Elixir X509 key generation",
|
|
38
|
+
description: "X509.PrivateKey.new_rsa / new_ec",
|
|
39
|
+
category: "kem",
|
|
40
|
+
severity: "high",
|
|
41
|
+
confidence: "high",
|
|
42
|
+
algorithm: "RSA",
|
|
43
|
+
hndl: true,
|
|
44
|
+
cwe: CWE_BROKEN_CRYPTO,
|
|
45
|
+
message: "Generates a classical key pair via the X509 library (Elixir) — not quantum-safe.",
|
|
46
|
+
};
|
|
47
|
+
const RULE_EX_JOSE = {
|
|
48
|
+
id: "elixir-jose-jwk",
|
|
49
|
+
title: "Elixir JOSE JWK generation",
|
|
50
|
+
description: "JOSE.JWK.generate_key ({:rsa|:ec|:okp})",
|
|
51
|
+
category: "kem",
|
|
52
|
+
severity: "high",
|
|
53
|
+
confidence: "high",
|
|
54
|
+
algorithm: "RSA",
|
|
55
|
+
hndl: true,
|
|
56
|
+
cwe: CWE_BROKEN_CRYPTO,
|
|
57
|
+
message: "Generates a classical JWK via JOSE (Elixir) — not quantum-safe.",
|
|
58
|
+
};
|
|
59
|
+
const RSA_CLS = { algo: "RSA", cat: "kem", sev: "high", hndl: true, label: "RSA" };
|
|
60
|
+
const DH_CLS = { algo: "DH", cat: "key-exchange", sev: "high", hndl: true, label: "DH" };
|
|
61
|
+
const ECDH_CLS = {
|
|
62
|
+
algo: "ECDH",
|
|
63
|
+
cat: "key-exchange",
|
|
64
|
+
sev: "high",
|
|
65
|
+
hndl: true,
|
|
66
|
+
label: "ECDH",
|
|
67
|
+
remediation: KEX_REM,
|
|
68
|
+
};
|
|
69
|
+
const X25519_CLS = {
|
|
70
|
+
algo: "X25519",
|
|
71
|
+
cat: "key-exchange",
|
|
72
|
+
sev: "medium",
|
|
73
|
+
hndl: true,
|
|
74
|
+
label: "X25519",
|
|
75
|
+
remediation: KEX_REM,
|
|
76
|
+
};
|
|
77
|
+
const X448_CLS = { ...X25519_CLS, algo: "X448", label: "X448" };
|
|
78
|
+
const EDDSA_CLS = {
|
|
79
|
+
algo: "EdDSA",
|
|
80
|
+
cat: "signature",
|
|
81
|
+
sev: "low",
|
|
82
|
+
hndl: false,
|
|
83
|
+
label: "EdDSA",
|
|
84
|
+
remediation: SIG_REM,
|
|
85
|
+
};
|
|
86
|
+
const EC_CLS = {
|
|
87
|
+
algo: "ECDH",
|
|
88
|
+
cat: "key-exchange",
|
|
89
|
+
sev: "high",
|
|
90
|
+
hndl: true,
|
|
91
|
+
label: "EC (ECDSA/ECDH)",
|
|
92
|
+
remediation: KEX_REM,
|
|
93
|
+
};
|
|
94
|
+
/** Classify a `:crypto.generate_key(:<type>, …)` by its type atom (+ the curve
|
|
95
|
+
* atom in a short window for the ecdh X25519/X448 case). */
|
|
96
|
+
function classifyGen(type, window) {
|
|
97
|
+
switch (type) {
|
|
98
|
+
case "rsa":
|
|
99
|
+
return RSA_CLS;
|
|
100
|
+
case "dh":
|
|
101
|
+
return DH_CLS;
|
|
102
|
+
case "eddsa":
|
|
103
|
+
case "ed25519":
|
|
104
|
+
return EDDSA_CLS;
|
|
105
|
+
case "ecdh":
|
|
106
|
+
if (/:x25519\b/i.test(window))
|
|
107
|
+
return X25519_CLS;
|
|
108
|
+
if (/:x448\b/i.test(window))
|
|
109
|
+
return X448_CLS;
|
|
110
|
+
return ECDH_CLS;
|
|
111
|
+
default:
|
|
112
|
+
return null; // srp / other non-broken-in-this-model types
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
/** Signature algorithm classification for `:crypto.sign(:<type>, …)`. */
|
|
116
|
+
function classifySign(type) {
|
|
117
|
+
if (type === "rsa")
|
|
118
|
+
return "RSA";
|
|
119
|
+
if (type === "ecdsa")
|
|
120
|
+
return "ECDSA";
|
|
121
|
+
if (type === "eddsa" || type === "ed25519")
|
|
122
|
+
return "EdDSA";
|
|
123
|
+
return null;
|
|
124
|
+
}
|
|
125
|
+
/** Detects classical asymmetric crypto in Elixir (:crypto, X509, JOSE). */
|
|
126
|
+
export const elixirDetector = {
|
|
127
|
+
id: "elixir-crypto",
|
|
128
|
+
description: "Classical asymmetric crypto in Elixir (:crypto, X509, JOSE)",
|
|
129
|
+
scope: "source",
|
|
130
|
+
language: "elixir",
|
|
131
|
+
rules: [RULE_EX_KEYGEN, RULE_EX_SIGN, RULE_EX_X509, RULE_EX_JOSE],
|
|
132
|
+
appliesTo: (f) => hasExtension(f, ELIXIR_EXTENSIONS),
|
|
133
|
+
detect({ file, content }) {
|
|
134
|
+
const findings = [];
|
|
135
|
+
const at = (m) => ({
|
|
136
|
+
file,
|
|
137
|
+
content,
|
|
138
|
+
index: m.index,
|
|
139
|
+
matchLength: m[0].length,
|
|
140
|
+
});
|
|
141
|
+
// :crypto.generate_key(:type, …) — classify by the type atom (+ curve window).
|
|
142
|
+
eachMatch(RE_EX_GEN, content, (m) => {
|
|
143
|
+
const cls = classifyGen(m[1], content.slice(m.index, m.index + 80));
|
|
144
|
+
if (!cls)
|
|
145
|
+
return;
|
|
146
|
+
findings.push(findingFromRule(RULE_EX_KEYGEN, at(m), {
|
|
147
|
+
title: `Elixir :crypto ${cls.label} key generation`,
|
|
148
|
+
category: cls.cat,
|
|
149
|
+
severity: cls.sev,
|
|
150
|
+
algorithm: cls.algo,
|
|
151
|
+
hndl: cls.hndl,
|
|
152
|
+
message: `Generates a classical ${cls.label} key pair via Erlang :crypto (Elixir) — not quantum-safe.`,
|
|
153
|
+
...(cls.remediation ? { remediation: cls.remediation } : {}),
|
|
154
|
+
}));
|
|
155
|
+
});
|
|
156
|
+
// :crypto.sign / :crypto.verify(:type, …).
|
|
157
|
+
eachMatch(RE_EX_SIGN, content, (m) => {
|
|
158
|
+
const algo = classifySign(m[1]);
|
|
159
|
+
if (!algo)
|
|
160
|
+
return;
|
|
161
|
+
findings.push(findingFromRule(RULE_EX_SIGN, at(m), {
|
|
162
|
+
algorithm: algo,
|
|
163
|
+
message: `Classical ${algo} signature via Erlang :crypto (Elixir) is forgeable by a quantum attacker.`,
|
|
164
|
+
}));
|
|
165
|
+
});
|
|
166
|
+
// X509.PrivateKey.new_rsa / new_ec.
|
|
167
|
+
eachMatch(RE_EX_X509_RSA, content, (m) => findings.push(findingFromRule(RULE_EX_X509, at(m), { algorithm: "RSA" })));
|
|
168
|
+
eachMatch(RE_EX_X509_EC, content, (m) => findings.push(findingFromRule(RULE_EX_X509, at(m), {
|
|
169
|
+
title: "Elixir X509 EC key generation",
|
|
170
|
+
category: EC_CLS.cat,
|
|
171
|
+
algorithm: EC_CLS.algo,
|
|
172
|
+
hndl: EC_CLS.hndl,
|
|
173
|
+
message: "Generates a classical EC key pair via the X509 library (Elixir); EC keys feed BOTH ECDSA and ECDH.",
|
|
174
|
+
remediation: KEX_REM,
|
|
175
|
+
})));
|
|
176
|
+
// JOSE.JWK.generate_key({:rsa|:ec|:okp, …}).
|
|
177
|
+
eachMatch(RE_EX_JOSE, content, (m) => {
|
|
178
|
+
const kind = m[1];
|
|
179
|
+
const cls = kind === "rsa" ? RSA_CLS : kind === "ec" ? EC_CLS : kind === "okp" ? EDDSA_CLS : null;
|
|
180
|
+
if (!cls)
|
|
181
|
+
return;
|
|
182
|
+
findings.push(findingFromRule(RULE_EX_JOSE, at(m), {
|
|
183
|
+
title: `Elixir JOSE ${cls.label} JWK`,
|
|
184
|
+
category: cls.cat,
|
|
185
|
+
severity: cls.sev,
|
|
186
|
+
algorithm: cls.algo,
|
|
187
|
+
hndl: cls.hndl,
|
|
188
|
+
message: `Generates a classical ${cls.label} JWK via JOSE (Elixir) — not quantum-safe.`,
|
|
189
|
+
...(cls.remediation ? { remediation: cls.remediation } : {}),
|
|
190
|
+
}));
|
|
191
|
+
});
|
|
192
|
+
return findings;
|
|
193
|
+
},
|
|
194
|
+
};
|
|
195
|
+
//# sourceMappingURL=elixir.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elixir.js","sourceRoot":"","sources":["../../src/detectors/elixir.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACjG,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAE9C,MAAM,SAAS,GAAG,sCAAsC,CAAC;AACzD,MAAM,UAAU,GAAG,yCAAyC,CAAC;AAC7D,MAAM,cAAc,GAAG,mCAAmC,CAAC;AAC3D,MAAM,aAAa,GAAG,kCAAkC,CAAC;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G;gBACjB,SAAS,EAAE,GAAG,CAAC,IAAI;gBACnB,IAAI,EAAE,GAAG,CAAC,IAAI;gBACd,OAAO,EAAE,yBAAyB,GAAG,CAAC,KAAK,4CAA4C;gBACvF,GAAG,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aAC7D,CAAC,CACH,CAAC;QACJ,CAAC,CAAC,CAAC;QAEH,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF,CAAC","sourcesContent":["/**\n * Source-code detector for classical asymmetric cryptography in Elixir (the BEAM\n * / Phoenix ecosystem), previously uncovered. Handles the three common surfaces:\n *\n * - **Erlang `:crypto`** — `:crypto.generate_key(:rsa|:ecdh|:dh|:eddsa, …)`\n * (the curve atom disambiguates X25519/X448 from a generic ECDH curve) and\n * `:crypto.sign/:crypto.verify(:rsa|:ecdsa|:eddsa, …)`.\n * - **`X509`** (the `x509` hex package) — `X509.PrivateKey.new_rsa` / `new_ec`.\n * - **`JOSE`** (erlang-jose) — `JOSE.JWK.generate_key({:rsa|:ec|:okp, …})`.\n *\n * Lexical, like the other packs; the `:crypto.` atom-module syntax and the\n * `X509.` / `JOSE.` module paths are distinctive, so the false-positive rate is low.\n *\n * HNDL: RSA and (EC/X)DH key agreement are harvest-now-decrypt-later exposed\n * (hndl:true); ECDSA / EdDSA signatures are hndl:false but forgeable.\n */\nimport type { AlgorithmFamily, Detector, Finding, RuleMeta } from \"../types.js\";\nimport { ELIXIR_EXTENSIONS, eachMatch, findingFromRule, hasExtension } from \"../detect-utils.js\";\nimport { CWE_BROKEN_CRYPTO } from \"../cwe.js\";\n\nconst RE_EX_GEN = /:crypto\\.generate_key\\s*\\(\\s*:(\\w+)/g;\nconst RE_EX_SIGN = /:crypto\\.(?:sign|verify)\\s*\\(\\s*:(\\w+)/g;\nconst RE_EX_X509_RSA = /\\bX509\\.PrivateKey\\.new_rsa\\s*\\(/g;\nconst RE_EX_X509_EC = /\\bX509\\.PrivateKey\\.new_ec\\s*\\(/g;\nconst RE_EX_JOSE = /\\bJOSE\\.JWK\\.generate_key\\s*\\(\\s*\\{\\s*:(\\w+)/g;\n\ninterface Cls {\n algo: AlgorithmFamily;\n cat: Finding[\"category\"];\n sev: Finding[\"severity\"];\n hndl: boolean;\n label: string;\n remediation?: string;\n}\nconst SIG_REM = \"ML-DSA-65 (FIPS 204) or SLH-DSA (FIPS 205)\";\nconst KEX_REM = \"hybrid X25519MLKEM768 (ML-KEM-768)\";\n\nconst RULE_EX_KEYGEN: RuleMeta = {\n id: \"elixir-crypto-keygen\",\n title: \"Elixir :crypto key generation\",\n description: \":crypto.generate_key (rsa/ecdh/dh/eddsa)\",\n category: \"kem\",\n severity: \"high\",\n confidence: \"high\",\n algorithm: \"RSA\",\n hndl: true,\n cwe: CWE_BROKEN_CRYPTO,\n message: \"Generates a classical key pair via Erlang :crypto (Elixir) — not quantum-safe.\",\n};\nconst RULE_EX_SIGN: RuleMeta = {\n id: \"elixir-crypto-sign\",\n title: \"Elixir :crypto signature\",\n description: \":crypto.sign / :crypto.verify (rsa/ecdsa/eddsa)\",\n category: \"signature\",\n severity: \"high\",\n confidence: \"high\",\n algorithm: \"unknown\",\n hndl: false,\n cwe: CWE_BROKEN_CRYPTO,\n message: \"Classical signature via Erlang :crypto (Elixir) is forgeable by a quantum attacker.\",\n remediation: SIG_REM,\n};\nconst RULE_EX_X509: RuleMeta = {\n id: \"elixir-x509-keygen\",\n title: \"Elixir X509 key generation\",\n description: \"X509.PrivateKey.new_rsa / new_ec\",\n category: \"kem\",\n severity: \"high\",\n confidence: \"high\",\n algorithm: \"RSA\",\n hndl: true,\n cwe: CWE_BROKEN_CRYPTO,\n message: \"Generates a classical key pair via the X509 library (Elixir) — not quantum-safe.\",\n};\nconst RULE_EX_JOSE: RuleMeta = {\n id: \"elixir-jose-jwk\",\n title: \"Elixir JOSE JWK generation\",\n description: \"JOSE.JWK.generate_key ({:rsa|:ec|:okp})\",\n category: \"kem\",\n severity: \"high\",\n confidence: \"high\",\n algorithm: \"RSA\",\n hndl: true,\n cwe: CWE_BROKEN_CRYPTO,\n message: \"Generates a classical JWK via JOSE (Elixir) — not quantum-safe.\",\n};\n\nconst RSA_CLS: Cls = { algo: \"RSA\", cat: \"kem\", sev: \"high\", hndl: true, label: \"RSA\" };\nconst DH_CLS: Cls = { algo: \"DH\", cat: \"key-exchange\", sev: \"high\", hndl: true, label: \"DH\" };\nconst ECDH_CLS: Cls = {\n algo: \"ECDH\",\n cat: \"key-exchange\",\n sev: \"high\",\n hndl: true,\n label: \"ECDH\",\n remediation: KEX_REM,\n};\nconst X25519_CLS: Cls = {\n algo: \"X25519\",\n cat: \"key-exchange\",\n sev: \"medium\",\n hndl: true,\n label: \"X25519\",\n remediation: KEX_REM,\n};\nconst X448_CLS: Cls = { ...X25519_CLS, algo: \"X448\", label: \"X448\" };\nconst EDDSA_CLS: Cls = {\n algo: \"EdDSA\",\n cat: \"signature\",\n sev: \"low\",\n hndl: false,\n label: \"EdDSA\",\n remediation: SIG_REM,\n};\nconst EC_CLS: Cls = {\n algo: \"ECDH\",\n cat: \"key-exchange\",\n sev: \"high\",\n hndl: true,\n label: \"EC (ECDSA/ECDH)\",\n remediation: KEX_REM,\n};\n\n/** Classify a `:crypto.generate_key(:<type>, …)` by its type atom (+ the curve\n * atom in a short window for the ecdh X25519/X448 case). */\nfunction classifyGen(type: string, window: string): Cls | null {\n switch (type) {\n case \"rsa\":\n return RSA_CLS;\n case \"dh\":\n return DH_CLS;\n case \"eddsa\":\n case \"ed25519\":\n return EDDSA_CLS;\n case \"ecdh\":\n if (/:x25519\\b/i.test(window)) return X25519_CLS;\n if (/:x448\\b/i.test(window)) return X448_CLS;\n return ECDH_CLS;\n default:\n return null; // srp / other non-broken-in-this-model types\n }\n}\n\n/** Signature algorithm classification for `:crypto.sign(:<type>, …)`. */\nfunction classifySign(type: string): AlgorithmFamily | null {\n if (type === \"rsa\") return \"RSA\";\n if (type === \"ecdsa\") return \"ECDSA\";\n if (type === \"eddsa\" || type === \"ed25519\") return \"EdDSA\";\n return null;\n}\n\n/** Detects classical asymmetric crypto in Elixir (:crypto, X509, JOSE). */\nexport const elixirDetector: Detector = {\n id: \"elixir-crypto\",\n description: \"Classical asymmetric crypto in Elixir (:crypto, X509, JOSE)\",\n scope: \"source\",\n language: \"elixir\",\n rules: [RULE_EX_KEYGEN, RULE_EX_SIGN, RULE_EX_X509, RULE_EX_JOSE],\n appliesTo: (f) => hasExtension(f, ELIXIR_EXTENSIONS),\n detect({ file, content }): Finding[] {\n const findings: Finding[] = [];\n const at = (m: RegExpExecArray) => ({\n file,\n content,\n index: m.index,\n matchLength: m[0].length,\n });\n\n // :crypto.generate_key(:type, …) — classify by the type atom (+ curve window).\n eachMatch(RE_EX_GEN, content, (m) => {\n const cls = classifyGen(m[1], content.slice(m.index, m.index + 80));\n if (!cls) return;\n findings.push(\n findingFromRule(RULE_EX_KEYGEN, at(m), {\n title: `Elixir :crypto ${cls.label} key generation`,\n category: cls.cat,\n severity: cls.sev,\n algorithm: cls.algo,\n hndl: cls.hndl,\n message: `Generates a classical ${cls.label} key pair via Erlang :crypto (Elixir) — not quantum-safe.`,\n ...(cls.remediation ? { remediation: cls.remediation } : {}),\n }),\n );\n });\n\n // :crypto.sign / :crypto.verify(:type, …).\n eachMatch(RE_EX_SIGN, content, (m) => {\n const algo = classifySign(m[1]);\n if (!algo) return;\n findings.push(\n findingFromRule(RULE_EX_SIGN, at(m), {\n algorithm: algo,\n message: `Classical ${algo} signature via Erlang :crypto (Elixir) is forgeable by a quantum attacker.`,\n }),\n );\n });\n\n // X509.PrivateKey.new_rsa / new_ec.\n eachMatch(RE_EX_X509_RSA, content, (m) =>\n findings.push(findingFromRule(RULE_EX_X509, at(m), { algorithm: \"RSA\" })),\n );\n eachMatch(RE_EX_X509_EC, content, (m) =>\n findings.push(\n findingFromRule(RULE_EX_X509, at(m), {\n title: \"Elixir X509 EC key generation\",\n category: EC_CLS.cat,\n algorithm: EC_CLS.algo,\n hndl: EC_CLS.hndl,\n message:\n \"Generates a classical EC key pair via the X509 library (Elixir); EC keys feed BOTH ECDSA and ECDH.\",\n remediation: KEX_REM,\n }),\n ),\n );\n\n // JOSE.JWK.generate_key({:rsa|:ec|:okp, …}).\n eachMatch(RE_EX_JOSE, content, (m) => {\n const kind = m[1];\n const cls =\n kind === \"rsa\" ? RSA_CLS : kind === \"ec\" ? EC_CLS : kind === \"okp\" ? EDDSA_CLS : null;\n if (!cls) return;\n findings.push(\n findingFromRule(RULE_EX_JOSE, at(m), {\n title: `Elixir JOSE ${cls.label} JWK`,\n category: cls.cat,\n severity: cls.sev,\n algorithm: cls.algo,\n hndl: cls.hndl,\n message: `Generates a classical ${cls.label} JWK via JOSE (Elixir) — not quantum-safe.`,\n ...(cls.remediation ? { remediation: cls.remediation } : {}),\n }),\n );\n });\n\n return findings;\n },\n};\n"]}
|
package/dist/detectors/go.d.ts
CHANGED
|
@@ -6,11 +6,13 @@
|
|
|
6
6
|
* `ecdsa.SignASN1`, `ecdh.X25519`, …) are precise, low-false-positive signals.
|
|
7
7
|
*
|
|
8
8
|
* Covered:
|
|
9
|
-
* - crypto/rsa — GenerateKey, EncryptOAEP/PKCS1v15, SignPKCS1v15/PSS
|
|
10
|
-
* - crypto/ecdsa — GenerateKey, Sign/SignASN1
|
|
9
|
+
* - crypto/rsa — GenerateKey, EncryptOAEP/PKCS1v15, SignPKCS1v15/PSS, DecryptOAEP, VerifyPKCS1v15/PSS
|
|
10
|
+
* - crypto/ecdsa — GenerateKey, Sign/SignASN1, Verify/VerifyASN1
|
|
11
11
|
* - crypto/ecdh — P256/P384/P521/X25519 curve construction (key agreement)
|
|
12
|
-
* - crypto/
|
|
12
|
+
* - crypto/elliptic — GenerateKey / ScalarMult (classic pre-1.20 ECDH)
|
|
13
|
+
* - crypto/ed25519 — GenerateKey, Sign, Verify
|
|
13
14
|
* - crypto/dsa — GenerateKey, GenerateParameters (deprecated)
|
|
15
|
+
* - crypto/tls — InsecureSkipVerify, legacy MinVersion (transport config hygiene)
|
|
14
16
|
*
|
|
15
17
|
* HNDL policy mirrors the other detectors: KEM / key agreement (RSA encryption,
|
|
16
18
|
* ECDH) is harvest-now-decrypt-later exposed (hndl:true); signatures (RSA-sign,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"go.d.ts","sourceRoot":"","sources":["../../src/detectors/go.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"go.d.ts","sourceRoot":"","sources":["../../src/detectors/go.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAqB,MAAM,aAAa,CAAC;AAqR/D,oFAAoF;AACpF,eAAO,MAAM,UAAU,EAAE,QAoExB,CAAC"}
|