From ffa1f8095d864807b2188cd74192fbb1f44bee7b Mon Sep 17 00:00:00 2001 From: Kevin Longmuir Date: Fri, 1 May 2026 19:28:20 -0400 Subject: [PATCH 1/6] feat: vex command --- .gitignore | 1 + README.md | 64 ++++++- src/commands/vex/index.ts | 148 +++++++++++++++ src/config/constants.ts | 1 + src/service/file.svc.ts | 6 +- src/service/vex.svc.ts | 128 +++++++++++++ test/commands/vex/index.test.ts | 323 +++++++++++++++++++++++++++++++ test/service/vex.svc.test.ts | 326 ++++++++++++++++++++++++++++++++ 8 files changed, 992 insertions(+), 5 deletions(-) create mode 100644 src/commands/vex/index.ts create mode 100644 src/service/vex.svc.ts create mode 100644 test/commands/vex/index.test.ts create mode 100644 test/service/vex.svc.test.ts diff --git a/.gitignore b/.gitignore index 84f54957..c696060c 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,7 @@ pnpm-lock.yaml # Various CLI Output Files herodevs.report.json herodevs.sbom.json +herodevs.openvex.json bom.json sbom.json cdx.json diff --git a/README.md b/README.md index e81d2ec6..bee9f04c 100644 --- a/README.md +++ b/README.md @@ -102,6 +102,7 @@ USAGE * [`hd tracker init`](#hd-tracker-init) * [`hd tracker run`](#hd-tracker-run) * [`hd update [CHANNEL]`](#hd-update-channel) +* [`hd vex`](#hd-vex) ### `hd auth login` @@ -177,10 +178,10 @@ USAGE FLAGS -c, --csv Output in CSV format -d, --directory= Directory to search - -e, --afterDate= [default: 2025-04-23] Start date (format: yyyy-MM-dd) + -e, --afterDate= [default: 2025-05-01] Start date (format: yyyy-MM-dd) -m, --months= [default: 12] The number of months of git history to review. Cannot be used along beforeDate and afterDate - -s, --beforeDate= [default: 2026-04-23] End date (format: yyyy-MM-dd) + -s, --beforeDate= [default: 2026-05-01] End date (format: yyyy-MM-dd) -s, --save Save the committers report as herodevs.committers. -x, --exclude=... Path Exclusions (eg -x="./src/bin" -x="./dist") --json Output to JSON format @@ -336,7 +337,7 @@ EXAMPLES Update to a specific version: - $ hd update --version 2.0.6 + $ hd update --version 1.0.0 Interactively select version: @@ -348,6 +349,63 @@ EXAMPLES ``` _See code: [@oclif/plugin-update](https://github.com/oclif/plugin-update/blob/4.7.32/src/commands/update.ts)_ + +### `hd vex` + +Download and filter the HeroDevs VEX statement + +``` +USAGE + $ hd vex [--json] [-f ] [-p ...] [-v ...] [--status + affected|not_affected|fixed|under_investigation...] [-s] [-o ] + +FLAGS + -f, --file= Path to a CycloneDX or SPDX 2.3 SBOM; filters VEX entries to packages present in the SBOM + -o, --output= Save VEX statement to a custom path (defaults to herodevs.vex.json when not provided) + -p, --package=... Glob pattern matched against product PURLs (repeatable, e.g. --package "pkg:npm/lodash*"). + Keeps statements where any product matches. + -s, --save Save VEX statement to herodevs.vex.json in the current directory + -v, --vuln=... Glob pattern matched against vulnerability IDs (repeatable, e.g. --vuln "CVE-2021-*") + --status=