@quantakrypto/core 0.4.3 → 0.5.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/README.md +76 -27
- package/dist/cbom-merge.d.ts +9 -0
- package/dist/cbom-merge.d.ts.map +1 -0
- package/dist/cbom-merge.js +121 -0
- package/dist/cbom-merge.js.map +1 -0
- package/dist/cbom.d.ts +5 -0
- package/dist/cbom.d.ts.map +1 -1
- package/dist/cbom.js +132 -37
- package/dist/cbom.js.map +1 -1
- package/dist/comments.d.ts +6 -26
- package/dist/comments.d.ts.map +1 -1
- package/dist/comments.js +77 -38
- package/dist/comments.js.map +1 -1
- package/dist/dependencies.d.ts.map +1 -1
- package/dist/dependencies.js +1 -1
- package/dist/dependencies.js.map +1 -1
- package/dist/detect-utils.d.ts +59 -21
- package/dist/detect-utils.d.ts.map +1 -1
- package/dist/detect-utils.js +143 -8
- package/dist/detect-utils.js.map +1 -1
- package/dist/detectors/age.d.ts +16 -0
- package/dist/detectors/age.d.ts.map +1 -0
- package/dist/detectors/age.js +40 -0
- package/dist/detectors/age.js.map +1 -0
- package/dist/detectors/ansible.d.ts +13 -0
- package/dist/detectors/ansible.d.ts.map +1 -0
- package/dist/detectors/ansible.js +108 -0
- package/dist/detectors/ansible.js.map +1 -0
- package/dist/detectors/bicep.d.ts +20 -0
- package/dist/detectors/bicep.d.ts.map +1 -0
- package/dist/detectors/bicep.js +74 -0
- package/dist/detectors/bicep.js.map +1 -0
- package/dist/detectors/c.d.ts +4 -2
- package/dist/detectors/c.d.ts.map +1 -1
- package/dist/detectors/c.js +222 -4
- 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 +129 -0
- package/dist/detectors/cicd.js.map +1 -0
- package/dist/detectors/cloud-kms.d.ts +24 -0
- package/dist/detectors/cloud-kms.d.ts.map +1 -0
- package/dist/detectors/cloud-kms.js +99 -0
- package/dist/detectors/cloud-kms.js.map +1 -0
- package/dist/detectors/cloudformation.d.ts +38 -0
- package/dist/detectors/cloudformation.d.ts.map +1 -0
- package/dist/detectors/cloudformation.js +201 -0
- package/dist/detectors/cloudformation.js.map +1 -0
- package/dist/detectors/codesign.d.ts +50 -0
- package/dist/detectors/codesign.d.ts.map +1 -0
- package/dist/detectors/codesign.js +143 -0
- package/dist/detectors/codesign.js.map +1 -0
- package/dist/detectors/csharp.d.ts.map +1 -1
- package/dist/detectors/csharp.js +13 -3
- package/dist/detectors/csharp.js.map +1 -1
- package/dist/detectors/dart.d.ts +35 -0
- package/dist/detectors/dart.d.ts.map +1 -0
- package/dist/detectors/dart.js +177 -0
- package/dist/detectors/dart.js.map +1 -0
- package/dist/detectors/database.d.ts +19 -0
- package/dist/detectors/database.d.ts.map +1 -0
- package/dist/detectors/database.js +97 -0
- package/dist/detectors/database.js.map +1 -0
- package/dist/detectors/dkim.d.ts +54 -0
- package/dist/detectors/dkim.d.ts.map +1 -0
- package/dist/detectors/dkim.js +92 -0
- package/dist/detectors/dkim.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 +116 -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 +227 -0
- package/dist/detectors/elixir.js.map +1 -0
- package/dist/detectors/java.d.ts.map +1 -1
- package/dist/detectors/java.js +34 -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 +72 -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 +131 -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 +88 -0
- package/dist/detectors/k8s.js.map +1 -0
- package/dist/detectors/keystore.d.ts +19 -0
- package/dist/detectors/keystore.d.ts.map +1 -0
- package/dist/detectors/keystore.js +76 -0
- package/dist/detectors/keystore.js.map +1 -0
- package/dist/detectors/mesh.d.ts +34 -0
- package/dist/detectors/mesh.d.ts.map +1 -0
- package/dist/detectors/mesh.js +91 -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 +79 -0
- package/dist/detectors/messaging.js.map +1 -0
- package/dist/detectors/objc.d.ts +41 -0
- package/dist/detectors/objc.d.ts.map +1 -0
- package/dist/detectors/objc.js +146 -0
- package/dist/detectors/objc.js.map +1 -0
- package/dist/detectors/openpgp.d.ts +20 -0
- package/dist/detectors/openpgp.d.ts.map +1 -0
- package/dist/detectors/openpgp.js +151 -0
- package/dist/detectors/openpgp.js.map +1 -0
- package/dist/detectors/pem.d.ts.map +1 -1
- package/dist/detectors/pem.js +33 -1
- package/dist/detectors/pem.js.map +1 -1
- package/dist/detectors/php.d.ts +25 -0
- package/dist/detectors/php.d.ts.map +1 -0
- package/dist/detectors/php.js +171 -0
- package/dist/detectors/php.js.map +1 -0
- package/dist/detectors/pkcs11.d.ts +17 -0
- package/dist/detectors/pkcs11.d.ts.map +1 -0
- package/dist/detectors/pkcs11.js +87 -0
- package/dist/detectors/pkcs11.js.map +1 -0
- package/dist/detectors/proxy.d.ts +52 -0
- package/dist/detectors/proxy.d.ts.map +1 -0
- package/dist/detectors/proxy.js +157 -0
- package/dist/detectors/proxy.js.map +1 -0
- package/dist/detectors/pulumi.d.ts +19 -0
- package/dist/detectors/pulumi.d.ts.map +1 -0
- package/dist/detectors/pulumi.js +80 -0
- package/dist/detectors/pulumi.js.map +1 -0
- package/dist/detectors/python.d.ts.map +1 -1
- package/dist/detectors/python.js +70 -0
- package/dist/detectors/python.js.map +1 -1
- package/dist/detectors/rust.d.ts.map +1 -1
- package/dist/detectors/rust.js +73 -0
- package/dist/detectors/rust.js.map +1 -1
- package/dist/detectors/secrets.d.ts +24 -0
- package/dist/detectors/secrets.d.ts.map +1 -0
- package/dist/detectors/secrets.js +63 -0
- package/dist/detectors/secrets.js.map +1 -0
- package/dist/detectors/solidity.d.ts +50 -0
- package/dist/detectors/solidity.d.ts.map +1 -0
- package/dist/detectors/solidity.js +108 -0
- package/dist/detectors/solidity.js.map +1 -0
- package/dist/detectors/source.d.ts.map +1 -1
- package/dist/detectors/source.js +243 -53
- package/dist/detectors/source.js.map +1 -1
- package/dist/detectors/spire.d.ts +49 -0
- package/dist/detectors/spire.d.ts.map +1 -0
- package/dist/detectors/spire.js +77 -0
- package/dist/detectors/spire.js.map +1 -0
- package/dist/detectors/ssh-ca.d.ts +72 -0
- package/dist/detectors/ssh-ca.d.ts.map +1 -0
- package/dist/detectors/ssh-ca.js +119 -0
- package/dist/detectors/ssh-ca.js.map +1 -0
- package/dist/detectors/stateful-hbs.d.ts.map +1 -1
- package/dist/detectors/stateful-hbs.js +9 -6
- package/dist/detectors/stateful-hbs.js.map +1 -1
- package/dist/detectors/supply-chain.d.ts +17 -0
- package/dist/detectors/supply-chain.d.ts.map +1 -0
- package/dist/detectors/supply-chain.js +89 -0
- package/dist/detectors/supply-chain.js.map +1 -0
- package/dist/detectors/swift.d.ts +22 -0
- package/dist/detectors/swift.d.ts.map +1 -0
- package/dist/detectors/swift.js +120 -0
- package/dist/detectors/swift.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 +150 -0
- package/dist/detectors/terraform.js.map +1 -0
- package/dist/detectors/vault.d.ts +15 -0
- package/dist/detectors/vault.d.ts.map +1 -0
- package/dist/detectors/vault.js +97 -0
- package/dist/detectors/vault.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 +73 -0
- package/dist/detectors/vpn.js.map +1 -0
- package/dist/detectors/weak-hash.d.ts +71 -0
- package/dist/detectors/weak-hash.d.ts.map +1 -0
- package/dist/detectors/weak-hash.js +116 -0
- package/dist/detectors/weak-hash.js.map +1 -0
- package/dist/detectors/webauthn.d.ts +61 -0
- package/dist/detectors/webauthn.d.ts.map +1 -0
- package/dist/detectors/webauthn.js +109 -0
- package/dist/detectors/webauthn.js.map +1 -0
- package/dist/detectors/xmldsig.d.ts +23 -0
- package/dist/detectors/xmldsig.d.ts.map +1 -0
- package/dist/detectors/xmldsig.js +84 -0
- package/dist/detectors/xmldsig.js.map +1 -0
- package/dist/evidence.d.ts +79 -4
- package/dist/evidence.d.ts.map +1 -1
- package/dist/evidence.js +76 -0
- package/dist/evidence.js.map +1 -1
- package/dist/index.d.ts +17 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +21 -9
- package/dist/index.js.map +1 -1
- package/dist/inventory.d.ts +0 -2
- package/dist/inventory.d.ts.map +1 -1
- package/dist/inventory.js +15 -6
- package/dist/inventory.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/registry.d.ts +9 -4
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +81 -4
- package/dist/registry.js.map +1 -1
- package/dist/remediate-pipeline.d.ts +0 -3
- package/dist/remediate-pipeline.d.ts.map +1 -1
- package/dist/remediate-pipeline.js +23 -2
- package/dist/remediate-pipeline.js.map +1 -1
- package/dist/remediation.d.ts +10 -0
- package/dist/remediation.d.ts.map +1 -1
- package/dist/remediation.js +32 -0
- 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 -1
- package/dist/report.js.map +1 -1
- package/dist/scan-worker.js +5 -3
- package/dist/scan-worker.js.map +1 -1
- package/dist/scan.d.ts.map +1 -1
- package/dist/scan.js +35 -6
- package/dist/scan.js.map +1 -1
- package/dist/standards-profiles.d.ts +58 -0
- package/dist/standards-profiles.d.ts.map +1 -0
- package/dist/standards-profiles.js +100 -0
- package/dist/standards-profiles.js.map +1 -0
- 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/types.d.ts +6 -5
- package/dist/types.d.ts.map +1 -1
- package/dist/types.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/vex.d.ts +39 -0
- package/dist/vex.d.ts.map +1 -0
- package/dist/vex.js +87 -0
- package/dist/vex.js.map +1 -0
- package/dist/walk.d.ts +8 -3
- package/dist/walk.d.ts.map +1 -1
- package/dist/walk.js +32 -1
- package/dist/walk.js.map +1 -1
- package/package.json +1 -1
- package/src/cbom-merge.ts +146 -0
- package/src/cbom.ts +153 -39
- package/src/comments.ts +84 -39
- package/src/dependencies.ts +2 -1
- package/src/detect-utils.ts +146 -12
- package/src/detectors/age.ts +60 -0
- package/src/detectors/ansible.ts +140 -0
- package/src/detectors/bicep.ts +107 -0
- package/src/detectors/c.ts +240 -6
- package/src/detectors/cicd.ts +171 -0
- package/src/detectors/cloud-kms.ts +141 -0
- package/src/detectors/cloudformation.ts +250 -0
- package/src/detectors/codesign.ts +214 -0
- package/src/detectors/csharp.ts +13 -3
- package/src/detectors/dart.ts +237 -0
- package/src/detectors/database.ts +141 -0
- package/src/detectors/dkim.ts +172 -0
- package/src/detectors/dnssec.ts +195 -0
- package/src/detectors/elixir.ts +268 -0
- package/src/detectors/java.ts +39 -4
- package/src/detectors/jose.ts +110 -0
- package/src/detectors/jwk.ts +170 -0
- package/src/detectors/k8s.ts +115 -0
- package/src/detectors/keystore.ts +109 -0
- package/src/detectors/mesh.ts +130 -0
- package/src/detectors/messaging.ts +106 -0
- package/src/detectors/objc.ts +209 -0
- package/src/detectors/openpgp.ts +194 -0
- package/src/detectors/pem.ts +31 -1
- package/src/detectors/php.ts +230 -0
- package/src/detectors/pkcs11.ts +113 -0
- package/src/detectors/proxy.ts +236 -0
- package/src/detectors/pulumi.ts +106 -0
- package/src/detectors/python.ts +71 -0
- package/src/detectors/rust.ts +76 -0
- package/src/detectors/secrets.ts +103 -0
- package/src/detectors/solidity.ts +176 -0
- package/src/detectors/source.ts +283 -73
- package/src/detectors/spire.ts +143 -0
- package/src/detectors/ssh-ca.ts +215 -0
- package/src/detectors/stateful-hbs.ts +9 -6
- package/src/detectors/supply-chain.ts +117 -0
- package/src/detectors/swift.ts +149 -0
- package/src/detectors/terraform.ts +188 -0
- package/src/detectors/vault.ts +120 -0
- package/src/detectors/vpn.ts +103 -0
- package/src/detectors/weak-hash.ts +217 -0
- package/src/detectors/webauthn.ts +205 -0
- package/src/detectors/xmldsig.ts +115 -0
- package/src/evidence.ts +138 -4
- package/src/index.ts +50 -12
- package/src/inventory.ts +15 -7
- package/src/policy.ts +180 -0
- package/src/registry.ts +81 -4
- package/src/remediate-pipeline.ts +26 -3
- package/src/remediation.ts +39 -0
- package/src/report.ts +43 -1
- package/src/scan-worker.ts +5 -3
- package/src/scan.ts +41 -6
- package/src/standards-profiles.ts +136 -0
- package/src/standards.ts +186 -0
- package/src/types.ts +11 -4
- package/src/version.ts +1 -1
- package/src/vex.ts +122 -0
- package/src/walk.ts +33 -2
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Single source of truth for the post-quantum standards this tool depends on.
|
|
3
|
+
*
|
|
4
|
+
* The scanner's credibility rests on its recommendations tracking the current
|
|
5
|
+
* NIST / CNSA / IETF state. That tracking used to be ad-hoc — facts were spread
|
|
6
|
+
* across `remediation.ts` with no dates, no citations, and nothing to catch code
|
|
7
|
+
* drifting from the published standards. This module makes the standards facts
|
|
8
|
+
* explicit, dated, and cited, and the companion drift test
|
|
9
|
+
* (`test/standards.test.ts`) fails the build if the runtime constants
|
|
10
|
+
* (`TIER_PARAMS`, `PQC_TRANSITION_NOTE`, `STATEFUL_HBS_NOTE`) fall out of sync
|
|
11
|
+
* with what is recorded here.
|
|
12
|
+
*
|
|
13
|
+
* ## Cadence
|
|
14
|
+
*
|
|
15
|
+
* Re-verify every quarter (see `docs/standards/pqc-standards.md` for the runbook).
|
|
16
|
+
* On each review: check the sources below for changes, update the facts + their
|
|
17
|
+
* `asOf`, and roll `lastReviewed` / `nextReview` forward. `scripts/standards-check.mjs`
|
|
18
|
+
* (advisory, runs in CI) flags when `nextReview` has passed so a review can't be
|
|
19
|
+
* silently skipped. `standardsReviewStatus(now)` is the pure predicate behind it.
|
|
20
|
+
*/
|
|
21
|
+
/** A single standards fact with its citation and when it was last verified. */
|
|
22
|
+
export interface StandardsCitation {
|
|
23
|
+
/** One-line statement of the fact. */
|
|
24
|
+
readonly summary: string;
|
|
25
|
+
/** Spec identifier / publication (and URL where stable). */
|
|
26
|
+
readonly source: string;
|
|
27
|
+
/** `YYYY-MM` — when this fact was last verified against its source. */
|
|
28
|
+
readonly asOf: string;
|
|
29
|
+
}
|
|
30
|
+
/** The full post-quantum standards snapshot the tool tracks. */
|
|
31
|
+
export interface PqcStandards {
|
|
32
|
+
/** `YYYY-MM-DD` — when the whole snapshot was last reviewed. */
|
|
33
|
+
readonly lastReviewed: string;
|
|
34
|
+
/** `YYYY-MM-DD` — when the next review is due. */
|
|
35
|
+
readonly nextReview: string;
|
|
36
|
+
/** Cadence, in months, between reviews. */
|
|
37
|
+
readonly reviewIntervalMonths: number;
|
|
38
|
+
/** NIST's finalized PQC FIPS (the recommendation targets). */
|
|
39
|
+
readonly fips: {
|
|
40
|
+
readonly mlKem: StandardsCitation;
|
|
41
|
+
readonly mlDsa: StandardsCitation;
|
|
42
|
+
readonly slhDsa: StandardsCitation;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* CNSA 2.0 security tiers → the KEM / signature parameter sets. These MUST
|
|
46
|
+
* mirror `remediation.TIER_PARAMS`; the drift test asserts they stay identical.
|
|
47
|
+
*/
|
|
48
|
+
readonly cnsa: {
|
|
49
|
+
readonly category3: {
|
|
50
|
+
readonly kem: string;
|
|
51
|
+
readonly signature: string;
|
|
52
|
+
};
|
|
53
|
+
readonly category5: {
|
|
54
|
+
readonly kem: string;
|
|
55
|
+
readonly signature: string;
|
|
56
|
+
};
|
|
57
|
+
readonly source: string;
|
|
58
|
+
readonly asOf: string;
|
|
59
|
+
};
|
|
60
|
+
/** Stateful hash-based signatures (firmware / boot signing). */
|
|
61
|
+
readonly statefulHbs: StandardsCitation;
|
|
62
|
+
/** The migration deadline the transition note surfaces. */
|
|
63
|
+
readonly transitionTimeline: {
|
|
64
|
+
/** Year after which classical public-key crypto is deprecated. */
|
|
65
|
+
readonly deprecateAfter: number;
|
|
66
|
+
/** Year after which it is disallowed. */
|
|
67
|
+
readonly disallowAfter: number;
|
|
68
|
+
readonly source: string;
|
|
69
|
+
readonly asOf: string;
|
|
70
|
+
};
|
|
71
|
+
/** Emerging / backup standards worth tracking beyond the current FIPS. */
|
|
72
|
+
readonly emerging: readonly StandardsCitation[];
|
|
73
|
+
/** Recommended hybrid key-exchange groups. */
|
|
74
|
+
readonly hybrids: readonly StandardsCitation[];
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* The current snapshot. Update on each quarterly review; the drift test keeps the
|
|
78
|
+
* runtime remediation constants aligned with it.
|
|
79
|
+
*/
|
|
80
|
+
export declare const PQC_STANDARDS: PqcStandards;
|
|
81
|
+
/** Result of {@link standardsReviewStatus}. */
|
|
82
|
+
export interface StandardsReviewStatus {
|
|
83
|
+
/** True when `now` is on or after `nextReview` — a review is due. */
|
|
84
|
+
readonly due: boolean;
|
|
85
|
+
/** The `nextReview` date being compared against (`YYYY-MM-DD`). */
|
|
86
|
+
readonly nextReview: string;
|
|
87
|
+
/** Whole days from `now` until `nextReview` (negative when overdue). */
|
|
88
|
+
readonly daysUntil: number;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Whether a standards review is due as of `now`. Pure (takes `now` explicitly) so
|
|
92
|
+
* it is deterministic in tests; the CI script passes the real clock. Compares on
|
|
93
|
+
* whole UTC days so a same-day run is not spuriously "overdue".
|
|
94
|
+
*/
|
|
95
|
+
export declare function standardsReviewStatus(now: Date, standards?: PqcStandards): StandardsReviewStatus;
|
|
96
|
+
//# sourceMappingURL=standards.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"standards.d.ts","sourceRoot":"","sources":["../src/standards.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,+EAA+E;AAC/E,MAAM,WAAW,iBAAiB;IAChC,sCAAsC;IACtC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,4DAA4D;IAC5D,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,uEAAuE;IACvE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,gEAAgE;AAChE,MAAM,WAAW,YAAY;IAC3B,gEAAgE;IAChE,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,kDAAkD;IAClD,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,2CAA2C;IAC3C,QAAQ,CAAC,oBAAoB,EAAE,MAAM,CAAC;IAEtC,8DAA8D;IAC9D,QAAQ,CAAC,IAAI,EAAE;QACb,QAAQ,CAAC,KAAK,EAAE,iBAAiB,CAAC;QAClC,QAAQ,CAAC,KAAK,EAAE,iBAAiB,CAAC;QAClC,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC;KACpC,CAAC;IAEF;;;OAGG;IACH,QAAQ,CAAC,IAAI,EAAE;QACb,QAAQ,CAAC,SAAS,EAAE;YAAE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;YAAC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;SAAE,CAAC;QACzE,QAAQ,CAAC,SAAS,EAAE;YAAE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;YAAC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;SAAE,CAAC;QACzE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;QACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;KACvB,CAAC;IAEF,gEAAgE;IAChE,QAAQ,CAAC,WAAW,EAAE,iBAAiB,CAAC;IAExC,2DAA2D;IAC3D,QAAQ,CAAC,kBAAkB,EAAE;QAC3B,kEAAkE;QAClE,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;QAChC,yCAAyC;QACzC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;QAC/B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;QACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;KACvB,CAAC;IAEF,0EAA0E;IAC1E,QAAQ,CAAC,QAAQ,EAAE,SAAS,iBAAiB,EAAE,CAAC;IAEhD,8CAA8C;IAC9C,QAAQ,CAAC,OAAO,EAAE,SAAS,iBAAiB,EAAE,CAAC;CAChD;AAED;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,YA6E3B,CAAC;AAEF,+CAA+C;AAC/C,MAAM,WAAW,qBAAqB;IACpC,qEAAqE;IACrE,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC;IACtB,mEAAmE;IACnE,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,wEAAwE;IACxE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,IAAI,EACT,SAAS,GAAE,YAA4B,GACtC,qBAAqB,CAMvB"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Single source of truth for the post-quantum standards this tool depends on.
|
|
3
|
+
*
|
|
4
|
+
* The scanner's credibility rests on its recommendations tracking the current
|
|
5
|
+
* NIST / CNSA / IETF state. That tracking used to be ad-hoc — facts were spread
|
|
6
|
+
* across `remediation.ts` with no dates, no citations, and nothing to catch code
|
|
7
|
+
* drifting from the published standards. This module makes the standards facts
|
|
8
|
+
* explicit, dated, and cited, and the companion drift test
|
|
9
|
+
* (`test/standards.test.ts`) fails the build if the runtime constants
|
|
10
|
+
* (`TIER_PARAMS`, `PQC_TRANSITION_NOTE`, `STATEFUL_HBS_NOTE`) fall out of sync
|
|
11
|
+
* with what is recorded here.
|
|
12
|
+
*
|
|
13
|
+
* ## Cadence
|
|
14
|
+
*
|
|
15
|
+
* Re-verify every quarter (see `docs/standards/pqc-standards.md` for the runbook).
|
|
16
|
+
* On each review: check the sources below for changes, update the facts + their
|
|
17
|
+
* `asOf`, and roll `lastReviewed` / `nextReview` forward. `scripts/standards-check.mjs`
|
|
18
|
+
* (advisory, runs in CI) flags when `nextReview` has passed so a review can't be
|
|
19
|
+
* silently skipped. `standardsReviewStatus(now)` is the pure predicate behind it.
|
|
20
|
+
*/
|
|
21
|
+
/**
|
|
22
|
+
* The current snapshot. Update on each quarterly review; the drift test keeps the
|
|
23
|
+
* runtime remediation constants aligned with it.
|
|
24
|
+
*/
|
|
25
|
+
export const PQC_STANDARDS = {
|
|
26
|
+
lastReviewed: "2026-07-19",
|
|
27
|
+
nextReview: "2026-10-19",
|
|
28
|
+
reviewIntervalMonths: 3,
|
|
29
|
+
fips: {
|
|
30
|
+
mlKem: {
|
|
31
|
+
summary: "ML-KEM (Kyber) key encapsulation — finalized August 2024.",
|
|
32
|
+
source: "NIST FIPS 203",
|
|
33
|
+
asOf: "2026-07",
|
|
34
|
+
},
|
|
35
|
+
mlDsa: {
|
|
36
|
+
summary: "ML-DSA (Dilithium) lattice signatures — finalized August 2024.",
|
|
37
|
+
source: "NIST FIPS 204",
|
|
38
|
+
asOf: "2026-07",
|
|
39
|
+
},
|
|
40
|
+
slhDsa: {
|
|
41
|
+
summary: "SLH-DSA (SPHINCS+) stateless hash-based signatures — finalized August 2024.",
|
|
42
|
+
source: "NIST FIPS 205",
|
|
43
|
+
asOf: "2026-07",
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
cnsa: {
|
|
47
|
+
category3: { kem: "ML-KEM-768 (FIPS 203)", signature: "ML-DSA-65 (FIPS 204)" },
|
|
48
|
+
category5: { kem: "ML-KEM-1024 (FIPS 203)", signature: "ML-DSA-87 (FIPS 204)" },
|
|
49
|
+
source: "NSA CNSA 2.0 (national-security systems; 2030/2033 migration milestones)",
|
|
50
|
+
asOf: "2026-07",
|
|
51
|
+
},
|
|
52
|
+
statefulHbs: {
|
|
53
|
+
summary: "LMS/HSS and XMSS/XMSSMT stateful hash-based signatures (incl. the SHAKE256 and " +
|
|
54
|
+
"192-bit parameter sets) are approved for firmware/boot signing, but are STATEFUL.",
|
|
55
|
+
source: "NIST SP 800-208",
|
|
56
|
+
asOf: "2026-07",
|
|
57
|
+
},
|
|
58
|
+
transitionTimeline: {
|
|
59
|
+
deprecateAfter: 2030,
|
|
60
|
+
disallowAfter: 2035,
|
|
61
|
+
source: "NIST IR 8547 (transition to post-quantum cryptography standards)",
|
|
62
|
+
asOf: "2026-07",
|
|
63
|
+
},
|
|
64
|
+
emerging: [
|
|
65
|
+
{
|
|
66
|
+
summary: "HQC — NIST's code-based backup KEM (selected March 2025; draft FIPS expected ~2026), a " +
|
|
67
|
+
"diversity hedge against ML-KEM's lattice assumption.",
|
|
68
|
+
source: "NIST PQC (HQC selection)",
|
|
69
|
+
asOf: "2026-07",
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
summary: "FN-DSA / Falcon — compact lattice signatures.",
|
|
73
|
+
source: "NIST draft FIPS 206",
|
|
74
|
+
asOf: "2026-07",
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
summary: "X-Wing — X25519 + ML-KEM-768 hybrid KEM for HPKE-style encryption.",
|
|
78
|
+
source: "IETF draft-connolly-cfrg-xwing-kem",
|
|
79
|
+
asOf: "2026-07",
|
|
80
|
+
},
|
|
81
|
+
],
|
|
82
|
+
hybrids: [
|
|
83
|
+
{
|
|
84
|
+
summary: "X25519MLKEM768 — the default TLS 1.3 hybrid key-exchange group.",
|
|
85
|
+
source: "IETF draft-ietf-tls-ecdhe-mlkem",
|
|
86
|
+
asOf: "2026-07",
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
summary: "SecP384r1MLKEM1024 — the Category-5 / CNSA hybrid key-exchange group.",
|
|
90
|
+
source: "IETF draft-ietf-tls-ecdhe-mlkem",
|
|
91
|
+
asOf: "2026-07",
|
|
92
|
+
},
|
|
93
|
+
],
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* Whether a standards review is due as of `now`. Pure (takes `now` explicitly) so
|
|
97
|
+
* it is deterministic in tests; the CI script passes the real clock. Compares on
|
|
98
|
+
* whole UTC days so a same-day run is not spuriously "overdue".
|
|
99
|
+
*/
|
|
100
|
+
export function standardsReviewStatus(now, standards = PQC_STANDARDS) {
|
|
101
|
+
const MS_PER_DAY = 86_400_000;
|
|
102
|
+
const next = Date.parse(`${standards.nextReview}T00:00:00Z`);
|
|
103
|
+
const today = Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate());
|
|
104
|
+
const daysUntil = Math.round((next - today) / MS_PER_DAY);
|
|
105
|
+
return { due: daysUntil <= 0, nextReview: standards.nextReview, daysUntil };
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=standards.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"standards.js","sourceRoot":"","sources":["../src/standards.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AA2DH;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAiB;IACzC,YAAY,EAAE,YAAY;IAC1B,UAAU,EAAE,YAAY;IACxB,oBAAoB,EAAE,CAAC;IAEvB,IAAI,EAAE;QACJ,KAAK,EAAE;YACL,OAAO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ACF,CAAC;AAYF;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CACnC,GAAS,EACT,YAA0B,aAAa;IAEvC,MAAM,UAAU,GAAG,UAAU,CAAC;IAC9B,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC,UAAU,YAAY,CAAC,CAAC;IAC7D,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,cAAc,EAAE,EAAE,GAAG,CAAC,WAAW,EAAE,EAAE,GAAG,CAAC,UAAU,EAAE,CAAC,CAAC;IAClF,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,GAAG,KAAK,CAAC,GAAG,UAAU,CAAC,CAAC;IAC1D,OAAO,EAAE,GAAG,EAAE,SAAS,IAAI,CAAC,EAAE,UAAU,EAAE,SAAS,CAAC,UAAU,EAAE,SAAS,EAAE,CAAC;AAC9E,CAAC","sourcesContent":["/**\n * Single source of truth for the post-quantum standards this tool depends on.\n *\n * The scanner's credibility rests on its recommendations tracking the current\n * NIST / CNSA / IETF state. That tracking used to be ad-hoc — facts were spread\n * across `remediation.ts` with no dates, no citations, and nothing to catch code\n * drifting from the published standards. This module makes the standards facts\n * explicit, dated, and cited, and the companion drift test\n * (`test/standards.test.ts`) fails the build if the runtime constants\n * (`TIER_PARAMS`, `PQC_TRANSITION_NOTE`, `STATEFUL_HBS_NOTE`) fall out of sync\n * with what is recorded here.\n *\n * ## Cadence\n *\n * Re-verify every quarter (see `docs/standards/pqc-standards.md` for the runbook).\n * On each review: check the sources below for changes, update the facts + their\n * `asOf`, and roll `lastReviewed` / `nextReview` forward. `scripts/standards-check.mjs`\n * (advisory, runs in CI) flags when `nextReview` has passed so a review can't be\n * silently skipped. `standardsReviewStatus(now)` is the pure predicate behind it.\n */\n\n/** A single standards fact with its citation and when it was last verified. */\nexport interface StandardsCitation {\n /** One-line statement of the fact. */\n readonly summary: string;\n /** Spec identifier / publication (and URL where stable). */\n readonly source: string;\n /** `YYYY-MM` — when this fact was last verified against its source. */\n readonly asOf: string;\n}\n\n/** The full post-quantum standards snapshot the tool tracks. */\nexport interface PqcStandards {\n /** `YYYY-MM-DD` — when the whole snapshot was last reviewed. */\n readonly lastReviewed: string;\n /** `YYYY-MM-DD` — when the next review is due. */\n readonly nextReview: string;\n /** Cadence, in months, between reviews. */\n readonly reviewIntervalMonths: number;\n\n /** NIST's finalized PQC FIPS (the recommendation targets). */\n readonly fips: {\n readonly mlKem: StandardsCitation; // FIPS 203\n readonly mlDsa: StandardsCitation; // FIPS 204\n readonly slhDsa: StandardsCitation; // FIPS 205\n };\n\n /**\n * CNSA 2.0 security tiers → the KEM / signature parameter sets. These MUST\n * mirror `remediation.TIER_PARAMS`; the drift test asserts they stay identical.\n */\n readonly cnsa: {\n readonly category3: { readonly kem: string; readonly signature: string };\n readonly category5: { readonly kem: string; readonly signature: string };\n readonly source: string;\n readonly asOf: string;\n };\n\n /** Stateful hash-based signatures (firmware / boot signing). */\n readonly statefulHbs: StandardsCitation; // SP 800-208\n\n /** The migration deadline the transition note surfaces. */\n readonly transitionTimeline: {\n /** Year after which classical public-key crypto is deprecated. */\n readonly deprecateAfter: number;\n /** Year after which it is disallowed. */\n readonly disallowAfter: number;\n readonly source: string;\n readonly asOf: string;\n };\n\n /** Emerging / backup standards worth tracking beyond the current FIPS. */\n readonly emerging: readonly StandardsCitation[];\n\n /** Recommended hybrid key-exchange groups. */\n readonly hybrids: readonly StandardsCitation[];\n}\n\n/**\n * The current snapshot. Update on each quarterly review; the drift test keeps the\n * runtime remediation constants aligned with it.\n */\nexport const PQC_STANDARDS: PqcStandards = {\n lastReviewed: \"2026-07-19\",\n nextReview: \"2026-10-19\",\n reviewIntervalMonths: 3,\n\n fips: {\n mlKem: {\n summary: \"ML-KEM (Kyber) key encapsulation — finalized August 2024.\",\n source: \"NIST FIPS 203\",\n asOf: \"2026-07\",\n },\n mlDsa: {\n summary: \"ML-DSA (Dilithium) lattice signatures — finalized August 2024.\",\n source: \"NIST FIPS 204\",\n asOf: \"2026-07\",\n },\n slhDsa: {\n summary: \"SLH-DSA (SPHINCS+) stateless hash-based signatures — finalized August 2024.\",\n source: \"NIST FIPS 205\",\n asOf: \"2026-07\",\n },\n },\n\n cnsa: {\n category3: { kem: \"ML-KEM-768 (FIPS 203)\", signature: \"ML-DSA-65 (FIPS 204)\" },\n category5: { kem: \"ML-KEM-1024 (FIPS 203)\", signature: \"ML-DSA-87 (FIPS 204)\" },\n source: \"NSA CNSA 2.0 (national-security systems; 2030/2033 migration milestones)\",\n asOf: \"2026-07\",\n },\n\n statefulHbs: {\n summary:\n \"LMS/HSS and XMSS/XMSSMT stateful hash-based signatures (incl. the SHAKE256 and \" +\n \"192-bit parameter sets) are approved for firmware/boot signing, but are STATEFUL.\",\n source: \"NIST SP 800-208\",\n asOf: \"2026-07\",\n },\n\n transitionTimeline: {\n deprecateAfter: 2030,\n disallowAfter: 2035,\n source: \"NIST IR 8547 (transition to post-quantum cryptography standards)\",\n asOf: \"2026-07\",\n },\n\n emerging: [\n {\n summary:\n \"HQC — NIST's code-based backup KEM (selected March 2025; draft FIPS expected ~2026), a \" +\n \"diversity hedge against ML-KEM's lattice assumption.\",\n source: \"NIST PQC (HQC selection)\",\n asOf: \"2026-07\",\n },\n {\n summary: \"FN-DSA / Falcon — compact lattice signatures.\",\n source: \"NIST draft FIPS 206\",\n asOf: \"2026-07\",\n },\n {\n summary: \"X-Wing — X25519 + ML-KEM-768 hybrid KEM for HPKE-style encryption.\",\n source: \"IETF draft-connolly-cfrg-xwing-kem\",\n asOf: \"2026-07\",\n },\n ],\n\n hybrids: [\n {\n summary: \"X25519MLKEM768 — the default TLS 1.3 hybrid key-exchange group.\",\n source: \"IETF draft-ietf-tls-ecdhe-mlkem\",\n asOf: \"2026-07\",\n },\n {\n summary: \"SecP384r1MLKEM1024 — the Category-5 / CNSA hybrid key-exchange group.\",\n source: \"IETF draft-ietf-tls-ecdhe-mlkem\",\n asOf: \"2026-07\",\n },\n ],\n};\n\n/** Result of {@link standardsReviewStatus}. */\nexport interface StandardsReviewStatus {\n /** True when `now` is on or after `nextReview` — a review is due. */\n readonly due: boolean;\n /** The `nextReview` date being compared against (`YYYY-MM-DD`). */\n readonly nextReview: string;\n /** Whole days from `now` until `nextReview` (negative when overdue). */\n readonly daysUntil: number;\n}\n\n/**\n * Whether a standards review is due as of `now`. Pure (takes `now` explicitly) so\n * it is deterministic in tests; the CI script passes the real clock. Compares on\n * whole UTC days so a same-day run is not spuriously \"overdue\".\n */\nexport function standardsReviewStatus(\n now: Date,\n standards: PqcStandards = PQC_STANDARDS,\n): StandardsReviewStatus {\n const MS_PER_DAY = 86_400_000;\n const next = Date.parse(`${standards.nextReview}T00:00:00Z`);\n const today = Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate());\n const daysUntil = Math.round((next - today) / MS_PER_DAY);\n return { due: daysUntil <= 0, nextReview: standards.nextReview, daysUntil };\n}\n"]}
|
package/dist/types.d.ts
CHANGED
|
@@ -96,7 +96,7 @@ export type DetectorScope = "source" | "config";
|
|
|
96
96
|
* The programming language / surface a detector targets. `"any"` means the
|
|
97
97
|
* detector is language-agnostic (e.g. PEM material, config files).
|
|
98
98
|
*/
|
|
99
|
-
export type DetectorLanguage = "js" | "python" | "go" | "java" | "csharp" | "rust" | "ruby" | "c" | "any";
|
|
99
|
+
export type DetectorLanguage = "js" | "python" | "go" | "java" | "csharp" | "rust" | "ruby" | "php" | "elixir" | "c" | "swift" | "objc" | "dart" | "solidity" | "any";
|
|
100
100
|
/**
|
|
101
101
|
* Declarative metadata for a single rule a detector can emit. This is the
|
|
102
102
|
* catalog entry: the stable, queryable description of a rule keyed by the
|
|
@@ -295,10 +295,11 @@ export interface ScanResult {
|
|
|
295
295
|
*/
|
|
296
296
|
diagnostics?: ScanDiagnostics;
|
|
297
297
|
/**
|
|
298
|
-
* Of `filesScanned`, how many were in a source language the scanner can
|
|
299
|
-
*
|
|
300
|
-
*
|
|
301
|
-
*
|
|
298
|
+
* Of `filesScanned`, how many were in a source language the scanner can actually
|
|
299
|
+
* analyze for inline crypto (the 13 packs: JS/TS, Python, Go, Java/Kotlin/Scala,
|
|
300
|
+
* C#, Rust, Ruby, PHP, Elixir, C/C++, Swift, Objective-C, Dart). When this is 0
|
|
301
|
+
* but `filesScanned` > 0, the readiness score reflects NO analyzable code — the
|
|
302
|
+
* crypto likely lives in an unsupported language (Lua, Perl, …) — and
|
|
302
303
|
* reporters surface that so a bare 100/100 can't read as "safe". Optional for
|
|
303
304
|
* backward compatibility with hand-built results.
|
|
304
305
|
*/
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,6DAA6D;AAC7D,MAAM,MAAM,QAAQ,GAAG,UAAU,GAAG,MAAM,GAAG,QAAQ,GAAG,KAAK,GAAG,MAAM,CAAC;AAEvE,gFAAgF;AAChF,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC;AAEnD,+DAA+D;AAC/D,MAAM,MAAM,eAAe,GACvB,KAAK,GACL,cAAc,GACd,WAAW,GACX,KAAK,GACL,aAAa,GACb,YAAY,GACZ,MAAM,GACN,KAAK,CAAC;AAEV,yEAAyE;AACzE,MAAM,MAAM,eAAe,GACvB,KAAK,GACL,MAAM,GACN,OAAO,GACP,OAAO,GACP,IAAI,GACJ,KAAK,GACL,QAAQ,GACR,MAAM,GACN,OAAO,GACP,SAAS,CAAC;AAEd,gDAAgD;AAChD,MAAM,WAAW,cAAc;IAC7B,8DAA8D;IAC9D,IAAI,EAAE,MAAM,CAAC;IACb,2BAA2B;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,uCAAuC;IACvC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gDAAgD;IAChD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,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ACnB,0GAA0G;IAC1G,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,iCAAiC;AACjC,MAAM,WAAW,UAAU;IACzB,mCAAmC;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B;;;;;;;;OAQG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,eAAe,CAAC;IAC3B,sBAAsB;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,6CAA6C;IAC7C,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,iDAAiD;AACjD,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC;AAEtD,8DAA8D;AAC9D,MAAM,WAAW,WAAW;IAC1B,SAAS,EAAE,eAAe,CAAC;IAC3B,gFAAgF;IAChF,cAAc,EAAE,MAAM,CAAC;IACvB,wBAAwB;IACxB,MAAM,EAAE,MAAM,CAAC;CAChB"}
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG","sourcesContent":["/**\n * @quantakrypto/core — shared types (the locked public contract).\n *\n * These types are the stable interface between every tool in the monorepo\n * (qScan, the MCP server, the GitHub Action). Treat additions as backwards\n * compatible; treat renames/removals as breaking.\n */\n\n/** How serious a finding is, ordered most → least severe. */\nexport type Severity = \"critical\" | \"high\" | \"medium\" | \"low\" | \"info\";\n\n/** How sure the detector is that the finding is a real use of the algorithm. */\nexport type Confidence = \"high\" | \"medium\" | \"low\";\n\n/** What kind of cryptographic concern a finding represents. */\nexport type FindingCategory =\n | \"kem\" // key encapsulation / public-key encryption (e.g. RSA-OAEP)\n | \"key-exchange\" // (EC)DH\n | \"signature\" // RSA/ECDSA/EdDSA signing\n | \"tls\" // transport configuration\n | \"certificate\" // X.509 / PKI material\n | \"dependency\" // a quantum-vulnerable library in the dependency tree\n | \"hash\" // weak / pre-quantum hash usage\n | \"rng\"; // randomness concerns\n\n/** Classical asymmetric algorithm families that are not quantum-safe. */\nexport type AlgorithmFamily =\n | \"RSA\"\n | \"ECDH\"\n | \"ECDSA\"\n | \"EdDSA\"\n | \"DH\"\n | \"DSA\"\n | \"X25519\"\n | \"X448\"\n | \"ECIES\"\n | \"unknown\";\n\n/** A precise location inside a scanned file. */\nexport interface SourceLocation {\n /** Path relative to the scan root, using POSIX separators. */\n file: string;\n /** 1-based line number. */\n line: number;\n /** 1-based column number, if known. */\n column?: number;\n /** 1-based end line, for multi-line matches. */\n endLine?: number;\n /** The matched source text (trimmed, single line). */\n snippet?: string;\n}\n\n/** Relative urgency an LLM triage pass assigns to a finding. */\nexport type TriagePriority = \"now\" | \"soon\" | \"later\";\n\n/**\n * Optional LLM triage annotation attached to a finding by `qscan --triage`.\n * Purely additive: it re-ranks and explains, it never suppresses a finding and\n * never influences the exit code (which is computed from `severity` alone).\n */\nexport interface TriageAnnotation {\n /** 0–100 real-world exposure/exploitability estimate. */\n exposureScore: number;\n priority: TriagePriority;\n rationale: string;\n}\n\n/** A single detected concern. */\nexport interface Finding {\n /** Stable rule identifier, e.g. \"rsa-keygen\", \"ecdh-usage\", \"tls-legacy-version\", \"dep-vulnerable\". */\n ruleId: string;\n title: string;\n category: FindingCategory;\n severity: Severity;\n confidence: Confidence;\n /** The classical algorithm involved, when applicable. */\n algorithm?: AlgorithmFamily;\n /** True when this is exposed to \"harvest now, decrypt later\". */\n hndl: boolean;\n /** One-line human explanation of the concern. */\n message: string;\n /** Suggested post-quantum remediation (e.g. ML-KEM, hybrid X25519MLKEM768). */\n remediation?: string;\n /** Associated CWE identifier, e.g. \"CWE-327\" (broken crypto), \"CWE-326\" (weak strength). */\n cwe?: string;\n /**\n * True when the matched snippet IS the sensitive value (e.g. a PEM private/\n * public key block, an `ssh-rsa AAAA…` public key). Reporters ALWAYS drop the\n * snippet for such findings, regardless of any redaction flag.\n */\n sensitive?: boolean;\n /** Optional LLM triage annotation (`qscan --triage`); never affects exit code. */\n triage?: TriageAnnotation;\n location: SourceLocation;\n}\n\n/** Package ecosystems the dependency scanner understands. */\nexport type DependencyEcosystem = \"npm\" | \"pypi\" | \"cargo\" | \"go\" | \"maven\" | \"rubygems\" | \"nuget\";\n\n/** A known quantum-vulnerable dependency entry. */\nexport interface VulnerableDependency {\n /** Package name (as written in the ecosystem's manifest). */\n name: string;\n ecosystem: DependencyEcosystem;\n /** Why it's flagged (what classical crypto it provides). */\n reason: string;\n /** Algorithm families the package primarily exposes. */\n algorithms: AlgorithmFamily[];\n severity: Severity;\n /**\n * Explicit harvest-now-decrypt-later override. When omitted, HNDL is inferred\n * from whether any listed family is a confidentiality family. Set `false` for\n * signing-only packages (e.g. JWS/JWT libraries) that list RSA/EC as families\n * but never do key transport or key agreement — signatures are not HNDL-exposed.\n */\n hndl?: boolean;\n}\n\n/**\n * Which logical scope a detector belongs to. Drives the source/config scope\n * toggles in {@link ScanOptions} (replacing the old ruleId-prefix inference).\n */\nexport type DetectorScope = \"source\" | \"config\";\n\n/**\n * The programming language / surface a detector targets. `\"any\"` means the\n * detector is language-agnostic (e.g. PEM material, config files).\n */\nexport type DetectorLanguage =\n | \"js\"\n | \"python\"\n | \"go\"\n | \"java\"\n | \"csharp\"\n | \"rust\"\n | \"ruby\"\n | \"c\"\n | \"any\";\n\n/**\n * Declarative metadata for a single rule a detector can emit. This is the\n * catalog entry: the stable, queryable description of a rule keyed by the\n * `ruleId` it stamps onto findings. It is the single source of truth for a\n * rule's title / severity / category / remediation, consumed by the SARIF\n * `rules[]` block, the MCP `explain_finding` resolver, and future per-rule\n * enable/disable + language-pack work.\n *\n * For most rules the metadata is fixed and `detect()` builds findings straight\n * from it (see `findingFromRule`). A few rules are inherently multi-variant\n * (e.g. `node-crypto-keygen` spans RSA/EC/DSA/DH/Ed25519 at different\n * severities); for those the metadata here is a REPRESENTATIVE umbrella and\n * `detect()` refines the per-finding fields at match time. The catalog always\n * enumerates every emittable ruleId regardless.\n */\nexport interface RuleMeta {\n /** Stable rule id — matches {@link Finding.ruleId}. Unique across the catalog. */\n id: string;\n /** Canonical human title. */\n title: string;\n category: FindingCategory;\n severity: Severity;\n /** Default confidence for findings of this rule. */\n confidence: Confidence;\n /** Harvest-now-decrypt-later exposure. */\n hndl: boolean;\n /** Representative classical algorithm family; refined per-finding when it varies. */\n algorithm?: AlgorithmFamily;\n /** Associated CWE identifier (e.g. \"CWE-327\"). */\n cwe?: string;\n /** Suggested post-quantum remediation. When omitted, derived from {@link algorithm}. */\n remediation?: string;\n /** Canonical one-line human explanation; may be refined per-finding. */\n message: string;\n /** True when this rule's matched snippet IS sensitive key material. */\n sensitive?: boolean;\n /** Short description of what the rule detects (for catalog / MCP surfaces). */\n description?: string;\n}\n\n/** A pluggable source detector. Detectors are pure and stateless. */\nexport interface Detector {\n /** Unique id, used as the Finding.ruleId prefix space. */\n id: string;\n /** Human description of what the detector looks for. */\n description: string;\n /**\n * Logical scope of this detector's findings. Used by `scan()` to honour the\n * `config` / `source` toggles. Defaults to `\"source\"` when omitted (for\n * backward compatibility with externally-defined detectors).\n */\n scope?: DetectorScope;\n /**\n * Language this detector targets, for documentation / registry filtering.\n * Defaults to `\"js\"` when omitted.\n */\n language?: DetectorLanguage;\n /**\n * The rules this detector can emit, as declarative metadata. Together across\n * all detectors these form the rule catalog ({@link DetectorRegistry.ruleCatalog}).\n * Optional for backward compatibility with externally-defined detectors, but\n * all built-in detectors declare it.\n */\n rules?: RuleMeta[];\n /** Whether this detector should run against the given file path. */\n appliesTo(filePath: string): boolean;\n /** Inspect a single file's contents and return zero or more findings. */\n detect(input: DetectorInput): Finding[];\n}\n\nexport interface DetectorInput {\n /** Path relative to the scan root (POSIX). */\n file: string;\n /** Full file contents. */\n content: string;\n}\n\n/** Options controlling a scan. */\nexport interface ScanOptions {\n /** Absolute or relative directory (or single file) to scan. */\n root: string;\n /**\n * Restrict the walk to paths matching one of these include patterns\n * (substring or relative-path-prefix match). When omitted, all non-excluded\n * files are scanned. Wired into the walker.\n */\n include?: string[];\n /** Extra exclude patterns (in addition to the built-in defaults). */\n exclude?: string[];\n /** Disable the built-in ignore list (node_modules, .git, dist, …). */\n noDefaultIgnores?: boolean;\n /** Scan source files for inline crypto usage. Default: true. */\n source?: boolean;\n /** Scan dependency manifests/lockfiles for vulnerable libraries. Default: true. */\n dependencies?: boolean;\n /** Scan config files (TLS, certificates). Default: true. */\n config?: boolean;\n /** Max file size to read, in bytes. Default: 2 MiB. */\n maxFileSize?: number;\n /**\n * Scan minified / generated / bundled files (large single-line content)\n * instead of skipping them. Default: false (skip them for speed).\n */\n scanMinified?: boolean;\n /**\n * Explicit relative file list (POSIX, relative to `root`) to scan instead of\n * walking the tree. Used for incremental / changed-files scans. Each path is\n * still subject to the binary / size filters. When set, the directory walk is\n * bypassed entirely.\n */\n files?: string[];\n /**\n * Override / extend the built-in detector set. When omitted, the default\n * registry's detectors are used.\n */\n detectors?: Detector[];\n /**\n * Rule ids to suppress. Any finding whose `ruleId` is listed here is dropped\n * after detection. Serializable (a plain string array), so it is honoured on\n * both the serial and the worker-thread (`scanParallel`) paths. See the rule\n * catalog ({@link DetectorRegistry.ruleCatalog}) for the valid ids.\n */\n disabledRules?: string[];\n /**\n * Path to an on-disk scan cache. When set, unchanged files (same content hash)\n * reuse their previous findings instead of re-running detectors, and the cache\n * is rewritten after the scan. Invalidated wholesale when the tool version,\n * detector set, or `disabledRules` change. Optional; omitted = no caching.\n * The cache forces the in-process (serial) path.\n */\n cacheFile?: string;\n /** Optional progress callback. */\n onFile?: (file: string) => void;\n /**\n * Optional abort signal. When it fires mid-walk the scan stops cooperatively\n * and rejects with an `AbortError` (a `DOMException`-like error with\n * `name === \"AbortError\"`).\n */\n signal?: AbortSignal;\n /**\n * Work budget: maximum number of files to scan. When exceeded mid-walk the\n * scan stops and throws a `BudgetExceededError`. Unlimited when omitted.\n */\n maxFiles?: number;\n /**\n * Work budget: maximum cumulative bytes of scanned file content. When\n * exceeded mid-walk the scan stops and throws a `BudgetExceededError`.\n * Unlimited when omitted.\n */\n maxBytes?: number;\n}\n\n/** Extra options for {@link scanParallel}, layered onto {@link ScanOptions}. */\nexport interface ParallelScanOptions extends ScanOptions {\n /**\n * Number of worker threads. Default: `os.availableParallelism()`. A value of\n * 0 or 1 forces the in-process serial path.\n */\n concurrency?: number;\n /**\n * Combined-size floor (bytes) below which the scan always runs in-process.\n * Default: 2 MiB. Also stays serial below `parallelFileThreshold` files.\n */\n parallelThresholdBytes?: number;\n /** File-count floor below which the scan always runs in-process. Default: 200. */\n parallelFileThreshold?: number;\n /** Target bytes per worker chunk. Default: 4 MiB. */\n chunkBytes?: number;\n}\n\n/** Aggregated counts produced from a scan's findings. */\nexport interface CryptoInventory {\n byAlgorithm: Partial<Record<AlgorithmFamily, number>>;\n byCategory: Partial<Record<FindingCategory, number>>;\n bySeverity: Record<Severity, number>;\n /** Number of findings exposed to harvest-now-decrypt-later. */\n hndlCount: number;\n /** 0–100 readiness score (100 = no classical asymmetric crypto found). */\n readinessScore: number;\n}\n\n/**\n * Non-fatal things that happened during a scan that reduce coverage. Surfaced so\n * a silent under-scan (e.g. half the tree was unreadable) can't masquerade as a\n * clean \"0 findings\" result — reporters warn when any count is non-zero.\n */\nexport interface ScanDiagnostics {\n /** Files that could not be read (permissions, vanished, decode failure) and were skipped. */\n unreadable: number;\n /** Files skipped because they look machine-minified / generated (scan with `scanMinified` to include). */\n skippedMinified: number;\n}\n\n/** The full result of a scan. */\nexport interface ScanResult {\n /** The scan root (as provided). */\n root: string;\n findings: Finding[];\n filesScanned: number;\n /**\n * Coverage diagnostics: counts of files skipped as unreadable or minified.\n * Optional for backward compatibility with hand-built results.\n */\n diagnostics?: ScanDiagnostics;\n /**\n * Of `filesScanned`, how many were in a source language the scanner can\n * actually analyze for inline crypto (JS/TS, Python, Go, Java). When this is 0 but\n * `filesScanned` > 0, the readiness score reflects NO analyzable code — the\n * crypto likely lives in an unsupported language (Go, Java, Rust, …) — and\n * reporters surface that so a bare 100/100 can't read as \"safe\". Optional for\n * backward compatibility with hand-built results.\n */\n analyzedFiles?: number;\n inventory: CryptoInventory;\n /** ISO timestamps. */\n startedAt: string;\n finishedAt: string;\n /** Tool version that produced the result. */\n toolVersion: string;\n}\n\n/** Output formats qScan / reporters can emit. */\nexport type ReportFormat = \"human\" | \"json\" | \"sarif\";\n\n/** A remediation recommendation for a classical algorithm. */\nexport interface Remediation {\n algorithm: AlgorithmFamily;\n /** Short recommended replacement, e.g. \"ML-KEM-768 (hybrid X25519MLKEM768)\". */\n recommendation: string;\n /** Longer rationale. */\n detail: string;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG","sourcesContent":["/**\n * @quantakrypto/core — shared types (the locked public contract).\n *\n * These types are the stable interface between every tool in the monorepo\n * (qScan, the MCP server, the GitHub Action). Treat additions as backwards\n * compatible; treat renames/removals as breaking.\n */\n\n/** How serious a finding is, ordered most → least severe. */\nexport type Severity = \"critical\" | \"high\" | \"medium\" | \"low\" | \"info\";\n\n/** How sure the detector is that the finding is a real use of the algorithm. */\nexport type Confidence = \"high\" | \"medium\" | \"low\";\n\n/** What kind of cryptographic concern a finding represents. */\nexport type FindingCategory =\n | \"kem\" // key encapsulation / public-key encryption (e.g. RSA-OAEP)\n | \"key-exchange\" // (EC)DH\n | \"signature\" // RSA/ECDSA/EdDSA signing\n | \"tls\" // transport configuration\n | \"certificate\" // X.509 / PKI material\n | \"dependency\" // a quantum-vulnerable library in the dependency tree\n | \"hash\" // weak / pre-quantum hash usage\n | \"rng\"; // randomness concerns\n\n/** Classical asymmetric algorithm families that are not quantum-safe. */\nexport type AlgorithmFamily =\n | \"RSA\"\n | \"ECDH\"\n | \"ECDSA\"\n | \"EdDSA\"\n | \"DH\"\n | \"DSA\"\n | \"X25519\"\n | \"X448\"\n | \"ECIES\"\n | \"unknown\";\n\n/** A precise location inside a scanned file. */\nexport interface SourceLocation {\n /** Path relative to the scan root, using POSIX separators. */\n file: string;\n /** 1-based line number. */\n line: number;\n /** 1-based column number, if known. */\n column?: number;\n /** 1-based end line, for multi-line matches. */\n endLine?: number;\n /** The matched source text (trimmed, single line). */\n snippet?: string;\n}\n\n/** Relative urgency an LLM triage pass assigns to a finding. */\nexport type TriagePriority = \"now\" | \"soon\" | \"later\";\n\n/**\n * Optional LLM triage annotation attached to a finding by `qscan --triage`.\n * Purely additive: it re-ranks and explains, it never suppresses a finding and\n * never influences the exit code (which is computed from `severity` alone).\n */\nexport interface TriageAnnotation {\n /** 0–100 real-world exposure/exploitability estimate. */\n exposureScore: number;\n priority: TriagePriority;\n rationale: string;\n}\n\n/** A single detected concern. */\nexport interface Finding {\n /** Stable rule identifier, e.g. \"rsa-keygen\", \"ecdh-usage\", \"tls-legacy-version\", \"dep-vulnerable\". */\n ruleId: string;\n title: string;\n category: FindingCategory;\n severity: Severity;\n confidence: Confidence;\n /** The classical algorithm involved, when applicable. */\n algorithm?: AlgorithmFamily;\n /** True when this is exposed to \"harvest now, decrypt later\". */\n hndl: boolean;\n /** One-line human explanation of the concern. */\n message: string;\n /** Suggested post-quantum remediation (e.g. ML-KEM, hybrid X25519MLKEM768). */\n remediation?: string;\n /** Associated CWE identifier, e.g. \"CWE-327\" (broken crypto), \"CWE-326\" (weak strength). */\n cwe?: string;\n /**\n * True when the matched snippet IS the sensitive value (e.g. a PEM private/\n * public key block, an `ssh-rsa AAAA…` public key). Reporters ALWAYS drop the\n * snippet for such findings, regardless of any redaction flag.\n */\n sensitive?: boolean;\n /** Optional LLM triage annotation (`qscan --triage`); never affects exit code. */\n triage?: TriageAnnotation;\n location: SourceLocation;\n}\n\n/** Package ecosystems the dependency scanner understands. */\nexport type DependencyEcosystem = \"npm\" | \"pypi\" | \"cargo\" | \"go\" | \"maven\" | \"rubygems\" | \"nuget\";\n\n/** A known quantum-vulnerable dependency entry. */\nexport interface VulnerableDependency {\n /** Package name (as written in the ecosystem's manifest). */\n name: string;\n ecosystem: DependencyEcosystem;\n /** Why it's flagged (what classical crypto it provides). */\n reason: string;\n /** Algorithm families the package primarily exposes. */\n algorithms: AlgorithmFamily[];\n severity: Severity;\n /**\n * Explicit harvest-now-decrypt-later override. When omitted, HNDL is inferred\n * from whether any listed family is a confidentiality family. Set `false` for\n * signing-only packages (e.g. JWS/JWT libraries) that list RSA/EC as families\n * but never do key transport or key agreement — signatures are not HNDL-exposed.\n */\n hndl?: boolean;\n}\n\n/**\n * Which logical scope a detector belongs to. Drives the source/config scope\n * toggles in {@link ScanOptions} (replacing the old ruleId-prefix inference).\n */\nexport type DetectorScope = \"source\" | \"config\";\n\n/**\n * The programming language / surface a detector targets. `\"any\"` means the\n * detector is language-agnostic (e.g. PEM material, config files).\n */\nexport type DetectorLanguage =\n | \"js\"\n | \"python\"\n | \"go\"\n | \"java\"\n | \"csharp\"\n | \"rust\"\n | \"ruby\"\n | \"php\"\n | \"elixir\"\n | \"c\"\n | \"swift\"\n | \"objc\"\n | \"dart\"\n | \"solidity\"\n | \"any\";\n\n/**\n * Declarative metadata for a single rule a detector can emit. This is the\n * catalog entry: the stable, queryable description of a rule keyed by the\n * `ruleId` it stamps onto findings. It is the single source of truth for a\n * rule's title / severity / category / remediation, consumed by the SARIF\n * `rules[]` block, the MCP `explain_finding` resolver, and future per-rule\n * enable/disable + language-pack work.\n *\n * For most rules the metadata is fixed and `detect()` builds findings straight\n * from it (see `findingFromRule`). A few rules are inherently multi-variant\n * (e.g. `node-crypto-keygen` spans RSA/EC/DSA/DH/Ed25519 at different\n * severities); for those the metadata here is a REPRESENTATIVE umbrella and\n * `detect()` refines the per-finding fields at match time. The catalog always\n * enumerates every emittable ruleId regardless.\n */\nexport interface RuleMeta {\n /** Stable rule id — matches {@link Finding.ruleId}. Unique across the catalog. */\n id: string;\n /** Canonical human title. */\n title: string;\n category: FindingCategory;\n severity: Severity;\n /** Default confidence for findings of this rule. */\n confidence: Confidence;\n /** Harvest-now-decrypt-later exposure. */\n hndl: boolean;\n /** Representative classical algorithm family; refined per-finding when it varies. */\n algorithm?: AlgorithmFamily;\n /** Associated CWE identifier (e.g. \"CWE-327\"). */\n cwe?: string;\n /** Suggested post-quantum remediation. When omitted, derived from {@link algorithm}. */\n remediation?: string;\n /** Canonical one-line human explanation; may be refined per-finding. */\n message: string;\n /** True when this rule's matched snippet IS sensitive key material. */\n sensitive?: boolean;\n /** Short description of what the rule detects (for catalog / MCP surfaces). */\n description?: string;\n}\n\n/** A pluggable source detector. Detectors are pure and stateless. */\nexport interface Detector {\n /** Unique id, used as the Finding.ruleId prefix space. */\n id: string;\n /** Human description of what the detector looks for. */\n description: string;\n /**\n * Logical scope of this detector's findings. Used by `scan()` to honour the\n * `config` / `source` toggles. Defaults to `\"source\"` when omitted (for\n * backward compatibility with externally-defined detectors).\n */\n scope?: DetectorScope;\n /**\n * Language this detector targets, for documentation / registry filtering.\n * Defaults to `\"js\"` when omitted.\n */\n language?: DetectorLanguage;\n /**\n * The rules this detector can emit, as declarative metadata. Together across\n * all detectors these form the rule catalog ({@link DetectorRegistry.ruleCatalog}).\n * Optional for backward compatibility with externally-defined detectors, but\n * all built-in detectors declare it.\n */\n rules?: RuleMeta[];\n /** Whether this detector should run against the given file path. */\n appliesTo(filePath: string): boolean;\n /** Inspect a single file's contents and return zero or more findings. */\n detect(input: DetectorInput): Finding[];\n}\n\nexport interface DetectorInput {\n /** Path relative to the scan root (POSIX). */\n file: string;\n /** Full file contents. */\n content: string;\n}\n\n/** Options controlling a scan. */\nexport interface ScanOptions {\n /** Absolute or relative directory (or single file) to scan. */\n root: string;\n /**\n * Restrict the walk to paths matching one of these include patterns\n * (substring or relative-path-prefix match). When omitted, all non-excluded\n * files are scanned. Wired into the walker.\n */\n include?: string[];\n /** Extra exclude patterns (in addition to the built-in defaults). */\n exclude?: string[];\n /** Disable the built-in ignore list (node_modules, .git, dist, …). */\n noDefaultIgnores?: boolean;\n /** Scan source files for inline crypto usage. Default: true. */\n source?: boolean;\n /** Scan dependency manifests/lockfiles for vulnerable libraries. Default: true. */\n dependencies?: boolean;\n /** Scan config files (TLS, certificates). Default: true. */\n config?: boolean;\n /** Max file size to read, in bytes. Default: 2 MiB. */\n maxFileSize?: number;\n /**\n * Scan minified / generated / bundled files (large single-line content)\n * instead of skipping them. Default: false (skip them for speed).\n */\n scanMinified?: boolean;\n /**\n * Explicit relative file list (POSIX, relative to `root`) to scan instead of\n * walking the tree. Used for incremental / changed-files scans. Each path is\n * still subject to the binary / size filters. When set, the directory walk is\n * bypassed entirely.\n */\n files?: string[];\n /**\n * Override / extend the built-in detector set. When omitted, the default\n * registry's detectors are used.\n */\n detectors?: Detector[];\n /**\n * Rule ids to suppress. Any finding whose `ruleId` is listed here is dropped\n * after detection. Serializable (a plain string array), so it is honoured on\n * both the serial and the worker-thread (`scanParallel`) paths. See the rule\n * catalog ({@link DetectorRegistry.ruleCatalog}) for the valid ids.\n */\n disabledRules?: string[];\n /**\n * Path to an on-disk scan cache. When set, unchanged files (same content hash)\n * reuse their previous findings instead of re-running detectors, and the cache\n * is rewritten after the scan. Invalidated wholesale when the tool version,\n * detector set, or `disabledRules` change. Optional; omitted = no caching.\n * The cache forces the in-process (serial) path.\n */\n cacheFile?: string;\n /** Optional progress callback. */\n onFile?: (file: string) => void;\n /**\n * Optional abort signal. When it fires mid-walk the scan stops cooperatively\n * and rejects with an `AbortError` (a `DOMException`-like error with\n * `name === \"AbortError\"`).\n */\n signal?: AbortSignal;\n /**\n * Work budget: maximum number of files to scan. When exceeded mid-walk the\n * scan stops and throws a `BudgetExceededError`. Unlimited when omitted.\n */\n maxFiles?: number;\n /**\n * Work budget: maximum cumulative bytes of scanned file content. When\n * exceeded mid-walk the scan stops and throws a `BudgetExceededError`.\n * Unlimited when omitted.\n */\n maxBytes?: number;\n}\n\n/** Extra options for {@link scanParallel}, layered onto {@link ScanOptions}. */\nexport interface ParallelScanOptions extends ScanOptions {\n /**\n * Number of worker threads. Default: `os.availableParallelism()`. A value of\n * 0 or 1 forces the in-process serial path.\n */\n concurrency?: number;\n /**\n * Combined-size floor (bytes) below which the scan always runs in-process.\n * Default: 2 MiB. Also stays serial below `parallelFileThreshold` files.\n */\n parallelThresholdBytes?: number;\n /** File-count floor below which the scan always runs in-process. Default: 200. */\n parallelFileThreshold?: number;\n /** Target bytes per worker chunk. Default: 4 MiB. */\n chunkBytes?: number;\n}\n\n/** Aggregated counts produced from a scan's findings. */\nexport interface CryptoInventory {\n byAlgorithm: Partial<Record<AlgorithmFamily, number>>;\n byCategory: Partial<Record<FindingCategory, number>>;\n bySeverity: Record<Severity, number>;\n /** Number of findings exposed to harvest-now-decrypt-later. */\n hndlCount: number;\n /** 0–100 readiness score (100 = no classical asymmetric crypto found). */\n readinessScore: number;\n}\n\n/**\n * Non-fatal things that happened during a scan that reduce coverage. Surfaced so\n * a silent under-scan (e.g. half the tree was unreadable) can't masquerade as a\n * clean \"0 findings\" result — reporters warn when any count is non-zero.\n */\nexport interface ScanDiagnostics {\n /** Files that could not be read (permissions, vanished, decode failure) and were skipped. */\n unreadable: number;\n /** Files skipped because they look machine-minified / generated (scan with `scanMinified` to include). */\n skippedMinified: number;\n}\n\n/** The full result of a scan. */\nexport interface ScanResult {\n /** The scan root (as provided). */\n root: string;\n findings: Finding[];\n filesScanned: number;\n /**\n * Coverage diagnostics: counts of files skipped as unreadable or minified.\n * Optional for backward compatibility with hand-built results.\n */\n diagnostics?: ScanDiagnostics;\n /**\n * Of `filesScanned`, how many were in a source language the scanner can actually\n * analyze for inline crypto (the 13 packs: JS/TS, Python, Go, Java/Kotlin/Scala,\n * C#, Rust, Ruby, PHP, Elixir, C/C++, Swift, Objective-C, Dart). When this is 0\n * but `filesScanned` > 0, the readiness score reflects NO analyzable code — the\n * crypto likely lives in an unsupported language (Lua, Perl, …) — and\n * reporters surface that so a bare 100/100 can't read as \"safe\". Optional for\n * backward compatibility with hand-built results.\n */\n analyzedFiles?: number;\n inventory: CryptoInventory;\n /** ISO timestamps. */\n startedAt: string;\n finishedAt: string;\n /** Tool version that produced the result. */\n toolVersion: string;\n}\n\n/** Output formats qScan / reporters can emit. */\nexport type ReportFormat = \"human\" | \"json\" | \"sarif\";\n\n/** A remediation recommendation for a classical algorithm. */\nexport interface Remediation {\n algorithm: AlgorithmFamily;\n /** Short recommended replacement, e.g. \"ML-KEM-768 (hybrid X25519MLKEM768)\". */\n recommendation: string;\n /** Longer rationale. */\n detail: string;\n}\n"]}
|
package/dist/version.d.ts
CHANGED
package/dist/version.js
CHANGED
package/dist/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC","sourcesContent":["/**\n * The tool version surfaced in reports. Kept in its own module so reporters and\n * the scan orchestrator can import it without creating a cycle through index.ts.\n * Keep in sync with packages/core/package.json.\n */\nexport const VERSION = \"0.
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC","sourcesContent":["/**\n * The tool version surfaced in reports. Kept in its own module so reporters and\n * the scan orchestrator can import it without creating a cycle through index.ts.\n * Keep in sync with packages/core/package.json.\n */\nexport const VERSION = \"0.5.0\";\n"]}
|
package/dist/vex.d.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { ScanResult } from "./types.js";
|
|
2
|
+
/** A single OpenVEX statement: one synthetic vulnerability over its affected products. */
|
|
3
|
+
export interface OpenVexStatement {
|
|
4
|
+
vulnerability: {
|
|
5
|
+
name: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
};
|
|
8
|
+
products: {
|
|
9
|
+
"@id": string;
|
|
10
|
+
}[];
|
|
11
|
+
status: "not_affected" | "affected" | "fixed" | "under_investigation";
|
|
12
|
+
/** Recommended action for an `affected` product (the rule's remediation). */
|
|
13
|
+
action_statement?: string;
|
|
14
|
+
/** Free-form status detail — carries the `--triage` exposure verdict when present. */
|
|
15
|
+
status_notes?: string;
|
|
16
|
+
}
|
|
17
|
+
/** An OpenVEX 0.2.0 document. */
|
|
18
|
+
export interface OpenVexDocument {
|
|
19
|
+
"@context": "https://openvex.dev/ns/v0.2.0";
|
|
20
|
+
"@id": string;
|
|
21
|
+
author: string;
|
|
22
|
+
timestamp: string;
|
|
23
|
+
version: number;
|
|
24
|
+
statements: OpenVexStatement[];
|
|
25
|
+
}
|
|
26
|
+
/** Options for {@link toOpenVex}. */
|
|
27
|
+
export interface OpenVexOptions {
|
|
28
|
+
/** Document author (VEX issuer). Default: `"qScan"`. */
|
|
29
|
+
author?: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Build an OpenVEX 0.2.0 document from a scan result. One statement per distinct
|
|
33
|
+
* rule id, listing every affected `file:line` product. Output is deterministic
|
|
34
|
+
* (statements sorted by vulnerability name, products sorted and de-duplicated;
|
|
35
|
+
* the `@id` and `timestamp` derive from the result), so re-exporting the same
|
|
36
|
+
* scan yields byte-identical VEX.
|
|
37
|
+
*/
|
|
38
|
+
export declare function toOpenVex(result: ScanResult, opts?: OpenVexOptions): OpenVexDocument;
|
|
39
|
+
//# sourceMappingURL=vex.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vex.d.ts","sourceRoot":"","sources":["../src/vex.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAW,UAAU,EAAE,MAAM,YAAY,CAAC;AAEtD,0FAA0F;AAC1F,MAAM,WAAW,gBAAgB;IAC/B,aAAa,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACtD,QAAQ,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC9B,MAAM,EAAE,cAAc,GAAG,UAAU,GAAG,OAAO,GAAG,qBAAqB,CAAC;IACtE,6EAA6E;IAC7E,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,sFAAsF;IACtF,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,iCAAiC;AACjC,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE,+BAA+B,CAAC;IAC5C,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,gBAAgB,EAAE,CAAC;CAChC;AAED,qCAAqC;AACrC,MAAM,WAAW,cAAc;IAC7B,wDAAwD;IACxD,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAWD;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,GAAE,cAAmB,GAAG,eAAe,CA0DxF"}
|
package/dist/vex.js
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OpenVEX export — turn a {@link ScanResult} into an OpenVEX 0.2.0 document so
|
|
3
|
+
* the quantum-readiness posture flows into the SAME supply-chain pipeline that
|
|
4
|
+
* already ingests CVE-based VEX (Vulnerability Exploitability eXchange).
|
|
5
|
+
*
|
|
6
|
+
* Reference: OpenVEX spec (https://openvex.dev/, `@context` v0.2.0).
|
|
7
|
+
*
|
|
8
|
+
* Modeling choice (documented, honest): PQC findings have no CVE, so each qScan
|
|
9
|
+
* rule becomes a synthetic vulnerability `QK-<ruleId>`. Every finding is reported
|
|
10
|
+
* `status: "affected"` — the classical, Shor-breakable primitive IS present in
|
|
11
|
+
* the product by construction — with the rule's remediation as the VEX
|
|
12
|
+
* `action_statement`. A `--triage` exposure verdict, when present, is surfaced in
|
|
13
|
+
* `status_notes` (score / priority / rationale). qScan never downgrades a finding
|
|
14
|
+
* to `not_affected`: only the operator can attest a mitigation, so that judgment
|
|
15
|
+
* is deliberately left to them (they can post-process this document).
|
|
16
|
+
*/
|
|
17
|
+
import { createHash } from "node:crypto";
|
|
18
|
+
/**
|
|
19
|
+
* A stable product identifier for a finding as an IRI (OpenVEX requires product
|
|
20
|
+
* `@id` to be an IRI): a `file:` URI with the line in the fragment, e.g.
|
|
21
|
+
* `file:src/a.ts#L3`.
|
|
22
|
+
*/
|
|
23
|
+
function productId(f) {
|
|
24
|
+
return `file:${f.location.file}#L${f.location.line}`;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Build an OpenVEX 0.2.0 document from a scan result. One statement per distinct
|
|
28
|
+
* rule id, listing every affected `file:line` product. Output is deterministic
|
|
29
|
+
* (statements sorted by vulnerability name, products sorted and de-duplicated;
|
|
30
|
+
* the `@id` and `timestamp` derive from the result), so re-exporting the same
|
|
31
|
+
* scan yields byte-identical VEX.
|
|
32
|
+
*/
|
|
33
|
+
export function toOpenVex(result, opts = {}) {
|
|
34
|
+
// Group findings by rule id → one VEX statement per rule.
|
|
35
|
+
const byRule = new Map();
|
|
36
|
+
for (const f of result.findings) {
|
|
37
|
+
const list = byRule.get(f.ruleId);
|
|
38
|
+
if (list)
|
|
39
|
+
list.push(f);
|
|
40
|
+
else
|
|
41
|
+
byRule.set(f.ruleId, [f]);
|
|
42
|
+
}
|
|
43
|
+
const statements = [...byRule.entries()]
|
|
44
|
+
.sort((a, b) => (a[0] < b[0] ? -1 : a[0] > b[0] ? 1 : 0))
|
|
45
|
+
.map(([ruleId, findings]) => {
|
|
46
|
+
const first = findings[0];
|
|
47
|
+
// De-duplicate + sort the affected products (a rule can fire many times).
|
|
48
|
+
const products = [...new Set(findings.map(productId))].sort().map((id) => ({ "@id": id }));
|
|
49
|
+
// Surface a triage verdict (if any finding for this rule carries one). Findings
|
|
50
|
+
// of the same rule share a rule; the most-exposed verdict is the informative one.
|
|
51
|
+
const triaged = findings
|
|
52
|
+
.filter((f) => f.triage)
|
|
53
|
+
.sort((a, b) => (b.triage?.exposureScore ?? 0) - (a.triage?.exposureScore ?? 0))[0]?.triage;
|
|
54
|
+
const statement = {
|
|
55
|
+
vulnerability: {
|
|
56
|
+
name: `QK-${ruleId}`,
|
|
57
|
+
description: first.message,
|
|
58
|
+
},
|
|
59
|
+
products,
|
|
60
|
+
status: "affected",
|
|
61
|
+
action_statement: first.remediation ?? "Migrate to a NIST PQC standard (FIPS 203/204/205).",
|
|
62
|
+
};
|
|
63
|
+
if (triaged) {
|
|
64
|
+
statement.status_notes =
|
|
65
|
+
`qScan triage — exposure ${triaged.exposureScore}/100, priority ${triaged.priority}: ` +
|
|
66
|
+
triaged.rationale;
|
|
67
|
+
}
|
|
68
|
+
return statement;
|
|
69
|
+
});
|
|
70
|
+
// Deterministic doc id + timestamp so the same scan yields identical VEX. The
|
|
71
|
+
// triage `status_notes` are part of the identity: a triaged and an untriaged
|
|
72
|
+
// export of the same scan are DIFFERENT documents and must not share an @id.
|
|
73
|
+
const digest = createHash("sha256").update(`${result.root}|${result.toolVersion}`, "utf8");
|
|
74
|
+
for (const s of statements) {
|
|
75
|
+
digest.update(`\n${s.vulnerability.name}|${s.products.map((p) => p["@id"]).join(",")}|${s.status_notes ?? ""}`);
|
|
76
|
+
}
|
|
77
|
+
const id = `https://quantakrypto.com/vex/${digest.digest("hex").slice(0, 16)}`;
|
|
78
|
+
return {
|
|
79
|
+
"@context": "https://openvex.dev/ns/v0.2.0",
|
|
80
|
+
"@id": id,
|
|
81
|
+
author: opts.author ?? "qScan",
|
|
82
|
+
timestamp: result.finishedAt,
|
|
83
|
+
version: 1,
|
|
84
|
+
statements,
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=vex.js.map
|
package/dist/vex.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vex.js","s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B,MAAM,CAAC,MAAM,CACX,KAAK,CAAC,CAAC,aAAa,CAAC,IAAI,IAAI,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,YAAY,IAAI,EAAE,EAAE,CACjG,CAAC;IACJ,CAAC;IACD,MAAM,EAAE,GAAG,gCAAgC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC;IAE/E,OAAO;QACL,UAAU,EAAE,+BAA+B;QAC3C,KAAK,EAAE,EAAE;QACT,MAAM,EAAE,IAAI,CAAC,MAAM,IAAI,OAAO;QAC9B,SAAS,EAAE,MAAM,CAAC,UAAU;QAC5B,OAAO,EAAE,CAAC;QACV,UAAU;KACX,CAAC;AACJ,CAAC","sourcesContent":["/**\n * OpenVEX export — turn a {@link ScanResult} into an OpenVEX 0.2.0 document so\n * the quantum-readiness posture flows into the SAME supply-chain pipeline that\n * already ingests CVE-based VEX (Vulnerability Exploitability eXchange).\n *\n * Reference: OpenVEX spec (https://openvex.dev/, `@context` v0.2.0).\n *\n * Modeling choice (documented, honest): PQC findings have no CVE, so each qScan\n * rule becomes a synthetic vulnerability `QK-<ruleId>`. Every finding is reported\n * `status: \"affected\"` — the classical, Shor-breakable primitive IS present in\n * the product by construction — with the rule's remediation as the VEX\n * `action_statement`. A `--triage` exposure verdict, when present, is surfaced in\n * `status_notes` (score / priority / rationale). qScan never downgrades a finding\n * to `not_affected`: only the operator can attest a mitigation, so that judgment\n * is deliberately left to them (they can post-process this document).\n */\nimport { createHash } from \"node:crypto\";\n\nimport type { Finding, ScanResult } from \"./types.js\";\n\n/** A single OpenVEX statement: one synthetic vulnerability over its affected products. */\nexport interface OpenVexStatement {\n vulnerability: { name: string; description?: string };\n products: { \"@id\": string }[];\n status: \"not_affected\" | \"affected\" | \"fixed\" | \"under_investigation\";\n /** Recommended action for an `affected` product (the rule's remediation). */\n action_statement?: string;\n /** Free-form status detail — carries the `--triage` exposure verdict when present. */\n status_notes?: string;\n}\n\n/** An OpenVEX 0.2.0 document. */\nexport interface OpenVexDocument {\n \"@context\": \"https://openvex.dev/ns/v0.2.0\";\n \"@id\": string;\n author: string;\n timestamp: string;\n version: number;\n statements: OpenVexStatement[];\n}\n\n/** Options for {@link toOpenVex}. */\nexport interface OpenVexOptions {\n /** Document author (VEX issuer). Default: `\"qScan\"`. */\n author?: string;\n}\n\n/**\n * A stable product identifier for a finding as an IRI (OpenVEX requires product\n * `@id` to be an IRI): a `file:` URI with the line in the fragment, e.g.\n * `file:src/a.ts#L3`.\n */\nfunction productId(f: Finding): string {\n return `file:${f.location.file}#L${f.location.line}`;\n}\n\n/**\n * Build an OpenVEX 0.2.0 document from a scan result. One statement per distinct\n * rule id, listing every affected `file:line` product. Output is deterministic\n * (statements sorted by vulnerability name, products sorted and de-duplicated;\n * the `@id` and `timestamp` derive from the result), so re-exporting the same\n * scan yields byte-identical VEX.\n */\nexport function toOpenVex(result: ScanResult, opts: OpenVexOptions = {}): OpenVexDocument {\n // Group findings by rule id → one VEX statement per rule.\n const byRule = new Map<string, Finding[]>();\n for (const f of result.findings) {\n const list = byRule.get(f.ruleId);\n if (list) list.push(f);\n else byRule.set(f.ruleId, [f]);\n }\n\n const statements: OpenVexStatement[] = [...byRule.entries()]\n .sort((a, b) => (a[0] < b[0] ? -1 : a[0] > b[0] ? 1 : 0))\n .map(([ruleId, findings]) => {\n const first = findings[0] as Finding;\n // De-duplicate + sort the affected products (a rule can fire many times).\n const products = [...new Set(findings.map(productId))].sort().map((id) => ({ \"@id\": id }));\n\n // Surface a triage verdict (if any finding for this rule carries one). Findings\n // of the same rule share a rule; the most-exposed verdict is the informative one.\n const triaged = findings\n .filter((f) => f.triage)\n .sort((a, b) => (b.triage?.exposureScore ?? 0) - (a.triage?.exposureScore ?? 0))[0]?.triage;\n\n const statement: OpenVexStatement = {\n vulnerability: {\n name: `QK-${ruleId}`,\n description: first.message,\n },\n products,\n status: \"affected\",\n action_statement: first.remediation ?? \"Migrate to a NIST PQC standard (FIPS 203/204/205).\",\n };\n if (triaged) {\n statement.status_notes =\n `qScan triage — exposure ${triaged.exposureScore}/100, priority ${triaged.priority}: ` +\n triaged.rationale;\n }\n return statement;\n });\n\n // Deterministic doc id + timestamp so the same scan yields identical VEX. The\n // triage `status_notes` are part of the identity: a triaged and an untriaged\n // export of the same scan are DIFFERENT documents and must not share an @id.\n const digest = createHash(\"sha256\").update(`${result.root}|${result.toolVersion}`, \"utf8\");\n for (const s of statements) {\n digest.update(\n `\\n${s.vulnerability.name}|${s.products.map((p) => p[\"@id\"]).join(\",\")}|${s.status_notes ?? \"\"}`,\n );\n }\n const id = `https://quantakrypto.com/vex/${digest.digest(\"hex\").slice(0, 16)}`;\n\n return {\n \"@context\": \"https://openvex.dev/ns/v0.2.0\",\n \"@id\": id,\n author: opts.author ?? \"qScan\",\n timestamp: result.finishedAt,\n version: 1,\n statements,\n };\n}\n"]}
|
package/dist/walk.d.ts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
/** Directories ignored by default (can be disabled with noDefaultIgnores). */
|
|
2
|
-
export declare const DEFAULT_IGNORES: readonly string[];
|
|
3
1
|
/** Default maximum file size to read: 2 MiB. */
|
|
4
2
|
export declare const DEFAULT_MAX_FILE_SIZE: number;
|
|
5
3
|
/** Options accepted by {@link walkFiles}. */
|
|
6
|
-
|
|
4
|
+
interface WalkOptions {
|
|
7
5
|
/**
|
|
8
6
|
* Restrict to paths matching one of these include patterns (substring or
|
|
9
7
|
* relative-path-prefix match). When omitted/empty, all files pass.
|
|
@@ -27,6 +25,12 @@ export declare function toPosix(p: string): string;
|
|
|
27
25
|
export declare function matchesAny(rel: string, patterns: readonly string[]): boolean;
|
|
28
26
|
/** True if the file's extension marks it as binary / non-text. */
|
|
29
27
|
export declare function isBinaryPath(rel: string): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* True if the path is a binary cryptographic key container we scan byte-preserving.
|
|
30
|
+
* Uses a suffix match (not `extname`) so it agrees with the detectors' `hasExtension`
|
|
31
|
+
* even for a bare dotfile literally named e.g. `.gpg` (where `extname` returns "").
|
|
32
|
+
*/
|
|
33
|
+
export declare function isKeystorePath(rel: string): boolean;
|
|
30
34
|
/** True if the path looks like generated / bundled output (by name). */
|
|
31
35
|
export declare function isGeneratedPath(rel: string): boolean;
|
|
32
36
|
/**
|
|
@@ -41,4 +45,5 @@ export declare function looksMinified(content: string): boolean;
|
|
|
41
45
|
* basename (subject to the size / binary filters).
|
|
42
46
|
*/
|
|
43
47
|
export declare function walkFiles(root: string, options?: WalkOptions): AsyncGenerator<string>;
|
|
48
|
+
export {};
|
|
44
49
|
//# sourceMappingURL=walk.d.ts.map
|
package/dist/walk.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"walk.d.ts","sourceRoot":"","sources":["../src/walk.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"walk.d.ts","sourceRoot":"","sources":["../src/walk.ts"],"names":[],"mappings":"AA0BA,gDAAgD;AAChD,eAAO,MAAM,qBAAqB,QAAkB,CAAC;AAyErD,6CAA6C;AAC7C,UAAU,WAAW;IACnB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,wEAAwE;IACxE,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,kDAAkD;IAClD,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,wDAAwD;IACxD,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,0DAA0D;AAC1D,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAEzC;AA6DD;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAc5E;AAgBD,kEAAkE;AAClE,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAMjD;AAsBD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAInD;AASD,wEAAwE;AACxE,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAEpD;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAmBtD;AAED;;;;GAIG;AACH,wBAAuB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,WAAgB,GAAG,cAAc,CAAC,MAAM,CAAC,CAsBhG"}
|
package/dist/walk.js
CHANGED
|
@@ -8,7 +8,7 @@ import { readdir, stat } from "node:fs/promises";
|
|
|
8
8
|
import * as path from "node:path";
|
|
9
9
|
import { isManifestFile } from "./dependencies.js";
|
|
10
10
|
/** Directories ignored by default (can be disabled with noDefaultIgnores). */
|
|
11
|
-
|
|
11
|
+
const DEFAULT_IGNORES = [
|
|
12
12
|
"node_modules",
|
|
13
13
|
".git",
|
|
14
14
|
"dist",
|
|
@@ -206,6 +206,37 @@ export function isBinaryPath(rel) {
|
|
|
206
206
|
const ext = path.posix.extname(lower);
|
|
207
207
|
return BINARY_EXTENSIONS.has(ext);
|
|
208
208
|
}
|
|
209
|
+
/**
|
|
210
|
+
* Binary cryptographic key containers we DO want to scan — Java/PKCS#12 keystores
|
|
211
|
+
* and binary OpenPGP keyrings/messages. Unlike the images/archives above these are
|
|
212
|
+
* read byte-preserving (latin1) and exempted from the minified skip, so the
|
|
213
|
+
* keystore + openpgp detectors can identify them by magic number / packet tag.
|
|
214
|
+
* Kept separate from {@link BINARY_EXTENSIONS} so those detectors can opt in.
|
|
215
|
+
*/
|
|
216
|
+
const KEYSTORE_EXTENSIONS = new Set([
|
|
217
|
+
".jks",
|
|
218
|
+
".keystore",
|
|
219
|
+
".jceks",
|
|
220
|
+
".bks",
|
|
221
|
+
".p12",
|
|
222
|
+
".pfx",
|
|
223
|
+
// Binary OpenPGP keyrings / messages (armored .asc is text; handled elsewhere).
|
|
224
|
+
".gpg",
|
|
225
|
+
".pgp",
|
|
226
|
+
".kbx",
|
|
227
|
+
]);
|
|
228
|
+
/**
|
|
229
|
+
* True if the path is a binary cryptographic key container we scan byte-preserving.
|
|
230
|
+
* Uses a suffix match (not `extname`) so it agrees with the detectors' `hasExtension`
|
|
231
|
+
* even for a bare dotfile literally named e.g. `.gpg` (where `extname` returns "").
|
|
232
|
+
*/
|
|
233
|
+
export function isKeystorePath(rel) {
|
|
234
|
+
const lower = rel.toLowerCase();
|
|
235
|
+
for (const ext of KEYSTORE_EXTENSIONS)
|
|
236
|
+
if (lower.endsWith(ext))
|
|
237
|
+
return true;
|
|
238
|
+
return false;
|
|
239
|
+
}
|
|
209
240
|
/**
|
|
210
241
|
* Compound / pattern extensions that mark generated or bundled output we skip
|
|
211
242
|
* by default (beyond `.min.js` / `.map`, which {@link isBinaryPath} handles).
|