Skip to content

Add Trivy vulnerability scanning for Docker images - #135

Open
vharseko wants to merge 1 commit into
OpenIdentityPlatform:masterfrom
vharseko:docker-trivy-scan
Open

vharseko wants to merge 1 commit into
OpenIdentityPlatform:masterfrom
vharseko:docker-trivy-scan

Conversation

@vharseko

Copy link
Copy Markdown
Member

Adds Docker image vulnerability scanning with Trivy, mirroring OpenIdentityPlatform/OpenDJ#854.

build.yml — both build-docker and build-docker-alpine jobs now scan the freshly built image (resolved from the local Docker daemon, so the runner's linux/amd64 manifest only) right after the Docker test step. Findings do not fail the build: the SARIF report is uploaded via codeql-action/upload-sarif, so PRs get a "Code scanning results / trivy-build-*" check like CodeQL, and the full list lives in the Security tab. Only fixable CRITICAL/HIGH CVEs are reported (ignore-unfixed: true plus limit-severities-for-sarif: true — without the latter the severity filter is silently dropped for SARIF output), and only the vulnerability scanner runs (scanners: vuln). The action's built-in ~1GB DB cache is disabled (cache: false) so it cannot evict the m2-repository caches out of the repo's 10GB actions-cache quota. The two docker jobs get security-events: write (scoped to just those jobs, since build.yml has no workflow-level permissions: block yet).

docker-scan.yml (new) — weekly cron (30 5 * * 1) + workflow_dispatch scan of the published openidentityplatform/openicf:latest and :alpine images: new CVEs surface in already-released images (mostly via the base image) without any change in this repository. Unlike the build-time scan, unfixed CVEs are reported too. Reports are uploaded as SARIF with a separate category per tag (trivy-image-*, distinct from the trivy-build-* categories in build.yml). The scheduled run is skipped in forks; manual runs are always allowed.

aquasecurity/trivy-action is pinned by commit SHA (v0.36.0), matching the pinning convention #130 is introducing for third-party actions in this repo. Future false positives / accepted findings can be suppressed via a .trivyignore file in the repository root or dismissed in the Security tab.

Scans the freshly built images (default and alpine) in build.yml for
fixable CRITICAL/HIGH CVEs and uploads SARIF to code scanning, and adds
a weekly docker-scan workflow that scans the published
openidentityplatform/openicf:latest/:alpine images. Mirrors
OpenIdentityPlatform/OpenDJ#854, with aquasecurity/trivy-action pinned
by commit SHA to match the pinning convention introduced in OpenIdentityPlatform#130.
@vharseko vharseko added ci CI, build & workflow changes docker security Security fix / CVE remediation labels Sep 18, 2026
@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci CI, build & workflow changes docker security Security fix / CVE remediation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants