socket-patch vex
Write an OpenVEX document for the CVEs your patches cover
socket-patch vex writes an OpenVEX document that tells a vulnerability scanner which CVEs your patches cover. Run it after installing the patched dependencies.
- Status. Each advisory a patch fixes becomes one statement with the status
not_affectedand the justificationinline_mitigations_already_exist. The impact statement names the patch and its mode. - Scope. The document covers only what your patches fix. It makes no claim about any other vulnerability.
- Checked, not assumed. Before it writes a statement, the CLI checks that the patch is really in use: the lockfile link and its integrity hash in hosted mode, the committed package and its lockfile entry in vendored mode, and the installed files in agent mode. A patch the project no longer uses is left out.
- Product. The product is read from the Git remote or the project file. Pass
--productwhen the project has neither. scan,vendorandapplycan write the same document in one run with--vex <PATH>.
socket-patch vex --output socket.vex.json
socket-patch vex --output socket.vex.json --product pkg:generic/your-app
socket-patch vex --output socket.vex.json --json # also print a result for scripts
socket-patch scan --vex socket.vex.json # patch and write the document togetherProve what you patched shows a full document and how Socket's own SBOM and VEX exports record patches.
socket-patch vex -h
-h prints the common options shown here. socket-patch vex --help prints every option.
$ socket-patch vex -h
Generate OpenVEX for vulnerabilities addressed by verified patches
Usage: socket-patch vex [OPTIONS]
Options:
-O, --output <OUTPUT> Write the VEX document to this path instead of stdout (`-` means stdout).
A relative path resolves against the current directory, not `--cwd` [env:
SOCKET_VEX_OUTPUT=]
--product <PRODUCT> Override the auto-detected top-level product PURL/identifier [env:
SOCKET_VEX_PRODUCT=]
--no-verify Skip the on-disk file-hash check and trust the patch records. By default
every patch is verified before being emitted; this flag flips that off —
useful when generating a VEX doc on a build machine that doesn't have the
patched files laid out yet. The wiring checks still apply: a hosted or
vendored ledger record the lockfile no longer wires, or a lockfile
reference whose record is unavailable or names another package, is
omitted either way. A statement emitted this way says so (its impact
statement ends with "; not verified on disk"), and the run warns how many
there are [env: SOCKET_VEX_NO_VERIFY=]
-h, --help Print help (see more with '--help')
-V, --version Print version
Global options:
--cwd <CWD> Working directory [env: SOCKET_CWD=] [default: .]
-e, --ecosystems <ECOSYSTEMS> Restrict to these ecosystems (comma-separated): npm, pypi, cargo,
gem, golang, maven, composer, nuget, deno [env: SOCKET_ECOSYSTEMS=]
--offline Disable network access; fail if remote data is needed [env:
SOCKET_OFFLINE=]
-j, --json Emit machine-readable JSON output [env: SOCKET_JSON=]
--dry-run Preview the operation without making any mutations [env:
SOCKET_DRY_RUN=]Updated about 3 hours ago
Did this page help you?