/container-image:cve-scanfrom container-image
Scans container images for CVEs using Red Hat security data (Hydra API + Pyxis catalog) and open-source scanners (grype, trivy, govulncheck), merges results, and applies AI triage with prioritization, coverage gap analysis, and optional remediation or compliance evidence.
Ships in container-image. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Multi-source container-image CVE scanner with an AI triage layer. The bundled toolkit in
toolkit/ runs two complementary scanners and merges them; this skill drives
that toolkit and reasons over the merged report — the reasoning is the point, not the
mechanical scan.
Why two sources: no single scanner tells the whole truth about a Red Hat image. Red Hat's security data knows container-level and layered-product CVEs that NVD-driven scanners can't see, and applies backport-aware fix status and Red Hat severities. grype/trivy in turn report CVEs Red Hat has assessed as not-affected/won't-fix. Merging both is the only defensible picture.
/container-image:cve-scan [<image>] [--output=triage|remediation|evidence] [--severity=<list>]
<image> (optional) — target image ref (e.g. registry.redhat.io/edo/foo:1.2). If
omitted, infer it from the current session (see Phase 0).--output (default triage) — comma-separated list of AI artifacts to produce:
triage — prioritized findings + coverage-gap and disagreement analysis.remediation — concrete, grouped remediation steps tied to specific CVEs.evidence — auditable FedRAMP/ConMon narrative citing scanner versions + provenance.--severity (default: all) — comma-separated severities to focus on
(critical,important,moderate,low). Lower severities are still scanned, just not
foregrounded in the triage.Both scanners always run (Red Hat security data and the open-source scanners); there is no source toggle.
Operational details (engine selection, build/run commands, auth, caching, exit codes, troubleshooting, JSON shape) live in references/scanning.md — read it before running anything.
The scanner container takes one argument: a skopeo source (docker://…,
docker-archive:…, …) and copies it with skopeo — it cannot see the host engine. Deciding
which skopeo source to pass is the skill's job (Phase 0 → Phase 1).
<image> was given, use it.podman images / docker images);Dockerfile, Containerfile, or build command in the working dir;AskUserQuestion tool);Follow references/scanning.md:
docker or only podman is present, use it ($ENGINE); if both
are present or it is unclear, ask the user; if neither is installed, stop and
tell the user to install one first. Never install a container engine or any scanner on
the host.$ENGINE from the bundled toolkit as the build
context: ${CLAUDE_PLUGIN_ROOT}/skills/cve-scan/toolkit (see toolkit/).
Tag it by the toolkit's content so a plugin upgrade never silently reuses a stale
image: derive a short digest of the toolkit directory (e.g. find "$TOOLKIT" -type f | sort | xargs sha256sum | sha256sum | cut -c1-12) and build cve-scanner:<digest> only
when that tag is missing. (cve-scanner:latest is acceptable only if you rebuild
whenever the toolkit changes.)$ENGINE image exists <ref> (podman) / $ENGINE image inspect <ref>
(docker) succeeds, i.e. a build that lives only in the host engine (typically an
unqualified or localhost/… tag). Export it and pass it as an archive:
$ENGINE save --format docker-archive -o <tmp>/img.tar <ref> (docker: docker save -o <tmp>/img.tar <ref>), then source = docker-archive:/input/img.tar with the tar
mounted -v <tmp>/img.tar:/input/img.tar:ro,z (the ,z SELinux relabel is required).docker://<ref>. For authenticated registries, mount credentials (next step).$REGISTRY_AUTH_FILE → ${XDG_RUNTIME_DIR}/containers/auth.json (podman login) →
$HOME/.docker/config.json (docker login) →
${XDG_CONFIG_HOME:-$HOME/.config}/containers/auth.json.
Copy it into the per-run temp dir (a private mktemp -d, never relabel the user's live
file) and mount the copy
-v <tmp>/auth.json:/run/secrets/auth.json:ro,z -e REGISTRY_AUTH_FILE=/run/secrets/auth.json
(the ,z SELinux relabel is required, as with the local tar). Credential helpers: if
config.json uses credsStore/credHelpers (the secret is in a keychain, not the file),
copying it yields nothing — tell the user to podman login <registry> (writes an inline
auth.json) and use that. If none exists and the scan returns unauthorized, stop and tell
the user to log in first — never prompt for, echo, or store credentials. Public images need none.--format json -q, mounting a
/cache volume (plus the tar for a local source, and the auth copy for an authenticated
registry). The entrypoint pins a registry tag to its digest once so both scanners scan the
identical image. Both scanners run and merge automatically; for a local source the Pyxis
catalog cross-check is skipped (no catalog
record). Capture the merged JSON and the exit code.If the build or scan cannot run in this environment, stop and give the user the exact command to run, then offer to triage the JSON they produce.
Filter findings to --severity (default: all), then produce the requested --output:
triage (default): rank findings by real-world risk, combining Red Hat severity,
fix availability (fixed / won't-fix / under-investigation), PROVENANCE/COVERAGE, and Go
reachability (govulncheck). Explicitly call out:
script1-only) — only Red Hat's data reported them;
NVD scanners did not. This is which source saw it, not where it lives: Script 1 also
reports RPM and Go findings, so do not call these "container-level" from coverage alone.
True container-level CVEs are the Pyxis-sourced ones — identify them by PROVENANCE
(pyxis) / an image-level component, not by script1-only.script2-only) — reported only by the open-source
scanners, not in the Red Hat errata API. Their severity may come from NVD or a vendor
source (e.g. GHSA, or Red Hat via trivy's SeveritySource) — check the finding's
severity_source rather than assuming NVD; note when Red Hat has assessed them
not-affected/won't-fix.severity_source) for reference.remediation: concrete, grouped next steps tied to specific CVEs — rebuild on a
newer base, rebase the affected RPM/source package, backport, or waive-with-justification.evidence: an auditable narrative suitable for FedRAMP/ConMon, citing the pinned
scanner versions and scan provenance from the report header.--output may combine artifacts (e.g. --output=triage,remediation).
The requested AI artifact(s), plus a gate decision derived from the scan exit code:
0 clean, 1 Critical/Important present (gate would fail), 2 scan error (nothing usable
ran), 3 incomplete coverage — any of: Red Hat security data degraded, the image rootfs
only partially unpacked, or the OSS scan was requested but could not run or all its scanners
failed. Always state the image scanned, which sources ran, and the gate decision.
/container-image:cve-scan registry.access.redhat.com/ubi9/ubi-micro:latest
/container-image:cve-scan quay.io/myorg/myapp:tag --output=triage,remediation
/container-image:cve-scan --severity=critical,important # infer image from session
/container-image:cve-scan registry.redhat.io/edo/foo:1.3 --output=evidence
docker or podman available in the session (the skill will not install one).REGISTRY_AUTH_FILE for authenticated registries.references/scanning.md (opens in a new tab)toolkit/Dockerfile (opens in a new tab)toolkit/README.md (opens in a new tab)toolkit/cve_scan/__init__.py (opens in a new tab)toolkit/cve_scan/__main__.py (opens in a new tab)toolkit/cve_scan/acquire.py (opens in a new tab)toolkit/cve_scan/cli.py (opens in a new tab)toolkit/cve_scan/gomod.py (opens in a new tab)toolkit/cve_scan/goscan.py (opens in a new tab)toolkit/cve_scan/httpcache.py (opens in a new tab)toolkit/cve_scan/merge.py (opens in a new tab)toolkit/cve_scan/model.py (opens in a new tab)toolkit/cve_scan/oss.py (opens in a new tab)toolkit/cve_scan/proc.py (opens in a new tab)toolkit/cve_scan/redhat.py (opens in a new tab)toolkit/cve_scan/report.py (opens in a new tab)toolkit/cve_scan/rpmvercmp.py (opens in a new tab)toolkit/pyproject.toml (opens in a new tab)toolkit/tests/test_acquire.py (opens in a new tab)toolkit/tests/test_cli.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
cve-scanning, vulnerability-assessment, container-security, red-hat, grype, trivy
npx claudepluginhub openshift-eng/ai-helpers --plugin container-imageOther plugins' skills for the same job