Skip to content

Optional: pinned scanner image for the CVE scan runbook - #2144

Draft
NickJosevski wants to merge 1 commit into
mainfrom
nj/cve-scan-scanner-image
Draft

Optional: pinned scanner image for the CVE scan runbook#2144
NickJosevski wants to merge 1 commit into
mainfrom
nj/cve-scan-scanner-image

Conversation

@NickJosevski

Copy link
Copy Markdown
Contributor

Optional and additive. Nothing depends on this, and merging it changes no current
behaviour.
Raised separately from
#2143 so it can be adopted whenever
it is wanted, or not at all.

The problem it solves

scripts/scan-calamari-cves/scan.sh installs Trivy and Grype at runtime when they are not
on PATH. That is why the runbook works today with a stock worker-tools container and no
image to maintain.

Those installs are unpinned, which matters only once the scan runs unattended:

The runbook alerts when the reported CVE set changes. With unpinned scanners, a
scanner upgrade and a genuine new CVE produce the same signal — "something appeared" —
and telling those apart is the entire point of the alert.

Pinning makes scanner upgrades explicit, reviewable commits to a Dockerfile rather than
something that happens silently between two Wednesdays.

Adopting it

  1. Build and push (commands are in the Dockerfile header).
  2. Change container { feed, image } in the runbook's scan step — two lines in
    Modern-Deployments/.octopus/calamari-cve-scanning/runbooks/scan-cves.ocl.
  3. Nothing else. scan.sh auto-detects both binaries on PATH and skips its install step,
    so the same script still works locally with Docker and in the runbook without it.

Versions are pinned to trivy 0.74.0 / grype 0.117.0 — the versions observed in the first
green runbook run on 2026-08-18.

What is deliberately not in the image

The vulnerability databases. They change daily — this repo's README records CVE-2026-44788
going from absent to present in the audit source within one day. A database frozen into an
image would report a clean, quiet result for the same reason an end-of-life runtime does:
because nobody is looking, not because nothing is wrong.

Both tools fetch the current database at run time. On Octopus Cloud dynamic workers there is
no cross-run cache anyway, so this costs nothing extra.

Nothing depends on this. scan.sh installs Trivy and Grype at runtime when they are
absent, which is why the runbook works without an image today.

That install is unpinned, and for a scheduled scan that is a real weakness: the runbook
alerts when the reported CVE set changes, so a silent scanner upgrade and a genuine new
CVE produce the same signal. Pinning turns scanner upgrades into reviewable commits.

Adopting it is a two-line container{} change in the runbook. scan.sh needs no change - it
detects the binaries on PATH and skips its install step.

The vulnerability databases are deliberately not baked in. They change daily, and a stale
database would produce a quiet clean result for the same reason an EOL runtime does.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant