rhecosystemappeng/agentic-collections/container-cve-validator

Claude Code and agent skill by rhecosystemappeng/agentic-collections

Trust tier 3
  • community
  • ext:[{"type":"plugin","description":"Custom plugin integration"}]
Source check pending

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-validator

Semi-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:

bash
python $SCRIPTS_DIR/validate_input.py --cve [CVE-ID] --image [IMAGE_REFERENCE]

Batch mode (when `--file` was provided):

bash
python $SCRIPTS_DIR/validate_input.py --file [PATH]

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 valid is false: print the errors and stop. Do not proceed to any execution step.
  • If valid is true: use the entries array to drive the pipeline. Each entry contains image_ref, ref_format ("tag" or "digest"), registry info, and input_type.
  • If input_type is "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_type is "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:

bash
python $SCRIPTS_DIR/inspect_image.py [IMAGE_REFERENCE]

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:

regctl registry login registry.redhat.io

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 matching
  • labels.name → public component name for VEX matching
  • labels["com.redhat.component"] → internal build name (secondary fallback only)
  • labels.vendor and labels.maintainer — for registry ownership validation
  • labels["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 vendor or maintainer from inspect output is "Red Hat, Inc.": the image is a Red Hat image mirrored to an alternate registry. Record the canonical registry.redhat.io form 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:

bash
SCRIPTS_DIR="scripts"
test -f "$SCRIPTS_DIR/validate_input.py" || { echo "Error: Scripts directory not found at $SCRIPTS_DIR"; exit 1; }

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.

#StepRequiredMay skip only when
0Prerequisites checkAlwaysNever
0Input validation + image inspectionAlwaysNever
1CVE Reconnaissance (MITRE → OSV.dev → Go vuln DB)AlwaysNever
2SBOM Extraction + package verificationAlwaysNever
3Red Hat VEX ValidationAlwaysPackage NOT found in SBOM (Step 2)
4Newer Image Availability ScanConditionalTrigger conditions not met (see Step 4 header)
5Final ReportAlwaysNever

Strict rules:

  1. Execute each step using the helper scripts below. After each step, print: ✓ Step N complete — [key finding]
  2. FORBIDDEN COMMANDS — never use these, even inside loops or pipelines:
  • grep — do not grep through JSON data files
  • jq — do not use jq filters on JSON data
  • curl — do not fetch URLs directly, use the helper scripts
  • cosign — do not call cosign directly, use download_sbom.py
  • for ... do ... done loops that process tool-result files
  • Any ad-hoc bash script, Python one-liner, or shell pipeline that parses or filters JSON data
  1. The ONLY allowed bash commands are: running the helper scripts (python $SCRIPTS_DIR/...), SCRIPTS_DIR=... resolution, test -f, and cat to read a file.
  2. 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.
  3. Do not combine, reorder, or parallelise steps. Each step depends on outputs from previous steps.
  4. If a step produces unexpected results, report them and continue — do not stop unless explicitly instructed.
  5. Every field in the final report must come from actual script outputs. Use N/A — [reason] for undetermined fields. Never fabricate values.
  6. The fetch_redhat_vex.py script 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:

bash
python $SCRIPTS_DIR/fetch_cve_metadata.py [CVE-ID]

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 description
  • affected[] — all affected packages with ecosystem, package, versions (introduced/fixed), and source (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 affected is 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:

bash
python $SCRIPTS_DIR/download_sbom.py [IMAGE_REFERENCE]

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 info
  • errors[] — 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:

bash
python $SCRIPTS_DIR/generate_sbom_syft.py [IMAGE_REFERENCE]

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:

  1. 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.
  1. Search SBOM packages by PURL and name:
  • For each package in the SBOM, check its externalRefs[] for entries with referenceType: 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, or CONTAINED_BY relationship 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 name and sourceName fields (case-insensitive).
  1. If the package is NOT found by any method: skip Step 3 and go to Step 4 (Early Exit — package not in image).
  1. If the package IS found: record the installed version from the SPDX versionInfo field 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

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
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/rhecosystemappeng/agentic-collections/container-cve-validator/badge)](https://verified-skill.com/skills/rhecosystemappeng/agentic-collections/container-cve-validator)

Something wrong with this skill or its page? Tell us.