@shieldaai/security-watch 1.3.0 → 1.4.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 +21 -0
- package/CONTRIBUTING.md +2 -0
- package/README.md +68 -42
- package/dist/check.d.ts +193 -0
- package/dist/check.js +1000 -0
- package/dist/cli.js +115 -2
- package/dist/inventory.d.ts +2 -1
- package/dist/inventory.js +1 -2
- package/dist/manifests.d.ts +7 -0
- package/dist/manifests.js +16 -0
- package/dist/mcp-server.d.ts +256 -0
- package/dist/mcp-server.js +755 -0
- package/dist/sources.d.ts +2 -0
- package/dist/sources.js +4 -0
- package/docs/agents.md +139 -0
- package/docs/offline-advisory-preview.md +2 -2
- package/docs/sbom.md +3 -3
- package/npm-shrinkwrap.json +237 -0
- package/package.json +10 -5
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,27 @@
|
|
|
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.4.0
|
|
6
|
+
|
|
7
|
+
Security Watch answers now what the monitor answers over time, for people and for AI coding agents, and is published as a signed container image. Existing configurations, inventories and databases work unchanged. To be published under the default `latest` tag; the GitHub Action is used as `uses: ShieldaAI/security-watch@v1.4.0`.
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- **`security-watch check`.** One command, no configuration, nothing stored: reads a project's dependency files (or `--sbom FILE`), asks OSV about every package version, marks CISA known-exploited entries and, with `--epss`, adds EPSS. Findings are sorted malware first, then known exploited, then by priority, each with the fixed versions above the installed one and the files the package came from. `--base REF` reads the dependency files at a git commit with `git cat-file` (nothing is checked out, and a partial clone fetches nothing) and reports what the working tree added, what it fixed, and which packages were added, removed or changed. `--package ecosystem:name@version` (repeatable) checks packages before they are added; `--advisory ID` says whether a CVE, GHSA, PYSEC, RUSTSEC, GO or MAL record affects the project, following a CVE record's aliases to the records that name packages. `--base REF...` compares with the point where the branch left REF. Both sides are the files git knows (the working tree: tracked files and untracked ones that are not ignored), so submodules and ignored folders are left out. `--json`, `--production`, `--fail-on`. Exit code 1 when an installed version is affected at or above `--fail-on` (high; malware and known-exploited always count; an advisory without a severity counts as medium; a package without an exact version never fails), 2 when the check is incomplete: a source failed or a dependency file could not be read, which is said first in the output. A package with several findings gets one version that fixes them all. It runs the monitor's own engine on an in-memory database, so a check and the monitor agree. Library functions `checkProject`, `checkPackages`, `checkChange` and `checkAdvisory` in `dist/check.js` (not yet part of the stable exports).
|
|
12
|
+
- **MCP server for AI agents.** `security-watch mcp [PROJECT]` and the `security-watch-mcp` bin serve seven tools over stdio: `check_project_vulnerabilities`, `check_dependency_change`, `check_package`, `check_advisory`, `list_dependencies`, `write_sbom` (the only tool that writes: inside the project, never replacing a file unasked) and `list_watch_findings` (read-only, listed only when `SECURITY_WATCH_CONFIG` names a monitor configuration). Paths must stay inside the project, links that lead out are refused, and a server started in a filesystem root or the home folder asks the client for its roots (a tool call waits for the answer). A cancelled call stops before its next request to a source and sends no reply. `write_sbom` writes only outside hidden folders, never through a link that leads out, and replaces only an existing SBOM, with `overwrite: true`. Protocol versions 2024-11-05 to 2025-11-25. See [Security Watch for AI agents](docs/agents.md).
|
|
13
|
+
- **Plugin for Claude Code, Codex, ChatGPT and Antigravity.** `plugins/security-watch`: the MCP server through a launcher that runs npm's own npx for the pinned version from outside the project (so the project's `.npmrc` and `node_modules` cannot choose the checker), and two skills, one for checking dependencies before and after a change and one for setting up the monitor. Marketplace `shielda-security-watch` (`/plugin marketplace add ShieldaAI/security-watch`). `npm run pack:plugins` builds the archives for OpenAI's portal.
|
|
14
|
+
- **Container image.** Every release tag publishes `ghcr.io/shieldaai/security-watch` (`x.y.z`, `x.y` and `latest` for stable releases) for linux/amd64 and linux/arm64, after the test suite and the container checks pass, with an SBOM and build provenance attached and a keyless Sigstore signature. `compose.yaml` uses it. The image carries the OCI source label and the MCP Registry label.
|
|
15
|
+
- **MCP Registry entry.** `server.json` lists the npm package and the image as `io.github.ShieldaAI/security-watch`; `package.json` carries the matching `mcpName`.
|
|
16
|
+
|
|
17
|
+
### Changed
|
|
18
|
+
|
|
19
|
+
- The published package includes `npm-shrinkwrap.json`, written from `package-lock.json` at pack time with runtime packages only, so `npx` and global installs get exactly the dependency tree the release was tested with, sub-dependencies included. `npm run check:package` installs the packed tarball and checks every runtime package version.
|
|
20
|
+
- `compose.yaml` pulls the published image instead of building one.
|
|
21
|
+
|
|
22
|
+
### Fixed
|
|
23
|
+
|
|
24
|
+
- The README no longer lists EPSS among the integrations Security Watch lacks; it has had EPSS since 1.2.0.
|
|
25
|
+
|
|
5
26
|
## 1.3.0
|
|
6
27
|
|
|
7
28
|
Security Watch hands findings to whoever writes temporary mitigations (runtime shields, blocking policies, firewall rules), shows which hosts a mitigation covers, works with [Shirudo](docs/shirudo.md), writes OpenVEX for other scanners, and reads CycloneDX up to 1.7. 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.3.0`.
|
package/CONTRIBUTING.md
CHANGED
|
@@ -85,6 +85,8 @@ Use fixture-based affected/fixed pairs, conflicting sources, malformed input, so
|
|
|
85
85
|
|
|
86
86
|
The package is `@shieldaai/security-watch`. Stable versions publish under `latest` and prereleases (release candidates) under `next`. The one supported publish command is `npm run release` (rehearse with `npm run release -- --dry-run`): it chooses the tag from the version and passes it to `npm publish` explicitly. Do not run `npm publish` yourself and do not pass `--tag`. npm hands a command-line option to lifecycle scripts only when it differs from the default, so `prepublishOnly` cannot tell `npm publish --tag latest` from a bare `npm publish`, while npm lets that option override `publishConfig.tag`. `prepublishOnly` therefore refuses a publish that does not carry the tag statement `npm run release` sets, and any tag that is wrong for the version. `npm run release` accepts only `--dry-run` and `--otp=CODE`. These checks prevent mistakes; they are lifecycle scripts, so `npm publish --ignore-scripts` or setting `SECURITY_WATCH_RELEASE_TAG` by hand bypasses them, and neither is ever the right thing to do. `npm run release` and the release check refuse to run when npm is set to ignore scripts or to use another registry (`--ignore-scripts` or `--registry` typed before the `--`, a line in `.npmrc`, or an `npm_config_` environment variable), including a scoped `@shieldaai:registry` line in `.npmrc`. A scoped registry typed as an option before the `--` is not passed on by npm at all, so the publish goes to the official registry. The release check also refuses a package that would contain a file that is not in git, such as an ignored file left in `docs/` or `examples/`. The version is defined in `package.json`; `test/public-api.test.mjs` checks that the lockfile, `compose.yaml`, `CHANGELOG.md`, the README, `docs/offline-advisory-preview.md` and `scripts/check-docker.mjs` agree with it and that the exported names match `scripts/public-api.json`. A change to that list is a compatibility decision: record it in the changelog and follow the [compatibility policy](docs/compatibility.md). Before publishing, commit the reviewed changes, run `npm run check`, and inspect the output of `npm pack --dry-run`. The check command installs the tarball in a clean consumer and verifies the CLI, types and runtime exports. `prepublishOnly` repeats the checks and requires a clean checkout.
|
|
87
87
|
|
|
88
|
+
After npm serves the new version: the `v*` tag starts the container image workflow (`.github/workflows/image.yml`), which publishes, attests and signs `ghcr.io/shieldaai/security-watch` (the very first publish creates a private package: make it public once in the package settings, or nobody can pull it); then move `plugin-stable` to the release commit (`git push origin <commit>:refs/heads/plugin-stable`, which the Claude plugin directory follows), publish `server.json` to the MCP Registry with `mcp-publisher publish`, and upload the archive from `npm run pack:plugins` to OpenAI's plugin portal. Every version pin in `plugins/security-watch`, `server.json`, `docs/agents.md` and the skills moves in the version commit; `test/plugins.test.mjs` fails otherwise.
|
|
89
|
+
|
|
88
90
|
Only repository administrators can create `v*` release tags. These tags cannot be changed or deleted, including by administrators.
|
|
89
91
|
|
|
90
92
|
Update package metadata, CLI version output, the lockfile and release documentation together. Release notes should name the runtimes and provider protocols tested, and distinguish mocked checks from live integrations. Record any checks that could not run.
|
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.4.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.4.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.
|
|
@@ -130,12 +130,26 @@ If your list contains libraries that are not npm packages (Python, PHP, Java, Go
|
|
|
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.4.0.** This is `@shieldaai/security-watch` 1.4.0, a minor release of the first stable version (1.0.0). It answers in one command what the monitor answers over time (`security-watch check`: a project, a change since a git commit, a package, an advisory), gives AI coding agents the same checks through an [MCP server and a plugin](docs/agents.md), and is published as a signed container image (`ghcr.io/shieldaai/security-watch`); 1.3 added `shield-candidates`, mitigation status, [Shirudo](docs/shirudo.md) and OpenVEX, 1.2 read scores and exploitation reports from news and added EPSS, and 1.1 added SBOM generation, 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
|
|
|
137
|
+
## Check now, or let your AI agent check
|
|
138
|
+
|
|
139
|
+
No configuration is needed for a one-off answer. `check` reads the project's lockfiles, asks OSV about every package version and marks CISA known-exploited entries:
|
|
140
|
+
|
|
141
|
+
```sh
|
|
142
|
+
npx --yes @shieldaai/security-watch@1.4.0 check # this project
|
|
143
|
+
npx --yes @shieldaai/security-watch@1.4.0 check --base origin/main # only what this branch brings in
|
|
144
|
+
npx --yes @shieldaai/security-watch@1.4.0 check --package npm:lodash@4.17.21
|
|
145
|
+
npx --yes @shieldaai/security-watch@1.4.0 check --advisory CVE-2021-44906
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Exit code 1 means a finding at or above `--fail-on` (high by default), 2 that the check could not complete. AI coding agents get the same checks, plus SBOM writing, from `security-watch mcp` or the plugin for Claude Code, Codex and Antigravity: they check a package before adding it and a dependency change before handing it back. See [Security Watch for AI agents](docs/agents.md).
|
|
149
|
+
|
|
137
150
|
## Features
|
|
138
151
|
|
|
152
|
+
- One-off checks and AI agents: `security-watch check` for a project, a git change, a package or an advisory, and an [MCP server and plugin](docs/agents.md) with the same checks for coding agents, including OSV malicious-package records.
|
|
139
153
|
- Inventories from your code: `security-watch sbom` and `init --project` read the lockfiles and manifests of 12 ecosystems and write a CycloneDX SBOM; an SBOM folder turns every SBOM your pipelines deliver into a monitored system. A [GitHub Action](docs/sbom.md#github-actions) and a one-line command for other CI are included. Hand-written YAML/JSON inventories and library lists still work. Names alone are accepted; exact installed versions improve applicability checks.
|
|
140
154
|
- cve.now CVE updates and npm stack checks, plus The Hacker News security articles. Optional sources include OSV, GitHub, CISA KEV, official Node.js/Python/PHP feeds and other RSS/Atom feeds.
|
|
141
155
|
- Structured library checks without AI, with optional AI analysis to distinguish new vulnerabilities, updates to known vulnerabilities and general system news. Each finding records source severity, applicability and contextual priority separately.
|
|
@@ -171,7 +185,7 @@ To build and install from a source checkout:
|
|
|
171
185
|
npm ci
|
|
172
186
|
npm run check
|
|
173
187
|
npm pack
|
|
174
|
-
npm install --global ./shieldaai-security-watch-1.
|
|
188
|
+
npm install --global ./shieldaai-security-watch-1.4.0.tgz
|
|
175
189
|
```
|
|
176
190
|
|
|
177
191
|
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:
|
|
@@ -298,14 +312,22 @@ Run `security-watch providers` to list provider IDs, default endpoints, credenti
|
|
|
298
312
|
|
|
299
313
|
## Run with Docker
|
|
300
314
|
|
|
301
|
-
|
|
315
|
+
Each release is published as `ghcr.io/shieldaai/security-watch` for linux/amd64 and linux/arm64, with an SBOM and build provenance attached and a keyless Sigstore signature. Check it before you run it:
|
|
316
|
+
|
|
317
|
+
```sh
|
|
318
|
+
gh attestation verify oci://ghcr.io/shieldaai/security-watch:1.4.0 --repo ShieldaAI/security-watch
|
|
319
|
+
cosign verify ghcr.io/shieldaai/security-watch:1.4.0 \
|
|
320
|
+
--certificate-identity-regexp '^https://github.com/ShieldaAI/security-watch/' \
|
|
321
|
+
--certificate-oidc-issuer https://token.actions.githubusercontent.com
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
Then:
|
|
302
325
|
|
|
303
326
|
```sh
|
|
304
|
-
docker build -t shielda-security-watch .
|
|
305
327
|
docker volume create security-watch-data
|
|
306
328
|
docker run --rm --user 0 --entrypoint chown \
|
|
307
329
|
--mount type=volume,src=security-watch-data,dst=/data \
|
|
308
|
-
|
|
330
|
+
ghcr.io/shieldaai/security-watch:1.4.0 "$(id -u):$(id -g)" /data
|
|
309
331
|
docker run --rm --name security-watch \
|
|
310
332
|
--user "$(id -u):$(id -g)" \
|
|
311
333
|
--read-only --cap-drop ALL --security-opt no-new-privileges \
|
|
@@ -314,9 +336,11 @@ docker run --rm --name security-watch \
|
|
|
314
336
|
--mount type=bind,src="$(pwd)/watch/security-watch.yaml",dst=/config/security-watch.yaml,readonly \
|
|
315
337
|
--mount type=bind,src="$(pwd)/watch/systems.yaml",dst=/config/systems.yaml,readonly \
|
|
316
338
|
--mount type=volume,src=security-watch-data,dst=/data \
|
|
317
|
-
|
|
339
|
+
ghcr.io/shieldaai/security-watch:1.4.0 start --config /config/security-watch.yaml
|
|
318
340
|
```
|
|
319
341
|
|
|
342
|
+
To build the image from a checkout instead, run `docker build -t ghcr.io/shieldaai/security-watch:1.4.0 .` first; the commands stay the same.
|
|
343
|
+
|
|
320
344
|
Before running, set `inventory: /config/systems.yaml` and `database: /data/watch.db` in the container's configuration. Create `watch/.env` privately with only the credentials you use; it is not loaded automatically by the npm CLI. Keep configuration, inventory and `.env` readable only by your user, for example with `chmod 600` on those files. The short initialization command assigns the data volume to your UID/GID; the application itself then runs as that user. Your Docker VM must be able to access the configuration/inventory bind mounts. Add a read-only mount under `/config` for any imported lockfile or SBOM folder (for example `--mount type=bind,src="$(pwd)/watch/sboms",dst=/config/sboms,readonly`) and use the matching path in the inventory.
|
|
321
345
|
|
|
322
346
|
SQLite stays on a native Docker volume rather than a desktop VM's shared host filesystem. This avoids depending on host-sharing behavior for database locking and write-ahead logging. Retain `security-watch-data` when recreating the container. The application needs outbound network access, and an inbound port only if you turn on the SBOM receiver (`intake`).
|
|
@@ -331,7 +355,7 @@ chmod 600 security-watch.yaml systems.yaml .env
|
|
|
331
355
|
export SECURITY_WATCH_UID=$(id -u) SECURITY_WATCH_GID=$(id -g)
|
|
332
356
|
```
|
|
333
357
|
|
|
334
|
-
Edit the copied inventory, notification routes and credentials, and apply the same `/config/systems.yaml` and `/data/watch.db` settings before running `docker compose up
|
|
358
|
+
Edit the copied inventory, notification routes and credentials, and apply the same `/config/systems.yaml` and `/data/watch.db` settings before running `docker compose up -d`, which pulls the published image. Inspect `docker compose logs --follow`. Compose requires the host UID/GID variables and automatically runs a short volume-ownership initializer before the application starts. Its `watch-data` named volume keeps SQLite on Docker's native filesystem, while the private configuration/inventory remain read-only host mounts. You may persist the UID/GID values in the private `.env` file for later Compose invocations. Add an explicit read-only mount if the inventory imports a lockfile or reads an SBOM folder (`- ./sboms:/config/sboms:ro`). Retain the named volume when recreating containers; `docker compose down --volumes` removes it.
|
|
335
359
|
|
|
336
360
|
## How decisions work
|
|
337
361
|
|
|
@@ -355,37 +379,39 @@ Models cannot run tools, change recipients, edit version ranges or establish tha
|
|
|
355
379
|
|
|
356
380
|
Commands that operate on a configured monitor accept `--config PATH`; the default is `./security-watch.yaml`. For monitor commands, add `--credentials-file PATH` to load a private dotenv file, or export variables through your service manager. The offline `rehearse` command rejects credential files and uses simulated delivery. Existing environment values take precedence for monitor commands. Files are parsed as data, without shell evaluation; they are never loaded implicitly. `init` uses `--directory` instead. Unsupported flag/command combinations are rejected before activity.
|
|
357
381
|
|
|
358
|
-
| Command | Behavior
|
|
359
|
-
| ------------------------------------------------------------------------------------------------- |
|
|
360
|
-
| `
|
|
361
|
-
| `
|
|
362
|
-
| `
|
|
363
|
-
| `
|
|
364
|
-
| `
|
|
365
|
-
| `
|
|
366
|
-
| `
|
|
367
|
-
| `
|
|
368
|
-
| `
|
|
369
|
-
| `scan
|
|
370
|
-
| `scan --
|
|
371
|
-
| `scan --
|
|
372
|
-
| `
|
|
373
|
-
| `
|
|
374
|
-
| `
|
|
375
|
-
| `
|
|
376
|
-
| `
|
|
377
|
-
| `
|
|
378
|
-
| `
|
|
379
|
-
| `
|
|
380
|
-
| `
|
|
381
|
-
| `
|
|
382
|
-
| `
|
|
383
|
-
| `
|
|
384
|
-
| `
|
|
385
|
-
| `
|
|
386
|
-
| `
|
|
387
|
-
| `
|
|
388
|
-
| `
|
|
382
|
+
| Command | Behavior |
|
|
383
|
+
| ------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
|
|
384
|
+
| `check [PROJECT] [--base REF \| --package ECO:NAME@VER \| --advisory ID \| --sbom FILE]` | Check now, with no configuration: OSV and CISA KEV, nothing stored; exit 1 on a finding at or above `--fail-on` ([guide](docs/agents.md)) |
|
|
385
|
+
| `mcp [PROJECT]` | MCP server on stdio with the same checks and SBOM writing, for AI coding agents ([guide](docs/agents.md)) |
|
|
386
|
+
| `providers` | List supported provider profiles without configuration, credentials or network access |
|
|
387
|
+
| `templates` | List common system IDs available to `init --systems` |
|
|
388
|
+
| `ecosystems` | List supported library ecosystems |
|
|
389
|
+
| `sbom [--project PATH] [--output FILE]` | Read a project's lockfiles and manifests and write a CycloneDX SBOM; no network requests ([guide](docs/sbom.md)) |
|
|
390
|
+
| `upload --input FILE --url URL` | Send an SBOM to a monitor's receiver (`intake`); `sbom --upload URL` makes and sends one in a step |
|
|
391
|
+
| `import-sbom --input PATH` | Show what Security Watch reads from a CycloneDX or SPDX SBOM; exits 2 when some packages cannot be watched |
|
|
392
|
+
| `normalize-libraries --input PATH` | Parse a library list without network requests; optional `--ecosystem` sets the group and `--output` saves a new JSON file |
|
|
393
|
+
| `scan` | Run once, save evidence/findings and queue notifications; does not deliver by default |
|
|
394
|
+
| `scan --dry-run` | Use in-memory state, disable model calls and send no notifications; source requests still occur |
|
|
395
|
+
| `scan --notify` | Save a scan, attempt due delivery and report the remaining backlog; future or rate-limited jobs stay pending |
|
|
396
|
+
| `scan --fixture PATH` | Use local evidence instead of network sources and AI |
|
|
397
|
+
| `scan --no-ai` | Keep structured matching and disable model calls for this invocation |
|
|
398
|
+
| `start` | Run the scheduler and delivery worker in the foreground |
|
|
399
|
+
| `findings`, `status`, `deliveries`, `budget` | Inspect saved assessments, monitoring state, delivery outcomes and budget reservations |
|
|
400
|
+
| `health` | Check worker heartbeat, completed-scan freshness and actionable delivery problems; exits 2 when unhealthy |
|
|
401
|
+
| `health --scan-only` | Check completed scans and delivery without requiring a foreground worker, for external cron schedules |
|
|
402
|
+
| `reviews [--all] [--limit N] [--after CURSOR]` | Inspect the durable local AI dismissal queue and its backlog |
|
|
403
|
+
| `review FINDING_ID --revision N --disposition dismiss\|investigate --reviewer NAME --reason TEXT` | Adjudicate an exact current review locally without sending a notification |
|
|
404
|
+
| `explain FINDING_ID` | Show a finding, its current policy decision and acknowledgement/suppression controls |
|
|
405
|
+
| `history FINDING_ID` | Show saved finding revisions |
|
|
406
|
+
| `acknowledge FINDING_ID` | Acknowledge the current revision, or only revision N with `--revision N` |
|
|
407
|
+
| `suppress FINDING_ID --hours 24 --reason TEXT` | Suppress until an explicit expiry |
|
|
408
|
+
| `retry DELIVERY_ID` | Requeue a failed/uncertain delivery after checking receipt; does not send immediately |
|
|
409
|
+
| `backup --output PATH` | Create a consistent SQLite backup at a new destination and verify a temporary restored copy |
|
|
410
|
+
| `verify-backup --input PATH` | Verify a standalone backup without monitor configuration or replacing a live database |
|
|
411
|
+
| `prune` | Show a read-only plan using configured retention periods |
|
|
412
|
+
| `prune --apply` | Apply one bounded retention batch atomically |
|
|
413
|
+
| `unlock` | Remove stale lock metadata only when no worker owns the SQLite lock |
|
|
414
|
+
| `test-notification --channel slack` | Send an explicit test message; `email` is also supported |
|
|
389
415
|
|
|
390
416
|
Only one scan/scheduler instance may write a given database. Inspection and acknowledgement use SQLite safely alongside the worker. Do not share a database between containers or hosts or put it on a network filesystem. Stop the worker before replacing a database with a backup; retain permissions and move aside stale SQLite sidecar files with the old database.
|
|
391
417
|
|
|
@@ -426,11 +452,11 @@ The corpus contains source-derived synthetic scenarios with fictional inventorie
|
|
|
426
452
|
|
|
427
453
|
## Boundaries and privacy
|
|
428
454
|
|
|
429
|
-
cve.now stack queries disclose deduplicated npm package names and versions; lockfiles, SBOMs and deployment metadata are not uploaded. `security-watch sbom` makes no network requests. The Hacker News feed and article servers receive normal HTTP requests. Optional OSV queries also disclose dependency names and versions; optional GitHub, CISA and additional feed sources receive normal HTTP requests. GitHub authentication is optional. The selected model provider receives, under the default `minimal` disclosure profile, the matched package and product names and versions plus selected evidence; the `deployment-context` profile adds environment, exposure, criticality and matching keywords (see [SECURITY.md](SECURITY.md)). Slack/email receive findings and evidence links. Consider these disclosures before monitoring private dependencies.
|
|
455
|
+
`check` and the MCP server send package ecosystems, names and versions (and advisory IDs) to OSV, download the CISA known-exploited catalog, and send CVE IDs to FIRST only when EPSS is asked for; they store nothing. cve.now stack queries disclose deduplicated npm package names and versions; lockfiles, SBOMs and deployment metadata are not uploaded. `security-watch sbom` makes no network requests. The Hacker News feed and article servers receive normal HTTP requests. Optional OSV queries also disclose dependency names and versions; optional GitHub, CISA and additional feed sources receive normal HTTP requests. GitHub authentication is optional. The selected model provider receives, under the default `minimal` disclosure profile, the matched package and product names and versions plus selected evidence; the `deployment-context` profile adds environment, exposure, criticality and matching keywords (see [SECURITY.md](SECURITY.md)). Slack/email receive findings and evidence links. Consider these disclosures before monitoring private dependencies.
|
|
430
456
|
|
|
431
457
|
Authentication credentials are read from environment variables. Findings, evidence, quoted model output, budget reservations and history are stored locally. There is no automatic application telemetry. An explicitly configured heartbeat service receives success pings and normal request metadata. Protect the configuration, SQLite database, backups and credentials as operational data. Details are in [SECURITY.md](SECURITY.md).
|
|
432
458
|
|
|
433
|
-
This release has no automatic patching, shell execution from news, hosted dashboard, Slack action buttons, VEX import, operating-system package matching, distributed workers
|
|
459
|
+
This release has no automatic patching, shell execution from news, hosted dashboard, Slack action buttons, VEX import, operating-system package matching, distributed workers or independent security audit. CVSS v3.0/v3.1 vectors and supplied severity labels/scores are supported. OSV and GitHub also support [CVSS v4 base-vector scoring](docs/cvss-v4-support.md), with explicit base projection and unsupported-vector diagnostics. Product backports, reachability and exploit prerequisites require human/vendor evidence. cve.now starts from recent entries, revisits tracked/news-cited CVEs and checks exact npm packages through its stack endpoint; this is not an exhaustive historical audit of every product. Existing configurations retain explicitly enabled legacy sources; set `osv`, `github` and `kev` to `false` to switch exclusively to the new defaults.
|
|
434
460
|
|
|
435
461
|
Current evidence and findings are loaded into memory during each scan. Retention is disabled until configured, and protected unresolved records may continue growing even after cleanup is enabled. This release targets small installations. Plan storage and review retention dry runs before increasing scale.
|
|
436
462
|
|
package/dist/check.d.ts
ADDED
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { type DependencyFile } from './manifests.js';
|
|
2
|
+
import type { EpssScore, HttpClient, Severity } from './types.js';
|
|
3
|
+
export interface CheckOptions {
|
|
4
|
+
/** Mark CISA known-exploited entries. Default: true. */
|
|
5
|
+
kev?: boolean;
|
|
6
|
+
/** Add FIRST EPSS scores to findings with a CVE. Sends CVE IDs to api.first.org. Default: false. */
|
|
7
|
+
epss?: boolean;
|
|
8
|
+
http?: HttpClient;
|
|
9
|
+
now?: number;
|
|
10
|
+
signal?: AbortSignal;
|
|
11
|
+
}
|
|
12
|
+
export interface ProjectCheckOptions extends CheckOptions {
|
|
13
|
+
/** A project folder or one dependency file. */
|
|
14
|
+
project?: string;
|
|
15
|
+
/** A CycloneDX or SPDX JSON SBOM to check instead of reading a project. */
|
|
16
|
+
sbom?: string;
|
|
17
|
+
/** Leave out development-only dependencies where the dependency file says which they are. */
|
|
18
|
+
production?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface CheckFinding {
|
|
21
|
+
/** The advisory's own identifier (GHSA-, PYSEC-, RUSTSEC-, MAL- ...). */
|
|
22
|
+
id: string;
|
|
23
|
+
/** Other identifiers of the same problem, such as its CVE. */
|
|
24
|
+
aliases: string[];
|
|
25
|
+
title: string;
|
|
26
|
+
/** Severity the advisory gives. */
|
|
27
|
+
severity: Severity;
|
|
28
|
+
/** Security Watch's priority: the severity, raised for known exploitation, malware or an unknown version. */
|
|
29
|
+
priority: Severity;
|
|
30
|
+
/** `affected`: the installed version is in an affected range. `unknown`: no exact version to compare. */
|
|
31
|
+
applicability: 'affected' | 'unknown';
|
|
32
|
+
/** Listed in CISA's Known Exploited Vulnerabilities catalog. */
|
|
33
|
+
exploited: boolean;
|
|
34
|
+
/** An OSV malicious-package record: the package itself is malware. */
|
|
35
|
+
malware: boolean;
|
|
36
|
+
package: {
|
|
37
|
+
ecosystem: string;
|
|
38
|
+
name: string;
|
|
39
|
+
version?: string;
|
|
40
|
+
};
|
|
41
|
+
/** Dependency files the package was found in, relative to the project. */
|
|
42
|
+
files: string[];
|
|
43
|
+
/** Versions that fix it, as the advisory gives them. */
|
|
44
|
+
fixed?: string;
|
|
45
|
+
url?: string;
|
|
46
|
+
epss?: EpssScore;
|
|
47
|
+
reasons: string[];
|
|
48
|
+
}
|
|
49
|
+
export interface CheckReport {
|
|
50
|
+
/** A project's dependency files, an SBOM file, or packages named in the request. */
|
|
51
|
+
kind: 'project' | 'sbom' | 'packages';
|
|
52
|
+
checked_at: string;
|
|
53
|
+
/** What was checked: a project folder, a file, an SBOM or a package list. */
|
|
54
|
+
target: string;
|
|
55
|
+
packages: number;
|
|
56
|
+
/** Packages without an exact version (a manifest without a lockfile): checked by name only. */
|
|
57
|
+
unversioned: number;
|
|
58
|
+
files: DependencyFile[];
|
|
59
|
+
ecosystems: string[];
|
|
60
|
+
findings: CheckFinding[];
|
|
61
|
+
/** Sources asked. */
|
|
62
|
+
sources: string[];
|
|
63
|
+
/** A source failed or answered in part: the findings may be incomplete. */
|
|
64
|
+
degraded: boolean;
|
|
65
|
+
errors: string[];
|
|
66
|
+
/** Dependency files that could not be read. Their packages were not checked, so `degraded` is set. */
|
|
67
|
+
warnings: string[];
|
|
68
|
+
/** Notes about what was read: version ranges, entries from Git or local paths, SBOM notices. */
|
|
69
|
+
notices: string[];
|
|
70
|
+
}
|
|
71
|
+
/** The reader's warnings that mean a file's packages are missing, rather than notes about them. */
|
|
72
|
+
export declare const isUnreadableWarning: (warning: string) => boolean;
|
|
73
|
+
/** A GET cache for the sources' static files (KEV, EPSS, OSV records), shared by checks in one session. */
|
|
74
|
+
export declare function cachingHttp(inner?: HttpClient, ttlMs?: number): HttpClient;
|
|
75
|
+
/**
|
|
76
|
+
* A git commit ID: 7 to 64 hex digits with at least one letter, or a full 40- or 64-digit ID.
|
|
77
|
+
* Date-style versions (org.json 20230227, pdfminer.six 20251107) are all digits and stay versions.
|
|
78
|
+
*/
|
|
79
|
+
export declare function isCommitId(text: string): boolean;
|
|
80
|
+
/** A version that compares, or undefined: commit IDs and other text never pass for a version. */
|
|
81
|
+
export declare function comparable(version: string): string | undefined;
|
|
82
|
+
/**
|
|
83
|
+
* The fixed versions worth showing, from an advisory's fix list ("1.2.6; 0.2.4, 1.2.6"): each once,
|
|
84
|
+
* in version order, without commit IDs, and, when the installed version is known, only those above
|
|
85
|
+
* it (an advisory for several release lines lists a fix per line, and "upgrade to 0.2.4" is no
|
|
86
|
+
* advice for 1.2.5). Versions that do not compare are kept as they are.
|
|
87
|
+
*/
|
|
88
|
+
export declare function fixesAbove(fix: string, installed: string | undefined): string | undefined;
|
|
89
|
+
/** Reads a project's dependency files (or an SBOM) and checks every package against OSV. */
|
|
90
|
+
export declare function checkProject(options?: ProjectCheckOptions): Promise<CheckReport>;
|
|
91
|
+
export interface PackageQuery {
|
|
92
|
+
ecosystem: string;
|
|
93
|
+
name: string;
|
|
94
|
+
/** Exact version. Without one, every advisory for the package is listed as `unknown`. */
|
|
95
|
+
version?: string;
|
|
96
|
+
}
|
|
97
|
+
/** Checks named packages, such as one an agent is about to add or upgrade to. */
|
|
98
|
+
export declare function checkPackages(packages: readonly PackageQuery[], options?: CheckOptions): Promise<CheckReport>;
|
|
99
|
+
export interface ChangeReport {
|
|
100
|
+
/** The ref as given; `REF...` means the point where the working tree's branch left REF. */
|
|
101
|
+
base: string;
|
|
102
|
+
/** The commit the base resolved to. */
|
|
103
|
+
commit: string;
|
|
104
|
+
head: CheckReport;
|
|
105
|
+
/** Findings the change brought in: the advisory did not concern this package at the base. */
|
|
106
|
+
added: CheckFinding[];
|
|
107
|
+
/** Findings at the base that the change removed. */
|
|
108
|
+
resolved: CheckFinding[];
|
|
109
|
+
/** Findings present before and after. */
|
|
110
|
+
unchanged: number;
|
|
111
|
+
packages: {
|
|
112
|
+
added: string[];
|
|
113
|
+
removed: string[];
|
|
114
|
+
changed: string[];
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Writes the dependency files of `project` as they were at `base` into a new temporary folder.
|
|
119
|
+
* Only files the project reader would pick up are taken, with `git cat-file`; nothing is checked
|
|
120
|
+
* out and no repository code runs. Submodules are not followed.
|
|
121
|
+
*/
|
|
122
|
+
export declare function dependencyFilesAt(project: string, base: string): {
|
|
123
|
+
folder: string;
|
|
124
|
+
project: string;
|
|
125
|
+
commit: string;
|
|
126
|
+
skipped: string[];
|
|
127
|
+
skippedPaths: string[];
|
|
128
|
+
};
|
|
129
|
+
/**
|
|
130
|
+
* The dependency files of the working tree that git tracks or would track: tracked files as they
|
|
131
|
+
* are on disk, and untracked files that are not ignored. Submodules, nested repositories and
|
|
132
|
+
* ignored folders are left out, as they are at the base.
|
|
133
|
+
*/
|
|
134
|
+
export declare function dependencyFilesInWorkingTree(project: string): {
|
|
135
|
+
folder: string;
|
|
136
|
+
project: string;
|
|
137
|
+
skipped: string[];
|
|
138
|
+
skippedPaths: string[];
|
|
139
|
+
};
|
|
140
|
+
/**
|
|
141
|
+
* Compares a project's dependencies at a git ref with the working tree and reports what the change
|
|
142
|
+
* added and fixed. Both sides are the files git knows: the base from its objects, the working tree
|
|
143
|
+
* as it is on disk (tracked, plus untracked files that are not ignored).
|
|
144
|
+
*/
|
|
145
|
+
export declare function checkChange(options: ProjectCheckOptions & {
|
|
146
|
+
base: string;
|
|
147
|
+
}): Promise<ChangeReport>;
|
|
148
|
+
export interface AdvisoryReport {
|
|
149
|
+
id: string;
|
|
150
|
+
/** The record was found in OSV. */
|
|
151
|
+
found: boolean;
|
|
152
|
+
title?: string;
|
|
153
|
+
summary?: string;
|
|
154
|
+
aliases: string[];
|
|
155
|
+
url?: string;
|
|
156
|
+
severity?: Severity;
|
|
157
|
+
/** Packages the advisory names, with their affected ranges and fixes. */
|
|
158
|
+
packages: Array<{
|
|
159
|
+
ecosystem: string;
|
|
160
|
+
name: string;
|
|
161
|
+
range?: string;
|
|
162
|
+
fixed?: string;
|
|
163
|
+
}>;
|
|
164
|
+
/** Findings in the project for this advisory (by its ID or an alias). */
|
|
165
|
+
findings: CheckFinding[];
|
|
166
|
+
/** Packages the advisory names that the project has, at versions it does not list as affected. */
|
|
167
|
+
present_not_affected: string[];
|
|
168
|
+
project: CheckReport;
|
|
169
|
+
}
|
|
170
|
+
/** CVE and GHSA identifiers in the case OSV uses; anything else as typed. */
|
|
171
|
+
export declare function normalizeAdvisoryId(value: string): string;
|
|
172
|
+
/**
|
|
173
|
+
* Answers "does this advisory concern the project?": looks the identifier up in OSV (CVE, GHSA,
|
|
174
|
+
* PYSEC, RUSTSEC, GO, MAL ...), follows aliases to the records that name packages, and checks
|
|
175
|
+
* the project.
|
|
176
|
+
*/
|
|
177
|
+
export declare function checkAdvisory(advisory: string, options?: ProjectCheckOptions): Promise<AdvisoryReport>;
|
|
178
|
+
/**
|
|
179
|
+
* Whether a finding fails a check at `failOn`. Malware always does. An installed version that is
|
|
180
|
+
* affected fails when it is known exploited or at or above the level. A package without an exact
|
|
181
|
+
* version ("check by hand") does not: nothing says the version in use is affected.
|
|
182
|
+
*/
|
|
183
|
+
export declare function failsAt(finding: CheckFinding, failOn: Severity | 'none'): boolean;
|
|
184
|
+
export declare function findingLine(finding: CheckFinding, kind?: CheckReport['kind']): string;
|
|
185
|
+
/**
|
|
186
|
+
* One line per package with several findings: the lowest listed fixed version that fixes all of
|
|
187
|
+
* them, each judged on its own release line, so that an agent upgrades once instead of once per
|
|
188
|
+
* finding. Nothing is said when no listed version fixes them all.
|
|
189
|
+
*/
|
|
190
|
+
export declare function upgradeSummary(findings: readonly CheckFinding[]): string[];
|
|
191
|
+
export declare function formatCheckReport(report: CheckReport, min?: Severity): string;
|
|
192
|
+
export declare function formatChangeReport(change: ChangeReport, min?: Severity): string;
|
|
193
|
+
export declare function formatAdvisoryReport(report: AdvisoryReport): string;
|