Skip to content

Vulnerability scanning

Anna Sancho Vaquer edited this page Oct 21, 2026 · 3 revisions

Rocks are scanned for known vulnerabilities in two places.

When Where Effect
On every push/PR Test stage of the rock pipeline A fixable HIGH or CRITICAL vulnerability fails the pipeline and blocks the upload.
Daily Threat monitor workflow Opens or updates a GitHub issue when the published images have vulnerabilities.

The Threat monitor

.github/workflows/threats.yml runs every day at 01:00 UTC and can be started manually from the Actions tab.

Enabling it

It is controlled from .github/ci.yaml:

ghcr:
  upload: true
  cve-scan: true

cve-scan requires upload: true, because the scan pulls the published image from GHCR:

ghcr.io/<owner>/<repository>/<rock-name>:<version>-<base>_edge

What it reports

For each rock in .github/ci.yaml, the workflow:

  1. Pulls the published image from GHCR.
  2. Scans it for HIGH and CRITICAL vulnerabilities with an available fix.
  3. Opens a GitHub issue titled Vulnerabilities found for <name>:<tag> listing the vulnerability IDs, targets, severities and affected packages when vulnerabilities are found. If an issue with that title already exists, no new one is opened (duplicates are closed).
  4. Closes an issue automatically once a scan comes back clean.

The scan runs against what is already published. To fix a reported vulnerability, rebuild the rock with updated packages (for example by pushing a change to main), so that a new image is published.

Ignoring vulnerabilities

To accept a specific vulnerability such as a false positive or one with no practical impact, list its ID in a .trivyignore file in the rock's directory, next to its rockcraft.yaml:

main
├── rockcraft.yaml
├── .trivyignore
└── ...
# One vulnerability ID per line. Comments start with '#'.
CVE-2024-12345

See Trivy's documentation on .trivyignore for the full syntax.

Pro-enabled rocks

Pro-enabled rocks are not uploaded to GHCR from public repositories, so the Threat monitor cannot scan them.

Clone this wiki locally