Repository navigation
Description
Summary
Move the scan-image composite action, which scans an image with Trivy and uploads the fixable findings as SARIF to code scanning, into .github as actions/scan-image. Callers pin it by SHA.
Why
foca, cloud-registry and proTES each have a copy in .github/actions/scan-image, marked "identical copies: change them together". They have already drifted: foca pins github/codeql-action/upload-sarif at v4.39.1, while cloud-registry and proTES pin v4.39.0, because Dependabot bumps each copy separately. With one shared copy, the drift ends.
Tasks
- Add
actions/scan-imagein.github, based on foca's copy (the newest). It keeps the inputs (image reference, category, the Trivy version, the full-report option). - Add the action's directory to
.github'sdependabot.yml, so Dependabot updates the Trivy and CodeQL action pins inside it. The Trivy binary version (version: v0.75.0) is an input and Dependabot doesn't bump it, so note that in the action's docs. - Tests in the
.githubCI: scan a tiny image and check that the outputs and the failure on fixable CRITICAL/HIGH findings work. - Rollout, after a release of
.githuband tracked in each repo: foca, cloud-registry and proTES (later trs-filer) change theirci.yml,release.ymlandscan.ymltouses: elixir-cloud-aai/.github/actions/scan-image@<sha> # vX.Y.Z, delete their local copy and remove the/.github/actions/scan-imageentry fromdirectoriesin theirdependabot.yml.
What stays per repo
.trivyignore.yaml (the action runs in the caller's workspace, so it still applies), the image reference and category, the job's permissions: security-events: write, and keeping scans in jobs without registry credentials.
Check names don't change, so no ruleset changes are needed.
Part of the parent issue on sharing workflow steps as composite actions.
Activity
ci: check why the vulnerable scan fails