rhecosystemappeng/agentic-collections/container-cve-validator
Claude Code and agent skill by rhecosystemappeng/agentic-collections
- community
- ext:[{"type":"plugin","description":"Custom plugin integration"}]
Checking that the SKILL.md file is still in the repository.
Validate a CVE against a Red Hat container image using official SBOM attestations, Red Hat VEX data, and CVE metadata from MITRE/OSV.dev.
Install
npx vskill@latest install rhecosystemappeng/agentic-collections/container-cve-validatorSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as rhecosystemappeng/agentic-collections/container-cve-validator.
Red Hat Container Security Validator
When to Use This Skill
Use this skill when the user asks you to check, validate, or analyze one or more CVEs against Red Hat container images. Input may be a single CVE ID + image reference, or a CSV file path containing multiple pairs.
Optional Output Flags
The user may specify these optional flags. Parse them before extracting the required inputs.
--format markdown— (default) Markdown report; verbosity controlled by--output--format json— machine-readable JSON with 6 structured fields--format csv— single-row CSV with a header row (one row per scan in batch mode)--output full— (default) complete Markdown report with all sections; only applies to--format markdown--output summary— condensed Markdown: executive summary + recommended actions only; only applies to--format markdown--file PATH— path to a CSV input file for batch scanning (mutually exclusive with positional CVE ID and image reference)
Record the resolved values as OUTPUT_FORMAT (default: markdown), OUTPUT_MODE (default: full), and INPUT_FILE (default: empty). Strip all flag tokens before extracting remaining positional arguments.
Input Validation
Use the validate_input.py script for all input validation — both single scan and batch mode.
Single scan:
Batch mode (when `--file` was provided):
The script returns JSON with valid (boolean), mode ("single" or "batch"), entries (array of validated CVE/image pairs with registry classification), and errors (array of error messages with line numbers for batch mode).
- If
validisfalse: print the errors and stop. Do not proceed to any execution step. - If
validistrue: use theentriesarray to drive the pipeline. Each entry containsimage_ref,ref_format("tag" or "digest"),registryinfo, andinput_type. - If
input_typeis"rhsa": the user provided an RHSA advisory ID. Resolve it to individual CVEs using (do NOT use WebFetch or curl to access access.redhat.com):
``bash python $SCRIPTS_DIR/fetch_rhsa_advisory.py [RHSA-ID] ` Run the full validation pipeline for each CVE in the returned cve_ids[]` list against the same image.
- If
input_typeis"cve": proceed directly with the single CVE ID. - For batch mode, run the full validation pipeline for each entry. Print a progress indicator:
[1/N] Scanning CVE-YYYY-NNNNN — registry.../image:tag
Batch output aggregation:
- `--format markdown`: print each report separated by a
====divider line - `--format json`: output a single JSON array
[{...}, {...}]— one object per scan - `--format csv`: one header row followed by one data row per scan (no repeated headers)
Image Inspection
Use the inspect_image.py script to fetch image metadata:
The script returns JSON with labels (cpe, name, com.redhat.component, vendor, maintainer, org.opencontainers.image.created), digest, architecture, and errors.
If the script fails with an authentication error, log in first:
Then re-run. If login fails, stop and inform the user.
From the output, record:
labels.cpe→product_cpe— primary anchor for VEX product_tree matchinglabels.name→ public component name for VEX matchinglabels["com.redhat.component"]→ internal build name (secondary fallback only)labels.vendorandlabels.maintainer— for registry ownership validationlabels["org.opencontainers.image.created"]→ image build timestamp
Registry ownership check: The validate_input.py output already classifies the registry (is_redhat, type). For non-Red Hat registries:
- If
vendorormaintainerfrom inspect output is"Red Hat, Inc.": the image is a Red Hat image mirrored to an alternate registry. Record the canonicalregistry.redhat.ioform for VEX matching. - Otherwise: stop and report that this skill only validates Red Hat-maintained images.
Input format classification: The validate_input.py output provides ref_format ("tag" or "digest"). For digest-based references, the human-readable tag will be extracted from the SBOM in Step 2.
Do NOT use version or release labels to reconstruct the image tag.
Prerequisites
Step 0 — Resolve scripts directory. Before anything else, locate the helper scripts. They are inside the skill's scripts/ subfolder. Run:
Use $SCRIPTS_DIR in all subsequent script calls. The scripts handle tool checks internally (regctl, cosign, syft) and return clear errors if tools are missing.
Workflow
MANDATORY EXECUTION CONTRACT — read before starting:
This skill requires completing ALL of the following steps in order. No step may be skipped, condensed, or replaced with an alternative approach — regardless of which model is executing.
| # | Step | Required | May skip only when | |
|---|---|---|---|---|
| 0 | Prerequisites check | Always | Never | |
| 0 | Input validation + image inspection | Always | Never | |
| 1 | CVE Reconnaissance (MITRE → OSV.dev → Go vuln DB) | Always | Never | |
| 2 | SBOM Extraction + package verification | Always | Never | |
| 3 | Red Hat VEX Validation | Always | Package NOT found in SBOM (Step 2) | |
| 4 | Newer Image Availability Scan | Conditional | Trigger conditions not met (see Step 4 header) | |
| 5 | Final Report | Always | Never |
Strict rules:
- Execute each step using the helper scripts below. After each step, print:
✓ Step N complete — [key finding] - FORBIDDEN COMMANDS — never use these, even inside loops or pipelines:
grep— do not grep through JSON data filesjq— do not use jq filters on JSON datacurl— do not fetch URLs directly, use the helper scriptscosign— do not call cosign directly, usedownload_sbom.pyfor ... do ... doneloops that process tool-result files- Any ad-hoc bash script, Python one-liner, or shell pipeline that parses or filters JSON data
- The ONLY allowed bash commands are: running the helper scripts (
python $SCRIPTS_DIR/...),SCRIPTS_DIR=...resolution,test -f, andcatto read a file. - How to handle large VEX/SBOM data: Read the raw JSON output directly in your context window. Analyze it in your reasoning, not with shell tools. Do NOT attempt to filter it with grep/jq.
- Do not combine, reorder, or parallelise steps. Each step depends on outputs from previous steps.
- If a step produces unexpected results, report them and continue — do not stop unless explicitly instructed.
- Every field in the final report must come from actual script outputs. Use
N/A — [reason]for undetermined fields. Never fabricate values. - The
fetch_redhat_vex.pyscript takes ONLY a CVE-ID argument — no flags. It returns the full raw VEX document.
Step 1: CVE Reconnaissance
Run the fetch_cve_metadata.py script to query all CVE data sources in a single call:
The script automatically queries MITRE CVE API, OSV.dev, and (if a GO-* alias is found) the Go vulnerability database. It returns merged JSON with:
description— CVE descriptionaffected[]— all affected packages withecosystem,package,versions(introduced/fixed), andsource(mitre/osv/go_vuln_db)aliases[]— cross-references (GO-, GHSA-, etc.)errors[]— any API failures (non-fatal; the script continues with available data)
From the output, identify:
- The target package name and ecosystem for SBOM matching
- For Go CVEs, the Go vuln DB module path is authoritative for SBOM matching
- Vulnerable version ranges (use the union across all sources)
- If
affectedis empty and errors indicate the CVE was not found: stop and report "CVE not found"
Print: ✓ Step 1 complete — [package name], ecosystem: [ecosystem], sources: [list from affected[].source]
Step 2: SBOM Extraction
Run the download_sbom.py script to handle all SBOM extraction logic in a single call:
The script handles attestation/build-time fallback and image index detection automatically. It returns JSON with:
sbom_source— "attestation" or "build_time"spdx— the full raw SPDX JSON document with all packages, relationships, PURLs, and version infoerrors[]— any issues encountered
Read and interpret the full raw SPDX document from the `spdx` field. Analyze the SPDX data directly — packages (with externalRefs PURLs and versionInfo), relationships (for parent RPM linkage), checksums. Do NOT use grep or jq to search the SBOM.
If spdx is null (no SBOM found), fall back to syft:
This generates an analyzed SBOM using syft. The output has the same JSON schema but sbom_source will be "syft_analyzed" — note this in the report as a generated SBOM, not an official one.
If neither method produces an SBOM: stop and report "Unable to extract SBOM. Cannot determine package presence."
Package presence check and version confirmation:
Red Hat container image SBOMs contain both RPM packages and non-RPM content (Go modules, Python packages, Node.js packages, etc.), each identified by ecosystem-specific PURLs. A non-RPM package may exist as a standalone SBOM entry AND be linked via an SPDX relationship to the RPM package that delivers it. Use the following matching logic:
- Identify the target package name and ecosystem from Step 1. For Go, use the module path from the Go vuln DB as the authoritative name.
- Search SBOM packages by PURL and name:
- For each package in the SBOM, check its
externalRefs[]for entries withreferenceType: purl. Parse the PURL to extract ecosystem, name, and version. - Match the ecosystem prefix against the CVE ecosystem (
pkg:rpm,pkg:golang,pkg:pypi,pkg:npm, etc.). - Match the package name case-insensitively. For Go, match against the full module path (e.g.,
golang.org/x/net). - If found as a non-RPM package: also check its SPDX relationships — look for a
DYNAMIC_LINK,STATIC_LINK, orCONTAINED_BYrelationship to a parent RPM package entry. Record both the non-RPM package entry and its parent RPM if present. - If found only as an RPM package: check
nameandsourceNamefields (case-insensitive).
- If the package is NOT found by any method: skip Step 3 and go to Step 4 (Early Exit — package not in image).
- If the package IS found: record the installed version from the SPDX
versionInfofield and proceed to version range confirmation.
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingocp-admin/skills/container-cve-validator/SKILL.md
Popularity
- Repository stars
- 48
- Repository forks
- 32
- 7-day trend score
- 19
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Extension points
pluginCustom plugin integration
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/rhecosystemappeng/agentic-collections/container-cve-validator)