@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,27 @@
|
|
|
1
|
+
version: 1
|
|
2
|
+
inventory: ./libraries.example.yaml
|
|
3
|
+
database: ./data/libraries.db
|
|
4
|
+
poll_interval_minutes: 30
|
|
5
|
+
|
|
6
|
+
# Structured package checks work without a model or model credentials.
|
|
7
|
+
sources:
|
|
8
|
+
cve_now: false
|
|
9
|
+
hacker_news: false
|
|
10
|
+
osv: true
|
|
11
|
+
github: false
|
|
12
|
+
kev: false
|
|
13
|
+
feeds: []
|
|
14
|
+
vendor_feeds: []
|
|
15
|
+
models:
|
|
16
|
+
enabled: false
|
|
17
|
+
|
|
18
|
+
policy:
|
|
19
|
+
library:
|
|
20
|
+
levels: [critical]
|
|
21
|
+
basis: source_severity
|
|
22
|
+
channels: [] # Set [slack] or [email], and configure that destination below.
|
|
23
|
+
health_channels: []
|
|
24
|
+
notifications:
|
|
25
|
+
max_attempts: 3
|
|
26
|
+
# slack:
|
|
27
|
+
# webhook_url_env: SLACK_WEBHOOK_URL
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import assert from 'node:assert/strict';
|
|
2
|
+
import { dirname, join } from 'node:path';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
import { parseConfig, loadInventory, readFixture, Store, runScan } from '@shieldaai/security-watch';
|
|
5
|
+
|
|
6
|
+
// Use fictional data distributed in the installed package, not private inventory.
|
|
7
|
+
const packageRoot = dirname(dirname(fileURLToPath(import.meta.resolve('@shieldaai/security-watch'))));
|
|
8
|
+
const inventory = loadInventory(join(packageRoot, 'examples/systems.example.yaml'));
|
|
9
|
+
const now = new Date().toISOString();
|
|
10
|
+
for (const system of inventory.systems) system.updated_at = now;
|
|
11
|
+
// Simulated fresh capture times for fictional evidence; nothing was fetched.
|
|
12
|
+
const fixture = readFixture(join(packageRoot, 'examples/advisories.json')).map((event) => ({
|
|
13
|
+
...event,
|
|
14
|
+
modified_at: now,
|
|
15
|
+
fetched_at: now,
|
|
16
|
+
}));
|
|
17
|
+
const config = parseConfig({ version: 1 });
|
|
18
|
+
const store = new Store(':memory:');
|
|
19
|
+
const previousFetch = globalThis.fetch;
|
|
20
|
+
globalThis.fetch = async () => {
|
|
21
|
+
throw new Error('This fixture example must not use the network');
|
|
22
|
+
};
|
|
23
|
+
try {
|
|
24
|
+
const report = await runScan({
|
|
25
|
+
config,
|
|
26
|
+
inventory,
|
|
27
|
+
store,
|
|
28
|
+
fixture,
|
|
29
|
+
});
|
|
30
|
+
assert(report.findings.some((f) => f.applicability === 'affected'));
|
|
31
|
+
assert(report.findings.some((f) => f.applicability === 'not_affected'));
|
|
32
|
+
for (const finding of report.findings) {
|
|
33
|
+
console.log(
|
|
34
|
+
`${finding.system_id}: ${finding.applicability}; source severity: ${finding.source_severity}`,
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
console.log('All assertions passed. Fictional advisory and inventory; in-memory storage.');
|
|
38
|
+
console.log('No network, model requests, credentials or notifications.');
|
|
39
|
+
} finally {
|
|
40
|
+
store.close();
|
|
41
|
+
globalThis.fetch = previousFetch;
|
|
42
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 1,
|
|
3
|
+
"frames": [
|
|
4
|
+
{
|
|
5
|
+
"at": "2026-11-05T12:00:00.000Z",
|
|
6
|
+
"inventory": {
|
|
7
|
+
"systems": [
|
|
8
|
+
{
|
|
9
|
+
"id": "synthetic-rehearsal",
|
|
10
|
+
"name": "Synthetic rehearsal",
|
|
11
|
+
"environment": "test",
|
|
12
|
+
"exposure": "unknown",
|
|
13
|
+
"criticality": "low",
|
|
14
|
+
"updated_at": "2026-11-05T12:00:00.000Z",
|
|
15
|
+
"components": [
|
|
16
|
+
{
|
|
17
|
+
"id": "example-parser",
|
|
18
|
+
"ecosystem": "npm",
|
|
19
|
+
"name": "example-parser",
|
|
20
|
+
"version": "1.0.0"
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
"products": [],
|
|
24
|
+
"keywords": []
|
|
25
|
+
}
|
|
26
|
+
]
|
|
27
|
+
},
|
|
28
|
+
"evidence": [
|
|
29
|
+
{
|
|
30
|
+
"id": "synthetic:rehearsal-parser",
|
|
31
|
+
"source": "synthetic",
|
|
32
|
+
"kind": "advisory",
|
|
33
|
+
"title": "Synthetic parser advisory",
|
|
34
|
+
"description": "Fictional deterministic staging input.",
|
|
35
|
+
"url": "https://example.invalid/rehearsal",
|
|
36
|
+
"aliases": ["CVE-2099-99901"],
|
|
37
|
+
"severity": "critical",
|
|
38
|
+
"modified_at": "2026-11-05T12:00:00.000Z",
|
|
39
|
+
"fetched_at": "2026-11-05T12:00:00.000Z",
|
|
40
|
+
"packages": [
|
|
41
|
+
{
|
|
42
|
+
"ecosystem": "npm",
|
|
43
|
+
"name": "example-parser",
|
|
44
|
+
"range": "<2.0.0"
|
|
45
|
+
}
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
]
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"at": "2026-11-05T12:01:00.000Z",
|
|
52
|
+
"evidence": [
|
|
53
|
+
{
|
|
54
|
+
"id": "synthetic:rehearsal-parser",
|
|
55
|
+
"source": "synthetic",
|
|
56
|
+
"kind": "advisory",
|
|
57
|
+
"title": "Synthetic parser advisory",
|
|
58
|
+
"description": "Fictional deterministic staging input.",
|
|
59
|
+
"url": "https://example.invalid/rehearsal",
|
|
60
|
+
"aliases": ["CVE-2099-99901"],
|
|
61
|
+
"severity": "critical",
|
|
62
|
+
"modified_at": "2026-11-05T12:00:00.000Z",
|
|
63
|
+
"fetched_at": "2026-11-05T12:00:00.000Z",
|
|
64
|
+
"packages": [
|
|
65
|
+
{
|
|
66
|
+
"ecosystem": "npm",
|
|
67
|
+
"name": "example-parser",
|
|
68
|
+
"range": "<2.0.0"
|
|
69
|
+
}
|
|
70
|
+
]
|
|
71
|
+
}
|
|
72
|
+
]
|
|
73
|
+
}
|
|
74
|
+
]
|
|
75
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
version: 1
|
|
2
|
+
inventory: ./systems.example.yaml
|
|
3
|
+
database: ./data/watch.db
|
|
4
|
+
poll_interval_minutes: 30
|
|
5
|
+
news_lookback_minutes: 40
|
|
6
|
+
inventory_stale_days: 7
|
|
7
|
+
digest_interval_hours: 24
|
|
8
|
+
|
|
9
|
+
sources:
|
|
10
|
+
cve_now: true
|
|
11
|
+
hacker_news: true # The Hacker News security publication, not Hacker News/Y Combinator.
|
|
12
|
+
osv: false # Enable for library queries across the supported ecosystems.
|
|
13
|
+
github: false
|
|
14
|
+
github_token_env: GITHUB_TOKEN
|
|
15
|
+
kev: false
|
|
16
|
+
feeds: [] # Optional additional public HTTPS RSS/Atom feeds.
|
|
17
|
+
vendor_feeds: [] # Optional official news: [nodejs, python, php].
|
|
18
|
+
|
|
19
|
+
models:
|
|
20
|
+
enabled: false
|
|
21
|
+
daily_request_limit: 100
|
|
22
|
+
daily_token_limit: 100000
|
|
23
|
+
max_input_chars: 12000
|
|
24
|
+
max_output_tokens: 1500
|
|
25
|
+
timeout_seconds: 45
|
|
26
|
+
# Enable AI to distinguish an impacted system from general news about it.
|
|
27
|
+
# Set enabled: true, provide credentials, and configure your exact model ID:
|
|
28
|
+
# analysis:
|
|
29
|
+
# provider: openai
|
|
30
|
+
# model: YOUR_MODEL_ID
|
|
31
|
+
# api_key_env: OPENAI_API_KEY
|
|
32
|
+
# verification:
|
|
33
|
+
# provider: anthropic
|
|
34
|
+
# model: YOUR_REVIEW_MODEL_ID
|
|
35
|
+
# api_key_env: ANTHROPIC_API_KEY
|
|
36
|
+
# daily_budget_usd requires input_usd_per_million and output_usd_per_million
|
|
37
|
+
# on each model. Without prices, only request and token limits are enforced.
|
|
38
|
+
|
|
39
|
+
policy:
|
|
40
|
+
library:
|
|
41
|
+
levels: [critical]
|
|
42
|
+
basis: source_severity
|
|
43
|
+
channels: [] # Choose [slack], [email], or [slack, email] and configure below.
|
|
44
|
+
product:
|
|
45
|
+
levels: [high, critical]
|
|
46
|
+
basis: priority
|
|
47
|
+
channels: []
|
|
48
|
+
news:
|
|
49
|
+
levels: [high, critical]
|
|
50
|
+
basis: priority
|
|
51
|
+
channels: []
|
|
52
|
+
urgent_unknown: true
|
|
53
|
+
exploited_override: true
|
|
54
|
+
malware_override: true
|
|
55
|
+
health_channels: [] # Recommended: a working channel for monitoring failures.
|
|
56
|
+
|
|
57
|
+
notifications:
|
|
58
|
+
max_attempts: 3
|
|
59
|
+
# slack:
|
|
60
|
+
# webhook_url_env: SLACK_WEBHOOK_URL
|
|
61
|
+
# email:
|
|
62
|
+
# smtp_url_env: SMTP_URL
|
|
63
|
+
# from: security-watch@example.com
|
|
64
|
+
# to: [security@example.com]
|
|
65
|
+
|
|
66
|
+
# Optional external success pings. Configure the receiver to alert on missed pings.
|
|
67
|
+
# monitoring:
|
|
68
|
+
# heartbeat_url_env: HEARTBEAT_URL
|
|
69
|
+
# interval_seconds: 60
|
|
70
|
+
# allow_private_endpoint: false
|
|
71
|
+
|
|
72
|
+
# Optional automatic maintenance. Preview with `security-watch prune` before starting.
|
|
73
|
+
# maintenance:
|
|
74
|
+
# interval_hours: 24
|
|
75
|
+
# retention:
|
|
76
|
+
# analysis_cache_days: 30
|
|
77
|
+
# evidence_history_days: 180
|
|
78
|
+
# finding_history_days: 180
|
|
79
|
+
# accepted_delivery_days: 180
|
|
80
|
+
# inactive_findings_days: 365
|
|
81
|
+
# unreferenced_evidence_days: 365
|
|
82
|
+
# batch_size: 1000
|
|
83
|
+
# backup:
|
|
84
|
+
# directory: ./backups
|
|
85
|
+
# keep: 7
|
|
86
|
+
# max_bytes: 536870912
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Fictional demonstration data. Replace it and update updated_at before real monitoring.
|
|
2
|
+
systems:
|
|
3
|
+
- id: payments-production
|
|
4
|
+
name: Payments API
|
|
5
|
+
environment: production
|
|
6
|
+
owner: payments-team
|
|
7
|
+
# A note says where to look. It is repeated in every alert about this system.
|
|
8
|
+
note: runs on cluster eu-1, namespace payments; on-call rota "payments"
|
|
9
|
+
exposure: internet
|
|
10
|
+
criticality: critical
|
|
11
|
+
updated_at: '2026-10-23T00:00:00Z'
|
|
12
|
+
components:
|
|
13
|
+
- id: example-parser
|
|
14
|
+
ecosystem: npm
|
|
15
|
+
name: example-parser
|
|
16
|
+
version: 1.2.0
|
|
17
|
+
note: request parsing in services/payments-api, file package.json
|
|
18
|
+
# lockfile: ../application/package-lock.json
|
|
19
|
+
products:
|
|
20
|
+
- name: Example Database
|
|
21
|
+
version: '4.2'
|
|
22
|
+
keywords: [Example Database Server]
|
|
23
|
+
note: managed instance "payments-prod", owned by the data team
|
|
24
|
+
keywords: [Example Cloud]
|
|
25
|
+
- id: payments-staging
|
|
26
|
+
name: Payments staging
|
|
27
|
+
environment: staging
|
|
28
|
+
exposure: internal
|
|
29
|
+
criticality: medium
|
|
30
|
+
updated_at: '2026-10-23T00:00:00Z'
|
|
31
|
+
components:
|
|
32
|
+
- id: example-parser
|
|
33
|
+
ecosystem: npm
|
|
34
|
+
name: example-parser
|
|
35
|
+
version: 1.3.0
|
package/package.json
CHANGED
|
@@ -1,6 +1,87 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shieldaai/security-watch",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Know quickly which new vulnerabilities and security news affect your stack. Self-hosted advisory monitoring with Slack or email alerts.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "Apache-2.0",
|
|
7
|
+
"engines": {
|
|
8
|
+
"node": ">=24.10.0"
|
|
9
|
+
},
|
|
10
|
+
"bin": {
|
|
11
|
+
"security-watch": "dist/cli.js"
|
|
12
|
+
},
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"import": "./dist/index.js"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"dist",
|
|
21
|
+
"examples",
|
|
22
|
+
"docs",
|
|
23
|
+
"README.md",
|
|
24
|
+
"CHANGELOG.md",
|
|
25
|
+
"LICENSE",
|
|
26
|
+
"SECURITY.md",
|
|
27
|
+
"CONTRIBUTING.md"
|
|
28
|
+
],
|
|
29
|
+
"scripts": {
|
|
30
|
+
"build": "node scripts/build.mjs",
|
|
31
|
+
"test": "npm run build && node --test test/*.test.mjs",
|
|
32
|
+
"test:coverage": "npm run build && node --test --experimental-test-coverage --test-coverage-lines=95 --test-coverage-branches=88 --test-coverage-functions=95 --test-coverage-exclude=test/** test/*.test.mjs",
|
|
33
|
+
"check": "npm run format:check && npm test && node scripts/check-package.mjs",
|
|
34
|
+
"check:package": "node scripts/check-package.mjs",
|
|
35
|
+
"check:models": "npm run build && node scripts/check-models.mjs",
|
|
36
|
+
"evaluate:models": "npm run build && node scripts/evaluate-models.mjs",
|
|
37
|
+
"start": "node dist/cli.js start",
|
|
38
|
+
"prepublishOnly": "node scripts/release-check.mjs",
|
|
39
|
+
"release": "node scripts/release.mjs",
|
|
40
|
+
"demo": "npm run build && node scripts/demo.mjs",
|
|
41
|
+
"check:docker": "node scripts/check-docker.mjs",
|
|
42
|
+
"format": "prettier --write .",
|
|
43
|
+
"format:check": "prettier --check .",
|
|
44
|
+
"prepack": "npm run build",
|
|
45
|
+
"evaluate:outcomes": "npm run build && node scripts/evaluate-alerts.mjs"
|
|
46
|
+
},
|
|
47
|
+
"dependencies": {
|
|
48
|
+
"@renovatebot/pep440": "6.0.0",
|
|
49
|
+
"fast-xml-parser": "5.12.1",
|
|
50
|
+
"ipaddr.js": "2.5.0",
|
|
51
|
+
"nodemailer": "10.2.1",
|
|
52
|
+
"parse5": "8.0.1",
|
|
53
|
+
"semver": "7.8.5",
|
|
54
|
+
"yaml": "2.9.1",
|
|
55
|
+
"zod": "4.6.7"
|
|
56
|
+
},
|
|
57
|
+
"devDependencies": {
|
|
58
|
+
"@types/node": "24.10.1",
|
|
59
|
+
"@types/nodemailer": "7.0.4",
|
|
60
|
+
"@types/semver": "7.7.1",
|
|
61
|
+
"prettier": "3.9.10",
|
|
62
|
+
"typescript": "7.0.2"
|
|
63
|
+
},
|
|
64
|
+
"publishConfig": {
|
|
65
|
+
"access": "public",
|
|
66
|
+
"tag": "latest"
|
|
67
|
+
},
|
|
68
|
+
"repository": {
|
|
69
|
+
"type": "git",
|
|
70
|
+
"url": "git+https://github.com/ShieldaAI/security-watch.git"
|
|
71
|
+
},
|
|
72
|
+
"bugs": {
|
|
73
|
+
"url": "https://github.com/ShieldaAI/security-watch/issues"
|
|
74
|
+
},
|
|
75
|
+
"homepage": "https://github.com/ShieldaAI/security-watch#readme",
|
|
76
|
+
"keywords": [
|
|
77
|
+
"security-advisories",
|
|
78
|
+
"dependency-monitoring",
|
|
79
|
+
"vulnerability-monitoring",
|
|
80
|
+
"cve",
|
|
81
|
+
"osv",
|
|
82
|
+
"npm",
|
|
83
|
+
"slack",
|
|
84
|
+
"self-hosted",
|
|
85
|
+
"typescript"
|
|
86
|
+
]
|
|
87
|
+
}
|