@shieldaai/security-watch 0.0.0-stage → 1.0.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/CHANGELOG.md +170 -0
- package/CONTRIBUTING.md +92 -0
- package/LICENSE +202 -0
- package/README.md +394 -2
- package/SECURITY.md +62 -0
- package/dist/assessment.d.ts +16 -0
- package/dist/assessment.js +569 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +1105 -0
- package/dist/config.d.ts +302 -0
- package/dist/config.js +381 -0
- package/dist/coverage.d.ts +4 -0
- package/dist/coverage.js +11 -0
- package/dist/cve-now.d.ts +35 -0
- package/dist/cve-now.js +1002 -0
- package/dist/cvss4.d.ts +3 -0
- package/dist/cvss4.js +39 -0
- package/dist/delivery.d.ts +58 -0
- package/dist/delivery.js +687 -0
- package/dist/ecosystems.d.ts +48 -0
- package/dist/ecosystems.js +332 -0
- package/dist/engine.d.ts +80 -0
- package/dist/engine.js +388 -0
- package/dist/everyday-words.d.ts +11 -0
- package/dist/everyday-words.js +256 -0
- package/dist/health.d.ts +24 -0
- package/dist/health.js +122 -0
- package/dist/heartbeat.d.ts +13 -0
- package/dist/heartbeat.js +74 -0
- package/dist/http.d.ts +15 -0
- package/dist/http.js +280 -0
- package/dist/index.d.ts +36 -0
- package/dist/index.js +23 -0
- package/dist/inventory-evidence.d.ts +10 -0
- package/dist/inventory-evidence.js +206 -0
- package/dist/inventory.d.ts +276 -0
- package/dist/inventory.js +336 -0
- package/dist/lock.d.ts +3 -0
- package/dist/lock.js +112 -0
- package/dist/maintenance.d.ts +48 -0
- package/dist/maintenance.js +295 -0
- package/dist/matching.d.ts +29 -0
- package/dist/matching.js +537 -0
- package/dist/models.d.ts +33 -0
- package/dist/models.js +932 -0
- package/dist/operations.d.ts +17 -0
- package/dist/operations.js +117 -0
- package/dist/pilot-cases.d.ts +171 -0
- package/dist/pilot-cases.js +330 -0
- package/dist/pilot-input.d.ts +16 -0
- package/dist/pilot-input.js +125 -0
- package/dist/pilot-recall.d.ts +166 -0
- package/dist/pilot-recall.js +231 -0
- package/dist/pilot-report.d.ts +113 -0
- package/dist/pilot-report.js +279 -0
- package/dist/pilot-responses.d.ts +111 -0
- package/dist/pilot-responses.js +159 -0
- package/dist/providers.d.ts +209 -0
- package/dist/providers.js +459 -0
- package/dist/python-version.d.ts +3 -0
- package/dist/python-version.js +30 -0
- package/dist/rehearsal.d.ts +440 -0
- package/dist/rehearsal.js +372 -0
- package/dist/sbom.d.ts +13 -0
- package/dist/sbom.js +193 -0
- package/dist/setup.d.ts +113 -0
- package/dist/setup.js +100 -0
- package/dist/source-error.d.ts +38 -0
- package/dist/source-error.js +71 -0
- package/dist/sources.d.ts +3 -0
- package/dist/sources.js +1725 -0
- package/dist/store.d.ts +96 -0
- package/dist/store.js +953 -0
- package/dist/types.d.ts +404 -0
- package/dist/types.js +1 -0
- package/dist/util.d.ts +29 -0
- package/dist/util.js +94 -0
- package/dist/vendor/cvss4-reference.d.ts +2 -0
- package/dist/vendor/cvss4-reference.js +789 -0
- package/dist/vendor-sources.d.ts +24 -0
- package/dist/vendor-sources.js +56 -0
- package/dist/word-filter.d.ts +3 -0
- package/dist/word-filter.js +3291 -0
- package/docs/alert-outcome-evaluation.md +150 -0
- package/docs/compatibility.md +35 -0
- package/docs/configuration.md +666 -0
- package/docs/cvss-v4-support.md +41 -0
- package/docs/offline-advisory-preview.md +114 -0
- package/docs/offline-rehearsal.md +44 -0
- package/docs/pilot-cases.md +58 -0
- package/docs/pilot-recall.md +124 -0
- package/docs/pilot-report.md +52 -0
- package/docs/validation/alert-outcome-evaluation-2026-11-05.json +2935 -0
- package/docs/validation/cvss-v4-reference-parity-2026-11-05.json +93 -0
- package/docs/validation/rehearsal-accepted-2026-11-05.json +175 -0
- package/docs/validation/rehearsal-unknown-2026-11-05.json +175 -0
- package/docs/vendor/cvss-v4-LICENSE.txt +22 -0
- package/docs/vendor/cvss-v4-provenance.json +38 -0
- package/examples/advisories.json +17 -0
- package/examples/agent-advisories-2026.json +145 -0
- package/examples/agent-advisory-cases-2026.json +397 -0
- package/examples/common-systems.yaml +243 -0
- package/examples/libraries.example.txt +18 -0
- package/examples/libraries.example.yaml +40 -0
- package/examples/library-watch.example.yaml +27 -0
- package/examples/offline-advisory-preview.mjs +42 -0
- package/examples/rehearsal.json +75 -0
- package/examples/security-watch.example.yaml +86 -0
- package/examples/systems.example.yaml +35 -0
- package/package.json +85 -4
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { CoverageReceipt } from './types.js';
|
|
2
|
+
export declare function coverageFreshness(receipt: Pick<CoverageReceipt, 'last_success_at' | 'fresh_until'>, now: number): CoverageReceipt['freshness'];
|
|
3
|
+
/** Re-evaluate saved receipts at read time so a stopped monitor cannot look perpetually fresh. */
|
|
4
|
+
export declare function refreshCoverage(receipts: CoverageReceipt[], now?: number): CoverageReceipt[];
|
package/dist/coverage.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export function coverageFreshness(receipt, now) {
|
|
2
|
+
const success = receipt.last_success_at ? Date.parse(receipt.last_success_at) : NaN;
|
|
3
|
+
const expiry = receipt.fresh_until ? Date.parse(receipt.fresh_until) : NaN;
|
|
4
|
+
if (!Number.isFinite(success))
|
|
5
|
+
return 'never';
|
|
6
|
+
return success <= now + 300_000 && Number.isFinite(expiry) && now <= expiry ? 'fresh' : 'stale';
|
|
7
|
+
}
|
|
8
|
+
/** Re-evaluate saved receipts at read time so a stopped monitor cannot look perpetually fresh. */
|
|
9
|
+
export function refreshCoverage(receipts, now = Date.now()) {
|
|
10
|
+
return receipts.map((receipt) => ({ ...receipt, freshness: coverageFreshness(receipt, now) }));
|
|
11
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { Evidence, HttpClient, Inventory } from './types.js';
|
|
2
|
+
/** What the collector remembers between polls, besides its checkpoint. */
|
|
3
|
+
export interface CveNowState {
|
|
4
|
+
/** In: cited identifiers the service did not have, with the time each was last asked for (JSON). */
|
|
5
|
+
missing?: string | undefined;
|
|
6
|
+
/** Out: the same list after this poll. Unset when the poll did not get as far as asking. */
|
|
7
|
+
next?: string;
|
|
8
|
+
/** In: identifiers whose requests failed on the last poll (JSON). They are asked for last. */
|
|
9
|
+
troubled?: string | undefined;
|
|
10
|
+
/** Out: the identifiers whose requests failed on this poll. */
|
|
11
|
+
nextTroubled?: string;
|
|
12
|
+
/** In: for each package version, when its lookup was last tried (JSON). */
|
|
13
|
+
lookups?: string | undefined;
|
|
14
|
+
/** Out: the same after this poll. */
|
|
15
|
+
nextLookups?: string;
|
|
16
|
+
/** In: new records still to be read, each with the time of its first failure and its arrival (JSON). */
|
|
17
|
+
owed?: string | undefined;
|
|
18
|
+
/** Out: the same list after this poll. */
|
|
19
|
+
nextOwed?: string;
|
|
20
|
+
/** In: since when a listing entry without a usable identifier has held the checkpoint. */
|
|
21
|
+
refusedSince?: number | undefined;
|
|
22
|
+
/** Out: the same, or null when no such entry is waited for. */
|
|
23
|
+
nextRefusedSince?: number | null;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Whether a record concerns this inventory. Advisory text is matched only against terms the operator
|
|
27
|
+
* declared (products and keywords): an advisory names its packages in structured claims, and package
|
|
28
|
+
* names such as "send" or "buffer" appear in unrelated descriptions. News has no structured claims,
|
|
29
|
+
* so a package named in a story about packages also counts.
|
|
30
|
+
*/
|
|
31
|
+
export declare function evidenceRelevant(item: Evidence, inventory: Inventory): boolean;
|
|
32
|
+
/** Collect recent CVEs, exact npm matches and updates to relevant tracked IDs.
|
|
33
|
+
* The publication-ordered listing does not cover every historical modification, and a record the
|
|
34
|
+
* service ingests more than LATE_INGEST_DAYS after its publication date is not found by it. */
|
|
35
|
+
export declare function collectCveNow(inventory: Inventory, checkpoint: string | undefined, previous: Evidence[], news: Evidence[], http: HttpClient, now: number, state?: CveNowState): Promise<Evidence[]>;
|