Repository navigation
ci(security): consolidate Trivy into manual pre-merge Security scan workflow - #656
Merged
Merged
Conversation
…orkflow Replace trivy.yml with a single security-scan.yml that can be run manually on a PR branch before merging (workflow_dispatch), runs automatically on main pushes and weekly on schedule (CVE drift), but does NOT run on every pull_request push - intermediate commits in a PR no longer trigger the heavy scan pipeline. Jobs (all self-hosted, timeout-minutes set): - build-image: docker build of the PR tree without publishing (push:false, load:true), exported via an artifact (docker save) so nothing unreviewed ever reaches ghcr and scan-image works regardless of which runner in the pool picked the job - scan-fs / scan-config: Trivy fs and misconfig scans with the existing trivy.yaml/.trivyignore - scan-image: Trivy image scan of the locally loaded artifact image - scan-result: aggregate job (needs all, if: always()) that fails if any scan failed or was skipped - this is the check to mark as required in branch protection Branch protection (manual, admin): require Test, Loadtest, DCO and scan-result, with 'Require branches to be up to date before merging' enabled. scan-result stays 'expected' on a PR until someone runs the workflow on its head SHA; a new commit after a run requires re-running. Fork PRs are expected to be merged via admin bypass, since workflow_dispatch cannot run on fork branches (accepted trade-off). Signed-off-by: pirog-spb <[email protected]>
Address the CodeQL actions alerts on security-scan.yml: jobs without
an explicit permissions block inherit the repository default GITHUB_TOKEN
permissions, which are usually broader than needed.
- workflow level: contents: read (checkout only)
- scan-image: {} - same-run artifact download uses ACTIONS_RUNTIME_TOKEN,
docker load and trivy image scan are local operations
- scan-result: {} - pure shell job
- build-image: drop the job-level block, now covered by the workflow-level
default
Signed-off-by: pirog-spb <[email protected]>
pirog-spb
pushed a commit
that referenced
this pull request
Oct 4, 2026
The badge links still referenced trivy.yml, which was replaced by security-scan.yml in #656, so the 'Security' badge in the README went dead. Signed-off-by: pirog-spb <[email protected]>
pirog-spb
added a commit
that referenced
this pull request
Oct 31, 2026
…orkflow (#656) Signed-off-by: pirog-spb <[email protected]> (cherry picked from commit 6b4c982) Signed-off-by: pirog-spb <[email protected]>
pirog-spb
added a commit
that referenced
this pull request
Oct 31, 2026
…orkflow (#656) Signed-off-by: pirog-spb <[email protected]> (cherry picked from commit 6b4c982) Signed-off-by: pirog-spb <[email protected]>
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.
Replace trivy.yml with a single security-scan.yml that can be run manually on a PR branch before merging (workflow_dispatch), runs automatically on main pushes and weekly on schedule (CVE drift), but does NOT run on every pull_request push - intermediate commits in a PR no longer trigger the heavy scan pipeline.
Jobs (all self-hosted, timeout-minutes set):
Branch protection (manual, admin): require Test, Loadtest, DCO and scan-result, with 'Require branches to be up to date before merging' enabled. scan-result stays 'expected' on a PR until someone runs the workflow on its head SHA; a new commit after a run requires re-running.
Fork PRs are expected to be merged via admin bypass, since workflow_dispatch cannot run on fork branches (accepted trade-off).