/ec-cve-check:ec-cve-checkfrom ec-cve-check
Inspect Enterprise Contract CVE scan results from Konflux-built images and test ECP exception removal. Use when investigating cve.cve_blockers violations, checking what CVEs Clair found in an image, or testing whether an ECP exception can be safely removed.
Ships in ec-cve-check. 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; scripts run unread.
Inspect Clair scan results from Konflux-built images and test ECP exception removability.
Two commands when logged into the Konflux cluster:
# 1. Set up auth (one-time per session)
bash skills/ec-cve-check/scripts/setup-auth.sh <tenant-namespace>
# 2. Scan
DOCKER_CONFIG=/tmp/clair-auth bash skills/ec-cve-check/scripts/inspect-clair-cves.sh <image-ref>
The --key flag is optional when cluster access is available — the script reads the cosign public key via k8s://openshift-pipelines/public-key by default. Use --key only for offline scenarios (see Auth details below).
Filter the report by severity and source when you only need a subset:
# Comma-separated values are supported; filters can also be repeated.
DOCKER_CONFIG=/tmp/clair-auth bash skills/ec-cve-check/scripts/inspect-clair-cves.sh \
<image-ref> --severity critical,high --source RHSA
For JSON output (useful for scripting or further analysis):
DOCKER_CONFIG=/tmp/clair-auth bash skills/ec-cve-check/scripts/inspect-clair-cves.sh <image-ref> --json
# Filters apply before JSON is emitted, so jq receives only matching findings.
DOCKER_CONFIG=/tmp/clair-auth bash skills/ec-cve-check/scripts/inspect-clair-cves.sh \
<image-ref> --severity high --source GHSA,PYSEC --json \
| jq -r '.vulnerabilities[] | [.severity, .source, .cve, .package] | @tsv'
Pass your Konflux tenant namespace. Find it from your application's namespace in the Konflux cluster.
The setup-auth.sh script extracts the components-namespace-pull secret, which covers all image repos under quay.io/redhat-user-workloads/<tenant>/*. It works for any component in the tenant — no need to find per-app secrets.
When working without cluster access, export the cosign key for offline use:
bash skills/ec-cve-check/scripts/setup-auth.sh <tenant-namespace> --key
# Then use: --key /tmp/clair-auth/tekton-public.pem
Or use the image proxy (one login covers all tenants):
podman login image-rbac-proxy.apps.<your-konflux-cluster-domain>
setup-auth.sh <tenant-namespace> [--key]Extracts components-namespace-pull secret to /tmp/clair-auth/config.json. With --key, also exports the cosign public key to /tmp/clair-auth/tekton-public.pem. Exits non-zero if the secret is missing or cluster access fails.
inspect-clair-cves.sh <image-ref> [options]Accepts any full image reference — tag (quay.io/repo:tag) or digest (quay.io/repo@sha256:...). Resolves tags to digests automatically. Fetches the cosign attestation, extracts the REPORTS OCI blob, and parses all CVE data.
--severity <list>: comma-separated or repeated filter using critical, high, medium, low, or unknown--source <list>: comma-separated or repeated filter using GHSA, PYSEC, or RHSA; severity and source filters are ANDed, while multiple values within one filter are ORed--json: structured JSON with image, filtered total_vulnerabilities, summary, source_summary, filters, and vulnerabilities arraycosign, skopeo, python3)DOCKER_CONFIG (directory with config.json), TEKTON_PUBLIC_KEY (alternative to --key)test-exception-removal.sh <namespace> <policy-file> <snapshot-name> [exception] [service-account]Submits an EC PipelineRun with a modified policy (exception removed). Waits up to 10 minutes.
namespace: tenant namespace (e.g., my-tenant)policy-file: local path to ECP YAML from your local clone of konflux-release-data (e.g., <your-local-clone>/config/<cluster>/product/EnterpriseContractPolicy/<your-ecp-policy>.yaml)snapshot-name: Konflux snapshot name (e.g., my-app-20260101-000000-000)exception: exception rule to remove (default: cve.cve_blockers)service-account: SA for PipelineRuns (default: konflux-integration-runner)Example:
bash skills/ec-cve-check/scripts/test-exception-removal.sh \
<tenant-namespace> \
<your-local-clone>/config/<cluster>/product/EnterpriseContractPolicy/<your-ecp-policy>.yaml \
<snapshot-name>
The Source column and JSON source field normalize each finding so it can be filtered:
| Output source | How it is identified | What it means |
|---|---|---|
| RHSA | Red Hat VEX updater or an RHSA-* link | Red Hat RPM or container-level CSAF/VEX assessment. The vulnerability ID is usually a CVE-* identifier. |
| GHSA | Vulnerability ID starts with GHSA- | GitHub Security Advisory data from the OSV/PyPI feed. |
| PYSEC | Vulnerability ID starts with PYSEC- | Python Security Advisory data from the OSV/PyPI feed. |
For example, --source RHSA selects the Red Hat findings, while --source GHSA,PYSEC selects Python ecosystem findings. The same CVE can appear in multiple package rows; use JSON and deduplicate by .cve when counting unique IDs.
Package names still help explain where a finding occurs:
<product-prefix>/<image-name> is a container-level CSAF/VEX assessment.setuptools or requests represents an OSV/PyPI finding and may be a false positive when a downstream patch has a local version suffix.Downstream-patched Python packages often carry local version identifiers (e.g., package==1.2.0+downstream.1). Clair strips the local suffix, so 1.2.0 matches upstream vulnerability ranges even when the backport contains the fix. Cross-reference Python CVEs against your downstream patching/requirements files to identify false positives.
When a product image (e.g., RHAIIS vLLM) is built on top of a base image (e.g., base-image-cuda), you can diff the two scans to see which CVEs are inherited vs introduced. This helps prioritize fixes — base image CVEs need a base image rebuild, while product-layer CVEs need changes in the product build.
skopeo inspect 'docker://<product-image>' | python3 -c "
import json, sys; labels = json.load(sys.stdin).get('Labels', {})
# Adjust label names to match your product's conventions
for k in ['base_image_label', 'image_label', 'git.commit']:
print(f'{k}: {labels.get(k, "N/A")}')
"
Key labels:
quay.io/<your-org>/base-images/<image>:<version>registry.redhat.io/rhel9/rhel:9.xgit.commit — source commit SHA# Get the git commit from the base image labels
skopeo inspect 'docker://<base-image-from-label>' | python3 -c "
import json, sys; print(json.load(sys.stdin).get('Labels', {}).get('git.commit', 'N/A'))"
# Find the Snapshot by commit SHA
oc get snapshots -n <tenant> \
-l pac.test.appstudio.openshift.io/sha=<commit-sha> \
-o custom-columns='NAME:.metadata.name,COMPONENT:.metadata.labels.appstudio\.openshift\.io/component,CREATED:.metadata.creationTimestamp'
# Extract the user-workloads image from the Snapshot
oc get snapshot <snapshot-name> -n <tenant> \
-o jsonpath='{range .spec.components[*]}{.name}{"\t"}{.containerImage}{"\n"}{end}'
--json:DOCKER_CONFIG=/tmp/clair-auth bash skills/ec-cve-check/scripts/inspect-clair-cves.sh <base-image> --json > /tmp/base-cves.json
DOCKER_CONFIG=/tmp/clair-auth bash skills/ec-cve-check/scripts/inspect-clair-cves.sh <product-image> --json > /tmp/product-cves.json
CVE-* (from RPM/VEX feeds), GHSA-* (GitHub Security Advisories), and PYSEC-* (Python Security DB via OSV). GHSA and PYSEC entries come from the osv/pypi updater and only appear when the image contains Python packages. A single vulnerability may have both a GHSA and PYSEC ID.Two approaches: local EC CLI (preferred) or cluster PipelineRun (slower, subject to Kueue quota).
Run EC validation locally with the exception removed from the policy. ~30s per component, no cluster queue wait.
Prerequisites:
/tmp/ec)bash skills/ec-cve-check/scripts/setup-auth.sh <tenant-namespace>konflux-release-dataSteps:
builtin.image.accessible to excludes to avoid registry auth noise):ECP="<your-local-clone>/config/<cluster>/product/EnterpriseContractPolicy/<your-ecp-policy>.yaml"
python3 -c "
import sys, yaml, json
d = yaml.safe_load(open('$ECP'))
spec = d['spec']
for source in spec.get('sources', []):
cfg = source.setdefault('config', {})
excl = cfg.get('exclude', [])
excl = [e for e in excl if e != 'cve.cve_blockers'] # remove the exception
cfg['exclude'] = excl
if 'builtin.image.accessible' not in excl:
excl.append('builtin.image.accessible')
with open('/tmp/ec-policy.json', 'w') as f:
json.dump(spec, f)
print('Policy written to /tmp/ec-policy.json')
"
oc get snapshot <snapshot-name> -n <namespace> -o json | python3 -c "
import json, sys
snap = json.load(sys.stdin)
spec = snap['spec']
comp = [c for c in spec['components'] if c['name'] == '<component-name>'][0]
json.dump({'application': spec['application'], 'artifacts': {}, 'components': [comp]}, open('/tmp/ec-snap.json', 'w'))
"
DOCKER_CONFIG=/tmp/clair-auth /tmp/ec validate image \
--images /tmp/ec-snap.json \
--policy /tmp/ec-policy.json \
--ignore-rekor \
--strict=false \
--output text \
--workers 5
Result interpretation:
Result: SUCCESS or Result: WARNING → exception can be removedResult: FAILURE with [Violation] cve.cve_blockers → exception still needed; check Term: field for CVE IDsrequired_tasks, cve_results_found) → unrelated to CVE exceptionImportant: Only push pipeline snapshots (on-push) have CVE scan data. Pull/MR snapshots (on-pull-request) skip scanning — cve.cve_blockers silently passes with no data. Filter snapshots:
oc get snapshots -n <namespace> \
-l "pac.test.appstudio.openshift.io/event-type=push,appstudio.openshift.io/application=<app>" \
--sort-by='.metadata.creationTimestamp' -o custom-columns='NAME:.metadata.name,CREATED:.metadata.creationTimestamp' \
| tail -5
You can verify by checking the snapshot label: appstudio.openshift.io/build-pipelinerun should contain on-push, not on-pull-request.
Submits an EC PipelineRun on the cluster. Slower (~60s+ plus Kueue queue wait) and subject to konflux-ci-dev-token quota limits (~2-3 concurrent PipelineRuns per tenant).
Read references/ecp-exception-testing.md before running — it covers interpreting results and troubleshooting PipelineRun issues.
The clair-scan Tekton task produces two outputs from a single scan: SCAN_OUTPUT (RHSA-filtered counts shown in the build UI, often 0 for Python) and REPORTS (full Clair report as OCI blob — what EC's cve.cve_blockers evaluates). This gap is why builds appear clean while EC catches real CVEs at release time. inspect-clair-cves.sh reads the REPORTS data.
For source repo links (clair-scan task, conftest policy, EC rule, clair-action) and the full two-path data flow, read references/cve-scanning-architecture.md.
skopeo inspect docker://<image-ref> to test access.quay.io/redhat-user-workloads/...) automatically. If both fail, verify components-namespace-pull auth.DOCKER_CONFIG points to a directory containing config.json, not a file directly.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
ec-cve-check@opendatahub-skills is listed by opendatahub-io/skills-registry — review the source before installing
npx claudepluginhub opendatahub-io/skills-registry --plugin ec-cve-check