Skip to content

fix: correct aquasecurity/trivy-action tag format in CI workflows - #139

Merged
tungbq merged 3 commits into
mainfrom
fix/trivy-action-tag-cicd-best-practices
Aug 30, 2026
Merged

fix: correct aquasecurity/trivy-action tag format in CI workflows#139
tungbq merged 3 commits into
mainfrom
fix/trivy-action-tag-cicd-best-practices

Conversation

@tungbq

@tungbq tungbq commented Aug 30, 2026

Copy link
Copy Markdown
Owner

Summary

Follow-up to #138, which merged before this fix landed on that branch — CI on main is currently red for projects/cicd-best-practices-container-apps/** because of it.

aquasecurity/trivy-action tags carry a v prefix (v0.36.0), unlike the bare 0.29.0 originally used, so GitHub Actions couldn't resolve the action at all (Unable to resolve action 'aquasecurity/trivy-action@0.29.0', unable to find version '0.29.0') before any step in the docker-build-and-scan job ran. Bumped hadolint/hadolint-action to its latest tag while in there.

Confirmed the fixed tags exist:

  • aquasecurity/trivy-action@v0.36.0 — latest release
  • hadolint/hadolint-action@v3.5.0 — latest release

Test plan

  • actionlint on both changed workflow files — zero findings
  • Confirmed via GitHub API that both tags resolve to real refs
  • CI on this PR (path-scoped verify-cicd-best-practices-container-apps.yml) should now go green — will confirm once it runs

https://claude.ai/code/session_01DgVRQrXf1xhAHKYsV2xVAQ

tungbq added 3 commits August 30, 2026 03:23
trivy-action's tags carry a "v" prefix (v0.36.0), unlike the bare
"0.29.0" originally used — GitHub Actions failed to resolve the action
at all before any step ran. Bumped hadolint-action to its latest tag
while in there.
hadolint DL3066 flags USER node — a non-numeric user ID isn't reliably
resolvable by every host/orchestrator (e.g. Kubernetes runAsNonRoot
checks read the numeric UID). node:22-alpine's "node" user is 1000:1000,
confirmed locally; switched to USER 1000:1000 and re-verified the image
still builds, runs, and serves /health correctly under that UID.
Trivy found two real, unrelated-to-the-app vulnerability sources in the
runtime image: node:22-alpine's OS packages (libssl3/libcrypto3) lagging
their latest security patch, and the npm CLI the base image bundles,
which vendors its own dependency tree (tar, pacote, brace-expansion, ...)
carrying several fixed-upstream CVEs. Neither matters to this app: `apk
upgrade` picks up current Alpine patches regardless of what was baked
into the base image tag, and npm is never invoked at runtime (CMD calls
node directly) so it's just removed. Re-verified locally: image builds,
runs, still serves /health and / correctly under UID 1000, hadolint
clean, and a local Trivy scan (matching CI's exact flags) now exits 0.
@tungbq
tungbq merged commit 51b20ee into main Aug 30, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant