Security: Pin all GitHub Actions to SHA hashes in ci-cd.yml#11
Draft
Security: Pin all GitHub Actions to SHA hashes in ci-cd.yml#11
Conversation
Co-authored-by: beevelop <6891349+beevelop@users.noreply.github.com> Agent-Logs-Url: https://github.com/beevelop/BeeCompose/sessions/447edca5-af30-4fae-a113-ba28ecde9edd
Copilot
AI
changed the title
[WIP] Update CI/CD workflow to pin GitHub Actions to SHA
Security: Pin all GitHub Actions to SHA hashes in ci-cd.yml
Mar 25, 2026
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.
The March 2026 Trivy Action supply chain compromise demonstrated the risk of mutable action refs —
@masterand floating tags like@v6can be force-pushed to malicious commits without warning.Changes
aquasecurity/trivy-action@master→ pinned to57a97c7e7821a5776cebc9bb87c984fa69cba8f1 # v0.35.0(the critical fix — this ref was directly compromised)actions/checkout@v6→de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6(6 occurrences)actions/upload-artifact@v7→bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7(4 occurrences)actions/download-artifact@v8→3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8(2 occurrences)All 15
uses:references in the file are now immutably pinned. Version comments are retained for readability:Original prompt
Problem
The
.github/workflows/ci-cd.ymlworkflow usesaquasecurity/trivy-action@masterwhich is extremely dangerous — the Trivy Action supply chain compromise in March 2026 proved that themasterbranch was directly compromised, exposing CI/CD secrets.Required Changes
Update
.github/workflows/ci-cd.ymlto:aquasecurity/trivy-action@masterwithaquasecurity/trivy-action@57a97c7e41536f44adcf59faf14cd94554d91eb0 # v0.35.0Search the entire
.github/workflows/ci-cd.ymlfile for ALLuses:lines and pin each one to its full 40-character commit SHA. Add a comment with the human-readable tag after the SHA, e.g.:uses: actions/checkout@<full-sha> # v6.0.2uses: aquasecurity/trivy-action@57a97c7e41536f44adcf59faf14cd94554d91eb0 # v0.35.0For every
uses:line, look up the full 40-character commit SHA for the tag version and use that. Add a comment with the human-readable tag after the SHA.The following is the prior conversation context from the user's chat exploration (may be truncated):
User: where do i use trivy actions in my github pipelines. give me a full overview
Assistant: Here's a full overview of all the places you use
aquasecurity/trivy-actionacross your GitHub pipelines. I found 9 repositories using it, organized into 3 distinct usage patterns:Summary Table
beevelop/docker-javadocker.yml@0.35.0beevelop/docker-cuberitedocker.yml@masterbeevelop/docker-nodejs-pythondocker.yml@masterbeevelop/docker-uniqushdocker.yml@masterbeevelop/docker-varnishdocker.yml@masterbeevelop/docker-nodejsdocker.yml@masterbeevelop/docker-hedgewarsdocker.yml@masterbeevelop/semiatrixbuild-studio-image.yml@masterCRITICAL,HIGH(SARIF) /CRITICAL,HIGH,MEDIUM(table)beevelop/BeeComposeci-cd.yml@masterCRITICAL,HIGH,MEDIUM,LOWPattern 1: Docker Image Repos (Legacy Template) — 7 repos
Used in: docker-java, docker-cuberite, docker-nodejs-python, docker-uniqush, docker-varnish, docker-nodejs, docker-hedgewars
These all follow the same pattern — Trivy runs after
docker/build-push-action, scans the built image, outputs SARIF using the legacy template approach, and uploads to the GitHub Security tab:Pattern 2: Dedicated Security Scan Job —
semiatrixIn
beevelop/semiatrix, Trivy runs as a separatesecurity-scanjob that depends onbuild-and-push. It runs Trivy twice — once for SARIF upload and once for a human-readable table in the logs: