Skip to content

Vulnerability scanning & SBOMs ​

batlehub is scanned for CVEs continuously, across every layer it ships. This page describes the layers, how to reproduce them locally, and how to match a future-disclosed CVE against a build you have already deployed.

Layers ​

LayerToolWhere it runsGate
Rust advisoriescargo audit (RUSTSEC)back-dep-audit.yaml (PR + daily)block
Rust advisories + bans + licenses + sourcescargo deny (deny.toml)back-dep-audit.yamlblock
JS dependenciespnpm audit --audit-level highdep-audit-frontend.yaml (PR + daily)block on high/critical
Dependency supply chain (reputation + vulns)postmortempostmortem.yaml (PR + daily) — one job per dependency root: Rust, UI, WebsiteRust, UI: block on high/critical vulns, block-new on a pull request; Website: block at critical; any MAL-: block — see the scale
Lockfile CVEs, second opinionvuln-scan-action (vuln.mlab.sh)vuln-scan.yaml (PR) — all four roots: Cargo.lock, mise.lock, and ui/ + docs/ via a syft CycloneDX SBOMreport-only, comments on the PR — see below
Container / OS layersTrivyimage-scan.yaml (PR + daily, GitHub) runs Trivy directly on the proxy image (Containerfile), the worker image (Containerfile.worker, RFC 0018 — the one that carries bubblewrap, postmortem and the Trivy client) and the GuardDog variant of the worker image (Containerfile.worker-guarddog, which adds the optional Python scanner and is gated separately, so its toolchain answers for its own CVEs); .forgejo/workflows/build.yaml (the fallback build: proxy, hardened and worker images, amd64, to Harbor) polls Harbor's own scan-on-push report insteadblock on fixable HIGH/CRITICAL
Development toolchainTrivy (rootfs over the installed tools)mise-scan.yaml (PR touching mise.toml/mise.lock, weekly)budget on fixable HIGH/CRITICAL — see below
Static analysisCodeQL + Semgrepcodeql.yaml, semgrep.yamlCodeQL block-new (a repository ruleset) / Semgrep block on ERROR, WARNING reported
API surface (OAS + OWASP API Top 10 auth rules)Spectral (.spectral.yaml)openapi-lint.yaml (PR touching ui/openapi.json or the ruleset)block on error
Injection flows, secrets, weak crypto, settings, workflows, dependenciesinkdex (inkdex-action)inkdex.yaml (PR + push + daily)block-new ≥ high on a pull request, report on push and schedule
Secretsgitleakssecret-scan.yaml (PR + push)block
Lint / unsafe hygieneclippy -D warningstest.yaml lint jobblock

The Gate column is a summary. The scale below is the canonical grid: what each finding blocks, on which root, at which threshold, and why.

The daily schedules are what turn this from a build-time snapshot into future CVE detection: a CVE disclosed against a pinned dependency or a base-image layer after the last commit still trips CI the next morning, with nothing in the repo having changed.

The scale ​

RFC 0041 §4 places every CI scanner on one scale, so a new scanner is placed by the same two rules rather than decided one workflow at a time.

Severity is the worker's own Severity: unknown < low < medium < high < critical. A scanner's own vocabulary is mapped onto it once, here: Semgrep ERROR → high, WARNING → medium; CodeQL security-severity by its CVSS bucket. unknown ranks as high on a ships root when the source never rates (RUSTSEC). Fixable means a version without the finding exists.

Root class — what a dependency root ends up in:

ClassMeansRoots
shipsin a released binary, image or chartCargo.lock, ui/ production dependencies, the three images
buildsruns in CI or at build time, never shippedui/ dev dependencies, docs/, CI actions, npx tools
deva contributor's local toolchainmise.lock

Gate actions:

ActionA matching finding…
blockfails the job, on every event
block-newfails a pull request only when the pull request introduces it; on main it is report
reportreaches SARIF, the job summary or a PR comment, never fails
budgetfails when the count exceeds a recorded number (mise-cve-budget.json)
ScannerFindingRoot classActionThreshold
cargo auditvulnerability, unmaintained, yankedshipsblockany (unknown = high)
cargo denyadvisory, ban, licence, sourceshipsblockany
pnpm audit (ui/)vulnerabilityships + buildsblock≥ high
pnpm audit --prod (docs/)vulnerability in what the published site bundlesshipsblock≥ high, prod deps
postmortem vulns (Rust, UI)vulnerabilityshipsblock on push and schedule, block-new on pull requests≥ high
postmortem vulns (docs)vulnerability in the whole docs treebuildsblockcritical
MAL- check (Rust, UI, docs)known-malicious packageallblockany MAL- id
postmortem reputationan added or changed dependency's signalsshipsblock-new on pull requests (Rust; UI a week later), report on push and schedule; lifted by a maintainer's approval of the headtyposquat, newborn < 7 d, install script; on a version change new-publisher, new install script, release < 7 d
postmortem harden .CIRSEC CB-DEP controlreporeportfail controls
vuln-scanvulnerabilityallreport—
Trivy (three images)OS / library CVEshipsblockfixable ≥ high
Trivy (mise-scan)CVE in a tooldevbudgetfixable ≥ high, count ≤ budget
Semgreprule matchcodeblock / reportERROR block, WARNING report
CodeQLsecurity alertcodeblock-newsecurity-severity ≥ high, via a repository ruleset
inkdexinjection flow, secret, crypto, setting, workflow, dependencycode + shipsblock-new on pull requests, report on push and schedule≥ high; code scanning gets high and up
SpectralOAS / OWASP API ruleAPIblock≥ warn
gitleakssecretallblockany
clippylintcodeblockany warning
SonarCloudquality gatecodeblockSonar way on new code

Two rules explain every row, and a new scanner is placed by them:

  • What ships blocks on what is fixable and serious; what only builds is reported, and blocks only at critical. pnpm audit and postmortem cannot filter on fixability, so a builds root blocks at critical whether a fix exists or not.
  • A signal that cannot be made clean today gates on change, not on state. That is block-new, and it is the only way reputation and CodeQL can block without failing every pull request or never failing at all. block-new hides nothing: the finding stays in main's SARIF.

A secret or a known-malicious package blocks whatever the root. vuln-scan stays report until two consecutive weekly runs show no withdrawn advisory among its findings and a rated severity on every RUSTSEC finding; it is then promoted to block on ships roots.

CodeQL's block-new is not in any workflow. It is a repository ruleset on main ("code scanning merge protection", tool CodeQL, alerts ≥ high), set by the maintainer. Scoped to CodeQL and not to all tools, or the Semgrep WARNINGs in the Security tab would block too.

Required checks ​

A block gate blocks a merge only once its check is required on main (RFC 0041 decisions 28 and 41). Each gated workflow ends with one aggregate job, <file>.yaml / required, and that is the only check the ruleset names. The job names are unique because a ruleset matches a check by name, not by workflow:

test.yaml, back-dep-audit.yaml, dep-audit-frontend.yaml, postmortem.yaml, image-scan.yaml, semgrep.yaml, inkdex.yaml, openapi-lint.yaml, secret-scan.yaml, front-lint.yaml, front-test.yaml, front-design.yaml (the only CI type-check of ui/src, and the generated-docs drift), docs-cli-commands.yaml, repo-interop.yaml, mise-scan.yaml, scripts-test.yaml, helm-lint.yaml, each followed by / required. test_required_gate.py fails when one of them does not wait for every other job of its workflow.

  • No workflow-level paths:. A pull request it skipped would leave the required check "Expected — waiting for status" forever. The workflow always runs; a first gate job applies the same path list (.github/actions/required-gate, from git diff --no-renames --name-only base...head, so a file moved out of a watched tree counts under its old name) and the other jobs hang off it. A schedule, a manual run or a push whose before is gone is a full run.
  • The verdict is .github/scripts/required_gate.py verdict: red unless every job succeeded, or the gate skipped them all. A job skipped any other way is a failure, so a stub cannot mask a job.
  • Dependabot (test.yaml only, recognised by the author dependabot[bot], never by the branch name anyone can push): without the full-test label the Rust suite is skipped, and test.yaml / required is green — unless Cargo.lock or fuzz/Cargo.lock changed, when it fails with "Cargo.lock changed but the Rust suite was skipped — add the full-test label". The path filter runs first, so a bump that touches nothing test.yaml covers stays green whatever its branch.
  • A fork's pull request: its own postmortem.yaml run has no VULN_MLAB_TOKEN and is red by construction; postmortem-fork.yaml, run by a maintainer on the reviewed head, posts the verdict as a commit status named postmortem.yaml / required. That this status satisfies the ruleset beside the failed check of the same name is not yet observed on a real fork PR.
  • inkdex needs the INKDEX_TOKEN secret. Without it — and so on a fork's pull request, which gets no secrets — the action exits 2 and inkdex.yaml / required is red: a scan that could not run is not a clean one. A maintainer re-runs a fork's change from a branch of this repository.
  • Not aggregated: CodeQL (the ruleset above), vuln-scan (report), SonarCloud (an external app), and the label- or schedule-driven workflows.

The ruleset itself is a repository setting the maintainer adds: these checks, CodeQL merge protection, and one approval of the most recent push with the maintainer in the bypass list (decision 47).

Dependabot waits seven days (cooldown) before it proposes a version bump. Security updates don't wait. One pin is invisible to it: the rustfs/rustfs test image. The github-actions ecosystem only reads uses:, and the docker ecosystem doesn't read workflow files. So the services: image in breaking-point.yaml, sonar.yaml and test.yaml (×2) and the podman run in .tasks/test.yaml and .tasks/coverage.yaml are bumped by hand, all six together (grep -rn rustfs/rustfs .github .tasks).

postmortem (dependency supply chain) ​

cargo audit and pnpm audit only know about published advisories. postmortem covers the other shape of supply-chain risk: it rebuilds the dependency forest from the committed lockfiles (no install, no lifecycle scripts), resolves each dependency to its source repository, and scores it on reputation and provenance signals — stars, age, last activity, archived/abandoned, unresolvable or typosquatted names — on top of a vulnerability cross-check against vuln.mlab.sh (OSV/GHSA/CVE).

Its detect() only looks at the lockfiles sitting directly in the scanned directory, so postmortem.yaml runs one job per dependency root — . (Cargo.lock), ui/, docs/ — each uploading its own SARIF. They are three separate jobs, not a matrix: postmortem stamps every SARIF result with artifactLocation.uri = ".", so the uploads are told apart only by the Code Scanning category upload-sarif derives from the job id. Read the alert message (<pkg>@<version> [<repo>] — <signal>) for the target.

The verdict is postmortem_new_risk.py's, never postmortem's exit code (RFC 0041 §6.5). Each job runs the mise-pinned postmortem twice over its root — tree --vulns --json, then tree --vulns --sarif (which reuses the local vulnerability cache; --online too on main and the nightly, never on a pull request: the whole tree's reputation is one GitHub API call per package, and ~600 per root emptied GITHUB_TOKEN's hourly budget for every other job) — and, on a pull request, an offline diff against the base. The script then fails the job on any of:

  • a lookup that did not complete. postmortem 2.9.2 exits 0 and writes an empty SARIF when vuln.mlab.sh does not answer, --fail-on-vuln included; only the JSON's vuln_scan_failed diagnostic says so. A SARIF holding a different number of advisories than the JSON fails too;
  • a root with more packages than the vuln.mlab.sh tier reads: 512 anonymously, 1 024 with VULN_MLAB_TOKEN. The service cuts a larger scan and says nothing about the rest; the Rust root (671) and ui/ (675) are both over 512;
  • any MAL- advisory in the tree, on every event, existing packages included. postmortem ranks a MAL- record medium, so fail-on-vuln: high alone passes it. The match is on the advisory id, never the message, so a package named MAL-… blocks nothing;
  • on push and schedule, any advisory ≥ high (Rust, UI) or critical (docs); unknown counts as high;
  • on a pull request (Rust, UI): an advisory ≥ high against a package the change adds or changes (block-new). An advisory published today against a package already on main does not fail an unrelated pull request: main's own run reports it. A root the base does not have, or more than 50 added packages, fails and needs a maintainer;
  • on a pull request (Rust; UI a week later): the reputation of what the change adds or changes, from postmortem diff --online and postmortem scripts on both sides (block-new). An added package blocks on typosquat, on newborn-package under 7 days, or on an install script; a version change blocks on new-publisher, on an install script the old version did not have, or on a target version published under 7 days ago (fresh-release). Every other signal is printed and blocks nothing. A Cargo build.rs or proc-macro is not an install script. A stats-failed signal — GitHub did not answer — fails the job: postmortem itself exits 0 on it.

A maintainer's approving review of the head lifts a reputation block. The job reads the pull request's reviews and accepts an APPROVED one whose commit is the pull request's current head, from an account with the admin or maintain role that is not the author; the review re-runs the job (pull_request_review), which then reports the block instead of failing on it. A push voids it. The same review lifts "new or moved dependency root". It never lifts a MAL- package, an advisory, or a lookup that did not complete. An API error, or a call over 30 s, is red.

ui/ and docs/ resolve with pnpm 9, whose lockfile no longer records which packages build, so postmortem scripts sees no install script there without node_modules. What stops one is pnpm's own allowBuilds: in pnpm-workspace.yaml, which pr-checklist.yaml lists as a gate input.

Every package name or version the script prints is escaped, so a lockfile cannot issue a workflow command.

A pull request cannot pick the binary or the script that judge it. The base commit is checked out into base/ and the pull request into head/. postmortem is installed from base/mise.toml and base/mise.lock (checksum verified, MISE_TRUSTED_CONFIG_PATHS limited to base/) and called by absolute path. base/.github/scripts/postmortem_new_risk.py judges. A change to the script therefore takes effect one pull request later, and the job summary says so. A pull request can still rewrite the workflow or .github/actions/postmortem-gate; review is the gate for that, and pr-checklist.yaml lists such changes from pull_request_target, where the pull request cannot edit the check.

The Rust job also adds postmortem harden . (CIRSEC CB-DEP controls) to its job summary, as report. On push and schedule the reputation scores reach SARIF and block nothing.

One caveat when reading its vulnerability list: vuln.mlab.sh also serves advisories that RustSec has since withdrawn — RUSTSEC-2020-0053 (dirs unmaintained, withdrawn 2021) and RUSTSEC-2025-0007 (ring unmaintained, withdrawn 2025) both still show up against this tree, and neither is actionable. Check withdrawn on the OSV record (https://api.osv.dev/v1/vulns/<id>) before chasing one. Don't allowlist them — the suppression stance below applies.

When a job fails on a push to main or the daily run, the issue job opens an issue labelled postmortem-rust, postmortem-ui or postmortem-docs. Later failures comment on it, and the next green run closes it. Pull requests never open one; the failed check is the report there.

VULN_MLAB_TOKEN is required, as a repository secret and as a Dependabot secret: runs triggered by Dependabot do not receive repository secrets. Without it the Rust and UI jobs fail on the 512-package cut, by design. The service allows one scan per 10 s per IP anonymously and one per 5 s with a token, and postmortem waits out that cooldown itself. vuln-scan.yaml reads the same secret.

A fork's pull request never receives the secret, so its Rust and UI jobs are red. A maintainer who has reviewed its head runs postmortem-fork.yaml (Actions → Run workflow) with the pull request number and the head SHA they reviewed. It refuses a head that has moved since. It checks out only the head's lockfiles and manifests, runs the same gate with the token, and posts postmortem-fork / Rust, / UI and / Website as commit statuses on that SHA.

Repository reputation is read from the GitHub API: CI passes github.token; locally, export GITHUB_TOKEN or every dependency comes back stats-failed. Locally, export VULN_MLAB_TOKEN in your shell or put vuln_token in ~/.postmortem/config.yml.

vuln-scan-action (lockfile CVEs, advisory) ​

vuln-scan.yaml scans all four dependency roots against vuln.mlab.sh on every pull request and posts the result as a single comment, edited in place on each push. It never fails the build.

Cargo.lock and mise.lock are sent as-is. ui/ and docs/ go through a CycloneDX SBOM: the scanner has no pnpm parser and pnpm-lock.yaml is the only frontend lockfile this repository keeps, so each root is catalogued with syft — the same tool build.yaml already uses for the image SBOM — and reduced by .github/scripts/slim_sbom.py. That script exists for two reasons, both found by running the thing rather than reading its README:

  • Size. A faithful syft SBOM of ui/ is 896 KB and the endpoint refuses it with HTTP 413. Keeping only type/name/version/purl — all a scanner reads — brings it to 73 KB.
  • The 512-package cap. The endpoint reads at most 512 components per request, warns once, and then reports the remainder as though it were the whole tree, so a truncated scan comes back looking clean. ui/ holds 691 packages. The script splits the document into pieces of at most 512, so ui/ costs two requests and docs/ one, and nothing is silently dropped.

Cargo.lock (675 crates) is still read only to that 512 limit, deliberately: it is the one root with a complete gate of its own in cargo audit, so this is a second opinion on it rather than its coverage, and converting it to CycloneDX to chunk it would mean building crate metadata on every pull request to buy nothing.

Why it is advisory and not a gate. A run on 2026-09-14 returned two Rust findings, dirs@7.0.0 (RUSTSEC-2020-0053) and ring@0.17.14 (RUSTSEC-2025-0007). Both are informational = "unmaintained" — not vulnerabilities — and both were withdrawn upstream, in 2021 and 2025. cargo audit reads the same RUSTSEC database and reports this lockfile clean, so a blocking gate would have failed every pull request on two retracted advisories.

Severity is the other half. RUSTSEC-sourced findings all come back severity: unknown, which ranks below low: fail-on: high can never trip and fail-on: any trips on exactly those two withdrawn advisories. npm findings do carry a real severity — the one standing frontend finding is @ai-sdk/provider-utils@4.0.5, CVE-2026-8769, low, which pnpm audit --audit-level high does not report. So the data is not uniformly poor, just not yet uniform enough to gate on, and fail-on is none. Re-check those two numbers before promoting it.

Quota — this is the expensive workflow. It spends 5 scans per run (Cargo.lock, mise.lock, two ui/ pieces, one docs/ piece) and postmortem spends 3 more against the same budget. Anonymous vuln.mlab.sh allows 8 per hour, so one pull-request push very nearly exhausts it. Set VULN_MLAB_TOKEN (25/hour) — the same secret already backs postmortem.yaml. A 429 is thrown rather than reported, so it fails the step whatever soft-fail says; the comment then says that half of the scan did not complete rather than showing an empty report as "clean".

Harbor scan-on-push (Forgejo build) ​

registry.batleforc.fr (Harbor) is configured to automatically scan every artifact pushed to the batleforc/batlehub* repositories and to generate its own SBOM accessory, so .forgejo/workflows/build.yaml doesn't run a second Trivy/Syft pass after pushing. Instead it polls Harbor's API for the vulnerability report of the digest it just pushed, for up to ~5 minutes, and fails the job if Harbor reports a fixable HIGH/CRITICAL CVE — the same gate as before, just sourced from Harbor instead of a local trivy image run. If Harbor hasn't finished scanning within those 5 minutes, or the scan errored, the job fails rather than shipping an image without a verdict. This build is the fallback for when the GitHub pipeline is unavailable; the daily image-scan.yaml run on GitHub remains the primary gate for that layer.

Run the gate locally ​

bash
task security        # audit + docs pnpm audit + postmortem + VEX + Rust SBOM + OpenAPI lint
task audit           # cargo audit + cargo deny + ui pnpm audit + Trivy on IMAGE=… (skipped when unset)
task audit:rust      # just cargo audit
task audit:image IMAGE=batlehub:scan  # just Trivy, same flags as image-scan.yaml
task deny            # just the cargo-deny supply-chain gate
task ui:audit        # just the frontend audit
task postmortem      # dependency supply chain, all three roots (Rust, UI, Website)
task postmortem:rust # just one root — also postmortem:ui / postmortem:docs
task postmortem:new-risk ROOT=ui  # what this branch adds to a root, judged as its pull request would be
task test:scripts    # the gate scripts' own tests (.github/scripts/tests)

postmortem is provisioned by mise install, pinned in mise.lock to the version CI installs. The tasks run postmortem_new_risk.py like CI does, so a scan cut at 512 packages fails locally too: export VULN_MLAB_TOKEN.

Image scanning, secret scanning and SAST need their own tools (all provisioned by mise install):

bash
# Build and scan the container image exactly as CI does
podman build -f Containerfile -t batlehub:scan .
trivy image --severity HIGH,CRITICAL --ignore-unfixed batlehub:scan

gitleaks detect --config gitleaks.toml          # secret scan
semgrep scan --config p/rust --config p/typescript
task openapi:lint                               # Spectral over ui/openapi.json

SBOMs — matching a future CVE against a shipped build ​

Every release publishes four CycloneDX SBOMs, one per artefact it ships:

  • sbom-rust.cdx.json — the shipped server's Rust dependency closure (crate-level), attached to the GitHub release and attested against the binary's own digest, so the SBOM that describes a given batlehub cannot be swapped for another.
  • sbom-image.cdx.json — the proxy container image (OS packages + binaries).
  • sbom-image-worker.cdx.json — the worker image (RFC 0018).
  • sbom-image-worker-guarddog.cdx.json — the GuardDog variant of the worker image.

All three image SBOMs are attached to the release and pushed to the registry as attestations (actions/attest-sbom, push-to-registry: true), which is what bound to the image means here: the attestation is an OCI referrer of the image digest, so it travels with the image through any registry that understands referrers — no release page, no GitHub API, and nothing to keep in step by hand.

The worker images matter most here and used to have no SBOM at all. They are the ones carrying a second toolchain — bubblewrap, the Trivy client, postmortem, and GuardDog's whole Python tree — so they are precisely the images whose contents a consumer cannot derive from this repository's lockfiles.

When a new CVE is disclosed months later, you don't need to rebuild to know whether a deployed version is affected — scan its SBOM:

bash
# Match the latest advisory DB against an already-shipped SBOM
trivy sbom sbom-image.cdx.json
trivy sbom sbom-rust.cdx.json

# Or with grype
grype sbom:sbom-image.cdx.json

Verify the image SBOM/provenance attestation before trusting it:

bash
gh attestation verify oci://ghcr.io/<owner>/batlehub:<version> --owner <owner>

Signatures — who published this ​

Everything a release publishes is signed, keylessly: the signing identity is the release workflow's OIDC token, recorded in Sigstore's transparency log, so there is no private key in a secret to leak and no public key for a consumer to fetch. Verification checks an identity — this workflow, on this repository — rather than a fingerprint someone has to be told to trust.

ArtefactMechanismVerify with
The three container imagescosign sign by digestcosign verify --certificate-identity-regexp … --certificate-oidc-issuer https://token.actions.githubusercontent.com <image>
The Helm chart (OCI)cosign sign by digestthe same command — an OCI chart is an image as far as cosign is concerned
Server binary, every CLI archiveactions/attest-build-provenancegh attestation verify <file> --repo <owner>/<repo>
Every asset on the release pagechecksums.txt + a detached Sigstore bundlecosign verify-blob --bundle checksums.txt.sigstore.json … checksums.txt then sha256sum -c checksums.txt

The last row is the one that works offline-ish: a mirror, a distro packager or an air-gapped importer has the files and not the GitHub API, and checksums.txt plus its bundle is enough to establish that this workflow produced exactly these bytes.

Signing is by digest and never by tag, everywhere. A tag is a mutable pointer, so a signature over :1.2.3 would attest to whatever that name resolves to at verification time — which is the property an attacker with push access needs.

What is not signed, and why. The Forgejo fallback build (.forgejo/workflows/build.yaml, which pushes the proxy, hardened and worker images to Harbor nightly, on a v* tag and on dispatch) is unsigned — including the :vX.Y.Z it pushes for a tag. Keyless signing needs an OIDC issuer Sigstore's public-good instance already trusts, and a self-hosted Forgejo is not one; signing there would mean a long-lived key in a secret, which is the thing keyless exists to avoid. Those images are a fallback gated on Harbor's own scan-on-push, not releases — the signed artefacts are the ones a release publishes, and that is the set the table above covers.

VEX — what the standing findings mean ​

A consumer who scans a published image sees the same findings the release gate accepted, and has no way to know they were ever assessed: .trivyignore.yaml is read by Trivy and by nothing else, and it never leaves this repository.

vex/batlehub.openvex.json is the other half. It states the same decisions in OpenVEX — a format every mainstream scanner reads — with, for each vulnerability, a machine-readable justification and the prose (impact_statement) that says why the vulnerable code is unreachable in these images.

Today the gate suppresses nothing: .trivyignore.yaml is empty, and the document's four statements are all fixed — the advisories against the worker's Trivy binary, closed by Trivy v0.76.0 (see below). They stay so that a consumer scanning an image published before that bump, which version 1 of the document stated not_affected, can see where the finding went.

The release binds it to what it published (.github/scripts/vex.py render): each product is rewritten from a repository name to the digest this release actually pushed, the document is attached to the release page, and cosign attest --type openvex publishes it as a referrer of each image. A consumer can then either apply it from the release page or read it off the image:

bash
# Scan with our assessment applied
trivy image --vex batlehub.openvex.json ghcr.io/<owner>/batlehub-worker:<version>

# Or read the attestation that travels with the image
cosign download attestation --predicate-type https://openvex.dev/ns \
  ghcr.io/<owner>/batlehub-worker@sha256:… | jq -r .payload | base64 -d | jq .predicate

The two files cannot drift. task vex (part of task security, and its own job in image-scan.yaml) fails when .trivyignore.yaml suppresses a CVE the VEX document does not state, and when the VEX document states a not_affected that the gate is not suppressing — the first means a consumer is told a finding is unassessed when it was, the second means a statement has outlived the reason it was made. It also enforces that every not_affected carries one of OpenVEX's five justifications and prose: the justification is for the scanner, the prose is for the person who has to believe it.

The expiry stays in .trivyignore.yaml and is deliberately not duplicated here — that file is the gate, and a date with two homes has one that is wrong.

Publishing an advisory for BatleHub itself ​

VEX above states what the project decided about other people's CVEs. A vulnerability in BatleHub's own code follows SECURITY.md: it arrives through GitHub's private vulnerability reporting, never an issue, and it is fixed and published in one release that carries three things together, so a scanner, a reader and an auditor see one answer:

  1. The GitHub Security Advisory, drafted in the private report, with its CVE requested from GitHub (a CNA) before the release and the affected and patched version ranges filled in. The fix is developed in the advisory's temporary private fork, not on a public branch.
  2. An entry under ### Security in the release's CHANGELOG.md section, naming the GHSA and CVE identifiers and the upgrade.
  3. A statement in vex/batlehub.openvex.json for the CVE: fixed for the release that carries the fix and affected — with an action_statement saying upgrade to — for the supported release before it. task vex accepts both statuses and ties neither to .trivyignore.yaml.

Publish the advisory once the release's images and binaries are up, not before: the advisory is what tells an attacker where to look, and the fixed build has to exist when it does. The disclosure clock — at the fix, or 90 days after the report — and the response targets are the policy's, not this page's.

The development toolchain ​

mise.toml installs some forty tools, and until recently nothing looked at them. The one thing that appeared to — mise.lock in vuln-scan.yaml — reads four of them: that endpoint's lockfile parser understands the cargo: and PyPI backends and nothing else, so every tool that arrives as a GitHub release asset (trivy, syft, helm, k6, gitleaks, node, go, task, rc, …) came back with no findings, which is indistinguishable from a clean scan.

mise-scan.yaml runs trivy rootfs over the installed toolchain instead. That reads what a lockfile scan cannot: the Go module list is embedded in every Go binary, and the Node and Python trees are on disk as themselves. Measured on 2026-09-15 against a toolchain the lockfile scan reported clean: 249 findings, 136 of them fixable HIGH or CRITICAL.

bash
task mise:cve            # the same scan and report, locally
task mise:cve:budget     # record the current number as the budget CI checks against

The scan root is the machine's, the count is this repository's. Trivy takes one directory and mise installs every tool into the same one, so a workstation's tree holds its owner's global tools and every other project's as well — the first measurement here was 461, of which 255 belonged to ~/.config/mise/config.toml (helm-ls, k9s), to a sibling checkout (etcd, kube-apiserver) and to this repo's own examples/terraform. A CI runner installs mise.toml and nothing else, so the two numbers described different machines. --only-tools now narrows the count to the install directories this repository asks for (.github/scripts/mise_repo_tools.sh derives them, with the global config excluded), and the report prints what it left out rather than quietly shrinking. The workflow passes the same flag, where it is a no-op, so the local command and the gate are one command.

Two things are worth knowing before reading the table as a to-do list. Over half of the count is Go stdlib — the Go release each binary was compiled with, which no pin in mise.toml changes; it moves when the upstream project rebuilds. And a latest tool that carries findings has no fix to apply: on 2026-09-15 every one of helm-docs, gitleaks, lazydocker, syft, k6, task, trivy and node was already the newest release upstream had published. What the number is good for is noticing a tool that stopped being maintained, or a new one that arrived carrying a pile — not a weekly bump ritual.

When a tool has stopped releasing, there are two levers left, and both have been pulled. Build it from a pinned commit through mise's go: backend, which compiles it with this repository's Go and the dependencies its source has moved to since. helm-docs is built this way, the same commit in mise.toml and in helm-lint.yaml, because its last release carried 42 findings. Or drop a tool nothing in the repository runs: lazydocker went for that reason, and anyone who wants it keeps it in ~/.config/mise.

It is a budget, not a zero, and that is a deliberate choice rather than leniency: none of this ships, a CVE in k9s reaches nothing this project publishes, and a gate that fails a pull request every time somebody else's tool has a bad week is a gate that gets switched off within the month. .github/mise-cve-budget.json records what the toolchain currently carries; the job goes red when the number grows — a tool that has gone stale, or a new tool that arrived carrying a pile of findings. Raising it is a commit, in the open, with a reason.

Until a budget has been recorded the job reports and cannot fail, and the report says so in those words rather than showing a green tick for a check that has nothing to check against.

Scanning proxied artifacts at runtime ​

The layers above scan batlehub itself. Separately, batlehub can continuously re-check the packages it proxies/hosts against newly disclosed CVEs, using the per-artifact SBOMs it already stores (see SBOM support).

Enable the background task globally:

toml
[vulnerability_scan]
enabled       = true
interval_secs = 86400                  # re-scan cadence (default: daily)
osv_api_url   = "https://api.osv.dev"  # optional; defaults to the public OSV API
batch_size    = 100

Each run pages through every stored CycloneDX SBOM, queries the OSV database for the components' PURLs, and records findings. Findings appear per-version in the Package Explorer and the admin package detail view. Like the daily CI schedules, this turns a one-time cache into future CVE detection: a vulnerability disclosed against a cached package after it was proxied surfaces on the next scan.

To act on findings, add a cve_gate rule to a registry. Warn-only (the default) surfaces the finding without blocking; block = true denies downloads of affected versions at or above min_severity:

toml
[[registries.rules]]
kind         = "cve_gate"
min_severity = "high"        # unknown | low | medium | high | critical
block        = true
bypass_roles = ["admin"]

See Adding a vulnerability scanner source for the API requirements and checklist when integrating another CVE database alongside OSV.

Suppressions ​

The stance is no suppressions: .cargo/audit.toml and deny.toml (advisories.ignore = []) both keep the ignore list empty. If an advisory is genuinely non-actionable, prefer upgrading or patching the dependency; only add an ignore with an inline justification and a tracking issue.

The hard case is a transitive advisory with no version to upgrade to, and there is a worked example in the tree. RUSTSEC-2026-0258 (h2, unbounded empty DATA frames) is fixed in h2 0.4.16 — already present for the hyper/reqwest path — but actix-http still requires the 0.3 line and no 0.3 backport exists, so no cargo update could resolve it. It was closed by removing the feature that wanted the crate: actix-web is declared default-features = false without http2, which drops h2 0.3 from the tree entirely. Two things make that safe to rely on rather than rediscover — the reasoning lives next to the declaration in Cargo.toml, and h2 <0.4 is in deny.toml's [bans].deny, so re-enabling the feature fails CI instead of silently restoring the advisory. Check whether a feature can be dropped before concluding an advisory is unfixable.

An advisory inside a third party's binary ​

Every entry here has a matching statement in vex/batlehub.openvex.json — see VEX above — and task vex fails when one of them does not. The ignore file is what quiets the gate; the VEX document is what tells a consumer why.

.trivyignore.yaml is the third case: a CVE in a dependency of a prebuilt binary the image copies in, where the fix is neither an upgrade of ours nor a feature we can drop. The worked example was the four advisories against /usr/local/bin/trivy: grpc-go CVE-2026-84304 and CVE-2026-84445 (Trivy vendored google.golang.org/grpc v1.82.1) and Go standard-library CVE-2026-78667 and CVE-2026-97031 (built with Go 1.26.6). Each was fixed upstream before any Trivy release carried the fix, so TRIVY_VERSION in Containerfile.worker had nowhere to move.

The entries were pinned to that one path, each said why the vulnerable code was unreachable here — the worker runs trivy … --server <endpoint>, the client half, and nothing in the image listens — and each carried an expired_at, so the gate would reopen on its own instead of the entry outliving its reason. Trivy v0.76.0 (Go 1.27.2, grpc v1.84.0) closed all four: the bump retired the entries, leaving the file empty, and turned their VEX statements to fixed. Before adding an entry for that binary again, check the go.mod and toolchain of the next Trivy tag first — the commands are in the file's header — because a release that carries the fix retires an entry rather than renewing it.

Scanner rule ignores are a different thing ​

The stance above is about dependency advisories — a CVE in something we pull in, where the fix is an upgrade. It does not govern a static-analysis rule that is simply wrong about this codebase. Those are handled in sonar-project.properties as sonar.issue.ignore.multicriteria entries, each pinned to one file and carrying its reasoning inline, so the justification is version-controlled rather than clicked away in a dashboard.

The largest group is the MD5/SHA-1 uses (rust:S4790), which are wire-format requirements of the package protocols BatleHub speaks. That group started at thirteen and is now nine: rechecking each against its specification found four that no protocol required, and those were deleted rather than ignored. MD5 and SHA-1 is the register, with the specification for each — and it is the model for an entry here: check the spec, do not repeat the last comment.

Test key fixtures ​

The secret scanners are right about what a committed private key is and wrong about whether it matters, and the tree has three of them: the RSA keys crates/adapters/src/repo/testdata/ holds for the apk index-signing tests. They cannot be minted at run time — include_str! needs a file, and aws-lc-rs generates nothing below 2048 bits, so the "key below the floor" test needs a committed 1024-bit one either way.

Each scanner has exactly one place that quiets it, and the other places fail closed and quiet:

  • Semgrep (generic.secrets.security.detected-private-key) — a path pattern in .semgrepignore. A // nosemgrep comment with the short rule id is silently ignored for the generic secrets rules, and a .pem has nowhere to put one.
  • gitleaks (private-key, curl-auth-header) — gitleaks.toml. The scan walks full history (fetch-depth: 0), so an inline gitleaks:allow fixes the working tree and leaves the commit that introduced the line flagged forever, and a path entry has to name every path the file has ever had — which is why the two pre-RFC-0005 website/ paths are still listed. Prefer a regexes entry: it names the value that is not a secret, so it survives a rename, covers the next file to carry the same literal, and still flags a real credential in the file it exempts.

Keep both tight — one pattern per fixture family, never a directory a real credential could later land in — and re-run the scanner after adding an entry (mise pins both), because a suppression that parses but does not apply looks exactly like one that works.

Duplicate versions ​

[bans].multiple-versions is deny, with every known duplicate enumerated in skip. The list is not a suppression in the sense above — nothing is being silenced, each entry names the third-party crate that holds the older line — but it is maintenance, and it works one way: a duplicate the list does not already account for fails the build.

That was measured before it was switched on. Twenty crates resolve to more than one version out of 440 on a Linux host and not one is reachable from this repository: rpm 0.27.1 is the latest release and still wants enum-display-derive (syn 1) and the digest 0.10 family; argon2 0.6 exists only as a release candidate and this is password hashing; the rest belong to actix, sqlx, jsonwebtoken, ring and the AWS SDK. cargo update moves five unrelated packages and resolves none of them. cargo-deny sees sixteen more than cargo tree does, because it reads the graph for every target — which is correct here, since the CLI is released for x86_64-pc-windows-msvc and restricting [graph].targets to Linux would also stop advisories being reported for that artefact.

Security outranks tidiness, and the file enforces the order rather than asking you to remember it. A red bans check is pressure, and pressure is where the wrong fix gets made — so:

  1. If upgrading a crate to close a RUSTSEC advisory creates a duplicate, the upgrade stands and the skip is added in the same commit. An advisory is never resolved by keeping an old line because the tree looks tidier, and a duplicate is never resolved by downgrading.
  2. skip has no power over [bans].deny. cargo-deny refuses to load the file at all when a crate appears in both — "a crate was specified in both skip and deny" — so the vulnerable lines named there (rsa, rustls 0.21, h2 <0.4, …) cannot be silenced by adding them to the skip list, by accident or under deadline. That is a property of the tool, not a convention.
  3. Only then: name who holds the old line, and check whether it can be upgraded away before adding a skip for it.

Released under the Apache 2.0 License. Made with care and too much coffee.