@quantakrypto/core 0.5.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/crypto-agility.d.ts +158 -0
- package/dist/crypto-agility.d.ts.map +1 -0
- package/dist/crypto-agility.js +285 -0
- package/dist/crypto-agility.js.map +1 -0
- package/dist/dependencies.d.ts.map +1 -1
- package/dist/dependencies.js +180 -18
- package/dist/dependencies.js.map +1 -1
- package/dist/detectors/source.d.ts.map +1 -1
- package/dist/detectors/source.js +52 -0
- package/dist/detectors/source.js.map +1 -1
- package/dist/hndl.d.ts +241 -0
- package/dist/hndl.d.ts.map +1 -0
- package/dist/hndl.js +752 -0
- package/dist/hndl.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/mandates.d.ts +138 -0
- package/dist/mandates.d.ts.map +1 -0
- package/dist/mandates.js +228 -0
- package/dist/mandates.js.map +1 -0
- package/dist/parallel.d.ts.map +1 -1
- package/dist/parallel.js +22 -23
- package/dist/parallel.js.map +1 -1
- package/dist/report.d.ts +8 -0
- package/dist/report.d.ts.map +1 -1
- package/dist/report.js +75 -19
- package/dist/report.js.map +1 -1
- package/dist/types.d.ts +1 -1
- 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/walk.d.ts +31 -1
- package/dist/walk.d.ts.map +1 -1
- package/dist/walk.js +30 -9
- package/dist/walk.js.map +1 -1
- package/package.json +1 -1
- package/src/crypto-agility.ts +407 -0
- package/src/dependencies.ts +182 -16
- package/src/detectors/source.ts +62 -0
- package/src/hndl.ts +1012 -0
- package/src/index.ts +71 -0
- package/src/mandates.ts +365 -0
- package/src/parallel.ts +21 -20
- package/src/report.ts +84 -19
- package/src/types.ts +9 -1
- package/src/version.ts +1 -1
- package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4B,uCAAuC;QAC9F,8BAA8B,+BAA+B,6CAA6C;QAC1G,EAAE;QACF,WAAW;QACX,qBAAqB,8BAA8B,oDAAoD;QACvG,EAAE;QACF,SAAS;KACV,CAAC;IAEF,IAAI,KAAK,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;QACrB,KAAK,CAAC,IAAI,CACR,gFAAgF,EAChF,qDAAqD,EACrD,uBAAuB,EACvB,wBAAwB,EACxB,+BAA+B,EAC/B,wBAAwB,EACxB,gCAAgC,EAChC,YAAY,EACZ,kBAAkB,CACnB,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,MAAM,IAAI,GAAG,CAAC,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;QACtC,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;YACvB,MAAM,KAAK,GAAG,CAAC,GAAI,KAAK,CAAC,GAAG,CAAC,GAAG,CAAiB,CAAC,CAAC,IAAI,EAAE,CAAC;YAC1D,MAAM,IAAI,GAAG,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,KAAK,CAAC;YAC7C,KAAK,CAAC,IAAI,CACR,2CAA2C,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAC7D,YAAY,OAAO,CAAC,GAAG,CAAC,EAAE,EAC1B,aAAa,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,GAAG,EAAE,EACpD,yFAAyF,EACzF,sEAAsE,EACtE,+EAA+E,EAC/E,YAAY,EACZ,YAAY,IAAI,GAAG,CACpB,CAAC;QACJ,CAAC;IACH,CAAC;IAED,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;AACjC,CAAC","sourcesContent":["/**\n * HNDL (\"harvest now, decrypt later\") data-risk quantifier - roadmap initiative 2.\n *\n * A crypto finding on its own answers \"what is broken\"; it does not answer \"how\n * much does it matter\". This module joins the crypto finding to the DATA it\n * protects and makes Mosca's inequality concrete, so a migration backlog can be\n * ranked by real exposure instead of by finding counts.\n *\n * Exposure per finding = crypto-vulnerability (V) x data-sensitivity (S) x\n * Mosca-factor (M), each normalised to 0..1, reported as an integer 0..100:\n *\n * - V: how breakable + how confidently detected the crypto is, discounted hard\n * when the finding is not HNDL-exposed (a signature cannot be broken\n * retroactively to reveal harvested ciphertext).\n * - S: the declared sensitivity class of the data the finding sits next to.\n * - M: the fraction of the data's protection horizon (retention / secrecy\n * lifetime + migration time) that extends BEYOND the quantum-threat\n * horizon. Mosca: concern exists when X + Y > Z.\n *\n * The data map is a declared `hndl.yml` (assets, classification, retention +\n * secrecy lifetime, path/scope bindings). Parsing is hand-rolled and\n * zero-dependency, consistent with the rest of core (ADR-0001): no YAML library\n * is pulled in. The full model is documented in docs/HNDL.md so the score is\n * contestable rather than magic.\n */\nimport { readFile } from \"node:fs/promises\";\nimport * as path from \"node:path\";\n\nimport type { Confidence, Finding, Severity } from \"./types.js\";\nimport { fingerprintFinding } from \"./baseline.js\";\nimport { defaultRegistry, detectorScope } from \"./registry.js\";\n\n/* -------------------------------------------------------------------------- */\n/* Model constants (exported so the score is contestable, not magic) */\n/* -------------------------------------------------------------------------- */\n\n/** Version of the exposure model. Bump on any weight / formula change. */\nexport const HNDL_MODEL_VERSION = \"1\" as const;\n\n/** Canonical `hndl.yml` file name discovered at a scan root. */\nexport const HNDL_FILENAME = \"hndl.yml\";\n\n/** Data sensitivity classes, least → most sensitive. Vocabulary aligned with the\n * readiness DPE (data-protection) practice. */\nexport type DataClassification = \"public\" | \"internal\" | \"confidential\" | \"regulated\";\n\nconst CLASSIFICATIONS: readonly DataClassification[] = [\n \"public\",\n \"internal\",\n \"confidential\",\n \"regulated\",\n];\n\n/**\n * Logical scope a finding belongs to, used for optional scope-bound assets. The\n * two detector scopes (\"source\" / \"config\") plus \"dependency\" (manifest\n * findings, which are not produced by a Detector).\n */\nexport type HndlScope = \"source\" | \"config\" | \"dependency\";\n\nconst HNDL_SCOPES: readonly HndlScope[] = [\"source\", \"config\", \"dependency\"];\n\n/** Crypto-vulnerability weight (V) contributed by a finding's severity. */\nexport const SEVERITY_VULNERABILITY: Record<Severity, number> = {\n critical: 1.0,\n high: 0.8,\n medium: 0.5,\n low: 0.25,\n info: 0.1,\n};\n\n/** Crypto-vulnerability weight (V) scaled by detector confidence. */\nexport const CONFIDENCE_WEIGHT: Record<Confidence, number> = {\n high: 1.0,\n medium: 0.85,\n low: 0.6,\n};\n\n/** Data-sensitivity weight (S) per classification. */\nexport const CLASSIFICATION_SENSITIVITY: Record<DataClassification, number> = {\n public: 0.1,\n internal: 0.4,\n confidential: 0.7,\n regulated: 1.0,\n};\n\n/**\n * Discount applied to V when a finding is NOT harvest-now-decrypt-later exposed\n * (e.g. a pure signature). A forged signature is a future-integrity problem, not\n * a retroactive-confidentiality one, so it barely moves the HNDL needle.\n */\nexport const NON_HNDL_DISCOUNT = 0.15;\n\n/**\n * Default years until a cryptographically-relevant quantum computer is assumed\n * to exist (Z in Mosca's inequality). 15 years is a defensible mid-point of the\n * commonly-cited Mosca / NIST window; override per-org in `hndl.yml`.\n */\nexport const DEFAULT_QUANTUM_THREAT_YEARS = 15;\n\n/**\n * Default years to complete the org's PQC migration (Y in Mosca's inequality).\n * Override per-org in `hndl.yml`.\n */\nexport const DEFAULT_MIGRATION_HORIZON_YEARS = 5;\n\n/** Classification assumed for findings that bind to no declared asset. */\nexport const DEFAULT_UNBOUND_CLASSIFICATION: DataClassification = \"internal\";\n\n/* -------------------------------------------------------------------------- */\n/* Declared data map (hndl.yml) */\n/* -------------------------------------------------------------------------- */\n\n/** A single declared data asset from `hndl.yml`. */\nexport interface HndlDataAsset {\n /** Stable id (referenced by finding exposures + the website's `data_asset.key`). */\n key: string;\n /** Human name. */\n name: string;\n classification: DataClassification;\n /** How long the data is retained, in years. */\n retentionYears: number;\n /** How long the data must remain confidential once captured, in years. */\n secrecyLifetimeYears: number;\n /** Path globs (POSIX, relative to scan root) whose findings bind to this asset. */\n paths: string[];\n /** Optional detector-scope filter: only findings of these scopes bind here. */\n scopes?: HndlScope[];\n}\n\n/** The Mosca horizons that gate the exposure model. */\nexport interface HndlHorizon {\n /** Z: years until a cryptographically-relevant quantum computer is assumed. */\n quantumThreatYears: number;\n /** Y: years to complete the org's PQC migration. */\n migrationHorizonYears: number;\n}\n\n/** Defaults applied to findings that bind to no declared asset. */\nexport interface HndlDefaults {\n classification: DataClassification;\n}\n\n/** A fully-parsed, validated `hndl.yml`. */\nexport interface HndlMap {\n version: number;\n horizon: HndlHorizon;\n defaults: HndlDefaults;\n assets: HndlDataAsset[];\n}\n\n/** Thrown when `hndl.yml` is malformed (structure or a bad known value). */\nexport class HndlError extends Error {\n override readonly name = \"HndlError\";\n /** The `hndl.yml` path the error relates to, when known. */\n readonly path: string | undefined;\n constructor(message: string, hndlPath?: string) {\n super(message);\n this.path = hndlPath;\n }\n}\n\n/* -------------------------------------------------------------------------- */\n/* Exposure results */\n/* -------------------------------------------------------------------------- */\n\n/** Full, auditable breakdown of one finding's exposure score. */\nexport interface ExposureRationale {\n /** V - crypto-vulnerability factor (0..1). */\n vulnerability: number;\n /** S - data-sensitivity factor (0..1). */\n sensitivity: number;\n /** M - Mosca factor (0..1): fraction of the protection horizon past the threat. */\n mosca: number;\n classification: DataClassification;\n retentionYears: number;\n secrecyLifetimeYears: number;\n /** X = max(retention, secrecy lifetime): the data's protection requirement. */\n secrecyHorizonYears: number;\n /** Z - quantum-threat horizon (years). */\n quantumThreatYears: number;\n /** Y - migration horizon (years). */\n migrationHorizonYears: number;\n /** (X + Y) - Z; positive means Mosca's inequality is breached. */\n moscaMarginYears: number;\n /** True when (X + Y) > Z (data captured today is exposed while still secret). */\n moscaBreach: boolean;\n /** Whether the finding is HNDL-exposed (drives {@link NON_HNDL_DISCOUNT}). */\n hndl: boolean;\n severity: Severity;\n confidence: Confidence;\n scope: HndlScope;\n /** True when the finding matched a declared asset (false = defaults applied). */\n bound: boolean;\n}\n\n/** A finding's computed exposure, keyed by fingerprint for website ingest. */\nexport interface FindingExposure {\n /** Finding identity: `finding.fingerprint` when present, else the canonical\n * `fingerprintFinding()` hash. This is the join key the website stores. */\n fingerprint: string;\n ruleId: string;\n file: string;\n /** The bound data asset's stable key, or null when unbound. */\n dataAsset: string | null;\n /** 0..100 exposure score. */\n exposureScore: number;\n rationale: ExposureRationale;\n}\n\n/** Per-asset rollup for the repo summary. */\nexport interface AssetExposure {\n key: string;\n name: string;\n classification: DataClassification;\n retentionYears: number;\n secrecyLifetimeYears: number;\n /** Number of findings bound to this asset. */\n findings: number;\n /** Highest exposure among this asset's findings. */\n maxExposure: number;\n /** True when the data's secrecy horizon outlives the quantum threat (X > Z). */\n outlivesThreat: boolean;\n}\n\n/** Repo-level HNDL summary. */\nexport interface HndlSummary {\n findingsScored: number;\n assetsDeclared: number;\n /** Declared assets that bound at least one finding. */\n assetsWithFindings: number;\n /** Declared assets whose secrecy horizon outlives the quantum threat (X > Z). */\n assetsOutlivingHorizon: number;\n /** Findings whose Mosca inequality is breached ((X + Y) > Z). */\n moscaBreaches: number;\n maxExposure: number;\n /** Rounded mean exposure across scored findings. */\n meanExposure: number;\n /** The worst findings, most-exposed first (capped). */\n topExposures: FindingExposure[];\n}\n\n/** The complete HNDL analysis of a scan. */\nexport interface HndlReport {\n modelVersion: string;\n horizon: HndlHorizon;\n /** Per-finding exposures, in input order. */\n exposures: FindingExposure[];\n /** Fingerprint → exposure, for reporters to annotate each finding. */\n byFingerprint: Map<string, FindingExposure>;\n /** Per-asset rollups. */\n assets: AssetExposure[];\n summary: HndlSummary;\n}\n\n/** How many findings the summary's `topExposures` lists. */\nconst TOP_EXPOSURES = 5;\n\n/* -------------------------------------------------------------------------- */\n/* Fingerprint + scope resolution */\n/* -------------------------------------------------------------------------- */\n\n/**\n * Identity key for a finding's exposure. Prefers a `finding.fingerprint` field\n * when a build supplies one (another workstream is adding it to core's Finding\n * type + reporters); falls back to the canonical `fingerprintFinding()` hash\n * (`sha256(ruleId|file|normalizedSnippet)`) otherwise. INTEGRATION POINT: once\n * `Finding.fingerprint` lands, this transparently switches to it - no caller\n * change needed.\n */\nexport function findingFingerprint(f: Finding): string {\n const declared = (f as { fingerprint?: unknown }).fingerprint;\n if (typeof declared === \"string\" && declared.length > 0) return declared;\n return fingerprintFinding(f);\n}\n\n/** ruleId → detector scope, built once from the default registry. */\nlet scopeIndex: Map<string, HndlScope> | undefined;\n\nfunction ruleScopeIndex(): Map<string, HndlScope> {\n if (scopeIndex) return scopeIndex;\n const index = new Map<string, HndlScope>();\n for (const det of defaultRegistry.all()) {\n const scope = detectorScope(det) as HndlScope;\n for (const rule of det.rules ?? []) index.set(rule.id, scope);\n }\n scopeIndex = index;\n return index;\n}\n\n/**\n * The scope a finding belongs to. Dependency findings (from the manifest\n * scanner, category \"dependency\") are \"dependency\"; everything else is looked up\n * by ruleId in the detector registry, defaulting to \"source\".\n */\nexport function findingScope(f: Finding): HndlScope {\n if (f.category === \"dependency\") return \"dependency\";\n return ruleScopeIndex().get(f.ruleId) ?? \"source\";\n}\n\n/* -------------------------------------------------------------------------- */\n/* Glob matching (hand-rolled, zero-dependency) */\n/* -------------------------------------------------------------------------- */\n\n/**\n * Match a POSIX path against a glob supporting `**` (any path segments incl.\n * `/`), `*` (any run of non-`/` chars), and `?` (a single non-`/` char). A\n * trailing `/**` also matches the directory itself. Everything else is literal.\n */\nexport function globMatch(glob: string, filePath: string): boolean {\n return globToRegExp(glob).test(filePath);\n}\n\nconst globCache = new Map<string, RegExp>();\n\nfunction globToRegExp(glob: string): RegExp {\n const cached = globCache.get(glob);\n if (cached) return cached;\n let re = \"^\";\n for (let i = 0; i < glob.length; i++) {\n const ch = glob[i] as string;\n if (ch === \"*\") {\n if (glob[i + 1] === \"*\") {\n // `**` - any number of characters including path separators. Consume a\n // following `/` so `a/**/b` matches `a/b` (zero segments) too.\n i++;\n if (glob[i + 1] === \"/\") i++;\n re += \".*\";\n } else {\n re += \"[^/]*\";\n }\n } else if (ch === \"?\") {\n re += \"[^/]\";\n } else if (\"\\\\^$.|+()[]{}\".includes(ch)) {\n re += `\\\\${ch}`;\n } else {\n re += ch;\n }\n }\n re += \"$\";\n const compiled = new RegExp(re);\n globCache.set(glob, compiled);\n return compiled;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Exposure math */\n/* -------------------------------------------------------------------------- */\n\nfunction clamp01(x: number): number {\n return x < 0 ? 0 : x > 1 ? 1 : x;\n}\n\n/** V - crypto-vulnerability factor for a finding (0..1). */\nexport function vulnerabilityFactor(f: Finding): number {\n const base = SEVERITY_VULNERABILITY[f.severity] * CONFIDENCE_WEIGHT[f.confidence];\n return clamp01(base * (f.hndl ? 1 : NON_HNDL_DISCOUNT));\n}\n\n/**\n * M - the Mosca factor (0..1). `X` is the data's protection horizon\n * (max of retention + secrecy lifetime), `Y` the migration horizon, `Z` the\n * quantum-threat horizon. M is the fraction of `X + Y` that falls after `Z`:\n * 0 when the threat is beyond the whole horizon, 1 when the threat is already\n * here. Mosca's inequality (X + Y > Z) is exactly `M > 0`.\n */\nexport function moscaFactor(secrecyHorizonYears: number, horizon: HndlHorizon): number {\n const span = secrecyHorizonYears + horizon.migrationHorizonYears;\n if (span <= 0) return 0;\n const margin = span - horizon.quantumThreatYears;\n return clamp01(margin / span);\n}\n\ninterface ScoreInput {\n vulnerability: number;\n classification: DataClassification;\n retentionYears: number;\n secrecyLifetimeYears: number;\n bound: boolean;\n}\n\nfunction scoreFinding(f: Finding, input: ScoreInput, horizon: HndlHorizon): FindingExposure {\n const sensitivity = CLASSIFICATION_SENSITIVITY[input.classification];\n const secrecyHorizonYears = Math.max(input.retentionYears, input.secrecyLifetimeYears);\n const mosca = moscaFactor(secrecyHorizonYears, horizon);\n const exposureScore = Math.round(100 * clamp01(input.vulnerability * sensitivity * mosca));\n const moscaMarginYears =\n secrecyHorizonYears + horizon.migrationHorizonYears - horizon.quantumThreatYears;\n const rationale: ExposureRationale = {\n vulnerability: round3(input.vulnerability),\n sensitivity: round3(sensitivity),\n mosca: round3(mosca),\n classification: input.classification,\n retentionYears: input.retentionYears,\n secrecyLifetimeYears: input.secrecyLifetimeYears,\n secrecyHorizonYears,\n quantumThreatYears: horizon.quantumThreatYears,\n migrationHorizonYears: horizon.migrationHorizonYears,\n moscaMarginYears,\n moscaBreach: moscaMarginYears > 0,\n hndl: f.hndl,\n severity: f.severity,\n confidence: f.confidence,\n scope: findingScope(f),\n bound: input.bound,\n };\n return {\n fingerprint: findingFingerprint(f),\n ruleId: f.ruleId,\n file: f.location.file,\n dataAsset: null,\n exposureScore,\n rationale,\n };\n}\n\nfunction round3(x: number): number {\n return Math.round(x * 1000) / 1000;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Binding + top-level compute */\n/* -------------------------------------------------------------------------- */\n\n/** Assets whose path globs + optional scope filter match a finding. */\nfunction matchingAssets(f: Finding, map: HndlMap, scope: HndlScope): HndlDataAsset[] {\n const out: HndlDataAsset[] = [];\n for (const asset of map.assets) {\n if (asset.scopes && !asset.scopes.includes(scope)) continue;\n if (asset.paths.some((g) => globMatch(g, f.location.file))) out.push(asset);\n }\n return out;\n}\n\n/**\n * Compute HNDL exposure for a set of findings against a declared data map.\n *\n * A finding binds to every declared asset whose path glob (and optional scope\n * filter) matches its file; when several match, the WORST-CASE (highest)\n * exposure is chosen and its asset recorded, since risk ranking should not be\n * diluted by an incidental low-sensitivity overlap. A finding that binds to no\n * asset is still scored, using the map's `defaults.classification` and the\n * global horizons, and flagged `bound: false` so it is visibly a fallback. Its\n * secrecy lifetime is assumed to be the quantum-threat horizon Z (the\n * minimum-concern horizon; see {@link scoreFinding} call below and docs/HNDL.md\n * §4), so the fallback classification produces a real, rankable exposure rather\n * than a dead 0.\n *\n * Purely additive: it never mutates findings and never affects a scan's exit\n * code.\n */\nexport function computeHndl(findings: readonly Finding[], map: HndlMap): HndlReport {\n const exposures: FindingExposure[] = [];\n const byFingerprint = new Map<string, FindingExposure>();\n const assetFindings = new Map<string, number>();\n const assetMax = new Map<string, number>();\n\n for (const f of findings) {\n const vulnerability = vulnerabilityFactor(f);\n const scope = findingScope(f);\n const candidates = matchingAssets(f, map, scope);\n\n let best: FindingExposure;\n if (candidates.length === 0) {\n best = scoreFinding(\n f,\n {\n vulnerability,\n classification: map.defaults.classification,\n // Unbound: the data's lifetime is unknown, so we cannot read X off a\n // declared asset. Assuming X = 0 would drive M (hence the score) to a\n // dead 0 for EVERY unbound finding under any sane horizon, making the\n // documented `defaults.classification` fallback unrankable. Instead we\n // assume the MINIMUM-CONCERN horizon: data captured today must stay\n // confidential at least until the quantum threat arrives (X = Z). That\n // yields M = Y / (Y + Z) - a small but non-zero, rankable exposure that\n // never exceeds a declared long-lived asset's and self-adjusts to any\n // per-org horizon override. Retention stays 0 (genuinely unknown); the\n // secrecy lifetime carries the assumption. See docs/HNDL.md §4.\n retentionYears: 0,\n secrecyLifetimeYears: map.horizon.quantumThreatYears,\n bound: false,\n },\n map.horizon,\n );\n } else {\n let bestAsset: HndlDataAsset | undefined;\n best = undefined as unknown as FindingExposure;\n for (const asset of candidates) {\n const scored = scoreFinding(\n f,\n {\n vulnerability,\n classification: asset.classification,\n retentionYears: asset.retentionYears,\n secrecyLifetimeYears: asset.secrecyLifetimeYears,\n bound: true,\n },\n map.horizon,\n );\n if (!bestAsset || scored.exposureScore > best.exposureScore) {\n best = scored;\n bestAsset = asset;\n }\n }\n best.dataAsset = bestAsset!.key;\n assetFindings.set(bestAsset!.key, (assetFindings.get(bestAsset!.key) ?? 0) + 1);\n assetMax.set(bestAsset!.key, Math.max(assetMax.get(bestAsset!.key) ?? 0, best.exposureScore));\n }\n\n exposures.push(best);\n byFingerprint.set(best.fingerprint, best);\n }\n\n const assets: AssetExposure[] = map.assets.map((a) => ({\n key: a.key,\n name: a.name,\n classification: a.classification,\n retentionYears: a.retentionYears,\n secrecyLifetimeYears: a.secrecyLifetimeYears,\n findings: assetFindings.get(a.key) ?? 0,\n maxExposure: assetMax.get(a.key) ?? 0,\n outlivesThreat:\n Math.max(a.retentionYears, a.secrecyLifetimeYears) > map.horizon.quantumThreatYears,\n }));\n\n const scores = exposures.map((e) => e.exposureScore);\n const maxExposure = scores.reduce((m, s) => Math.max(m, s), 0);\n const meanExposure =\n scores.length > 0 ? Math.round(scores.reduce((a, b) => a + b, 0) / scores.length) : 0;\n const topExposures = [...exposures]\n .sort((a, b) => b.exposureScore - a.exposureScore || a.fingerprint.localeCompare(b.fingerprint))\n .slice(0, TOP_EXPOSURES);\n\n const summary: HndlSummary = {\n findingsScored: exposures.length,\n assetsDeclared: map.assets.length,\n assetsWithFindings: assets.filter((a) => a.findings > 0).length,\n assetsOutlivingHorizon: assets.filter((a) => a.outlivesThreat).length,\n moscaBreaches: exposures.filter((e) => e.rationale.moscaBreach).length,\n maxExposure,\n meanExposure,\n topExposures,\n };\n\n return {\n modelVersion: HNDL_MODEL_VERSION,\n horizon: map.horizon,\n exposures,\n byFingerprint,\n assets,\n summary,\n };\n}\n\n/* -------------------------------------------------------------------------- */\n/* hndl.yml parsing (hand-rolled YAML subset) */\n/* -------------------------------------------------------------------------- */\n\ninterface YamlLine {\n indent: number;\n content: string;\n /** 1-based source line number, for error messages. */\n n: number;\n}\n\n/** Strip an inline `# comment` that begins after whitespace, outside quotes. */\nfunction stripInlineComment(text: string): string {\n let quote: string | undefined;\n for (let i = 0; i < text.length; i++) {\n const ch = text[i];\n if (quote) {\n if (ch === quote) quote = undefined;\n continue;\n }\n if (ch === '\"' || ch === \"'\") {\n quote = ch;\n continue;\n }\n if (ch === \"#\" && (i === 0 || /\\s/.test(text[i - 1] as string))) {\n return text.slice(0, i);\n }\n }\n return text;\n}\n\n/** Tokenise text into non-blank, non-comment lines with their indent depth. */\nfunction tokenizeYaml(text: string, file?: string): YamlLine[] {\n const lines: YamlLine[] = [];\n const raw = text.split(/\\r?\\n/);\n for (let i = 0; i < raw.length; i++) {\n const line = raw[i] as string;\n if (line.includes(\"\\t\")) {\n throw new HndlError(`tabs are not allowed for indentation (line ${i + 1})`, file);\n }\n const stripped = stripInlineComment(line).replace(/\\s+$/, \"\");\n if (stripped.trim() === \"\") continue;\n const indent = stripped.length - stripped.trimStart().length;\n lines.push({ indent, content: stripped.trimStart(), n: i + 1 });\n }\n return lines;\n}\n\n/** True when `content` opens a `key:` mapping entry (colon outside quotes). */\nfunction isKeyLine(content: string): boolean {\n return /^[A-Za-z0-9_.-]+\\s*:(\\s|$)/.test(content);\n}\n\nfunction splitKey(content: string, file: string, n: number): { key: string; value: string } {\n const idx = content.indexOf(\":\");\n if (idx < 0) throw new HndlError(`expected \"key: value\" (line ${n})`, file);\n return { key: content.slice(0, idx).trim(), value: content.slice(idx + 1).trim() };\n}\n\n/** Coerce a scalar token: quoted string, boolean, number, or bare string. */\nfunction parseScalar(token: string): string | number | boolean {\n if (token.length >= 2) {\n const q = token[0];\n if ((q === '\"' || q === \"'\") && token[token.length - 1] === q) {\n return token.slice(1, -1);\n }\n }\n if (token === \"true\") return true;\n if (token === \"false\") return false;\n if (/^-?\\d+(\\.\\d+)?$/.test(token)) return Number(token);\n return token;\n}\n\n/**\n * Parse a mapping/sequence VALUE token: either an inline-flow list\n * (`[a, \"b\", c]`, `[]`) or a plain scalar. Only flat flow lists of scalars are\n * supported - enough for `paths: [...]` / `scopes: [...]` without a full YAML\n * flow grammar.\n */\nfunction parseValueToken(token: string, file: string, n: number): YamlValue {\n if (token.startsWith(\"[\")) {\n if (!token.endsWith(\"]\")) {\n throw new HndlError(`unterminated inline list (line ${n})`, file);\n }\n return parseFlowList(token.slice(1, -1), file, n);\n }\n return parseScalar(token);\n}\n\n/** Split a flow-list body on top-level commas (quote-aware) → scalar elements. */\nfunction parseFlowList(body: string, file: string, n: number): YamlValue[] {\n const out: YamlValue[] = [];\n let cur = \"\";\n let quote: string | undefined;\n for (let i = 0; i < body.length; i++) {\n const ch = body[i] as string;\n if (quote) {\n cur += ch;\n if (ch === quote) quote = undefined;\n continue;\n }\n if (ch === '\"' || ch === \"'\") {\n quote = ch;\n cur += ch;\n continue;\n }\n if (ch === \",\") {\n out.push(cur.trim());\n cur = \"\";\n continue;\n }\n cur += ch;\n }\n if (quote) throw new HndlError(`unterminated string in inline list (line ${n})`, file);\n const last = cur.trim();\n // A trailing empty segment only when the list itself is empty (`[]`).\n if (last !== \"\" || out.length > 0) out.push(last);\n return out.filter((t) => t !== \"\").map((t) => parseScalar(t as string));\n}\n\ntype YamlValue = string | number | boolean | null | YamlValue[] | { [k: string]: YamlValue };\n\n/** Recursive-descent parse of the tokenised lines into a generic value. */\nfunction parseYaml(text: string, file: string): YamlValue {\n const lines = tokenizeYaml(text, file);\n if (lines.length === 0) return {};\n\n function parseNode(i: number, indent: number): [YamlValue, number] {\n const first = lines[i] as YamlLine;\n if (first.content === \"-\" || first.content.startsWith(\"- \")) {\n return parseSeq(i, indent);\n }\n return parseMap(i, indent);\n }\n\n function parseSeq(start: number, indent: number): [YamlValue[], number] {\n const arr: YamlValue[] = [];\n let i = start;\n while (\n i < lines.length &&\n (lines[i] as YamlLine).indent === indent &&\n ((lines[i] as YamlLine).content === \"-\" || (lines[i] as YamlLine).content.startsWith(\"- \"))\n ) {\n const line = lines[i] as YamlLine;\n const rest = line.content === \"-\" ? \"\" : line.content.slice(2).trim();\n const itemIndent = indent + 2;\n if (rest === \"\") {\n if (i + 1 < lines.length && (lines[i + 1] as YamlLine).indent > indent) {\n const [val, next] = parseNode(i + 1, (lines[i + 1] as YamlLine).indent);\n arr.push(val);\n i = next;\n } else {\n arr.push(null);\n i++;\n }\n } else if (isKeyLine(rest)) {\n // Map item introduced by the dash: rewrite this line as its first key at\n // the deeper indent, then let parseMap consume it + aligned siblings.\n lines[i] = { indent: itemIndent, content: rest, n: line.n };\n const [val, next] = parseMap(i, itemIndent);\n arr.push(val);\n i = next;\n } else {\n arr.push(parseValueToken(rest, file, line.n));\n i++;\n }\n }\n return [arr, i];\n }\n\n function parseMap(start: number, indent: number): [{ [k: string]: YamlValue }, number] {\n const obj: { [k: string]: YamlValue } = {};\n let i = start;\n while (\n i < lines.length &&\n (lines[i] as YamlLine).indent === indent &&\n !(lines[i] as YamlLine).content.startsWith(\"- \") &&\n (lines[i] as YamlLine).content !== \"-\"\n ) {\n const line = lines[i] as YamlLine;\n const { key, value } = splitKey(line.content, file, line.n);\n if (value !== \"\") {\n obj[key] = parseValueToken(value, file, line.n);\n i++;\n } else if (i + 1 < lines.length && (lines[i + 1] as YamlLine).indent > indent) {\n const [val, next] = parseNode(i + 1, (lines[i + 1] as YamlLine).indent);\n obj[key] = val;\n i = next;\n } else {\n obj[key] = null;\n i++;\n }\n }\n return [obj, i];\n }\n\n const [value] = parseNode(0, (lines[0] as YamlLine).indent);\n return value;\n}\n\n/* -------------------------------------------------------------------------- */\n/* hndl.yml validation → HndlMap */\n/* -------------------------------------------------------------------------- */\n\nfunction isObject(v: YamlValue): v is { [k: string]: YamlValue } {\n return typeof v === \"object\" && v !== null && !Array.isArray(v);\n}\n\nfunction asString(v: YamlValue, what: string, file: string): string {\n if (typeof v !== \"string\" || v.length === 0) {\n throw new HndlError(`${what} must be a non-empty string`, file);\n }\n return v;\n}\n\nfunction asNonNegNumber(v: YamlValue, what: string, file: string): number {\n if (typeof v !== \"number\" || !Number.isFinite(v) || v < 0) {\n throw new HndlError(`${what} must be a non-negative number`, file);\n }\n return v;\n}\n\nfunction asClassification(v: YamlValue, what: string, file: string): DataClassification {\n if (typeof v !== \"string\" || !(CLASSIFICATIONS as readonly string[]).includes(v)) {\n throw new HndlError(`${what} must be one of: ${CLASSIFICATIONS.join(\", \")}`, file);\n }\n return v as DataClassification;\n}\n\nfunction asStringList(v: YamlValue, what: string, file: string): string[] {\n if (!Array.isArray(v) || v.some((x) => typeof x !== \"string\" || x.length === 0)) {\n throw new HndlError(`${what} must be a list of non-empty strings`, file);\n }\n return v as string[];\n}\n\n/**\n * Validate a parsed `hndl.yml` object into a typed {@link HndlMap}. Applies\n * defaults for `version`, `horizon`, and `defaults`; requires each asset to have\n * a unique `key`, a `name`, a valid `classification`, non-negative retention +\n * secrecy lifetime, and at least one path glob.\n */\nexport function parseHndlMap(text: string, file = HNDL_FILENAME): HndlMap {\n const root = parseYaml(text, file);\n if (!isObject(root)) {\n throw new HndlError(`hndl.yml must be a mapping at the top level`, file);\n }\n\n let version = 1;\n if (\"version\" in root) {\n const v = root[\"version\"];\n if (typeof v !== \"number\" || !Number.isInteger(v)) {\n throw new HndlError(`\"version\" must be an integer`, file);\n }\n version = v;\n }\n\n const horizon: HndlHorizon = {\n quantumThreatYears: DEFAULT_QUANTUM_THREAT_YEARS,\n migrationHorizonYears: DEFAULT_MIGRATION_HORIZON_YEARS,\n };\n if (\"horizon\" in root && root[\"horizon\"] !== null) {\n const h = root[\"horizon\"];\n if (!isObject(h)) throw new HndlError(`\"horizon\" must be a mapping`, file);\n if (\"quantum_threat_years\" in h) {\n horizon.quantumThreatYears = asNonNegNumber(\n h[\"quantum_threat_years\"],\n `\"horizon.quantum_threat_years\"`,\n file,\n );\n }\n if (\"migration_horizon_years\" in h) {\n horizon.migrationHorizonYears = asNonNegNumber(\n h[\"migration_horizon_years\"],\n `\"horizon.migration_horizon_years\"`,\n file,\n );\n }\n }\n\n const defaults: HndlDefaults = { classification: DEFAULT_UNBOUND_CLASSIFICATION };\n if (\"defaults\" in root && root[\"defaults\"] !== null) {\n const d = root[\"defaults\"];\n if (!isObject(d)) throw new HndlError(`\"defaults\" must be a mapping`, file);\n if (\"classification\" in d) {\n defaults.classification = asClassification(\n d[\"classification\"],\n `\"defaults.classification\"`,\n file,\n );\n }\n }\n\n const rawAssets = \"assets\" in root ? root[\"assets\"] : [];\n if (!Array.isArray(rawAssets)) {\n throw new HndlError(`\"assets\" must be a list`, file);\n }\n const assets: HndlDataAsset[] = [];\n const seenKeys = new Set<string>();\n for (let idx = 0; idx < rawAssets.length; idx++) {\n const a = rawAssets[idx];\n if (!isObject(a)) throw new HndlError(`assets[${idx}] must be a mapping`, file);\n const key = asString(a[\"key\"], `assets[${idx}].key`, file);\n if (seenKeys.has(key)) throw new HndlError(`duplicate asset key \"${key}\"`, file);\n seenKeys.add(key);\n const asset: HndlDataAsset = {\n key,\n name: asString(a[\"name\"], `assets[${idx}].name`, file),\n classification: asClassification(a[\"classification\"], `assets[${idx}].classification`, file),\n retentionYears: asNonNegNumber(a[\"retention_years\"], `assets[${idx}].retention_years`, file),\n secrecyLifetimeYears: asNonNegNumber(\n a[\"secrecy_lifetime_years\"],\n `assets[${idx}].secrecy_lifetime_years`,\n file,\n ),\n paths: asStringList(a[\"paths\"], `assets[${idx}].paths`, file),\n };\n if (asset.paths.length === 0) {\n throw new HndlError(`assets[${idx}].paths must list at least one glob`, file);\n }\n if (\"scopes\" in a && a[\"scopes\"] !== null) {\n const scopes = asStringList(a[\"scopes\"], `assets[${idx}].scopes`, file);\n for (const s of scopes) {\n if (!(HNDL_SCOPES as readonly string[]).includes(s)) {\n throw new HndlError(\n `assets[${idx}].scopes: \"${s}\" must be one of: ${HNDL_SCOPES.join(\", \")}`,\n file,\n );\n }\n }\n asset.scopes = scopes as HndlScope[];\n }\n assets.push(asset);\n }\n\n return { version, horizon, defaults, assets };\n}\n\n/**\n * Load and validate the `hndl.yml` for a scan. By default reads\n * `<root>/hndl.yml`; pass an explicit `*.yml` path to read a named file. A\n * missing file is always an error here (the caller opted into `--hndl`).\n *\n * @throws {HndlError} On a missing file, unreadable file, or malformed content.\n */\nexport async function loadHndlMap(root: string): Promise<{ map: HndlMap; path: string }> {\n const base = path.basename(root);\n const file =\n base === HNDL_FILENAME || base.endsWith(\".yml\") || base.endsWith(\".yaml\")\n ? path.resolve(root)\n : path.resolve(root, HNDL_FILENAME);\n let text: string;\n try {\n text = await readFile(file, \"utf8\");\n } catch {\n throw new HndlError(\n `hndl.yml not found: ${file} (run \"qscan hndl init\" to scaffold one)`,\n file,\n );\n }\n return { map: parseHndlMap(text, file), path: file };\n}\n\n/* -------------------------------------------------------------------------- */\n/* hndl.yml scaffolding (`qscan hndl init`) */\n/* -------------------------------------------------------------------------- */\n\n/** First path segment of a POSIX file path, or \".\" for a root-level file. */\nfunction topDir(file: string): string {\n const slash = file.indexOf(\"/\");\n return slash < 0 ? \".\" : file.slice(0, slash);\n}\n\n/** A URL/key-safe slug for a directory name. */\nfunction slugify(dir: string): string {\n const slug = dir\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, \"-\")\n .replace(/^-+|-+$/g, \"\");\n return slug.length > 0 ? slug : \"root\";\n}\n\n/**\n * Scaffold an `hndl.yml` document seeded from a scan's findings. Config-scope,\n * HNDL-exposed findings are the crypto-to-data join points (KMS, secrets-at-rest,\n * database TDE, brokers, JOSE/JWE), so each directory that contains one becomes a\n * proposed asset stub the user fills in. The returned string is valid `hndl.yml`\n * (it round-trips through {@link parseHndlMap}); the classification / retention /\n * secrecy values are conservative placeholders the user is expected to correct.\n */\nexport function scaffoldHndlYaml(findings: readonly Finding[]): string {\n // Group data-adjacent findings by their top-level directory.\n const byDir = new Map<string, Set<string>>();\n for (const f of findings) {\n if (findingScope(f) !== \"config\" || !f.hndl) continue;\n const dir = topDir(f.location.file);\n let rules = byDir.get(dir);\n if (!rules) {\n rules = new Set<string>();\n byDir.set(dir, rules);\n }\n rules.add(f.ruleId);\n }\n\n const lines: string[] = [\n \"# hndl.yml - HNDL (harvest-now-decrypt-later) data map for this repo.\",\n \"#\",\n \"# qScan joins each crypto finding to the data it protects and scores exposure as\",\n \"# crypto-vulnerability x data-sensitivity x Mosca-factor (retention + secrecy\",\n \"# lifetime vs the quantum-threat horizon). See docs/HNDL.md for the model.\",\n \"#\",\n \"# Fill in the assets below: correct the classification, the retention_years and\",\n \"# secrecy_lifetime_years, and the path globs. Delete stubs that do not apply.\",\n \"version: 1\",\n \"\",\n \"horizon:\",\n ` quantum_threat_years: ${DEFAULT_QUANTUM_THREAT_YEARS} # Z: years until a CRQC is assumed`,\n ` migration_horizon_years: ${DEFAULT_MIGRATION_HORIZON_YEARS} # Y: years to finish your PQC migration`,\n \"\",\n \"defaults:\",\n ` classification: ${DEFAULT_UNBOUND_CLASSIFICATION} # applied to findings that match no asset below`,\n \"\",\n \"assets:\",\n ];\n\n if (byDir.size === 0) {\n lines.push(\n \" # No data-adjacent (config-scope, HNDL) findings were detected to seed from.\",\n \" # Declare your data assets manually, for example:\",\n \" - key: customer-pii\",\n \" name: Customer PII\",\n \" classification: regulated\",\n \" retention_years: 7\",\n \" secrecy_lifetime_years: 25\",\n \" paths:\",\n ' - \"src/**\"',\n );\n } else {\n const dirs = [...byDir.keys()].sort();\n for (const dir of dirs) {\n const rules = [...(byDir.get(dir) as Set<string>)].sort();\n const glob = dir === \".\" ? \"*\" : `${dir}/**`;\n lines.push(\n ` # detected data-adjacent crypto here: ${rules.join(\", \")}`,\n ` - key: ${slugify(dir)}`,\n ` name: ${dir === \".\" ? \"Repository root\" : dir}`,\n \" classification: confidential # TODO: public | internal | confidential | regulated\",\n \" retention_years: 7 # TODO: how long the data is kept\",\n \" secrecy_lifetime_years: 10 # TODO: how long it must stay confidential\",\n \" paths:\",\n ` - \"${glob}\"`,\n );\n }\n }\n\n return `${lines.join(\"\\n\")}\\n`;\n}\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -36,6 +36,8 @@ export type { Baseline } from "./baseline.js";
|
|
|
36
36
|
export { changedFiles } from "./changed.js";
|
|
37
37
|
export { loadConfig, ConfigError, CONFIG_FILENAME } from "./config.js";
|
|
38
38
|
export type { QuantakryptoFileConfig, LoadConfigResult } from "./config.js";
|
|
39
|
+
export { HNDL_MODEL_VERSION, HNDL_FILENAME, SEVERITY_VULNERABILITY, CONFIDENCE_WEIGHT, CLASSIFICATION_SENSITIVITY, NON_HNDL_DISCOUNT, DEFAULT_QUANTUM_THREAT_YEARS, DEFAULT_MIGRATION_HORIZON_YEARS, DEFAULT_UNBOUND_CLASSIFICATION, HndlError, computeHndl, vulnerabilityFactor, moscaFactor, globMatch, findingFingerprint, findingScope, parseHndlMap, loadHndlMap, scaffoldHndlYaml, } from "./hndl.js";
|
|
40
|
+
export type { DataClassification, HndlScope, HndlDataAsset, HndlHorizon, HndlDefaults, HndlMap, ExposureRationale, FindingExposure, AssetExposure, HndlSummary, HndlReport, } from "./hndl.js";
|
|
39
41
|
export { walkFiles, isBinaryPath, looksMinified } from "./walk.js";
|
|
40
42
|
export { isAnalyzableSource, ANALYZABLE_SOURCE_EXTENSIONS, ANALYZABLE_LANGUAGES_LABEL, } from "./detect-utils.js";
|
|
41
43
|
export { buildInventory } from "./inventory.js";
|
|
@@ -48,10 +50,14 @@ export type { CycloneDxBom, CbomComponent } from "./cbom.js";
|
|
|
48
50
|
export { mergeCboms } from "./cbom-merge.js";
|
|
49
51
|
export { toOpenVex } from "./vex.js";
|
|
50
52
|
export type { OpenVexDocument, OpenVexStatement, OpenVexOptions } from "./vex.js";
|
|
53
|
+
export { buildCryptoAgilityManifest, validateCryptoAgilityManifest, CRYPTO_AGILITY_MANIFEST_VERSION, CRYPTO_AGILITY_WELL_KNOWN_PATH, } from "./crypto-agility.js";
|
|
54
|
+
export type { CryptoAgilityManifest, CryptoAgilityManifestOptions, CryptoAgilityPosture, CryptoAgilityCbomSummary, CryptoAgilityFamily, CryptoAgilityPolicy, ManifestValidation, } from "./crypto-agility.js";
|
|
51
55
|
export { buildReadinessReport, signReadinessReport, verifyReadinessReport } from "./evidence.js";
|
|
52
56
|
export type { ReadinessReport, EvidenceFinding, ReadinessReportOptions, EvidenceSigner, SignEvidenceOptions, VerifyReadinessResult, } from "./evidence.js";
|
|
53
57
|
export { buildPolicyMapping, parseCryptoPolicy } from "./policy.js";
|
|
54
58
|
export type { CryptoPolicy, PolicyVerdict, PolicyMapping, PolicyFindingVerdict } from "./policy.js";
|
|
59
|
+
export { MANDATES, mandateIds, getMandate, assertKnownMandates, evaluateMandates, mandateGateFails, } from "./mandates.js";
|
|
60
|
+
export type { Mandate, MandateRule, MandateRuleTier, MandateStatus, MandateFindingVerdict, MandateEvaluation, MandateGateOptions, } from "./mandates.js";
|
|
55
61
|
export { remediationFor, remediationForTier, remediationForProfile, TIER_PARAMS, STATEFUL_HBS_NOTE, PQC_TRANSITION_NOTE, statefulHbsApplies, } from "./remediation.js";
|
|
56
62
|
export type { SecurityTier } from "./remediation.js";
|
|
57
63
|
export { PQC_STANDARDS } from "./standards.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,cAAc,YAAY,CAAC;AAG3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAGvC,YAAY,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAG5C,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAGzE,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAC7D,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAGhD,YAAY,EACV,YAAY,EACZ,eAAe,EACf,aAAa,EACb,KAAK,EACL,WAAW,GACZ,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACvF,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,qBAAqB,GACtB,MAAM,wBAAwB,CAAC;AAChC,YAAY,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACvE,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAA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EACnB,qBAAqB,GACtB,MAAM,eAAe,CAAC;AAGvB,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACpE,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAGpG,OAAO,EACL,QAAQ,EACR,UAAU,EACV,UAAU,EACV,mBAAmB,EACnB,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,eAAe,CAAC;AACvB,YAAY,EACV,OAAO,EACP,WAAW,EACX,eAAe,EACf,aAAa,EACb,qBAAqB,EACrB,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,qBAAqB,EACrB,WAAW,EACX,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAGrD,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,YAAY,EAAE,YAAY,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAG7F,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,uBAAuB,GACxB,MAAM,yBAAyB,CAAC;AACjC,YAAY,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAG9E,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,UAAU,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -36,6 +36,8 @@ export { fingerprintFinding, baselineFromFindings, applyBaseline, loadBaseline,
|
|
|
36
36
|
export { changedFiles } from "./changed.js";
|
|
37
37
|
// Optional `quantakrypto.config.json` loader (P2-9; see docs/CONFIG.md).
|
|
38
38
|
export { loadConfig, ConfigError, CONFIG_FILENAME } from "./config.js";
|
|
39
|
+
// HNDL (harvest-now-decrypt-later) data-risk quantifier (see docs/HNDL.md).
|
|
40
|
+
export { HNDL_MODEL_VERSION, HNDL_FILENAME, SEVERITY_VULNERABILITY, CONFIDENCE_WEIGHT, CLASSIFICATION_SENSITIVITY, NON_HNDL_DISCOUNT, DEFAULT_QUANTUM_THREAT_YEARS, DEFAULT_MIGRATION_HORIZON_YEARS, DEFAULT_UNBOUND_CLASSIFICATION, HndlError, computeHndl, vulnerabilityFactor, moscaFactor, globMatch, findingFingerprint, findingScope, parseHndlMap, loadHndlMap, scaffoldHndlYaml, } from "./hndl.js";
|
|
39
41
|
// Filesystem walker (relative POSIX paths, default ignores, size/binary filters).
|
|
40
42
|
export { walkFiles, isBinaryPath, looksMinified } from "./walk.js";
|
|
41
43
|
// Analyzable-language coverage (which source languages the scanner inspects).
|
|
@@ -56,10 +58,14 @@ export { toCbom } from "./cbom.js";
|
|
|
56
58
|
export { mergeCboms } from "./cbom-merge.js";
|
|
57
59
|
// OpenVEX 0.2.0 export — quantum-readiness posture as VEX statements.
|
|
58
60
|
export { toOpenVex } from "./vex.js";
|
|
61
|
+
// Crypto-agility manifest: agent-consumable crypto-posture document.
|
|
62
|
+
export { buildCryptoAgilityManifest, validateCryptoAgilityManifest, CRYPTO_AGILITY_MANIFEST_VERSION, CRYPTO_AGILITY_WELL_KNOWN_PATH, } from "./crypto-agility.js";
|
|
59
63
|
// ISO/IEC 27001 A.8.24 evidence-chain readiness report.
|
|
60
64
|
export { buildReadinessReport, signReadinessReport, verifyReadinessReport } from "./evidence.js";
|
|
61
65
|
// Cryptography policy → per-finding verdicts (A.8.24 evidence §4).
|
|
62
66
|
export { buildPolicyMapping, parseCryptoPolicy } from "./policy.js";
|
|
67
|
+
// Compliance mandates → dated, clause-named verdicts + gate (policy-as-code).
|
|
68
|
+
export { MANDATES, mandateIds, getMandate, assertKnownMandates, evaluateMandates, mandateGateFails, } from "./mandates.js";
|
|
63
69
|
// Remediation lookup (family + tier-aware + profile-aware) and stateful-HBS guidance.
|
|
64
70
|
export { remediationFor, remediationForTier, remediationForProfile, TIER_PARAMS, STATEFUL_HBS_NOTE, PQC_TRANSITION_NOTE, statefulHbsApplies, } from "./remediation.js";
|
|
65
71
|
// Post-quantum standards source of truth + review cadence.
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,cAAc,YAAY,CAAC;AAE3B,qEAAqE;AACrE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAKvC,8CAA8C;AAC9C,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAEzE,2EAA2E;AAC3E,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAW7D,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEvF,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,qBAAqB,GACtB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAErD,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAErE,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAQ5D,0CAA0C;AAC1C,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAE9D,6EAA6E;AAC7E,kFAAkF;AAClF,OAAO,EAAE,YAAY,EAAE,M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,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAUjG,mEAAmE;AACnE,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGpE,sFAAsF;AACtF,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,qBAAqB,EACrB,WAAW,EACX,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,kBAAkB,CAAC;AAG1B,2DAA2D;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAG/C,2EAA2E;AAC3E,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,uBAAuB,GACxB,MAAM,yBAAyB,CAAC;AAGjC,4BAA4B;AAC5B,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,UAAU,CAAC","sourcesContent":["/**\n * @quantakrypto/core — public API (LOCKED CONTRACT).\n *\n * The exported NAMES and SIGNATURES below are the stable contract that\n * @quantakrypto/qscan, @quantakrypto/mcp and the GitHub Action depend on — do not change\n * them without updating all consumers. The implementations live in focused\n * modules under src/ and are re-exported here; the public surface is identical\n * to the original stub file.\n */\nexport * from \"./types.js\";\n\n// Tool version, surfaced in reports. Keep in sync with package.json.\nexport { VERSION } from \"./version.js\";\n\n// Minimal SARIF 2.1.0 log shape, defined alongside the reporters.\nexport type { SarifLog } from \"./report.js\";\n\n// Core orchestration + built-in detector set.\nexport { scan, detectors, detectFile, compareFindings } from \"./scan.js\";\n\n// Snippet-level fix verification (shared by MCP verify_fix + remediation).\nexport { verifyFix, languageToExtension } from \"./verify.js\";\nexport type { VerifyResult } from \"./verify.js\";\n\n// Agent-plane shared types + the context redactor (offline; reused by MCP).\nexport type {\n ContextLevel,\n RedactedContext,\n TriageVerdict,\n Patch,\n FixProposal,\n} from \"./agent-types.js\";\nexport { buildContext, renderPreflight } from \"./redact.js\";\nexport { TRIAGE_RUBRIC, TRIAGE_VERDICT_SCHEMA, buildTriageRequest } from \"./triage.js\";\nexport type { TriageRequest } from \"./triage.js\";\nexport {\n REMEDIATE_RUBRIC,\n FIX_REQUEST_SCHEMA,\n buildRemediateRequest,\n} from \"./remediate-request.js\";\nexport type { RemediateRequest } from \"./remediate-request.js\";\nexport { checkPatchPolicy } from \"./patch-policy.js\";\nexport type { PolicyContext, PolicyDecision } from \"./patch-policy.js\";\nexport { withWorktree } from \"./worktree.js\";\nexport { codemodRegistry, codemodFor } from \"./codemods/registry.js\";\nexport type { Codemod } from \"./codemods/registry.js\";\nexport { configToggleCodemod } from \"./codemods/config-toggle.js\";\nexport { remediateFindings } from \"./remediate-pipeline.js\";\nexport type {\n RemediateOptions,\n RemediationResult,\n VerifiedPatch,\n RejectedPatch,\n} from \"./remediate-pipeline.js\";\n\n// Scan cancellation / work-budget errors.\nexport { AbortError, BudgetExceededError } from \"./errors.js\";\n\n// Parallel scanning (worker_threads pool). The chunk/merge helpers and their\n// SizedFile/ChunkResult types are internal plumbing (not part of the public API).\nexport { scanParallel } from \"./parallel.js\";\nexport type { ScanChunk } from \"./parallel.js\";\n\n// Detector registry (plugin point). `detectorScope` and the rule-catalog type are\n// internal.\nexport { DetectorRegistry, defaultRegistry } from \"./registry.js\";\n\n// Canonical baseline (shared by qScan + the Action).\nexport {\n fingerprintFinding,\n baselineFromFindings,\n applyBaseline,\n loadBaseline,\n saveBaseline,\n BASELINE_VERSION,\n} from \"./baseline.js\";\nexport type { Baseline } from \"./baseline.js\";\n\n// Incremental scanning: changed-files helper (git-aware, tolerant).\nexport { changedFiles } from \"./changed.js\";\n\n// Optional `quantakrypto.config.json` loader (P2-9; see docs/CONFIG.md).\nexport { loadConfig, ConfigError, CONFIG_FILENAME } from \"./config.js\";\nexport type { QuantakryptoFileConfig, LoadConfigResult } from \"./config.js\";\n\n// Filesystem walker (relative POSIX paths, default ignores, size/binary filters).\nexport { walkFiles, isBinaryPath, looksMinified } from \"./walk.js\";\n\n// Analyzable-language coverage (which source languages the scanner inspects).\nexport {\n isAnalyzableSource,\n ANALYZABLE_SOURCE_EXTENSIONS,\n ANALYZABLE_LANGUAGES_LABEL,\n} from \"./detect-utils.js\";\n\n// Inventory + readiness score.\nexport { buildInventory } from \"./inventory.js\";\n\n// Vulnerable-dependency database (the manifest scanner is used internally by scan()).\n// `DEP_VULNERABLE_RULE` is the generic catalog entry for dependency findings\n// (which don't come from a Detector, so aren't in the registry's rule catalog).\nexport { vulnerableDependencies, DEP_VULNERABLE_RULE, isManifestFile } from \"./dependencies.js\";\n\n// Severity utilities (ordering, threshold, SARIF level) — shared across tools.\nexport { SEVERITY_ORDER, severityRank, meetsThreshold, sarifLevel } from \"./severity.js\";\n\n// Reporters.\nexport {\n toSarif,\n toJson,\n formatSummary,\n formatTierGuidance,\n formatProfileGuidance,\n} from \"./report.js\";\nexport type { ReportOptions } from \"./report.js\";\n\n// CycloneDX 1.6 cryptographic bill of materials (CBOM) export.\nexport { toCbom } from \"./cbom.js\";\nexport type { CycloneDxBom, CbomComponent } from \"./cbom.js\";\n// Merge multiple CBOMs (code + infra + live endpoints) into one combined BOM.\nexport { mergeCboms } from \"./cbom-merge.js\";\n// OpenVEX 0.2.0 export — quantum-readiness posture as VEX statements.\nexport { toOpenVex } from \"./vex.js\";\nexport type { OpenVexDocument, OpenVexStatement, OpenVexOptions } from \"./vex.js\";\n// ISO/IEC 27001 A.8.24 evidence-chain readiness report.\nexport { buildReadinessReport, signReadinessReport, verifyReadinessReport } from \"./evidence.js\";\nexport type {\n ReadinessReport,\n EvidenceFinding,\n ReadinessReportOptions,\n EvidenceSigner,\n SignEvidenceOptions,\n VerifyReadinessResult,\n} from \"./evidence.js\";\n\n// Cryptography policy → per-finding verdicts (A.8.24 evidence §4).\nexport { buildPolicyMapping, parseCryptoPolicy } from \"./policy.js\";\nexport type { CryptoPolicy, PolicyVerdict, PolicyMapping, PolicyFindingVerdict } from \"./policy.js\";\n\n// Remediation lookup (family + tier-aware + profile-aware) and stateful-HBS guidance.\nexport {\n remediationFor,\n remediationForTier,\n remediationForProfile,\n TIER_PARAMS,\n STATEFUL_HBS_NOTE,\n PQC_TRANSITION_NOTE,\n statefulHbsApplies,\n} from \"./remediation.js\";\nexport type { SecurityTier } from \"./remediation.js\";\n\n// Post-quantum standards source of truth + review cadence.\nexport { PQC_STANDARDS } from \"./standards.js\";\nexport type { PqcStandards, StandardsCitation, StandardsReviewStatus } from \"./standards.js\";\n\n// Selectable standards regime profiles (NIST / CNSA / BSI / ANSSI / NCSC).\nexport {\n STANDARDS_PROFILES,\n DEFAULT_PROFILE_ID,\n standardsProfileIds,\n getStandardsProfile,\n defaultStandardsProfile,\n} from \"./standards-profiles.js\";\nexport type { StandardsProfile, HybridStance } from \"./standards-profiles.js\";\n\n// CWE identifier constants.\nexport {\n CWE_BROKEN_CRYPTO,\n CWE_WEAK_STRENGTH,\n CWE_CERT_VALIDATION,\n CWE_HARDCODED_KEY,\n CWE_RISKY_PRIMITIVE,\n} from \"./cwe.js\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,cAAc,YAAY,CAAC;AAE3B,qEAAqE;AACrE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAKvC,8CAA8C;AAC9C,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAEzE,2EAA2E;AAC3E,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAW7D,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEvF,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,qBAAqB,GACtB,MAAM,wBAAwB,CAAC;AAE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2D;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAG/C,2EAA2E;AAC3E,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,uBAAuB,GACxB,MAAM,yBAAyB,CAAC;AAGjC,4BAA4B;AAC5B,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,UAAU,CAAC","sourcesContent":["/**\n * @quantakrypto/core — public API (LOCKED CONTRACT).\n *\n * The exported NAMES and SIGNATURES below are the stable contract that\n * @quantakrypto/qscan, @quantakrypto/mcp and the GitHub Action depend on — do not change\n * them without updating all consumers. The implementations live in focused\n * modules under src/ and are re-exported here; the public surface is identical\n * to the original stub file.\n */\nexport * from \"./types.js\";\n\n// Tool version, surfaced in reports. Keep in sync with package.json.\nexport { VERSION } from \"./version.js\";\n\n// Minimal SARIF 2.1.0 log shape, defined alongside the reporters.\nexport type { SarifLog } from \"./report.js\";\n\n// Core orchestration + built-in detector set.\nexport { scan, detectors, detectFile, compareFindings } from \"./scan.js\";\n\n// Snippet-level fix verification (shared by MCP verify_fix + remediation).\nexport { verifyFix, languageToExtension } from \"./verify.js\";\nexport type { VerifyResult } from \"./verify.js\";\n\n// Agent-plane shared types + the context redactor (offline; reused by MCP).\nexport type {\n ContextLevel,\n RedactedContext,\n TriageVerdict,\n Patch,\n FixProposal,\n} from \"./agent-types.js\";\nexport { buildContext, renderPreflight } from \"./redact.js\";\nexport { TRIAGE_RUBRIC, TRIAGE_VERDICT_SCHEMA, buildTriageRequest } from \"./triage.js\";\nexport type { TriageRequest } from \"./triage.js\";\nexport {\n REMEDIATE_RUBRIC,\n FIX_REQUEST_SCHEMA,\n buildRemediateRequest,\n} from \"./remediate-request.js\";\nexport type { RemediateRequest } from \"./remediate-request.js\";\nexport { checkPatchPolicy } from \"./patch-policy.js\";\nexport type { PolicyContext, PolicyDecision } from \"./patch-policy.js\";\nexport { withWorktree } from \"./worktree.js\";\nexport { codemodRegistry, codemodFor } from \"./codemods/registry.js\";\nexport type { Codemod } from \"./codemods/registry.js\";\nexport { configToggleCodemod } from \"./codemods/config-toggle.js\";\nexport { remediateFindings } from \"./remediate-pipeline.js\";\nexport type {\n RemediateOptions,\n RemediationResult,\n VerifiedPatch,\n RejectedPatch,\n} from \"./remediate-pipeline.js\";\n\n// Scan cancellation / work-budget errors.\nexport { AbortError, BudgetExceededError } from \"./errors.js\";\n\n// Parallel scanning (worker_threads pool). The chunk/merge helpers and their\n// SizedFile/ChunkResult types are internal plumbing (not part of the public API).\nexport { scanParallel } from \"./parallel.js\";\nexport type { ScanChunk } from \"./parallel.js\";\n\n// Detector registry (plugin point). `detectorScope` and the rule-catalog type are\n// internal.\nexport { DetectorRegistry, defaultRegistry } from \"./registry.js\";\n\n// Canonical baseline (shared by qScan + the Action).\nexport {\n fingerprintFinding,\n baselineFromFindings,\n applyBaseline,\n loadBaseline,\n saveBaseline,\n BASELINE_VERSION,\n} from \"./baseline.js\";\nexport type { Baseline } from \"./baseline.js\";\n\n// Incremental scanning: changed-files helper (git-aware, tolerant).\nexport { changedFiles } from \"./changed.js\";\n\n// Optional `quantakrypto.config.json` loader (P2-9; see docs/CONFIG.md).\nexport { loadConfig, ConfigError, CONFIG_FILENAME } from \"./config.js\";\nexport type { QuantakryptoFileConfig, LoadConfigResult } from \"./config.js\";\n\n// HNDL (harvest-now-decrypt-later) data-risk quantifier (see docs/HNDL.md).\nexport {\n HNDL_MODEL_VERSION,\n HNDL_FILENAME,\n SEVERITY_VULNERABILITY,\n CONFIDENCE_WEIGHT,\n CLASSIFICATION_SENSITIVITY,\n NON_HNDL_DISCOUNT,\n DEFAULT_QUANTUM_THREAT_YEARS,\n DEFAULT_MIGRATION_HORIZON_YEARS,\n DEFAULT_UNBOUND_CLASSIFICATION,\n HndlError,\n computeHndl,\n vulnerabilityFactor,\n moscaFactor,\n globMatch,\n findingFingerprint,\n findingScope,\n parseHndlMap,\n loadHndlMap,\n scaffoldHndlYaml,\n} from \"./hndl.js\";\nexport type {\n DataClassification,\n HndlScope,\n HndlDataAsset,\n HndlHorizon,\n HndlDefaults,\n HndlMap,\n ExposureRationale,\n FindingExposure,\n AssetExposure,\n HndlSummary,\n HndlReport,\n} from \"./hndl.js\";\n\n// Filesystem walker (relative POSIX paths, default ignores, size/binary filters).\nexport { walkFiles, isBinaryPath, looksMinified } from \"./walk.js\";\n\n// Analyzable-language coverage (which source languages the scanner inspects).\nexport {\n isAnalyzableSource,\n ANALYZABLE_SOURCE_EXTENSIONS,\n ANALYZABLE_LANGUAGES_LABEL,\n} from \"./detect-utils.js\";\n\n// Inventory + readiness score.\nexport { buildInventory } from \"./inventory.js\";\n\n// Vulnerable-dependency database (the manifest scanner is used internally by scan()).\n// `DEP_VULNERABLE_RULE` is the generic catalog entry for dependency findings\n// (which don't come from a Detector, so aren't in the registry's rule catalog).\nexport { vulnerableDependencies, DEP_VULNERABLE_RULE, isManifestFile } from \"./dependencies.js\";\n\n// Severity utilities (ordering, threshold, SARIF level) — shared across tools.\nexport { SEVERITY_ORDER, severityRank, meetsThreshold, sarifLevel } from \"./severity.js\";\n\n// Reporters.\nexport {\n toSarif,\n toJson,\n formatSummary,\n formatTierGuidance,\n formatProfileGuidance,\n} from \"./report.js\";\nexport type { ReportOptions } from \"./report.js\";\n\n// CycloneDX 1.6 cryptographic bill of materials (CBOM) export.\nexport { toCbom } from \"./cbom.js\";\nexport type { CycloneDxBom, CbomComponent } from \"./cbom.js\";\n// Merge multiple CBOMs (code + infra + live endpoints) into one combined BOM.\nexport { mergeCboms } from \"./cbom-merge.js\";\n// OpenVEX 0.2.0 export — quantum-readiness posture as VEX statements.\nexport { toOpenVex } from \"./vex.js\";\nexport type { OpenVexDocument, OpenVexStatement, OpenVexOptions } from \"./vex.js\";\n// Crypto-agility manifest: agent-consumable crypto-posture document.\nexport {\n buildCryptoAgilityManifest,\n validateCryptoAgilityManifest,\n CRYPTO_AGILITY_MANIFEST_VERSION,\n CRYPTO_AGILITY_WELL_KNOWN_PATH,\n} from \"./crypto-agility.js\";\nexport type {\n CryptoAgilityManifest,\n CryptoAgilityManifestOptions,\n CryptoAgilityPosture,\n CryptoAgilityCbomSummary,\n CryptoAgilityFamily,\n CryptoAgilityPolicy,\n ManifestValidation,\n} from \"./crypto-agility.js\";\n// ISO/IEC 27001 A.8.24 evidence-chain readiness report.\nexport { buildReadinessReport, signReadinessReport, verifyReadinessReport } from \"./evidence.js\";\nexport type {\n ReadinessReport,\n EvidenceFinding,\n ReadinessReportOptions,\n EvidenceSigner,\n SignEvidenceOptions,\n VerifyReadinessResult,\n} from \"./evidence.js\";\n\n// Cryptography policy → per-finding verdicts (A.8.24 evidence §4).\nexport { buildPolicyMapping, parseCryptoPolicy } from \"./policy.js\";\nexport type { CryptoPolicy, PolicyVerdict, PolicyMapping, PolicyFindingVerdict } from \"./policy.js\";\n\n// Compliance mandates → dated, clause-named verdicts + gate (policy-as-code).\nexport {\n MANDATES,\n mandateIds,\n getMandate,\n assertKnownMandates,\n evaluateMandates,\n mandateGateFails,\n} from \"./mandates.js\";\nexport type {\n Mandate,\n MandateRule,\n MandateRuleTier,\n MandateStatus,\n MandateFindingVerdict,\n MandateEvaluation,\n MandateGateOptions,\n} from \"./mandates.js\";\n\n// Remediation lookup (family + tier-aware + profile-aware) and stateful-HBS guidance.\nexport {\n remediationFor,\n remediationForTier,\n remediationForProfile,\n TIER_PARAMS,\n STATEFUL_HBS_NOTE,\n PQC_TRANSITION_NOTE,\n statefulHbsApplies,\n} from \"./remediation.js\";\nexport type { SecurityTier } from \"./remediation.js\";\n\n// Post-quantum standards source of truth + review cadence.\nexport { PQC_STANDARDS } from \"./standards.js\";\nexport type { PqcStandards, StandardsCitation, StandardsReviewStatus } from \"./standards.js\";\n\n// Selectable standards regime profiles (NIST / CNSA / BSI / ANSSI / NCSC).\nexport {\n STANDARDS_PROFILES,\n DEFAULT_PROFILE_ID,\n standardsProfileIds,\n getStandardsProfile,\n defaultStandardsProfile,\n} from \"./standards-profiles.js\";\nexport type { StandardsProfile, HybridStance } from \"./standards-profiles.js\";\n\n// CWE identifier constants.\nexport {\n CWE_BROKEN_CRYPTO,\n CWE_WEAK_STRENGTH,\n CWE_CERT_VALIDATION,\n CWE_HARDCODED_KEY,\n CWE_RISKY_PRIMITIVE,\n} from \"./cwe.js\";\n"]}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Policy-as-code compliance mandates → dated, clause-named verdicts for findings.
|
|
3
|
+
*
|
|
4
|
+
* `CryptoPolicy` (policy.ts) classifies findings by algorithm family but is
|
|
5
|
+
* date-blind. A mandate adds the missing dimension: named clauses with an effective
|
|
6
|
+
* DATE ("CNSA 2.0 disallows classical public-key crypto after 2035"). The evaluator
|
|
7
|
+
* compares each finding's algorithm against the selected mandates and today's date,
|
|
8
|
+
* so a finding on a prohibited family reads as `due` (every deadline still ahead),
|
|
9
|
+
* `deprecated` (the DEPRECATE deadline has passed — a warning), or `violation` (the
|
|
10
|
+
* DISALLOW deadline has passed — a failure), always naming the governing clause,
|
|
11
|
+
* deadline, and citation. This is what turns the inventory into an enforceable,
|
|
12
|
+
* mandate-mapped gate rather than a neutral list.
|
|
13
|
+
*
|
|
14
|
+
* Pure and deterministic (the caller supplies `now`), so it is trivially testable.
|
|
15
|
+
* qScan consumes it today for the `--mandate` gate; because it operates on the
|
|
16
|
+
* shared `Finding[]`, qProbe or the GitHub Action can reuse it unchanged.
|
|
17
|
+
*
|
|
18
|
+
* Catalog scope: the two regimes that carry hard algorithm deadlines — CNSA 2.0 and
|
|
19
|
+
* NIST IR 8547. DORA / NIS2 / PCI DSS require approved cryptography but set no
|
|
20
|
+
* independent algorithm date; they inherit these timelines and are cited in docs.
|
|
21
|
+
*/
|
|
22
|
+
import type { AlgorithmFamily, Finding } from "./types.js";
|
|
23
|
+
/** Which enforcement tier a clause encodes: warn (`deprecate`) or fail (`disallow`). */
|
|
24
|
+
export type MandateRuleTier = "deprecate" | "disallow";
|
|
25
|
+
export interface MandateRule {
|
|
26
|
+
/** The named clause this rule encodes (verbatim in the gate's failure message). */
|
|
27
|
+
clause: string;
|
|
28
|
+
/** Enforcement tier: a passed `deprecate` date warns; a passed `disallow` date fails. */
|
|
29
|
+
tier: MandateRuleTier;
|
|
30
|
+
/** Algorithm families prohibited from the effective date onward. */
|
|
31
|
+
prohibits: AlgorithmFamily[];
|
|
32
|
+
/** ISO date (YYYY-MM-DD) the prohibition takes effect. */
|
|
33
|
+
effective: string;
|
|
34
|
+
/** One-line human description of the clause. */
|
|
35
|
+
note: string;
|
|
36
|
+
}
|
|
37
|
+
export interface Mandate {
|
|
38
|
+
id: string;
|
|
39
|
+
name: string;
|
|
40
|
+
authority: string;
|
|
41
|
+
citation: string;
|
|
42
|
+
/** When this catalog entry was last reviewed against the source. */
|
|
43
|
+
asOf: string;
|
|
44
|
+
rules: MandateRule[];
|
|
45
|
+
}
|
|
46
|
+
/** The bundled mandate catalog. Keyed by `--mandate <id>`. */
|
|
47
|
+
export declare const MANDATES: Record<string, Mandate>;
|
|
48
|
+
export declare const mandateIds: () => string[];
|
|
49
|
+
export declare const getMandate: (id: string) => Mandate | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* Validate mandate ids loudly, matching `parseCryptoPolicy`'s fail-loud
|
|
52
|
+
* convention: a mistyped id must never silently evaluate to an empty gate.
|
|
53
|
+
* Throws an `Error` naming every unknown id and the known catalog.
|
|
54
|
+
* `evaluateMandates` itself stays lenient (unknown ids are skipped) so callers
|
|
55
|
+
* decide where to fail.
|
|
56
|
+
*/
|
|
57
|
+
export declare function assertKnownMandates(ids: readonly string[]): void;
|
|
58
|
+
/**
|
|
59
|
+
* A finding's status against a mandate, worst last:
|
|
60
|
+
* - `conformant` — in scope (classical asymmetric) but prohibited by no selected
|
|
61
|
+
* clause (e.g. X25519 as the presumed hybrid leg).
|
|
62
|
+
* - `due` — prohibited, with every deadline still ahead.
|
|
63
|
+
* - `deprecated` — the DEPRECATE deadline has passed; a warning, not a failure.
|
|
64
|
+
* - `violation` — the DISALLOW deadline has passed; fails the default gate.
|
|
65
|
+
*/
|
|
66
|
+
export type MandateStatus = "conformant" | "due" | "deprecated" | "violation";
|
|
67
|
+
export interface MandateFindingVerdict {
|
|
68
|
+
ruleId: string;
|
|
69
|
+
algorithm: AlgorithmFamily | "unknown";
|
|
70
|
+
file: string;
|
|
71
|
+
line: number;
|
|
72
|
+
/** Mandate id (e.g. "cnsa-2.0"). */
|
|
73
|
+
mandate: string;
|
|
74
|
+
/**
|
|
75
|
+
* The governing clause: the next upcoming clause when `due`, the passed
|
|
76
|
+
* DEPRECATE clause when `deprecated`, the passed DISALLOW clause on `violation`.
|
|
77
|
+
*/
|
|
78
|
+
clause: string;
|
|
79
|
+
/** ISO effective date of the governing clause. */
|
|
80
|
+
effective: string;
|
|
81
|
+
status: MandateStatus;
|
|
82
|
+
/** Whole months from `now` to the governing deadline; negative once it has passed. */
|
|
83
|
+
monthsUntil: number;
|
|
84
|
+
/**
|
|
85
|
+
* ISO effective date of this mandate's DISALLOW clause for the family, or null
|
|
86
|
+
* when the mandate carries none. The gate's `leadMonths` measures against this.
|
|
87
|
+
*/
|
|
88
|
+
disallowEffective: string | null;
|
|
89
|
+
/** Whole months from `now` to `disallowEffective`; null when there is none. */
|
|
90
|
+
monthsUntilDisallow: number | null;
|
|
91
|
+
citation: string;
|
|
92
|
+
}
|
|
93
|
+
export interface MandateEvaluation {
|
|
94
|
+
/** The `now` the evaluation was computed against (ISO). */
|
|
95
|
+
now: string;
|
|
96
|
+
/** Mandate ids evaluated. */
|
|
97
|
+
mandates: string[];
|
|
98
|
+
/**
|
|
99
|
+
* Counts of IN-SCOPE findings (classical asymmetric families) by their worst
|
|
100
|
+
* status across the selected mandates. Out-of-scope findings are excluded so
|
|
101
|
+
* the conformant count is an honest statement about asymmetric crypto only.
|
|
102
|
+
*/
|
|
103
|
+
summary: Record<MandateStatus, number>;
|
|
104
|
+
/**
|
|
105
|
+
* Findings outside the mandate's scope (hashes, RNG, dependency, TLS-config…),
|
|
106
|
+
* which a PQC-asymmetric mandate does not adjudicate.
|
|
107
|
+
*/
|
|
108
|
+
notInScope: number;
|
|
109
|
+
/** One row per (prohibited finding × applicable mandate). */
|
|
110
|
+
findings: MandateFindingVerdict[];
|
|
111
|
+
/** Earliest still-future deadline across non-violation rows, or null. */
|
|
112
|
+
nextDeadline: string | null;
|
|
113
|
+
/** True when at least one DISALLOW deadline has passed (a `violation` exists). */
|
|
114
|
+
hasViolation: boolean;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Evaluate findings against the selected mandates as of `now`. Unknown mandate
|
|
118
|
+
* ids are ignored — callers validate up front with {@link assertKnownMandates}.
|
|
119
|
+
* A finding outside the classical-asymmetric scope is counted in `notInScope`;
|
|
120
|
+
* an in-scope finding no selected mandate prohibits is `conformant`. Neither
|
|
121
|
+
* contributes a verdict row.
|
|
122
|
+
*/
|
|
123
|
+
export declare function evaluateMandates(findings: readonly Finding[], mandateIdList: readonly string[], now: Date): MandateEvaluation;
|
|
124
|
+
export interface MandateGateOptions {
|
|
125
|
+
/** Fail when a DISALLOW deadline is within this many months (early enforcement). */
|
|
126
|
+
leadMonths?: number;
|
|
127
|
+
/** Fail on any mandate-prohibited finding regardless of the deadlines. */
|
|
128
|
+
failNow?: boolean;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* The gate decision under the "deadline-aware" default: fail only once a DISALLOW
|
|
132
|
+
* deadline has passed (`violation`). A passed DEPRECATE date (`deprecated`) is a
|
|
133
|
+
* warning and does not fail the build. `leadMonths` fails early when a disallow
|
|
134
|
+
* deadline is within the window; `failNow` fails on any prohibited finding
|
|
135
|
+
* immediately.
|
|
136
|
+
*/
|
|
137
|
+
export declare function mandateGateFails(ev: MandateEvaluation, opts?: MandateGateOptions): boolean;
|
|
138
|
+
//# sourceMappingURL=mandates.d.ts.map
|
|
@@ -0,0 +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