Skip to content

ci: scan published Docker images for CVEs every week - #1545

Open
Faraz32123 wants to merge 2 commits into
overhangio:mainfrom
edly-io:faraz/weekly-image-scan
Open

Faraz32123 wants to merge 2 commits into
overhangio:mainfrom
edly-io:faraz/weekly-image-scan

Conversation

@Faraz32123

Copy link
Copy Markdown
Contributor

Part of #1543.

Adds a weekly scheduled workflow that scans the Docker images Tutor publishes, so newly disclosed CVEs in already-published images become visible without rebuilding anything:

  • A resolver job queries Docker Hub for the latest published tags of overhangio/openedx (current release and -main nightly) and overhangio/openedx-permissions.
  • A matrix job scans each image with Trivy (CRITICAL,HIGH) and uploads SARIF to the repository's Security tab, under one stable category per image stream so each week's report replaces the previous one instead of piling up.
  • workflow_dispatch accepts an arbitrary image reference, for scanning e.g. an -indigo variant or an older tag by hand.
  • SECURITY.md documents the triage policy; changelog entry included.

One deliberate choice, slightly different from what I proposed on the issue: instead of a .trivyignore listing ~500 kernel-header CVEs (which would need constant maintenance), the scan runs with ignore-unfixed: true. The linux-libc-dev findings have no released fix and don't apply to containers (which run on the host kernel), so they drop out automatically; everything with an available fix stays visible.

Testing

  • The tag-resolver logic was run locally against the live Docker Hub API and resolved openedx:22.0.4, openedx:23.0.0-main and openedx-permissions:22.0.4 — exactly the intended targets (Claude tested this).
  • The exact Trivy invocation (severity filter, ignore-unfixed, SARIF output) was run locally via the Trivy Docker image and produced valid SARIF.
  • Workflow YAML parses; actions are current (trivy-action@v0.36.0, upload-sarif@v4, Trivy 0.76.2).

The first scheduled run is Monday 06:00 UTC; it can be triggered manually before that from the Actions tab once merged.

🤖 Generated with Claude Code

A scheduled workflow resolves the latest published tags of overhangio/openedx
(release and main) and overhangio/openedx-permissions on Docker Hub, scans them
with Trivy, and uploads the reports to the repository's Security tab under one
stable category per image stream.

Unfixed findings are excluded: most of them are Ubuntu kernel-header CVEs that
do not apply to containers, and no action is possible for the rest. SECURITY.md
documents the triage policy for what remains.

Part of overhangio#1543.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@ahmed-arb ahmed-arb left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Scimmed it; LGTM. Can we see it in action?

@Faraz32123

Copy link
Copy Markdown
Contributor Author

Scimmed it; LGTM. Can we see it in action?

It runs automatically every Monday once merged — results will show up under the repo's Security tab. It can also be triggered manually from the Actions tab if you want to see it sooner.

@Abdul-Muqadim-Arbisoft Abdul-Muqadim-Arbisoft left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Faraz32123, the approach looks right to me, and ignore-unfixed is a better choice than a long .trivyignore. Two changes before merging:

  1. Pin trivy-action to a commit SHA. In March 2026 the trivy-action tags were force-pushed to malicious commits that stole CI secrets (Aqua's write-up), so a version tag isn't enough for this action. We already pin create-github-app-token this way, and Dependabot keeps SHA pins up to date:
    uses: aquasecurity/trivy-action@ed142fd0673e97e23eac54620cfb913e5ce36c25 # v0.36.0
  2. Scan the -indigo images on the schedule too. Indigo is enabled by default, so most installs run overhangio/openedx:<version>-indigo, which is the image from the original report. Right now it's only covered by a manual run. Something like:
    ("trivy-openedx-indigo-release", latest("overhangio/openedx", r"\d+\.\d+\.\d+-indigo")),
    ("trivy-openedx-indigo-main", latest("overhangio/openedx", r"\d+\.\d+\.\d+-main-indigo")),

Minor, optional: without a version: input, trivy-action v0.36.0 installs Trivy v0.70.0, not the 0.76.2 mentioned in the description. Setting version: explicitly would make it clear which Trivy runs.

On "can we see it in action?": a run on the edly-io fork before merging (e.g. with a temporary push trigger on this branch) would show the results in the fork's Security tab.

- Pin trivy-action to the v0.36.0 commit SHA: its version tags were
  force-pushed to malicious commits in March 2026, so a tag is not
  enough for this action. Dependabot keeps SHA pins up to date.
- Pin the Trivy version explicitly instead of relying on the default
  bundled with the action.
- Scan the "-indigo" image streams on the schedule too: Indigo is
  enabled by default, so most installs run these images.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

3 participants