Repository navigation
ci: migrate Trivy image build-and-scan workflows - #248
Open
kkurzacz-intel wants to merge 10 commits into
Open
kkurzacz-intel wants to merge 10 commits into
kkurzacz-intel wants to merge 10 commits into
Conversation
kkurzacz-intel
marked this pull request as draft
December 2, 2026 18:43
Port the scheduled "Sec :: Trivy" image scan from the innersource repo together with its reusable build/scan workflows and the result post-processing scripts. - Runs on intel-ubuntu-default; Intel certificates, proxy build args, the internal cache registry and the innersource certs action are dropped. - Image is built with plain docker build and scanned from the saved tarball (trivy --input), so skopeo and the Trivy container are no longer needed. - Trivy v0.74.0 via aquasecurity/setup-trivy, matching trivy.yml. - Per-image results are uploaded as trivy-<image> so the summary job downloads only those, not the image tarballs. - Triggers: workflow_dispatch, weekly on Monday, and PRs to release-3.1 for testing. Signed-off-by: Kurzacz, Kamil <kamil.kurzacz@intel.com>
trivy.yml becomes trivy-code.yml ("Trivy - Code") and the image scan is named "Trivy - Images". The reusable build/scan workflows also move to the intel-ubuntu-latest runner.
Signed-off-by: Kurzacz, Kamil <kamil.kurzacz@intel.com>
A trivy-db job downloads the vulnerability DB and saves it to the Actions cache under trivy-db-<run_id>. Each scan job restores it and runs with TRIVY_SKIP_DB_UPDATE, so the matrix no longer hits the DB registry once per image. A scan downloads the DB itself on a cache miss. setup-trivy now caches the Trivy binary. Signed-off-by: Kurzacz, Kamil <kamil.kurzacz@intel.com>
DOCKER_CONTEXT is read by the Docker CLI as the context/builder name, so docker build failed with 'no builder "src" found'. Use BUILD_CONTEXT instead. The summary job no longer fails when no scan produced results. Signed-off-by: Kurzacz, Kamil <kamil.kurzacz@intel.com>
The image list and the image builds check out vars.TRIVY_BRANCH, falling back to the triggering ref when it is unset. The run name shows the scanned branch. Signed-off-by: Kurzacz, Kamil <kamil.kurzacz@intel.com>
Signed-off-by: Kurzacz, Kamil <kamil.kurzacz@intel.com>
kkurzacz-intel
force-pushed
the
kkurzacz/migrate-trivy-scans
branch
from
December 3, 2026 15:02
dedbe37 to
dbd3610
Compare
trivy-build-and-scan-reusable.yml becomes trivy-images-build-scan-reusable.yml and trivy-reusable.yml becomes trivy-images-scan-reusable.yml, with matching workflow names. The inner scan job is named Trivy so checks read '<image> / Scan / Trivy'. Signed-off-by: Kurzacz, Kamil <kamil.kurzacz@intel.com>
A manual run scans the 'branch' input and falls back to the TRIVY_BRANCH variable, which the weekly schedule uses. Runs for different branches no longer cancel each other. The pull_request trigger was only for testing the migration. Signed-off-by: Kurzacz, Kamil <kamil.kurzacz@intel.com>
Signed-off-by: Kurzacz, Kamil <kamil.kurzacz@intel.com>
kkurzacz-intel
marked this pull request as ready for review
December 3, 2026 16:31
mik-now
approved these changes
Dec 4, 2026
mik-now
left a comment
Contributor
There was a problem hiding this comment.
lgtm, we could extend possibility to track if fix is available or we wait for upstream.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Ports the scheduled image scan ("Sec :: Trivy") from the previous internal repository, along with its reusable workflows and result scripts.
trivy-images.yml: readsdeployment/images.yaml(existingread-images-reusable.yml), builds and scans every image as a matrix, then merges the results intosummary-all.csv(trivy-results-archiveartifact).trivy-build-and-scan-reusable.yml:docker build+docker save, uploads the tarball asimage-<name>.trivy-reusable.yml: Trivy v0.74.0 table / JSON / SDL scans on the tarball. It writes a per-image job summary, uploadstrivy-<name>and exposesscan-status(error/vulnerable/clean)..github/custom_tools/trivy/: post-processing and summary scripts plus the SDL config/template.Changes vs. the original
intel-ubuntu-default. Everything internal is removed: CA certificates, proxy build args, the cache registry and the internal certs action.aquasecurity/setup-trivyand scans the tarball with--input.trivy-, so the summary job downloads only results and not the image tarballs.Triggers
workflow_dispatchand weekly on Monday 00:00 UTC.schedulefires only on the default branch.Testing
pull_requesttrigger: images build, the cached Trivy DB is restored and the scans complete. The trigger was removed afterwards.Scanned branch
A manual run scans the branch given in the
branchinput. The weekly run, and a manual run with an empty input, scan the branch in the repository variableTRIVY_DEFAULT_BRANCH. When neither is set, the triggering ref is scanned. The Trivy scripts and config always come from the workflow's own branch.