@shieldaai/security-watch 1.1.1 → 1.2.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 +20 -0
- package/README.md +5 -5
- package/SECURITY.md +2 -1
- package/dist/assessment.js +54 -0
- package/dist/config.d.ts +4 -0
- package/dist/config.js +4 -0
- package/dist/delivery.js +43 -1
- package/dist/engine.js +23 -3
- package/dist/epss.d.ts +37 -0
- package/dist/epss.js +166 -0
- package/dist/index.d.ts +1 -1
- package/dist/matching.d.ts +6 -0
- package/dist/matching.js +1 -1
- package/dist/news-signals.d.ts +29 -0
- package/dist/news-signals.js +271 -0
- package/dist/store.js +2 -1
- package/dist/types.d.ts +55 -0
- package/docs/configuration.md +31 -1
- package/docs/offline-advisory-preview.md +2 -2
- package/docs/sbom.md +3 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,26 @@
|
|
|
2
2
|
|
|
3
3
|
Versions follow [semantic versioning](https://semver.org/). What counts as a compatible change is defined in the [compatibility policy](docs/compatibility.md).
|
|
4
4
|
|
|
5
|
+
## 1.2.0
|
|
6
|
+
|
|
7
|
+
News that no advisory has scored yet gets a level from what the articles say, and findings can show EPSS. Existing configurations and inventories work unchanged. To be published under the default `latest` tag; the GitHub Action is used as `uses: ShieldaAI/security-watch@v1.2.0`.
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- **News signals.** For a news finding with no advisory severity (a zero-day without a CVE, a CVE that is reserved but not published, a vendor bulletin), the articles are read, without a model, for a CVSS score, a vendor's word rating, a report of exploitation, a denial of exploitation and public exploit code. A score or rating raises the finding's priority to at least its level; a report of exploitation raises it to critical, so with `urgent_unknown` (the default) the finding is sent at once as possibly critical. A statement counts only when it is tied to the finding's subject (its CVE or GHSA identifier, or the product or package it matched); negated and hedged statements and "zero-day" alone are not reports. Signals never lower, dismiss or mark a finding as known exploited, and stop being read once an advisory with a severity joins the finding. Alerts and digests have a `News signals:` line with the score, rating and subject only; `explain` shows the sentences they were read from. See [news signals](docs/configuration.md#news-signals).
|
|
12
|
+
- `policy.news_signals` (default `true`) turns news signals off.
|
|
13
|
+
- **EPSS, optional.** `sources.epss: true` looks up FIRST's EPSS for the CVEs of each current finding (including the CVE aliases of a GHSA-keyed library finding) and shows the highest, with its CVE, in alerts, digests, `explain`, `findings` and the scan report (`Assessment.epss`, exported type `EpssScore`). Only CVE identifiers are sent to `api.first.org`, in batches of 50, at most ten requests a scan, each score refreshed once a day. It is shown only: it changes no priority or decision, and a new daily score creates no finding revision, reopens no review and asks no model for a new analysis. A failed lookup is a notice, and findings keep the last score. See [EPSS](docs/configuration.md#epss).
|
|
14
|
+
- `Assessment.news_signals` and the exported types `NewsSignals` and `NewsStatement`.
|
|
15
|
+
- The configuration guide lists feeds that carry full articles with scores or exploitation reports (Rapid7, Tenable, The Register, Security Affairs, the Zero Day Initiative) and those that carry only headlines.
|
|
16
|
+
|
|
17
|
+
### Changed
|
|
18
|
+
|
|
19
|
+
- **Louder for unscored news.** A news finding that an article reports as exploited, or that an article scores at 9.0 or above, now alerts at once where 1.1 put it in the digest. Measured on one week of real articles against a 20-product inventory: five findings were raised and one more immediate alert was sent (an actively exploited ScreenConnect plugin). The first scan after the upgrade reassesses news findings still in the news window, so a raised one is sent once.
|
|
20
|
+
|
|
21
|
+
### Not verified
|
|
22
|
+
|
|
23
|
+
- Measured on 256 articles from one week of November 2026, labelled by the developer, not by an independent reviewer. The human-labelled pilot and a real Slack and email delivery remain open, as in 1.0.
|
|
24
|
+
|
|
5
25
|
## 1.1.1
|
|
6
26
|
|
|
7
27
|
Fixes for feeds that were read wrongly and for two checks that trusted a name. No configuration change. To be published under the default `latest` tag; the GitHub Action is used as `uses: ShieldaAI/security-watch@v1.1.1`.
|
package/README.md
CHANGED
|
@@ -86,7 +86,7 @@ intake:
|
|
|
86
86
|
|
|
87
87
|
```yaml
|
|
88
88
|
# GitHub Actions: makes the SBOM and sends it; the job fails if the monitor refuses it
|
|
89
|
-
- uses: ShieldaAI/security-watch@v1.
|
|
89
|
+
- uses: ShieldaAI/security-watch@v1.2.0
|
|
90
90
|
with:
|
|
91
91
|
system-id: my-app
|
|
92
92
|
owner: Dana, platform team
|
|
@@ -96,7 +96,7 @@ intake:
|
|
|
96
96
|
|
|
97
97
|
```sh
|
|
98
98
|
# Any other pipeline with Node.js 24 and SECURITY_WATCH_INTAKE_TOKEN set
|
|
99
|
-
npx --yes @shieldaai/security-watch@1.
|
|
99
|
+
npx --yes @shieldaai/security-watch@1.2.0 sbom --system-id my-app --upload https://watch.example.com:8787
|
|
100
100
|
```
|
|
101
101
|
|
|
102
102
|
[Watch a project from its dependency files](docs/sbom.md) covers the files that are read, GitLab CI, the receiver (tokens limited to some systems, TLS, Docker), other ways to deliver SBOMs, and SBOMs from Trivy, Syft, cdxgen or GitHub's dependency graph, which are accepted as they are.
|
|
@@ -126,11 +126,11 @@ Everything after `#` on a library line is the note for that library. Keep the qu
|
|
|
126
126
|
|
|
127
127
|
If your list contains libraries that are not npm packages (Python, PHP, Java, Go and so on), also open `watch/security-watch.yaml` and change `osv: false` to `osv: true`. That turns on the advisory database that covers those ecosystems; it receives the library names and versions you list. `init --project` does this for you when it finds such packages.
|
|
128
128
|
|
|
129
|
-
**What gets sent.** With the starter settings you get an immediate message for a critical finding in a library, anything reported as actively exploited, a malicious package, and a possibly critical finding that still needs checking (a critical product or news finding is one of these until it is confirmed). High findings for a product or in the news usually arrive in the daily digest: a product match cannot be confirmed from version ranges, and news is sent at once only when a configured model confirms that it affects you. Less urgent findings that need a look arrive together in one daily digest. Everything else is recorded and shown by `security-watch findings`. The `policy` section of the configuration file changes these thresholds.
|
|
129
|
+
**What gets sent.** With the starter settings you get an immediate message for a critical finding in a library, anything reported as actively exploited, a malicious package, and a possibly critical finding that still needs checking (a critical product or news finding is one of these until it is confirmed). High findings for a product or in the news usually arrive in the daily digest: a product match cannot be confirmed from version ranges, and news is sent at once only when a configured model confirms that it affects you, or when an article reports that something on your list is being exploited. News that no advisory has scored yet takes the CVSS score or vendor rating an article states for it ([news signals](docs/configuration.md#news-signals)). Less urgent findings that need a look arrive together in one daily digest. Everything else is recorded and shown by `security-watch findings`. The `policy` section of the configuration file changes these thresholds.
|
|
130
130
|
|
|
131
131
|
To try it with no network access and fictional data first, follow the [offline advisory preview](docs/offline-advisory-preview.md). The rest of this page covers the options in detail.
|
|
132
132
|
|
|
133
|
-
**Version 1.
|
|
133
|
+
**Version 1.2.0.** This is `@shieldaai/security-watch` 1.2.0, a minor release of the first stable version (1.0.0). It reads CVSS scores, vendor ratings and exploitation reports from news for findings that no advisory has scored yet, and can show FIRST's EPSS for each CVE; 1.1 added SBOM generation from dependency files, an SBOM folder for pipelines, SPDX import and a GitHub Action. It is published under the default `latest` tag and has no independent security audit. Read the [coverage and security limits](SECURITY.md) before relying on it, the [compatibility policy](docs/compatibility.md) for what stays stable, and the [changelog](CHANGELOG.md) for what changed.
|
|
134
134
|
|
|
135
135
|
Related projects: [Agent Guard](https://github.com/ShieldaAI/agent-guard) for tool permissions and approvals, and [SafeCall Node](https://github.com/GuardianMesh/llm-safecall-node) or [SafeCall Python](https://github.com/GuardianMesh/llm-safecall) for model response validation. The [package selection guide](https://github.com/ShieldaAI/agent-guard/blob/main/docs/package-guide.md) explains how they fit together.
|
|
136
136
|
|
|
@@ -170,7 +170,7 @@ To build and install from a source checkout:
|
|
|
170
170
|
npm ci
|
|
171
171
|
npm run check
|
|
172
172
|
npm pack
|
|
173
|
-
npm install --global ./shieldaai-security-watch-1.
|
|
173
|
+
npm install --global ./shieldaai-security-watch-1.2.0.tgz
|
|
174
174
|
```
|
|
175
175
|
|
|
176
176
|
Choose one setup command below. To start from your own code, use `init --project` as in [step 2](#get-started-in-four-steps). For a fictional example with AI disabled:
|
package/SECURITY.md
CHANGED
|
@@ -28,7 +28,7 @@ Models can misinterpret sources, feeds can omit important facts, and advisories
|
|
|
28
28
|
|
|
29
29
|
## Data handling
|
|
30
30
|
|
|
31
|
-
cve.now stack requests reveal deduplicated npm package names and exact versions through URL query parameters; lockfiles and system/deployment metadata are not uploaded. The Hacker News feed and article servers receive normal HTTP request metadata. Optional OSV requests reveal library ecosystem, package name and the installed version when supplied. Official vendor feeds receive normal request metadata. Other enabled advisory/feed servers receive normal request metadata, and GitHub may receive the configured API token.
|
|
31
|
+
cve.now stack requests reveal deduplicated npm package names and exact versions through URL query parameters; lockfiles and system/deployment metadata are not uploaded. The Hacker News feed and article servers receive normal HTTP request metadata. Optional OSV requests reveal library ecosystem, package name and the installed version when supplied. Official vendor feeds receive normal request metadata. With `sources.epss`, `api.first.org` receives the CVE identifiers of current findings, which together suggest which software you run. Other enabled advisory/feed servers receive normal request metadata, and GitHub may receive the configured API token.
|
|
32
32
|
|
|
33
33
|
Each configured AI model defaults to the `minimal` disclosure profile. It receives selected relevant package ecosystem/name/version and product name/version, request-local IDs and inventory freshness status, plus target event and selected evidence fields/excerpts. Original inventory IDs, system name/owner, repository URLs, provenance, dependency graphs, verification declarations, remediation records and operator identities are excluded. `deployment-context` opts that specific model into environment/exposure/criticality and evidence-matching keywords, never other inventory metadata. The verifier applies its own profile independently. Allowed names and evidence text are not secret-redacted; do not place private content there unless the endpoint is approved to receive it. Full contracts and migration behavior are in [model disclosure configuration](docs/configuration.md#data-sent-to-models).
|
|
34
34
|
|
|
@@ -47,6 +47,7 @@ SQLite stores evidence, finding revisions, model analysis excerpts, caches, budg
|
|
|
47
47
|
- Missing versions, unknown constraints and stale inventory remain uncertain. An empty advisory search does not establish that a system has no vulnerabilities.
|
|
48
48
|
- CVSS v3.0/v3.1 calculation and supplied source labels/scores are supported. For OSV and GitHub records, CVSS v4 base vectors are scored with the pinned FIRST reference calculator; threat and environmental metrics are not applied, and unsupported vectors are counted and left unknown. See [CVSS v4 support](docs/cvss-v4-support.md).
|
|
49
49
|
- A package named only in the prose of a news story is matched by rules, not by understanding: a name that is an English word must be named as a package, carry a release or be written as a name, a scoped package is matched by its full name only, and a Maven library by its coordinates or by an artifact name that is not an English word. Stories about such packages can be missed and, less often, an unrelated story can match; see the [matching rules](docs/configuration.md#sources-and-coverage). Advisories are matched by structured package claims and are not affected.
|
|
50
|
+
- News signals (stated CVSS scores, vendor ratings and exploitation reports read from articles for findings without an advisory severity) are text matching, not verification. An article can be wrong, out of date or written to mislead, and every feed you add is trusted to say what it means: a feed that falsely reports exploitation of a product you list raises that finding to critical and, with `urgent_unknown`, sends it at once. Signals only raise priority; they never lower, dismiss or mark a finding as known exploited, and statements that cannot be tied to the finding's subject in their sentence or clause are not read. A feed can still raise every product it names in a report of exploitation, one clause at a time; add only feeds you trust. See [news signals](docs/configuration.md#news-signals).
|
|
50
51
|
- Source requests and model inputs have size and request limits. Incomplete collection or analysis reports degraded monitoring and requires review.
|
|
51
52
|
- Recent cve.now entry collection, tracked/news-cited refreshes and exact npm stack queries do not establish exhaustive historical coverage for every product. The recent listing is read one week past the checkpoint; a record cve.now ingests more than a week after its publication date is found only through an exact npm match or a news citation. The Hacker News may block article access; the feed excerpt remains available for review without a confident impact conclusion.
|
|
52
53
|
- CycloneDX JSON 1.4–1.6 and SPDX JSON 2.2/2.3 package metadata import, and SBOM generation from lockfiles and manifests (`security-watch sbom`), are supported, but not VEX ingestion, operating-system package matching, attestation verification or live deployment discovery. There is no authenticated web crawling, automatic remediation, distributed lock, multi-host worker or independent penetration-test certification.
|
package/dist/assessment.js
CHANGED
|
@@ -3,6 +3,7 @@ import { pythonRangeStatus } from './python-version.js';
|
|
|
3
3
|
import { hash, highest, severityRank, timestamp } from './util.js';
|
|
4
4
|
import { exactLibraryVersion, normalizeEcosystem, packageKey } from './ecosystems.js';
|
|
5
5
|
import { mentions, packageMentioned } from './matching.js';
|
|
6
|
+
import { newsSignals, signalLevel } from './news-signals.js';
|
|
6
7
|
export function normalizeEventId(id) {
|
|
7
8
|
return /^(?:CVE-|GHSA-)/i.test(id) ? id.toUpperCase() : id;
|
|
8
9
|
}
|
|
@@ -247,6 +248,7 @@ knownFindings = new Set()) {
|
|
|
247
248
|
index.set(system, byKey);
|
|
248
249
|
}
|
|
249
250
|
for (const group of groupEvidence(evidence, knownEvents)) {
|
|
251
|
+
const firstOfGroup = output.length;
|
|
250
252
|
const advisories = group.evidence.filter((item) => item.kind === 'advisory');
|
|
251
253
|
const isNews = advisories.length === 0;
|
|
252
254
|
const identifiedNews = isNews && group.evidence.some((item) => identifiers(item).some(advisoryIdentifier));
|
|
@@ -392,9 +394,61 @@ knownFindings = new Set()) {
|
|
|
392
394
|
result.summary = `Security news relevant to ${system.name}; review the linked evidence.`;
|
|
393
395
|
output.push(result);
|
|
394
396
|
}
|
|
397
|
+
if (config.policy?.news_signals !== false)
|
|
398
|
+
applyNewsSignals(group, output.slice(firstOfGroup), inventory);
|
|
395
399
|
}
|
|
396
400
|
return output.sort((a, b) => a.id.localeCompare(b.id));
|
|
397
401
|
}
|
|
402
|
+
/**
|
|
403
|
+
* Raises the priority of news findings that have no advisory severity by what the articles state
|
|
404
|
+
* about their subject: a CVSS score, a vendor's word rating or a report of exploitation. Never
|
|
405
|
+
* lowers anything; the source severity stays what advisory sources said.
|
|
406
|
+
*/
|
|
407
|
+
function applyNewsSignals(group, results, inventory) {
|
|
408
|
+
const articles = group.evidence.filter((item) => item.kind === 'news');
|
|
409
|
+
if (!articles.length)
|
|
410
|
+
return;
|
|
411
|
+
const ids = [
|
|
412
|
+
...new Set([group.event, ...group.evidence.filter((item) => item.kind !== 'news').flatMap(identifiers)].filter(advisoryIdentifier)),
|
|
413
|
+
];
|
|
414
|
+
const cache = new Map();
|
|
415
|
+
for (const result of results) {
|
|
416
|
+
if (result.source_severity !== 'unknown' || !(result.news_candidate || result.news_only))
|
|
417
|
+
continue;
|
|
418
|
+
const system = inventory.systems.find((item) => item.id === result.system_id);
|
|
419
|
+
if (!system)
|
|
420
|
+
continue;
|
|
421
|
+
const names = targetNames(result, system, articles);
|
|
422
|
+
const key = JSON.stringify(names);
|
|
423
|
+
if (!cache.has(key))
|
|
424
|
+
cache.set(key, newsSignals(articles, { identifiers: ids, names }));
|
|
425
|
+
const signals = cache.get(key);
|
|
426
|
+
if (!signals)
|
|
427
|
+
continue;
|
|
428
|
+
const { level, reasons } = signalLevel(signals);
|
|
429
|
+
result.news_signals = signals;
|
|
430
|
+
result.reasons.push(...reasons);
|
|
431
|
+
if (level !== 'unknown')
|
|
432
|
+
result.priority = highest(result.priority, contextualPriority(level, system, false));
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
/** The inventory names a finding was matched by, for tying article statements to it. */
|
|
436
|
+
function targetNames(result, system, articles) {
|
|
437
|
+
const product = result.component_id?.startsWith('product:')
|
|
438
|
+
? system.products.find((item) => `product:${item.name.toLowerCase()}` === result.component_id)
|
|
439
|
+
: undefined;
|
|
440
|
+
if (product)
|
|
441
|
+
return [product.name, ...product.keywords];
|
|
442
|
+
const component = system.components.find((item) => item.id === result.component_id);
|
|
443
|
+
if (component)
|
|
444
|
+
return [component.name];
|
|
445
|
+
// A system-level news finding: its keywords and the installed packages the news names.
|
|
446
|
+
const text = articles.map((item) => `${item.title}\n${item.description}`).join('\n');
|
|
447
|
+
return [
|
|
448
|
+
...system.keywords,
|
|
449
|
+
...system.components.filter((item) => packageMentioned(text, item)).map((item) => item.name),
|
|
450
|
+
];
|
|
451
|
+
}
|
|
398
452
|
/** The source severity is always a floor; AI-proposed priority reductions cannot suppress it. */
|
|
399
453
|
export function decide(assessment, config) {
|
|
400
454
|
const policy = config.policy;
|
package/dist/config.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ export declare const configSchema: z.ZodObject<{
|
|
|
21
21
|
php: "php";
|
|
22
22
|
python: "python";
|
|
23
23
|
}>>>;
|
|
24
|
+
epss: z.ZodDefault<z.ZodBoolean>;
|
|
24
25
|
}, z.core.$strict>>;
|
|
25
26
|
models: z.ZodDefault<z.ZodObject<{
|
|
26
27
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -215,6 +216,7 @@ export declare const configSchema: z.ZodObject<{
|
|
|
215
216
|
review: "review";
|
|
216
217
|
}>>;
|
|
217
218
|
review_before_news_suppression: z.ZodOptional<z.ZodBoolean>;
|
|
219
|
+
news_signals: z.ZodDefault<z.ZodBoolean>;
|
|
218
220
|
health_channels: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
219
221
|
email: "email";
|
|
220
222
|
slack: "slack";
|
|
@@ -238,6 +240,7 @@ export declare const configSchema: z.ZodObject<{
|
|
|
238
240
|
urgent_unknown: boolean;
|
|
239
241
|
exploited_override: boolean;
|
|
240
242
|
malware_override: boolean;
|
|
243
|
+
news_signals: boolean;
|
|
241
244
|
health_channels: ("email" | "slack")[];
|
|
242
245
|
ai_dismissals: "record" | "review";
|
|
243
246
|
}, {
|
|
@@ -261,6 +264,7 @@ export declare const configSchema: z.ZodObject<{
|
|
|
261
264
|
malware_override: boolean;
|
|
262
265
|
ai_dismissals?: "record" | "review" | undefined;
|
|
263
266
|
review_before_news_suppression?: boolean | undefined;
|
|
267
|
+
news_signals: boolean;
|
|
264
268
|
health_channels: ("email" | "slack")[];
|
|
265
269
|
}>>;
|
|
266
270
|
notifications: z.ZodDefault<z.ZodObject<{
|
package/dist/config.js
CHANGED
|
@@ -116,6 +116,7 @@ export const configSchema = z
|
|
|
116
116
|
.max(3)
|
|
117
117
|
.refine((values) => new Set(values).size === values.length, 'Duplicate vendor feed')
|
|
118
118
|
.default([]),
|
|
119
|
+
epss: z.boolean().default(false),
|
|
119
120
|
})
|
|
120
121
|
.strict()
|
|
121
122
|
.default({
|
|
@@ -127,6 +128,7 @@ export const configSchema = z
|
|
|
127
128
|
kev: false,
|
|
128
129
|
feeds: [],
|
|
129
130
|
vendor_feeds: [],
|
|
131
|
+
epss: false,
|
|
130
132
|
}),
|
|
131
133
|
models: z
|
|
132
134
|
.object({
|
|
@@ -159,6 +161,7 @@ export const configSchema = z
|
|
|
159
161
|
malware_override: z.boolean().default(true),
|
|
160
162
|
ai_dismissals: z.enum(['review', 'record']).optional(),
|
|
161
163
|
review_before_news_suppression: z.boolean().optional(),
|
|
164
|
+
news_signals: z.boolean().default(true),
|
|
162
165
|
health_channels: channels.default([]),
|
|
163
166
|
})
|
|
164
167
|
.strict()
|
|
@@ -170,6 +173,7 @@ export const configSchema = z
|
|
|
170
173
|
exploited_override: true,
|
|
171
174
|
malware_override: true,
|
|
172
175
|
ai_dismissals: 'review',
|
|
176
|
+
news_signals: true,
|
|
173
177
|
health_channels: [],
|
|
174
178
|
})
|
|
175
179
|
.superRefine((policy, ctx) => {
|
package/dist/delivery.js
CHANGED
|
@@ -268,6 +268,43 @@ function fixLine(fix) {
|
|
|
268
268
|
}
|
|
269
269
|
/** One Slack section holds 3,000 characters. */
|
|
270
270
|
const MESSAGE_LIMIT = 2900;
|
|
271
|
+
/**
|
|
272
|
+
* What articles state about a finding without an advisory severity, in one line. Built from the
|
|
273
|
+
* score, the rating word and the subject (an identifier or an inventory name); article sentences
|
|
274
|
+
* are never put in a message.
|
|
275
|
+
*/
|
|
276
|
+
function newsSignalLine(a) {
|
|
277
|
+
const signals = a.news_signals;
|
|
278
|
+
if (!signals)
|
|
279
|
+
return [];
|
|
280
|
+
const parts = [
|
|
281
|
+
...(signals.cvss
|
|
282
|
+
? [
|
|
283
|
+
`CVSS ${signals.cvss.version ? `${signals.cvss.version} ` : ''}${signals.cvss.score} stated for ${signals.cvss.subject}`,
|
|
284
|
+
]
|
|
285
|
+
: []),
|
|
286
|
+
...(signals.rating ? [`rated "${signals.rating.word}" for ${signals.rating.subject}`] : []),
|
|
287
|
+
...(signals.exploitation
|
|
288
|
+
? ['exploitation reported by an article (not a known-exploited catalog entry)']
|
|
289
|
+
: []),
|
|
290
|
+
...(!signals.exploitation && signals.no_known_exploitation
|
|
291
|
+
? ['an article says no exploitation is known']
|
|
292
|
+
: []),
|
|
293
|
+
...(signals.public_exploit ? ['public exploit code reported'] : []),
|
|
294
|
+
];
|
|
295
|
+
return parts.length ? [single(`News signals: ${parts.join('; ')}`, 300)] : [];
|
|
296
|
+
}
|
|
297
|
+
/** FIRST's EPSS for the finding's CVE, when looked up. Numbers only. */
|
|
298
|
+
function epssLine(a) {
|
|
299
|
+
const epss = a.epss;
|
|
300
|
+
if (!epss || !Number.isFinite(epss.probability) || !Number.isFinite(epss.percentile))
|
|
301
|
+
return [];
|
|
302
|
+
const percent = epss.probability * 100;
|
|
303
|
+
const shown = percent < 0.1 ? 'under 0.1%' : `${percent < 10 ? percent.toFixed(1) : Math.round(percent)}%`;
|
|
304
|
+
return [
|
|
305
|
+
single(`EPSS for ${epss.cve}: ${shown} chance of exploitation in the next 30 days; higher than ${Math.floor(epss.percentile * 100)}% of scored CVEs (FIRST, ${epss.date})`, 200),
|
|
306
|
+
];
|
|
307
|
+
}
|
|
271
308
|
export function notificationText(job) {
|
|
272
309
|
const { assessment: a, reason } = JSON.parse(job.payload);
|
|
273
310
|
const subject = single(`[${a.priority.toUpperCase()}] ${a.title}`, 180);
|
|
@@ -281,6 +318,8 @@ export function notificationText(job) {
|
|
|
281
318
|
...locationLines(a, notes ? 300 : 0),
|
|
282
319
|
`Applicability: ${single(a.applicability, 40)}; source severity: ${single(a.source_severity, 40)}; priority: ${single(a.priority, 40)}`,
|
|
283
320
|
...(a.exploited ? ['Known exploitation reported.'] : []),
|
|
321
|
+
...newsSignalLine(a),
|
|
322
|
+
...epssLine(a),
|
|
284
323
|
`Summary: ${single(a.summary, 750)}`,
|
|
285
324
|
];
|
|
286
325
|
// In the order they give way when the text is too long for one Slack section: the last of these
|
|
@@ -353,7 +392,8 @@ export function notificationText(job) {
|
|
|
353
392
|
}
|
|
354
393
|
return { subject, text };
|
|
355
394
|
}
|
|
356
|
-
|
|
395
|
+
/** @internal Exported for tests; not part of the package root. */
|
|
396
|
+
export function digestText(jobs) {
|
|
357
397
|
const subject = `Security Watch digest: ${jobs.length} findings`;
|
|
358
398
|
const entries = jobs.map((job) => {
|
|
359
399
|
const { assessment: a } = JSON.parse(job.payload);
|
|
@@ -364,6 +404,8 @@ function digestText(jobs) {
|
|
|
364
404
|
`System: ${single(a.system_id, 60)}${a.component_id ? ` / ${single(a.component_id, 60)}` : ''}`,
|
|
365
405
|
...locationLines(a, 120),
|
|
366
406
|
`Applicability: ${single(a.applicability, 40)}; source: ${single(a.source_severity, 40)}`,
|
|
407
|
+
...newsSignalLine(a),
|
|
408
|
+
...epssLine(a),
|
|
367
409
|
...(a.news_analysis
|
|
368
410
|
? [
|
|
369
411
|
`AI news: ${single(a.news_analysis.classification, 60)}; impact: ${single(a.news_analysis.impact, 60)}`,
|
package/dist/engine.js
CHANGED
|
@@ -3,6 +3,7 @@ import { z } from 'zod';
|
|
|
3
3
|
import { cvssV4BaseScore } from './cvss4.js';
|
|
4
4
|
import { assess, decide } from './assessment.js';
|
|
5
5
|
import { collectSources } from './sources.js';
|
|
6
|
+
import { attachEpss, findingCves, readEpssCache, refreshEpss } from './epss.js';
|
|
6
7
|
import { attachLocation, attachRemediation, compareInventories } from './inventory-evidence.js';
|
|
7
8
|
import { ModelAnalyzer, PROMPT_VERSION } from './models.js';
|
|
8
9
|
import { Store } from './store.js';
|
|
@@ -143,8 +144,12 @@ export async function runScan(options) {
|
|
|
143
144
|
const knownFindings = new Set([...previousById.values()].filter((finding) => finding.active !== false).map((finding) => finding.id));
|
|
144
145
|
const decisions = {};
|
|
145
146
|
let remediationEvidence = store.evidence();
|
|
147
|
+
// EPSS is attached when a finding is saved, after its analysis basis is taken, and is left out of
|
|
148
|
+
// its revision and review: a score that changes daily must not re-send, reopen or re-analyse.
|
|
149
|
+
let epssCache = config.sources.epss ? readEpssCache(store.getMeta('epss:cache')) : {};
|
|
150
|
+
let epssEvidence = new Map(remediationEvidence.map((item) => [item.id, item]));
|
|
146
151
|
const persist = (assessment) => {
|
|
147
|
-
assessment = attachLocation(attachRemediation(assessment, inventory, remediationEvidence, config, now), inventory);
|
|
152
|
+
assessment = attachEpss(attachLocation(attachRemediation(assessment, inventory, remediationEvidence, config, now), inventory), epssCache, findingCves(assessment, epssEvidence));
|
|
148
153
|
const decision = decide(assessment, config);
|
|
149
154
|
decisions[assessment.id] = decision;
|
|
150
155
|
store.saveAssessment(assessment, decision, now, config.digest_interval_hours * 3_600_000, decision.review
|
|
@@ -155,7 +160,9 @@ export async function runScan(options) {
|
|
|
155
160
|
})
|
|
156
161
|
: undefined);
|
|
157
162
|
};
|
|
158
|
-
const retire = (
|
|
163
|
+
const retire = (previous) => {
|
|
164
|
+
// A retired finding is not looked up any more; an ageing score would only mislead.
|
|
165
|
+
const { epss: _epss, ...assessment } = previous;
|
|
159
166
|
store.saveAssessment({
|
|
160
167
|
...assessment,
|
|
161
168
|
active: false,
|
|
@@ -253,6 +260,7 @@ export async function runScan(options) {
|
|
|
253
260
|
const evidence = store.evidence();
|
|
254
261
|
remediationEvidence = evidence;
|
|
255
262
|
const evidenceById = new Map(evidence.map((e) => [e.id, e]));
|
|
263
|
+
epssEvidence = evidenceById;
|
|
256
264
|
const findings = assess(inventory, evidence, config, now, now, knownEvents, knownFindings);
|
|
257
265
|
const bases = new Map(findings.map((a) => [a.id, basis(a, evidenceById)]));
|
|
258
266
|
const errors = [
|
|
@@ -284,6 +292,17 @@ export async function runScan(options) {
|
|
|
284
292
|
!config.models.enabled)
|
|
285
293
|
// Running without a model is a supported setup, not a fault: say what it means and carry on.
|
|
286
294
|
notices.push('AI is disabled. System news receives candidate matching only; enable an analysis model to distinguish vulnerability impact from general system coverage.');
|
|
295
|
+
if (config.sources.epss && !options.fixture) {
|
|
296
|
+
const refreshed = await refreshEpss(findings
|
|
297
|
+
.filter((finding) => finding.category !== 'health')
|
|
298
|
+
.flatMap((finding) => findingCves(finding, evidenceById)), epssCache, http, now);
|
|
299
|
+
checkCancellation(signal);
|
|
300
|
+
epssCache = refreshed.cache;
|
|
301
|
+
store.setMeta('epss:cache', JSON.stringify(epssCache));
|
|
302
|
+
// Shown only, so a failed lookup is a notice, not degraded monitoring.
|
|
303
|
+
if (refreshed.failed)
|
|
304
|
+
notices.push('EPSS scores could not be refreshed from api.first.org; findings keep the scores of the last successful lookup.');
|
|
305
|
+
}
|
|
287
306
|
for (const system of inventory.systems) {
|
|
288
307
|
const updated = Date.parse(system.updated_at);
|
|
289
308
|
if (!Number.isFinite(updated) ||
|
|
@@ -345,7 +364,8 @@ export async function runScan(options) {
|
|
|
345
364
|
if (!errors.some((e) => e.source === 'models' && e.message === code))
|
|
346
365
|
errors.push({ source: 'models', message: code });
|
|
347
366
|
}
|
|
348
|
-
|
|
367
|
+
// After analysis, so a model never receives it and a new score never asks for a new one.
|
|
368
|
+
enriched = attachEpss(attachRemediation(enriched, inventory, evidence, config, now), epssCache, findingCves(enriched, evidenceById));
|
|
349
369
|
analyzed.push(enriched);
|
|
350
370
|
persist(enriched);
|
|
351
371
|
store.setMeta(`assessment-basis:${finding.id}`, bases.get(finding.id));
|
package/dist/epss.d.ts
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { Assessment, EpssScore, Evidence, HttpClient } from './types.js';
|
|
2
|
+
/** A score as FIRST publishes it, before it is tied to a finding. */
|
|
3
|
+
type Score = Omit<EpssScore, 'cve'>;
|
|
4
|
+
/** One cached lookup: a score, or none when FIRST has no score for the CVE yet. */
|
|
5
|
+
export interface EpssEntry {
|
|
6
|
+
/** Local time of the lookup, in milliseconds. */
|
|
7
|
+
fetched: number;
|
|
8
|
+
score?: Score;
|
|
9
|
+
}
|
|
10
|
+
export type EpssCache = Record<string, EpssEntry>;
|
|
11
|
+
export interface EpssRefresh {
|
|
12
|
+
cache: EpssCache;
|
|
13
|
+
/** Requests that failed; the scan keeps the earlier scores for their identifiers. */
|
|
14
|
+
failed: number;
|
|
15
|
+
/** Identifiers still due after this scan's request budget. */
|
|
16
|
+
pending: number;
|
|
17
|
+
}
|
|
18
|
+
/** Reads a stored cache, dropping anything malformed rather than failing the scan. */
|
|
19
|
+
export declare function readEpssCache(value: string | undefined): EpssCache;
|
|
20
|
+
/**
|
|
21
|
+
* Looks up the CVEs that are due: never looked up, or looked up more than a day ago, the oldest
|
|
22
|
+
* first, in batches, within the scan's request budget. The first failure ends the lookups of this
|
|
23
|
+
* scan. The returned cache holds only the given CVEs.
|
|
24
|
+
*/
|
|
25
|
+
export declare function refreshEpss(identifiers: readonly string[], stored: EpssCache, http: HttpClient, now: number): Promise<EpssRefresh>;
|
|
26
|
+
/**
|
|
27
|
+
* The CVEs a finding is about: its event when that is a CVE, and the CVE aliases of its advisory and
|
|
28
|
+
* known-exploited evidence (a library finding is often keyed by its GHSA identifier). Not the CVEs a
|
|
29
|
+
* news story cites: a roundup cites many.
|
|
30
|
+
*/
|
|
31
|
+
export declare function findingCves(assessment: Assessment, evidence: ReadonlyMap<string, Evidence>): string[];
|
|
32
|
+
/**
|
|
33
|
+
* The finding with the cached score of its CVE, or the highest of its CVEs' scores, or without
|
|
34
|
+
* one. Never part of its conclusion.
|
|
35
|
+
*/
|
|
36
|
+
export declare function attachEpss(assessment: Assessment, cache: EpssCache, cves: readonly string[]): Assessment;
|
|
37
|
+
export {};
|
package/dist/epss.js
ADDED
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EPSS (FIRST's Exploit Prediction Scoring System): the estimated probability that a CVE is
|
|
3
|
+
* exploited in the next 30 days. Shown with a finding; it decides nothing. FIRST updates scores
|
|
4
|
+
* daily, so they are kept apart from everything that makes a finding revision, a review or a model
|
|
5
|
+
* analysis: a new score never re-sends an alert or reopens a review.
|
|
6
|
+
*
|
|
7
|
+
* Only CVE identifiers are sent, to `api.first.org`. No inventory data.
|
|
8
|
+
*/
|
|
9
|
+
const ENDPOINT = 'https://api.first.org/data/v1/epss';
|
|
10
|
+
/** The API answers at most 100 rows a page; 50 identifiers keep one request one page. */
|
|
11
|
+
const BATCH = 50;
|
|
12
|
+
/** Requests per scan; the rest wait for the next scan, the longest unrefreshed first. */
|
|
13
|
+
const MAX_REQUESTS = 10;
|
|
14
|
+
/** A score is refreshed once a day, as FIRST publishes them. */
|
|
15
|
+
const REFRESH_MS = 86_400_000;
|
|
16
|
+
/** Identifiers kept at most. */
|
|
17
|
+
const MAX_IDENTIFIERS = 20_000;
|
|
18
|
+
/**
|
|
19
|
+
* A CVE no current finding needs is kept this long after its last lookup, so a scan without
|
|
20
|
+
* findings (an empty inventory for a moment) does not throw every score away.
|
|
21
|
+
*/
|
|
22
|
+
const KEEP_UNUSED_MS = 30 * 86_400_000;
|
|
23
|
+
/** A score a successful answer left out is kept while FIRST's date is this recent. */
|
|
24
|
+
const KEEP_OMITTED_MS = 7 * 86_400_000;
|
|
25
|
+
const CVE = /^CVE-\d{4}-\d{4,19}$/;
|
|
26
|
+
const DATE = /^\d{4}-\d{2}-\d{2}$/;
|
|
27
|
+
/** Reads a stored cache, dropping anything malformed rather than failing the scan. */
|
|
28
|
+
export function readEpssCache(value) {
|
|
29
|
+
const cache = {};
|
|
30
|
+
if (!value)
|
|
31
|
+
return cache;
|
|
32
|
+
let parsed;
|
|
33
|
+
try {
|
|
34
|
+
parsed = JSON.parse(value);
|
|
35
|
+
}
|
|
36
|
+
catch {
|
|
37
|
+
return cache;
|
|
38
|
+
}
|
|
39
|
+
if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed))
|
|
40
|
+
return cache;
|
|
41
|
+
for (const [id, raw] of Object.entries(parsed)) {
|
|
42
|
+
if (!CVE.test(id) || !raw || typeof raw !== 'object')
|
|
43
|
+
continue;
|
|
44
|
+
const entry = raw;
|
|
45
|
+
if (typeof entry.fetched !== 'number' || !Number.isFinite(entry.fetched))
|
|
46
|
+
continue;
|
|
47
|
+
const score = validScore(entry.score);
|
|
48
|
+
cache[id] = score ? { fetched: entry.fetched, score } : { fetched: entry.fetched };
|
|
49
|
+
}
|
|
50
|
+
return cache;
|
|
51
|
+
}
|
|
52
|
+
function validScore(value) {
|
|
53
|
+
if (!value || typeof value !== 'object')
|
|
54
|
+
return undefined;
|
|
55
|
+
const { probability, percentile, date } = value;
|
|
56
|
+
return typeof probability === 'number' &&
|
|
57
|
+
probability >= 0 &&
|
|
58
|
+
probability <= 1 &&
|
|
59
|
+
typeof percentile === 'number' &&
|
|
60
|
+
percentile >= 0 &&
|
|
61
|
+
percentile <= 1 &&
|
|
62
|
+
typeof date === 'string' &&
|
|
63
|
+
DATE.test(date)
|
|
64
|
+
? { probability, percentile, date }
|
|
65
|
+
: undefined;
|
|
66
|
+
}
|
|
67
|
+
/** One row of the API's `data` array, or undefined when it is not one. */
|
|
68
|
+
function row(value) {
|
|
69
|
+
if (!value || typeof value !== 'object')
|
|
70
|
+
return undefined;
|
|
71
|
+
const { cve, epss, percentile, date } = value;
|
|
72
|
+
if (typeof cve !== 'string' || !CVE.test(cve.toUpperCase()))
|
|
73
|
+
return undefined;
|
|
74
|
+
// The API writes numbers as strings ("0.016400000").
|
|
75
|
+
const probability = typeof epss === 'string' && /^\d(?:\.\d{1,12})?$/.test(epss) ? Number(epss) : NaN;
|
|
76
|
+
const rank = typeof percentile === 'string' && /^\d(?:\.\d{1,12})?$/.test(percentile) ? Number(percentile) : NaN;
|
|
77
|
+
const score = validScore({ probability, percentile: rank, date });
|
|
78
|
+
return score ? { cve: cve.toUpperCase(), score } : undefined;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Looks up the CVEs that are due: never looked up, or looked up more than a day ago, the oldest
|
|
82
|
+
* first, in batches, within the scan's request budget. The first failure ends the lookups of this
|
|
83
|
+
* scan. The returned cache holds only the given CVEs.
|
|
84
|
+
*/
|
|
85
|
+
export async function refreshEpss(identifiers, stored, http, now) {
|
|
86
|
+
const wanted = [...new Set(identifiers.map((id) => id.toUpperCase()).filter((id) => CVE.test(id)))].slice(0, MAX_IDENTIFIERS);
|
|
87
|
+
const cache = {};
|
|
88
|
+
for (const id of wanted)
|
|
89
|
+
if (stored[id])
|
|
90
|
+
cache[id] = stored[id];
|
|
91
|
+
const due = wanted
|
|
92
|
+
.filter((id) => !cache[id] || !(cache[id].fetched <= now) || now - cache[id].fetched >= REFRESH_MS)
|
|
93
|
+
.sort((a, b) => (cache[a]?.fetched ?? -1) - (cache[b]?.fetched ?? -1) || a.localeCompare(b));
|
|
94
|
+
let failed = 0;
|
|
95
|
+
let sent = 0;
|
|
96
|
+
for (let index = 0; index < due.length && sent < MAX_REQUESTS; index += BATCH) {
|
|
97
|
+
const batch = due.slice(index, index + BATCH);
|
|
98
|
+
sent++;
|
|
99
|
+
try {
|
|
100
|
+
const response = await http(`${ENDPOINT}?cve=${batch.join(',')}`, {
|
|
101
|
+
maxBytes: 200_000,
|
|
102
|
+
headers: { accept: 'application/json' },
|
|
103
|
+
});
|
|
104
|
+
if (response.status !== 200)
|
|
105
|
+
throw new Error('EPSS_HTTP');
|
|
106
|
+
const body = JSON.parse(response.body);
|
|
107
|
+
if (body.status !== 'OK' || !Array.isArray(body.data))
|
|
108
|
+
throw new Error('EPSS_SCHEMA');
|
|
109
|
+
const scores = new Map();
|
|
110
|
+
for (const item of body.data) {
|
|
111
|
+
const parsed = row(item);
|
|
112
|
+
if (parsed && batch.includes(parsed.cve))
|
|
113
|
+
scores.set(parsed.cve, parsed.score);
|
|
114
|
+
}
|
|
115
|
+
for (const id of batch) {
|
|
116
|
+
// A CVE FIRST has scored before and leaves out once keeps its recent score; the date shows its age.
|
|
117
|
+
const earlier = cache[id]?.score;
|
|
118
|
+
const score = scores.get(id) ??
|
|
119
|
+
(earlier && now - Date.parse(`${earlier.date}T00:00:00Z`) <= KEEP_OMITTED_MS ? earlier : undefined);
|
|
120
|
+
cache[id] = score ? { fetched: now, score } : { fetched: now };
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
catch {
|
|
124
|
+
// A cancelled scan fails here too; the engine checks for cancellation right after.
|
|
125
|
+
failed++;
|
|
126
|
+
break;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
const pending = wanted.filter((id) => !cache[id] || !(cache[id].fetched <= now) || now - cache[id].fetched >= REFRESH_MS).length;
|
|
130
|
+
// Recently looked-up CVEs that no current finding needs, the most recent first, within the bound.
|
|
131
|
+
const unused = Object.entries(stored)
|
|
132
|
+
.filter(([id, entry]) => !(id in cache) && entry.fetched <= now && now - entry.fetched < KEEP_UNUSED_MS)
|
|
133
|
+
.sort(([, a], [, b]) => b.fetched - a.fetched)
|
|
134
|
+
.slice(0, Math.max(0, MAX_IDENTIFIERS - Object.keys(cache).length));
|
|
135
|
+
for (const [id, entry] of unused)
|
|
136
|
+
cache[id] = entry;
|
|
137
|
+
return { cache, failed, pending };
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* The CVEs a finding is about: its event when that is a CVE, and the CVE aliases of its advisory and
|
|
141
|
+
* known-exploited evidence (a library finding is often keyed by its GHSA identifier). Not the CVEs a
|
|
142
|
+
* news story cites: a roundup cites many.
|
|
143
|
+
*/
|
|
144
|
+
export function findingCves(assessment, evidence) {
|
|
145
|
+
const ids = [assessment.event_id];
|
|
146
|
+
for (const id of assessment.evidence_ids) {
|
|
147
|
+
const item = evidence.get(id);
|
|
148
|
+
if (item && item.kind !== 'news' && item.kind !== 'health')
|
|
149
|
+
ids.push(...item.aliases);
|
|
150
|
+
}
|
|
151
|
+
return [...new Set(ids.map((id) => id.toUpperCase()).filter((id) => CVE.test(id)))].sort();
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* The finding with the cached score of its CVE, or the highest of its CVEs' scores, or without
|
|
155
|
+
* one. Never part of its conclusion.
|
|
156
|
+
*/
|
|
157
|
+
export function attachEpss(assessment, cache, cves) {
|
|
158
|
+
const { epss: _old, ...rest } = assessment;
|
|
159
|
+
let best;
|
|
160
|
+
for (const cve of cves) {
|
|
161
|
+
const score = cache[cve.toUpperCase()]?.score;
|
|
162
|
+
if (score && (!best || score.probability > best.probability))
|
|
163
|
+
best = { cve: cve.toUpperCase(), ...score };
|
|
164
|
+
}
|
|
165
|
+
return best ? { ...rest, epss: best } : rest;
|
|
166
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { Severity, Category, Applicability, Channel, Provenance, DeploymentObservation, ArtifactKind, DeclaredVerification, DependencyLink, DependencyRelationship, DeclaredRemediation, InventoryEvidence, Component, Product, FindingLocation, System, Inventory, PackageClaim, CvssV4BaseScore, Evidence, ModelSpec, Config, Rule, Assessment, AiReviewReason, AiReview, Decision, Notification, HttpOptions, HttpResult, HttpClient, CoverageReceipt, InventoryDrift, RemediationEvidence, SourceResult, AiAnalysis, NewsAnalysis, } from './types.js';
|
|
1
|
+
export type { Severity, Category, Applicability, Channel, Provenance, DeploymentObservation, ArtifactKind, DeclaredVerification, DependencyLink, DependencyRelationship, DeclaredRemediation, InventoryEvidence, Component, Product, FindingLocation, System, Inventory, PackageClaim, CvssV4BaseScore, Evidence, ModelSpec, Config, Rule, Assessment, AiReviewReason, AiReview, Decision, Notification, HttpOptions, HttpResult, HttpClient, CoverageReceipt, InventoryDrift, RemediationEvidence, SourceResult, AiAnalysis, NewsAnalysis, NewsSignals, NewsStatement, EpssScore, } from './types.js';
|
|
2
2
|
export { scorePilotResponses, type PilotResponseRegister, type PilotResponseScore, } from './pilot-responses.js';
|
|
3
3
|
export { loadConfig, parseConfig, configSchema } from './config.js';
|
|
4
4
|
export { loadInventory } from './inventory.js';
|
package/dist/matching.d.ts
CHANGED
|
@@ -13,6 +13,12 @@ export declare function packageMentioned(text: string, component: {
|
|
|
13
13
|
ecosystem: Ecosystem;
|
|
14
14
|
name: string;
|
|
15
15
|
}): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Where a sentence ends: after ".", "!" or "?" and before a capital letter or a digit, but not after
|
|
18
|
+
* a common abbreviation ("e.g.", "i.e.", "incl.", "vs.") or a single lower-case letter. After "etc." and
|
|
19
|
+
* initials ("the U.S. Package scams") it does end.
|
|
20
|
+
*/
|
|
21
|
+
export declare const SENTENCE_END: RegExp;
|
|
16
22
|
export interface InventoryMatcher {
|
|
17
23
|
/** Identity keys of every inventory component. */
|
|
18
24
|
packages: Set<string>;
|
package/dist/matching.js
CHANGED
|
@@ -390,7 +390,7 @@ const STRONG_LIBRARY_CUE = new RegExp('(?:^|[^\\p{L}])(?:npm|pypi|rubygems|crate
|
|
|
390
390
|
* a common abbreviation ("e.g.", "i.e.", "incl.", "vs.") or a single lower-case letter. After "etc." and
|
|
391
391
|
* initials ("the U.S. Package scams") it does end.
|
|
392
392
|
*/
|
|
393
|
-
const SENTENCE_END = /(?<=[.!?])(?<!(?:^|[^\p{L}])(?:e\.g|i\.e|incl|vs|approx|cf|al|ca|no|nr|ver|v|\p{Ll})\.)\s+(?=[\p{Lu}\p{N}])/u;
|
|
393
|
+
export const SENTENCE_END = /(?<=[.!?])(?<!(?:^|[^\p{L}])(?:e\.g|i\.e|incl|vs|approx|cf|al|ca|no|nr|ver|v|\p{Ll})\.)\s+(?=[\p{Lu}\p{N}])/u;
|
|
394
394
|
/** Words that name a flaw. */
|
|
395
395
|
const FLAW_NOUN = '(?:flaws?|bugs?|vulnerabilit(?:y|ies)|escapes?|bypass(?:es)?|injections?)';
|
|
396
396
|
/** Words for the kind of a flaw that may come before it ("remote code execution flaw"). */
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { NewsSignals, Severity } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* What a news article states about one finding's subject, read without a model: a CVSS score, a
|
|
4
|
+
* vendor's word rating, a report of exploitation, a public exploit. These only ever raise a
|
|
5
|
+
* finding's priority; a missing or negated statement lowers and dismisses nothing.
|
|
6
|
+
*
|
|
7
|
+
* A statement counts for the subject only when it is tied to it: the nearest advisory identifier
|
|
8
|
+
* before the statement in its sentence is the subject's (`CVE-X (CVSS score: 9.8)`, a list item
|
|
9
|
+
* `CVE-X (CVSS score: 9.3) - text`); or the article cites no other identifier and the sentence names
|
|
10
|
+
* the subject; or, for a score or rating, the article is about the subject alone and the sentence
|
|
11
|
+
* cites nothing. "It scores all five 9.2" in an article about five flaws is not read.
|
|
12
|
+
*/
|
|
13
|
+
export interface SignalTarget {
|
|
14
|
+
/** Advisory identifiers of the finding's event, in any spelling. */
|
|
15
|
+
identifiers: string[];
|
|
16
|
+
/** Inventory names the finding matched: package, product and keyword names. */
|
|
17
|
+
names: string[];
|
|
18
|
+
}
|
|
19
|
+
export declare function scoreLevel(score: number): Severity;
|
|
20
|
+
/** Reads the articles for one finding. `undefined` when they state nothing about its subject. */
|
|
21
|
+
export declare function newsSignals(articles: readonly {
|
|
22
|
+
title: string;
|
|
23
|
+
description: string;
|
|
24
|
+
}[], target: SignalTarget): NewsSignals | undefined;
|
|
25
|
+
/** The level the signals give a finding, and one reason per signal, for the finding's reasons. */
|
|
26
|
+
export declare function signalLevel(signals: NewsSignals): {
|
|
27
|
+
level: Severity;
|
|
28
|
+
reasons: string[];
|
|
29
|
+
};
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
import { mentions, SENTENCE_END } from './matching.js';
|
|
2
|
+
import { cut, highest } from './util.js';
|
|
3
|
+
const IDENTIFIER = /\b(?:CVE-\d{4}-\d{4,19}|GHSA-[a-z\d]{4}-[a-z\d]{4}-[a-z\d]{4})\b/gi;
|
|
4
|
+
const normal = (id) => (/^cve-/i.test(id) ? id.toUpperCase() : id.toLowerCase());
|
|
5
|
+
/** At most this much of an article is read, and this many sentences. */
|
|
6
|
+
const MAX_TEXT = 40_000;
|
|
7
|
+
const MAX_SENTENCES = 2_000;
|
|
8
|
+
const EXCERPT = 160;
|
|
9
|
+
/** How far before a statement a hedging word counts. */
|
|
10
|
+
const HEDGE_WINDOW = 60;
|
|
11
|
+
/** How far after a report of exploitation its identifier may stand. */
|
|
12
|
+
const FOLLOWING_WINDOW = 160;
|
|
13
|
+
/**
|
|
14
|
+
* "CVSS score: 9.8", "CVSS v3.1 score of 9.8", "CVSSv4: 9.3", "CVSS 3.1: 5.5", "(CVSS 9.8)". A whole
|
|
15
|
+
* number counts only after "score" or "rating" or a colon: "CVSS v4 metrics" names a version.
|
|
16
|
+
*/
|
|
17
|
+
const SCORE_AFTER = /^CVSS\s*(?:v(?:ersion)?\s*)?([234](?:\.[01])?)?\s*(?:\(\s*v?[234]\.[01]\s*\)\s*)?(?:[-:,\s]*(?:base|severity|risk|overall)\b)?(?:[-:,\s]*(score|rating)\b)?(?:\s+(?:of|is|was|at))?([\s:=]*)(\d{1,2}(?:\.\d)?)(?![\d%]|\.\d)/i;
|
|
18
|
+
/** A threshold, not a score: "a CVSS score of 7 or higher", "CVSS 9.0+". */
|
|
19
|
+
const THRESHOLD_AFTER = /^\s*(?:\+|(?:or|and)\s+(?:higher|above|more|greater|over|up|lower|less|below))/i;
|
|
20
|
+
const THRESHOLD_BEFORE = /\b(?:above|over|below|at least|at most|exceed(?:s|ing)?|greater than|less than|higher than|lower than|threshold|minimum|maximum)\s+(?:(?:an?|the)\s+)?$/i;
|
|
21
|
+
/** "9.2 CVSS rating", "9.2 out of 10 on CVSS 4.0", "rated 9.8/10 under the CVSS scale". */
|
|
22
|
+
const SCORE_BEFORE = /(?<![\d.])(\d{1,2}\.\d|10(?=\s*\/\s*10|\s+out of 10)|\d(?=\s*\/\s*10|\s+out of 10))(?:\s*\/\s*10|\s+out of 10)?(?:\s+(?:on|under|in|with|using))?(?:\s+the)?\s+$/i;
|
|
23
|
+
/** What may follow "CVSS" after a score written before it: a version, then a noun or the end. */
|
|
24
|
+
const AFTER_SCORE_BEFORE = /^CVSS\s*(?:v(?:ersion)?\s*)?(?:[234](?:\.[01])?)?\s*(?:score|rating|scale|base|severity|\(|[.,;)]|$)/i;
|
|
25
|
+
/** The CVSS version right after "CVSS", when a score came before it ("on CVSS 4.0"). */
|
|
26
|
+
const VERSION_AFTER = /^CVSS\s*(?:v(?:ersion)?\s*)?([234]\.[01])(?!\.?\d)/i;
|
|
27
|
+
/** A vendor's own word rating: "Severity: moderate" (Apache), "rated the vulnerability Important". */
|
|
28
|
+
const RATINGS = [
|
|
29
|
+
/\bseverity\s*:\s*(low|moderate|medium|important|high|critical)\b/i,
|
|
30
|
+
/\brat(?:ed|es)\s+(?:(?:it|this|the\s+(?:flaw|vulnerability|bug|issue)|CVE-\d{4}-\d{4,19}|GHSA(?:-[a-z\d]{4}){3})\s+)?(?:as\s+)?(?:an?\s+)?(low|moderate|medium|important|high|critical)\b(?![-\s]*(?:risk|rated|severity))/i,
|
|
31
|
+
];
|
|
32
|
+
/** Statements that a subject is being exploited. Bound, not negated and not hedged to count. */
|
|
33
|
+
const EXPLOITED = new RegExp([
|
|
34
|
+
'exploited in (?:the wild|attacks?|real[- ]world attacks)',
|
|
35
|
+
'(?:under|come under|subject to) (?:active )?(?:exploitation|attacks?)',
|
|
36
|
+
'actively (?:being )?exploited',
|
|
37
|
+
'active exploitation',
|
|
38
|
+
'exploitation (?:attempts|activity)',
|
|
39
|
+
'in-the-wild exploitation',
|
|
40
|
+
'exploitation in the wild',
|
|
41
|
+
'(?:detected|observed|confirmed|seen|reported) (?:active |in-the-wild )?exploitation',
|
|
42
|
+
'(?:attackers|hackers|threat actors|adversaries|bad (?:guys|actors)|miscreants|criminals|crooks) (?:are |were |have been |had been |have |had )?(?:actively |now )?(?:exploiting|exploited|weaponi[sz]ing|abusing)',
|
|
43
|
+
'used in (?:the wild|attacks|real[- ]world attacks)',
|
|
44
|
+
'(?:is|are|was|were|being|been) (?:actively |now |still )?(?:being )?exploited',
|
|
45
|
+
'added\\b.{0,160}?(?:Known Exploited Vulnerabilities|\\bKEV\\b)',
|
|
46
|
+
].join('|'), 'i');
|
|
47
|
+
/**
|
|
48
|
+
* Read only to recognise a denial ("not aware of attacks exploiting the flaw"). On its own it is
|
|
49
|
+
* not a report: researchers publish "videos demonstrating attacks using" a flaw.
|
|
50
|
+
*/
|
|
51
|
+
const DENIED_ONLY = /\battacks? (?:exploiting|using|leveraging|targeting)/i;
|
|
52
|
+
/** Public exploit code: shown as a reason, it raises nothing. */
|
|
53
|
+
const PUBLIC_EXPLOIT = /proof[- ]of[- ]concept|\bPoC\b|exploit code|public(?:ly available)? exploits?\b|working exploits?\b|exploits? (?:is|was|were|has been|have been) (?:released|published)/i;
|
|
54
|
+
/**
|
|
55
|
+
* A denial of the statement that follows in the same clause: "no evidence that ... has been
|
|
56
|
+
* exploited", "neither ... nor ... report that it was used in attacks". "Without authentication"
|
|
57
|
+
* and "no patch" after a report do not deny it.
|
|
58
|
+
*/
|
|
59
|
+
const NEGATION = /\b(?:no|not|never|neither|nor|none|nothing|nobody|no one|unaware|yet to|absence|lack of)\b|n['’]t\b/i;
|
|
60
|
+
/** How far before a statement a denial counts, within its clause. */
|
|
61
|
+
const NEGATION_WINDOW = 160;
|
|
62
|
+
/** Where a clause ends inside a sentence: "X was patched, but attackers exploit Y". */
|
|
63
|
+
const CLAUSE_BREAK = /;|,\s*(?:but|while|whereas|although|though|yet|and|or|so)\b|\s(?:but|while|whereas|although)\s|\s[–—]\s/gi;
|
|
64
|
+
/** Reports whose identifier follows them: "attackers are exploiting CVE-A", "added CVE-A to KEV". */
|
|
65
|
+
const OBJECT_FOLLOWS = /^(?:attackers|hackers|threat actors|adversaries|bad|miscreants|criminals|crooks|added|detected|observed|confirmed|seen|reported|exploitation|in-the-wild|proof|poc|exploit|public|working)/i;
|
|
66
|
+
/** Words just before a statement that only suppose it: "could be exploited", "suspected to be exploiting". */
|
|
67
|
+
const HEDGE = /\b(?:could|may|might|can|would|should|if|potential(?:ly)?|possibl[ey]|suspect(?:ed|s)?|alleged(?:ly)?|claims?|likely|unconfirmed|whether|unless|expects?)\b/i;
|
|
68
|
+
function sentences(text) {
|
|
69
|
+
const out = [];
|
|
70
|
+
for (const line of text.slice(0, MAX_TEXT).split(/\n+/)) {
|
|
71
|
+
for (const sentence of line.split(SENTENCE_END)) {
|
|
72
|
+
const trimmed = sentence.trim();
|
|
73
|
+
if (trimmed)
|
|
74
|
+
out.push(trimmed);
|
|
75
|
+
if (out.length >= MAX_SENTENCES)
|
|
76
|
+
return out;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return out;
|
|
80
|
+
}
|
|
81
|
+
export function scoreLevel(score) {
|
|
82
|
+
return score >= 9
|
|
83
|
+
? 'critical'
|
|
84
|
+
: score >= 7
|
|
85
|
+
? 'high'
|
|
86
|
+
: score >= 4
|
|
87
|
+
? 'medium'
|
|
88
|
+
: score > 0
|
|
89
|
+
? 'low'
|
|
90
|
+
: 'unknown';
|
|
91
|
+
}
|
|
92
|
+
function ratingLevel(word) {
|
|
93
|
+
const value = word.toLowerCase();
|
|
94
|
+
return value === 'critical'
|
|
95
|
+
? 'critical'
|
|
96
|
+
: value === 'high' || value === 'important'
|
|
97
|
+
? 'high'
|
|
98
|
+
: value === 'moderate' || value === 'medium'
|
|
99
|
+
? 'medium'
|
|
100
|
+
: 'low';
|
|
101
|
+
}
|
|
102
|
+
/** Reads the articles for one finding. `undefined` when they state nothing about its subject. */
|
|
103
|
+
export function newsSignals(articles, target) {
|
|
104
|
+
const targets = new Set(target.identifiers.map(normal));
|
|
105
|
+
const names = [...new Set(target.names.filter((name) => name.trim().length >= 3))];
|
|
106
|
+
const signals = {};
|
|
107
|
+
for (const article of articles) {
|
|
108
|
+
const text = `${article.title}\n${article.description}`;
|
|
109
|
+
const cited = new Set((text.slice(0, MAX_TEXT).match(IDENTIFIER) ?? []).map(normal));
|
|
110
|
+
// Every identifier the article cites is this finding's: a sentence naming the subject is about it.
|
|
111
|
+
const singleSubject = [...cited].every((id) => targets.has(id));
|
|
112
|
+
/**
|
|
113
|
+
* An article about one subject: it cites one identifier, the finding's, or none and names the
|
|
114
|
+
* subject in its title (ZDI: "ZDI-26-1037: (0Day) Acme Router ... Vulnerability"). A score or
|
|
115
|
+
* rating in a sentence that cites nothing is about that subject ("The ZDI has assigned a CVSS
|
|
116
|
+
* rating of 7.6", "CISA gives the flaw a CVSS score of 5.0"). Not used for exploitation.
|
|
117
|
+
*/
|
|
118
|
+
const articleSubject = !singleSubject
|
|
119
|
+
? undefined
|
|
120
|
+
: cited.size === 1
|
|
121
|
+
? [...cited][0]
|
|
122
|
+
: cited.size === 0
|
|
123
|
+
? names.find((name) => mentions(article.title, name))
|
|
124
|
+
: undefined;
|
|
125
|
+
for (const sentence of sentences(text)) {
|
|
126
|
+
if (sentence.endsWith('?'))
|
|
127
|
+
continue; // "Is there a proof-of-concept available?"
|
|
128
|
+
const ids = [...sentence.matchAll(IDENTIFIER)].map((m) => ({ at: m.index, id: normal(m[0]) }));
|
|
129
|
+
const breaks = [...sentence.matchAll(CLAUSE_BREAK)].map((m) => m.index);
|
|
130
|
+
const clause = (at) => [
|
|
131
|
+
breaks.filter((index) => index < at).at(-1) ?? 0,
|
|
132
|
+
breaks.find((index) => index >= at) ?? sentence.length,
|
|
133
|
+
];
|
|
134
|
+
/** An inventory name in the clause around `at`, when the article cites only the finding's identifiers. */
|
|
135
|
+
const namedIn = (at) => {
|
|
136
|
+
if (!singleSubject)
|
|
137
|
+
return undefined;
|
|
138
|
+
const [start, end] = clause(at);
|
|
139
|
+
const part = sentence.slice(start, end);
|
|
140
|
+
return names.find((name) => mentions(part, name));
|
|
141
|
+
};
|
|
142
|
+
/** A score or rating: the nearest identifier before it, as in lists; or a name in its clause. */
|
|
143
|
+
const boundScore = (at) => {
|
|
144
|
+
const nearest = ids.filter((item) => item.at < at).at(-1);
|
|
145
|
+
if (nearest)
|
|
146
|
+
return targets.has(nearest.id) ? nearest.id : undefined;
|
|
147
|
+
return ids.length ? undefined : namedIn(at);
|
|
148
|
+
};
|
|
149
|
+
/**
|
|
150
|
+
* A report: an identifier in its own clause, the one it names when the report reads
|
|
151
|
+
* "attackers are exploiting CVE-A" or "added CVE-A to KEV", else the nearest before it ("CVE-A
|
|
152
|
+
* is being exploited"), else shortly after it ("X has come under active exploitation ...,
|
|
153
|
+
* tracked as CVE-A"). With no identifier in its clause and none in the sentence, a name in its
|
|
154
|
+
* clause.
|
|
155
|
+
*/
|
|
156
|
+
const boundReport = (match) => {
|
|
157
|
+
const [start, end] = clause(match.index);
|
|
158
|
+
const inClause = ids.filter((item) => item.at >= start && item.at < end);
|
|
159
|
+
const after = inClause.find((item) => item.at >= match.index && item.at - match.index <= FOLLOWING_WINDOW);
|
|
160
|
+
const before = inClause.filter((item) => item.at < match.index).at(-1);
|
|
161
|
+
const nearest = OBJECT_FOLLOWS.test(match[0]) ? (after ?? before) : (before ?? after);
|
|
162
|
+
if (nearest)
|
|
163
|
+
return targets.has(nearest.id) ? nearest.id : undefined;
|
|
164
|
+
return ids.length ? undefined : namedIn(match.index);
|
|
165
|
+
};
|
|
166
|
+
/** A denial before the statement, in its clause. */
|
|
167
|
+
const negated = (match) => {
|
|
168
|
+
const [start] = clause(match.index);
|
|
169
|
+
return NEGATION.test(sentence.slice(Math.max(start, match.index - NEGATION_WINDOW), match.index + match[0].length));
|
|
170
|
+
};
|
|
171
|
+
const excerpt = () => cut(sentence.replace(/\s+/g, ' '), EXCERPT);
|
|
172
|
+
for (const match of sentence.matchAll(/CVSS/gi)) {
|
|
173
|
+
const at = match.index;
|
|
174
|
+
const after = SCORE_AFTER.exec(sentence.slice(at, at + 80));
|
|
175
|
+
let score;
|
|
176
|
+
let version;
|
|
177
|
+
if (after) {
|
|
178
|
+
const [, written, word, separator, number] = after;
|
|
179
|
+
// "CVSS 4.0" names a version; it is a score only after "score" or "rating".
|
|
180
|
+
const isVersion = !written && !word && /^[234]\.[01]$/.test(number);
|
|
181
|
+
const stated = Boolean(word) || /[:=]/.test(separator) || number.includes('.');
|
|
182
|
+
const threshold = THRESHOLD_AFTER.test(sentence.slice(at + after[0].length, at + after[0].length + 20)) ||
|
|
183
|
+
THRESHOLD_BEFORE.test(sentence.slice(Math.max(0, at - 30), at));
|
|
184
|
+
if (!isVersion && stated && !threshold) {
|
|
185
|
+
score = Number(number);
|
|
186
|
+
version = written;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
if (score === undefined && AFTER_SCORE_BEFORE.test(sentence.slice(at, at + 40))) {
|
|
190
|
+
const before = SCORE_BEFORE.exec(sentence.slice(Math.max(0, at - 40), at));
|
|
191
|
+
if (before) {
|
|
192
|
+
score = Number(before[1]);
|
|
193
|
+
version = VERSION_AFTER.exec(sentence.slice(at, at + 20))?.[1];
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
if (score === undefined || !(score > 0 && score <= 10))
|
|
197
|
+
continue;
|
|
198
|
+
const subject = boundScore(at) ?? (ids.length ? undefined : articleSubject);
|
|
199
|
+
if (!subject)
|
|
200
|
+
continue;
|
|
201
|
+
if (!signals.cvss || score > signals.cvss.score)
|
|
202
|
+
signals.cvss = {
|
|
203
|
+
score,
|
|
204
|
+
...(version ? { version: version.includes('.') ? version : `${version}.x` } : {}),
|
|
205
|
+
level: scoreLevel(score),
|
|
206
|
+
subject,
|
|
207
|
+
excerpt: excerpt(),
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
for (const pattern of RATINGS) {
|
|
211
|
+
const match = pattern.exec(sentence);
|
|
212
|
+
if (!match)
|
|
213
|
+
continue;
|
|
214
|
+
// A "Severity:" field stands on a line of its own in Apache advisories.
|
|
215
|
+
const subject = boundScore(match.index + match[0].length) ?? (ids.length ? undefined : articleSubject);
|
|
216
|
+
if (!subject)
|
|
217
|
+
continue;
|
|
218
|
+
const level = ratingLevel(match[1]);
|
|
219
|
+
if (!signals.rating || highest(level, signals.rating.level) !== signals.rating.level)
|
|
220
|
+
signals.rating = { level, word: match[1].toLowerCase(), subject, excerpt: excerpt() };
|
|
221
|
+
}
|
|
222
|
+
// A denial counts before the statement in its clause; a hedge only just before it, since a
|
|
223
|
+
// merged sentence often goes on to "could".
|
|
224
|
+
const hedged = (match) => HEDGE.test(sentence.slice(Math.max(0, match.index - HEDGE_WINDOW), match.index + match[0].length));
|
|
225
|
+
for (const pattern of [EXPLOITED, DENIED_ONLY]) {
|
|
226
|
+
for (const match of sentence.matchAll(new RegExp(pattern.source, 'gi'))) {
|
|
227
|
+
const denied = negated(match);
|
|
228
|
+
if (!denied && (pattern === DENIED_ONLY || hedged(match)))
|
|
229
|
+
continue;
|
|
230
|
+
const subject = boundReport(match);
|
|
231
|
+
if (!subject)
|
|
232
|
+
continue;
|
|
233
|
+
if (denied)
|
|
234
|
+
signals.no_known_exploitation ??= { subject, excerpt: excerpt() };
|
|
235
|
+
else
|
|
236
|
+
signals.exploitation ??= { subject, excerpt: excerpt() };
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
for (const exploit of sentence.matchAll(new RegExp(PUBLIC_EXPLOIT.source, 'gi'))) {
|
|
240
|
+
if (negated(exploit) || hedged(exploit))
|
|
241
|
+
continue;
|
|
242
|
+
const subject = boundReport(exploit);
|
|
243
|
+
if (subject)
|
|
244
|
+
signals.public_exploit ??= { subject, excerpt: excerpt() };
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
return Object.keys(signals).length ? signals : undefined;
|
|
249
|
+
}
|
|
250
|
+
/** The level the signals give a finding, and one reason per signal, for the finding's reasons. */
|
|
251
|
+
export function signalLevel(signals) {
|
|
252
|
+
const reasons = [];
|
|
253
|
+
let level = 'unknown';
|
|
254
|
+
if (signals.cvss) {
|
|
255
|
+
level = highest(level, signals.cvss.level);
|
|
256
|
+
reasons.push(`An article states CVSS ${signals.cvss.version ? `${signals.cvss.version} ` : ''}${signals.cvss.score} for ${signals.cvss.subject}; no advisory severity is available yet.`);
|
|
257
|
+
}
|
|
258
|
+
if (signals.rating) {
|
|
259
|
+
level = highest(level, signals.rating.level);
|
|
260
|
+
reasons.push(`An article reports a "${signals.rating.word}" rating for ${signals.rating.subject}.`);
|
|
261
|
+
}
|
|
262
|
+
if (signals.exploitation) {
|
|
263
|
+
level = highest(level, 'critical');
|
|
264
|
+
reasons.push(`An article reports exploitation of ${signals.exploitation.subject}; not confirmed by a known-exploited catalog.`);
|
|
265
|
+
}
|
|
266
|
+
else if (signals.no_known_exploitation)
|
|
267
|
+
reasons.push(`An article says no exploitation of ${signals.no_known_exploitation.subject} is known.`);
|
|
268
|
+
if (signals.public_exploit)
|
|
269
|
+
reasons.push(`An article reports public exploit code for ${signals.public_exploit.subject}.`);
|
|
270
|
+
return { level, reasons };
|
|
271
|
+
}
|
package/dist/store.js
CHANGED
|
@@ -388,7 +388,8 @@ export class Store {
|
|
|
388
388
|
: [];
|
|
389
389
|
// Where the finding lives (inventory names and notes) is shown to the reader; it is not part
|
|
390
390
|
// of the conclusion a reviewer approves, so editing a note does not ask for a new review.
|
|
391
|
-
|
|
391
|
+
// EPSS changes daily and is shown only: it is not part of the conclusion either.
|
|
392
|
+
const { updated_at: _updated, location: _location, epss: _epss, ...reviewedAssessment } = assessment;
|
|
392
393
|
// Ordinary alert deduplication stays semantic. A human review instead binds the exact
|
|
393
394
|
// supplied conclusion, source content and host inventory/model context, excluding scan time.
|
|
394
395
|
const signature = decision.review
|
package/dist/types.d.ts
CHANGED
|
@@ -69,6 +69,20 @@ export interface Product {
|
|
|
69
69
|
/** Operator's pointer to where this product runs. Shown in notifications; never sent to models or sources. */
|
|
70
70
|
note?: string;
|
|
71
71
|
}
|
|
72
|
+
/**
|
|
73
|
+
* FIRST's EPSS for a finding's CVE: the estimated probability of exploitation in the next 30 days,
|
|
74
|
+
* and its rank among all scored CVEs. Shown only; not part of a finding's revision or review.
|
|
75
|
+
*/
|
|
76
|
+
export interface EpssScore {
|
|
77
|
+
/** The CVE it is for: the finding's event, or a CVE alias of its advisory when the event is a GHSA. */
|
|
78
|
+
cve: string;
|
|
79
|
+
/** 0 to 1. */
|
|
80
|
+
probability: number;
|
|
81
|
+
/** 0 to 1: the share of scored CVEs with a lower probability. */
|
|
82
|
+
percentile: number;
|
|
83
|
+
/** The day FIRST computed it, YYYY-MM-DD. */
|
|
84
|
+
date: string;
|
|
85
|
+
}
|
|
72
86
|
/** Where a reader should look to confirm a finding. Copied from the inventory; not security evidence. */
|
|
73
87
|
export interface FindingLocation {
|
|
74
88
|
system: string;
|
|
@@ -171,6 +185,8 @@ export interface Config {
|
|
|
171
185
|
kev: boolean;
|
|
172
186
|
feeds: string[];
|
|
173
187
|
vendor_feeds?: ('nodejs' | 'python' | 'php')[];
|
|
188
|
+
/** Look up FIRST's EPSS for the CVEs of current findings (CVE identifiers only). Default false. */
|
|
189
|
+
epss?: boolean;
|
|
174
190
|
};
|
|
175
191
|
models: {
|
|
176
192
|
enabled: boolean;
|
|
@@ -194,6 +210,11 @@ export interface Config {
|
|
|
194
210
|
ai_dismissals?: 'review' | 'record';
|
|
195
211
|
/** Deprecated configuration alias; true maps to review, false to record. */
|
|
196
212
|
review_before_news_suppression?: boolean;
|
|
213
|
+
/**
|
|
214
|
+
* Read stated CVSS scores, vendor ratings and exploitation reports from news to raise the
|
|
215
|
+
* priority of findings without an advisory severity. Default true.
|
|
216
|
+
*/
|
|
217
|
+
news_signals?: boolean;
|
|
197
218
|
health_channels: Channel[];
|
|
198
219
|
};
|
|
199
220
|
notifications: {
|
|
@@ -255,6 +276,8 @@ export interface Assessment {
|
|
|
255
276
|
remediation?: RemediationEvidence;
|
|
256
277
|
/** Inventory names and notes for the reader of a notification. Not part of alert deduplication. */
|
|
257
278
|
location?: FindingLocation;
|
|
279
|
+
/** EPSS for the finding's CVE when `sources.epss` is on. Shown only; changes nothing. */
|
|
280
|
+
epss?: EpssScore;
|
|
258
281
|
/** News-only or generic product context without deterministic package applicability. */
|
|
259
282
|
news_candidate?: boolean;
|
|
260
283
|
/**
|
|
@@ -284,6 +307,8 @@ export interface Assessment {
|
|
|
284
307
|
relevance?: 'relevant' | 'irrelevant' | 'unknown';
|
|
285
308
|
/** Model assessment of the article, separate from version-range applicability. */
|
|
286
309
|
news_analysis?: NewsAnalysis;
|
|
310
|
+
/** What articles state about a finding that has no advisory severity, read without a model. */
|
|
311
|
+
news_signals?: NewsSignals;
|
|
287
312
|
ai?: {
|
|
288
313
|
model: string;
|
|
289
314
|
provider: string;
|
|
@@ -291,6 +316,36 @@ export interface Assessment {
|
|
|
291
316
|
status: 'complete' | 'unavailable' | 'conflicting';
|
|
292
317
|
};
|
|
293
318
|
}
|
|
319
|
+
/** One statement an article makes about a finding's subject, with the sentence it was read from. */
|
|
320
|
+
export interface NewsStatement {
|
|
321
|
+
/** The identifier or inventory name the statement is tied to. */
|
|
322
|
+
subject: string;
|
|
323
|
+
/** The sentence, shortened. Untrusted article text. */
|
|
324
|
+
excerpt: string;
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* What news articles state about a finding without an advisory severity, read without a model.
|
|
328
|
+
* Signals only raise priority; see the configuration guide for what is read.
|
|
329
|
+
*/
|
|
330
|
+
export interface NewsSignals {
|
|
331
|
+
/** The highest CVSS base score stated for the subject. */
|
|
332
|
+
cvss?: NewsStatement & {
|
|
333
|
+
score: number;
|
|
334
|
+
version?: string;
|
|
335
|
+
level: Severity;
|
|
336
|
+
};
|
|
337
|
+
/** A vendor's word rating ("Severity: moderate", "rated Important"). */
|
|
338
|
+
rating?: NewsStatement & {
|
|
339
|
+
level: Severity;
|
|
340
|
+
word: string;
|
|
341
|
+
};
|
|
342
|
+
/** The article reports exploitation. Not a known-exploited catalog entry. */
|
|
343
|
+
exploitation?: NewsStatement;
|
|
344
|
+
/** The article says no exploitation is known. Shown only. */
|
|
345
|
+
no_known_exploitation?: NewsStatement;
|
|
346
|
+
/** The article reports public exploit code. Shown only. */
|
|
347
|
+
public_exploit?: NewsStatement;
|
|
348
|
+
}
|
|
294
349
|
export type AiReviewReason = 'ai_general_news' | 'ai_not_affected' | 'ai_irrelevant';
|
|
295
350
|
export interface AiReview {
|
|
296
351
|
finding_id: string;
|
package/docs/configuration.md
CHANGED
|
@@ -215,6 +215,7 @@ npm affected ranges and a documented PyPI final-release subset are evaluated loc
|
|
|
215
215
|
| `sources.github_token_env` | `GITHUB_TOKEN`; optional authentication for the GitHub API |
|
|
216
216
|
| `sources.kev` | `false`; optional matching-CVE enrichment with CISA known-exploitation evidence; KEV alone does not invent a product finding |
|
|
217
217
|
| `sources.vendor_feeds` | `[]`; opt-in official Node.js, Python and PHP feeds with bounded article extraction |
|
|
218
|
+
| `sources.epss` | `false`; FIRST's EPSS score for the CVE of each current finding, shown in alerts and `explain`; sends CVE identifiers only, see [EPSS](#epss) |
|
|
218
219
|
| `sources.feeds` | `[]`; up to 30 selected public HTTPS RSS 2.0/Atom URLs, without URL credentials |
|
|
219
220
|
|
|
220
221
|
Collection is designed to keep making progress. cve.now records that match a package on your list are re-read at every scan, the longest unread first. At most 4,000 records other than new ones from the listing are read in one scan (records named by the package lookups and cited CVEs included), so that 1,000 requests always stay for the listing; a lookup whose records did not all fit is sent first on the next scan; each request takes about 1.1 seconds, so 2,000 such records add about 37 minutes to a scan. With more than about 8,000 records for your packages, each is re-read less often than every second scan, and exclusions resting on those waiting their turn become `unknown` (and go to the review digest) until they are read again; records kept only because a declared product or keyword appears in their text, or because a stored news story cites them, are re-read in turn, 200 per scan, longest unread first. When cve.now or GitHub lists more new records than one scan reads (5,000), the oldest are collected, the scan is reported as incomplete, and the next scan continues from where this one stopped; any request left out by that limit is reported the same way. A package name in a source record that this application cannot normalise is kept as published and matches nothing; it no longer discards the rest of the record. A stored OSV record that the service no longer serves keeps its last known content and counts as checked at that scan, as a cve.now record does. A stored GitHub record for one of your packages that is not among the records modified since its last reading is unchanged, and counts as checked at each complete GitHub scan, also after a catch-up over more updates than one scan reads. Stored OSV records are re-read only while their package is in the inventory. A GitHub record that cannot be read is reported and remembered by its identifier, as GitHub wrote it (up to 10,000; beyond that, those first met more than a day ago are given up on first, then the newest, so the checkpoint can always move), and the checkpoint moves on. Later scans ask GitHub for it by identifier, the longest waiting first: two per scan without a token (GitHub allows 60 requests an hour without one), ten with one; a refusal for this client (403 or 429) ends those requests and is reported. Its stored copy is not confirmed as current meanwhile, so an exclusion resting on it becomes `unknown` and goes to the review digest; other records are confirmed as usual. It is given up on, with a report, only after three failed reads (an unreadable answer or 404) in scans whose listing could read something, and a day after it was first met. A scan whose listing has records but can read none of them is a format outage while any of those records was first met within the last day (with new records arriving, that can last as long as the outage): no attempt is counted and the checkpoint waits, so the whole window is listed again when GitHub serves the usual format; after a day they count as records that cannot be read. Listing a long window again costs one request per 100 records: without a token, GitHub's 60 requests an hour can run out during a long outage, so set `github_token_env` if you enable GitHub; once a record is read again by identifier, the listing is read again from the oldest record still remembered. A stored copy of a record that was given up on is not confirmed again until GitHub serves it readably; such records are kept as long as their stored copy exists. When a scan has request budget left, records that were given up on are asked for again in turn: with two requests to spare, one goes to the next record that has a stored copy and one to the next record in turn, so neither kind can keep the other from its turns; with one to spare, they simply take turns. A record lost to a long partial format change is so found again once GitHub serves it readably. A row whose `ghsa_id` is missing or reshaped is read by the identifier its own links end with. A row with no identifier at all is reported and cannot be asked for by name; stored records for those packages (every stored record, if it names none) read before the row was first seen (GitHub may list a row late) and older than the row's own update are not confirmed as current until each is read again by identifier. Scans do that in turn, from the same scan on, with the request budget left after the records above (one request is kept for them), longest unread first; one that cannot be read is remembered like any other. Such a row updated within the last day also holds the listing: later scans list again from the earliest of them, so a row that regains its identifier within a day of its update is read; not in a scan that reaches the page limit, and without a token not when the scan listed more than 300 records. While they wait, exclusions resting on them become `unknown` once not read for two poll intervals, as above, and go to the review digest. A listing that can read nothing while such a row was updated within the last day, or carries no update time, is a format outage, as above. An answer to a request by identifier that carries no identifier is a failed read of the record asked for. A stored cve.now record that the service no longer serves keeps its last known content and counts as checked at that scan; nothing is reported, and a finding that rests on it stays as it was. A stored record that the service serves in a form that cannot be used (a status this application does not know, such as a supersession) is reported as a failed request when it concerns one of your packages, and the exclusion resting on that record becomes `unknown` once it has not been read for two poll intervals; any other stored record keeps its last content. A new cve.now record whose request fails is not lost and cannot hold the source back. On the scan in which it first fails, the scan is reported as incomplete and its checkpoint stays where it was, as for any failed collection, unless that scan listed more than 200 records, counting the one-hour overlap (a first scan, or a catch-up after downtime): then the checkpoint moves at once, so that the next scan does not read the same records again. From then on the record is remembered by its identifier and the checkpoint moves on; the record is asked for again on every scan, after the records that have not failed and before the stored records re-read in turn, the ones tried least first. A listed record that is already stored (the checkpoint's one-hour overlap) is not read again. Records left unasked because a scan ended early are remembered the same way. Up to 2,000 records are remembered, the oldest first; when there are more, the checkpoint stops just before the first one that is not, and the next scan finds it in the listing. It is given up on, with a report, once its requests have failed three times and, since its first failure, one day has passed when the service answers with a refusal (such as HTTP 404) or with content that cannot be used, or three days when the request itself fails (a transport error, HTTP 5xx or "too many requests"). A record that waited without being asked for is not given up on. A record named by a package lookup whose request fails is reported, and the lookups that named it are sent first on the next scan. A record whose request failed without an answer (a transport error, HTTP 5xx or "too many requests") is given up on only in a scan in which other records were read: while none can be read, it is an outage, not a bad record. A record that was given up on is always reported, also when the listing request of that scan failed. A listing entry with no usable identifier cannot be asked for by name: it holds the checkpoint for at most one day from when it was first seen and is reported during that time. A checkpoint that lies ahead of the clock (the clock was set back) is treated like a new installation's: the scan looks back one day. A CVE that a stored news story cites and cve.now does not have is asked for again once a day; when it is published it also appears in the listing.
|
|
@@ -242,9 +243,15 @@ A release is written with at most three parts in prose ("Rails 7.0.8"); a four-p
|
|
|
242
243
|
|
|
243
244
|
`hacker_news` means **The Hacker News** at `thehackernews.com`, the cybersecurity publication, not Y Combinator's Hacker News. Its feed is [The Hacker News RSS](https://feeds.feedburner.com/TheHackersNews). The bot fetches bounded article text only from allowed The Hacker News hosts, without executing scripts: at most 50 articles per scan, four concurrently, with a 2 MB HTML response cap and 16,000 characters of extracted text per article. Evidence records whether full article content, a feed excerpt or unavailable content was used. A failed or capped article fetch retains the feed excerpt and cannot support a new confident AI-only dismissal. Incomplete articles relevant to the inventory create a `hacker_news:articles` monitoring-health finding; the successful RSS collection and its checkpoint are still retained.
|
|
244
245
|
|
|
246
|
+
### EPSS
|
|
247
|
+
|
|
248
|
+
`sources.epss: true` looks up [FIRST's EPSS](https://www.first.org/epss/) for the CVEs of every current finding (its event when that is a CVE, and the CVE aliases of its advisory and known-exploited records, since a library finding is often keyed by its GHSA identifier; not the CVEs a news story cites): the estimated probability that the CVE is exploited in the next 30 days, and how it ranks among all scored CVEs. When a finding has several CVEs, the highest score is shown with the CVE it is for. Alerts and digests show it on one line (`EPSS for CVE-2026-1234: 1.6% chance of exploitation in the next 30 days; higher than 76% of scored CVEs (FIRST, 2026-11-18)`), and `explain`, `findings` and the scan report carry it as `epss`.
|
|
249
|
+
|
|
250
|
+
It is shown only. It changes no priority, rule or decision, and it is not part of what makes a new finding revision, reopens a review or asks a model for a new analysis, so a score that FIRST updates daily never re-sends an alert. Only CVE identifiers are sent, to `https://api.first.org/data/v1/epss`, in batches of 50, at most ten requests a scan. A score is refreshed once a day, the longest unrefreshed first. A CVE that FIRST has not scored yet (usually one published in the last day or two) is asked for again the next day. GHSA and other identifiers have no EPSS. When a lookup fails, the scan reports a notice, not degraded monitoring, and findings keep the score of the last successful lookup. The cache holds the CVEs of current findings, and keeps others for 30 days after their last lookup, so a scan without findings does not throw the scores away. A score FIRST leaves out of one answer is kept while its date is within a week. A retired finding no longer shows a score. The notice of a failed lookup is in that scan's report (`scan`), not in `status`.
|
|
251
|
+
|
|
245
252
|
Set `sources.vendor_feeds: [nodejs, python, php]`, or choose those names with `init --vendor-feeds`, to enable the official Node.js vulnerability feed, Python release blog and PHP announcements. Each adapter fetches at most 20 eligible articles per scan from its fixed vendor origin, with bounded HTML parsing and 16,000-character text limits. Unsupported links or failed extraction retain an excerpt; relevant incomplete articles produce a health warning. PHP announcements are extracted by their feed anchor so unrelated releases do not become one article. Vendor release dates and later advisory-index publication dates do not prove first vulnerability disclosure.
|
|
246
253
|
|
|
247
|
-
Additional `feeds` supply titles and summaries/content present in their RSS/Atom response; their article links are not fetched. The bot does not search the web or obtain paywalled content. Choose feed URLs deliberately. Public destinations, DNS results, redirects, response sizes and request durations are checked; a failing source retains its previous checkpoint and cached evidence and produces degraded status.
|
|
254
|
+
Additional `feeds` supply titles and summaries/content present in their RSS/Atom response; their article links are not fetched. A feed that carries the whole article is therefore worth more than one that carries a headline and a few sentences. Feeds checked in November 2026 that carry full text with scores or exploitation reports: Rapid7's blog (`https://www.rapid7.com/blog/rss/`), Tenable's blog (`https://www.tenable.com/blog/feed`), The Register's security section (`https://www.theregister.com/security/headlines.atom`), Security Affairs (`https://securityaffairs.com/feed`), and the Zero Day Initiative's published advisories (`https://www.zerodayinitiative.com/rss/published/`), which state a CVSS rating for every advisory, including 0-day advisories published before a vendor fix or a CVE exists. oss-security (`https://seclists.org/rss/oss-sec.rss`) carries open-source disclosures as excerpts. BleepingComputer, SecurityWeek and Dark Reading feeds carry a headline and a few hundred characters. The bot does not search the web or obtain paywalled content. Choose feed URLs deliberately. Public destinations, DNS results, redirects, response sizes and request durations are checked; a failing source retains its previous checkpoint and cached evidence and produces degraded status.
|
|
248
255
|
|
|
249
256
|
Malformed individual records are skipped while valid neighboring records continue through collection and assessment. Incomplete collection keeps the previous checkpoint, including when valid records have already been saved; cve.now and GitHub instead remember the records they could not read by identifier and move their checkpoints on, as described above. Authentication failures, rate limits, invalid pagination and request bounds can stop the affected source; other sources and notification delivery continue. Cancellation stops further requests.
|
|
250
257
|
|
|
@@ -416,6 +423,7 @@ Each `library`, `product` and `news` rule has `levels`, `basis` and `channels`.
|
|
|
416
423
|
- Confirmed exclusions and all-source withdrawals are retained without new vulnerability notifications. Withdrawal alone does not prove a system safe. Withdrawal disagreement remains conflicting.
|
|
417
424
|
- AI distinguishes noncritical system news from vulnerability reports and evaluates claimed system impact before routing; general news and supported AI-only exclusions enter a durable local review queue by default, with a digest when channels are configured. Generic product reports with linked CVEs use this analysis too. Uncertain analysis goes to review. AI cannot suppress source-critical news, an enabled exploitation override or deterministic package urgency by declaring it irrelevant. Advisory-linked package news uses library policy. Multi-advisory articles retain unmatched CVE/GHSA subjects separately until authoritative alias evidence joins them.
|
|
418
425
|
- `policy.ai_dismissals: review` is the default. Both complete `general_news/not_applicable` and model-only `not_affected` conclusions require local review, including legacy AI-only irrelevant news. `record` is an explicit opt-out. Deterministic package exclusions, source-critical and enabled exploitation overrides take precedence. See the local review workflow below.
|
|
426
|
+
- `news_signals: true` (the default) reads what news articles state about a finding that has no advisory severity yet, without a model; see [News signals](#news-signals) below. `false` turns it off.
|
|
419
427
|
- `health_channels` routes monitoring failures independently from vulnerability thresholds. If every destination fails, inspect local status/logs; the bot cannot notify through an unavailable channel.
|
|
420
428
|
|
|
421
429
|
`poll_interval_minutes` is an integer from 1 to 1,440, default 15. `inventory_stale_days` is 1–365, default 7; timestamps more than five minutes in the future are also invalid for assessment. `digest_interval_hours` is an integer from 1 to 168, default 24. Digest boundaries are aligned to the Unix epoch in UTC, not a user's timezone. Each Slack/email digest contains at most five findings; additional groups are sent separately.
|
|
@@ -428,6 +436,28 @@ Slack digest groups also respect the message size limit. Entries that do not fit
|
|
|
428
436
|
|
|
429
437
|
Acknowledgement applies to the current finding revision. Material changes create a new revision. Pass the revision you read, `security-watch acknowledge FINDING_ID --revision N`, to have the command refuse when a newer revision has appeared in the meantime; without `--revision` the current revision is acknowledged and its number is printed. Suppression requires a reason and expiry and remains active until that expiry. `explain FINDING_ID` shows the current policy decision together with acknowledgement and suppression controls, so policy eligibility can be distinguished from an active operator hold. Existing pending deliveries are superseded when the assessment or policy changes. Ordinary alerts keep semantic deduplication. AI dismissal reviews additionally bind the exact reviewed conclusion, evidence content and inventory/model context; changes to that basis create a new review revision. Scan timestamps, unchanged evidence refreshes and JSON object key order do not reopen a review. Rare new advisory aliases can change canonical finding identity; this release does not migrate historical identities automatically.
|
|
430
438
|
|
|
439
|
+
### News signals
|
|
440
|
+
|
|
441
|
+
A news story often comes before the advisory record that carries a severity: a zero-day with no CVE yet, a CVE that is reserved but not published, a vendor bulletin. Such a finding has source severity `unknown`. With `policy.news_signals: true` (the default), Security Watch reads the articles of that finding for four statements, without a model:
|
|
442
|
+
|
|
443
|
+
| Statement | Read from | Effect |
|
|
444
|
+
| ------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
445
|
+
| A CVSS score | `CVE-2026-1234 (CVSS score: 9.8)`, `a CVSS v3.1 score of 7.5`, `9.2 out of 10 on CVSS 4.0`, `The ZDI has assigned a CVSS rating of 7.6` | Priority at least the score's level (9.0 critical, 7.0 high, 4.0 medium); the highest stated score counts |
|
|
446
|
+
| A vendor's word rating | `Severity: moderate` (Apache advisories), `rated the vulnerability Important` | Priority at least that level (important = high, moderate = medium) |
|
|
447
|
+
| A report of exploitation | `is being actively exploited in the wild`, `under active exploitation`, `attackers are exploiting`, `exploitation attempts`, `added ... to its Known Exploited Vulnerabilities catalog` | Priority critical. With `urgent_unknown: true` the finding is sent at once as possibly critical; `exploited` stays false, since an article is not a known-exploited catalog |
|
|
448
|
+
| Public exploit code, or a denial of exploitation | `published a proof-of-concept`, `no evidence ... has been exploited` | Shown only |
|
|
449
|
+
|
|
450
|
+
The same internet-exposed, business-critical context rule as for advisories applies to a stated score or rating. Signals only raise: a missing, denied or uncertain statement lowers nothing and dismisses nothing, the source severity keeps meaning what advisory sources said, and a model's `not_affected` answer still goes to [local review](#reviewing-ai-dismissals-locally). As soon as an advisory record with a severity joins the finding, signals are no longer read for it.
|
|
451
|
+
|
|
452
|
+
A statement counts only when it is tied to the finding's subject:
|
|
453
|
+
|
|
454
|
+
- A score or rating: the nearest CVE or GHSA identifier before it in the same sentence is the finding's (`CVE-A (CVSS score: 9.3) - text` in a list); or, when the sentence cites no identifier, the product, package or keyword the finding matched is named in the same clause and the article cites no other identifier; or the article is about the subject alone (it cites one identifier, the finding's, or none and its title names the product).
|
|
455
|
+
- A report of exploitation, a denial or exploit code: an identifier in the same clause. A clause ends at `;`, at `, but`, `, and`, `while` and similar. In "attackers are exploiting CVE-A" and "CISA added CVE-A to its KEV catalog" that is the identifier after the report; in "CVE-A is being actively exploited" the one before it. So in "CVE-B was patched in March, but attackers are now exploiting CVE-A" only CVE-A is reported as exploited. When the sentence cites no identifier, a product, package or keyword named in the same clause, if the article cites no other identifier.
|
|
456
|
+
|
|
457
|
+
A negation before a report in its clause ("no evidence that", "not aware of", "neither ... nor ... report") makes it a denial. "No patch is available" or "without authentication" after a report does not. A hedge just before a report ("could be exploited", "suspected to be exploiting") voids it. "Zero-day" alone and "can exploit" are not reports. A whole number next to "CVSS" counts as a score only after "score", "rating" or a colon, and never as a threshold ("a CVSS score of 7 or higher", "CVSS 9.0+"). So "10 CVSS critical flaws" and "CVSS v4 metrics" are not scores. Not read: group statements ("It scores all five 9.2"), a score in another sentence of an article about several flaws ("The flaw has a CVSS score of 9.8"), CVSS vectors without a score, adjectives such as "critical flaw" or "high-severity", and tables (CISA ICS advisories). The excerpt each statement was read from is kept in the finding (`explain`); alerts print only the score, the rating word and the subject, never article text.
|
|
458
|
+
|
|
459
|
+
This is text matching: an article can be wrong, out of date or misleading, and a feed you add is trusted to write what it means. It was measured on one week of articles from The Hacker News, Rapid7, Tenable, The Register, Security Affairs, ZDI, seclists.org and CISA (256 items): every score and every report it read was correct, and it read no report from the ten articles that denied exploitation; it misses statements it cannot tie, which is the intended trade-off. Against a 20-product inventory that week it raised five findings and sent one more immediate alert, because cve.now usually has a severity already.
|
|
460
|
+
|
|
431
461
|
### Reviewing AI dismissals locally
|
|
432
462
|
|
|
433
463
|
```yaml
|
|
@@ -4,7 +4,7 @@ Security Watch compares a system inventory with advisory evidence and records
|
|
|
4
4
|
why a finding applies. Begin with its published fictional inventory and advisory
|
|
5
5
|
fixture, then inspect the result before configuring real monitoring.
|
|
6
6
|
|
|
7
|
-
This example uses `@shieldaai/security-watch@1.
|
|
7
|
+
This example uses `@shieldaai/security-watch@1.2.0`, an in-memory database,
|
|
8
8
|
no provider credentials and no notification delivery. It is a fixture check of
|
|
9
9
|
matching behavior, not an audit of real dependencies.
|
|
10
10
|
|
|
@@ -16,7 +16,7 @@ Use Node.js 24.10 or newer in a new directory:
|
|
|
16
16
|
mkdir watch-demo
|
|
17
17
|
cd watch-demo
|
|
18
18
|
npm init -y
|
|
19
|
-
npm install --ignore-scripts --save-exact @shieldaai/security-watch@1.
|
|
19
|
+
npm install --ignore-scripts --save-exact @shieldaai/security-watch@1.2.0
|
|
20
20
|
```
|
|
21
21
|
|
|
22
22
|
## Run the fictional inventory
|
package/docs/sbom.md
CHANGED
|
@@ -127,7 +127,7 @@ jobs:
|
|
|
127
127
|
steps:
|
|
128
128
|
- uses: actions/checkout@v7
|
|
129
129
|
- id: sbom
|
|
130
|
-
uses: ShieldaAI/security-watch@v1.
|
|
130
|
+
uses: ShieldaAI/security-watch@v1.2.0
|
|
131
131
|
with:
|
|
132
132
|
system-id: checkout-api
|
|
133
133
|
owner: Dana, platform team
|
|
@@ -143,7 +143,7 @@ To use an SBOM made by another tool, pass it as `sbom-file`; the action checks t
|
|
|
143
143
|
|
|
144
144
|
```yaml
|
|
145
145
|
- run: trivy image --format cyclonedx --output image.cdx.json "$IMAGE"
|
|
146
|
-
- uses: ShieldaAI/security-watch@v1.
|
|
146
|
+
- uses: ShieldaAI/security-watch@v1.2.0
|
|
147
147
|
with:
|
|
148
148
|
sbom-file: image.cdx.json
|
|
149
149
|
system-id: checkout-image
|
|
@@ -160,7 +160,7 @@ Any job with Node.js 24.10 or newer can run the command:
|
|
|
160
160
|
security-watch-sbom:
|
|
161
161
|
image: node:24-slim
|
|
162
162
|
script:
|
|
163
|
-
- npx --yes @shieldaai/security-watch@1.
|
|
163
|
+
- npx --yes @shieldaai/security-watch@1.2.0 sbom --system-id checkout-api --output security-watch.cdx.json --upload https://watch.example.com:8787
|
|
164
164
|
artifacts:
|
|
165
165
|
paths: [security-watch.cdx.json]
|
|
166
166
|
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shieldaai/security-watch",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Self-hosted security alerts for the software you run: reads your lockfiles (npm, Python, Go, Rust, Java and 7 more ecosystems) or any SBOM, watches new advisories and security news, and alerts you on Slack or email.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|