Skip to content

fix(security): scan each image with one Trivy action and SARIF - #6488

Merged
dan-petty merged 5 commits into
mainfrom
ci/6405-image-scan-action-sarif
Nov 20, 2026
Merged

dan-petty merged 5 commits into
mainfrom
ci/6405-image-scan-action-sarif

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

Six image jobs installed Trivy (25-28 s each), wrote no SARIF, and read three ignore files with no path scope, so an OpenTofu entry also hid the same ID in kubectl.

The action .github/actions/image-scan runs the digest-pinned Trivy image as a docker:// step, writes SARIF, prints a table of the findings from its cache, and uploads the SARIF under the category of the caller. The six image jobs call it with exit code 1 and get security-events: write; the third-party scan calls it with exit code 0.

.trivyignore.yaml holds each image finding for one binary, and the three legacy files go. The expired kubectl CVE-2026-56851 entry goes to 2026-11-22 (SECURITY.md, #6084). The coupled trivy Renovate group and the tests of config values go.

Closes #6405

Change: openspec/changes/archive/2026-11-20-6405-image-scan-action-sarif/

Add the composite action .github/actions/image-scan. It runs the Trivy
image, pinned by tag and digest, as a docker:// step with HIGH and
CRITICAL fixed findings, an ignore file and an exit code. It writes
SARIF, prints the findings as a table from the cache of the scan, and
uploads the SARIF to code scanning under the category of the caller.

The six image jobs of ci.yml and release.yml and the third-party scan
call the action. The jobs lose the uv toolchain and the Trivy install,
and get security-events: write. .trivyignore.yaml holds each image
finding for one binary, with paths and purls, and the three legacy
ignore files go. The kubectl CVE-2026-56851 entry expired on
2026-11-20 with no released fix, so it goes to 2026-11-22 (#6084).

The tests of trivy-action inputs, of release-equals-CI and of the
legacy ignore format go: they asserted values of config files.
@dan-petty dan-petty added type/infra Type infra: the build, CI, images or cluster scope/security Security linters (trivy, bandit, gitleaks, kubeconform) and Vault labels Nov 20, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Test record

Read on 2026-11-20 against origin/main at 58e7b0dee, with Docker 29.9.3 and Trivy 0.76.2.

Local checks on the final code

  • uv run devops ci --check --only lint,format,docs,constructs,openspec,test-settings,test-tree,startup-imports,swallowed-failures,actionlint,zizmor: all rows pass.
  • uv run devops ci test tests/invariants/test_mcp_server_image.py tests/invariants/test_runner_image.py tests/invariants/test_service_image.py tests/commands/test_ci.py tests/core/test_renovate_config.py: 135 passed.
  • uv run devops ci test tests/invariants/test_workflow_contracts.py tests/invariants/test_architectural_invariants.py tests/roadmap/test_roadmap_runner_tools.py tests/research/test_inventory.py tests/research/test_advisories.py tests/invariants/test_uv_malware_check.py tests/github/test_merge_readiness.py tests/invariants/test_agents_md.py tests/commands/test_security_zizmor.py: 331 passed.
  • openspec validate and uv run devops openspec archive: every spec and change validates.
  • fail-to-pass: not run. The change has no fix of code under src/ (only a comment of tools.lock).

Scoped ignore entries (live check)
The two steps of the action ran with docker run, as the runner starts a docker:// step (workspace as working directory, Docker socket mounted), on the release images v0.182.0:

Image Scan Table pass Findings left
service exit 0, 55 s (database download included) 1 s 0
runner exit 0, 54 s 1 s 0
mcp-server exit 0, 62 s 2 s 0

--show-suppressed on the MCP server image lists 15 suppressed findings, and each one names only the binary of its entry (11 on the runner image, which holds no kubectl):

CVE-2026-116587 opt/devops-tools/tools/tofu/1.13.9/tofu pkg:golang/github.com/go-jose/go-jose/[email protected]
CVE-2026-56851 opt/devops-tools/tools/kubectl/1.37.2/kubectl pkg:golang/golang.org/x/[email protected]
CVE-2026-56864 opt/devops-tools/tools/tofu/1.13.9/tofu pkg:golang/golang.org/x/[email protected]
CVE-2026-56865 opt/devops-tools/tools/tofu/1.13.9/tofu pkg:golang/golang.org/x/[email protected]
CVE-2026-78661 opt/devops-tools/tools/kubectl/1.37.2/kubectl pkg:golang/golang.org/x/[email protected]
CVE-2026-78661 opt/devops-tools/tools/promtool/3.16.0/promtool pkg:golang/golang.org/x/[email protected]
CVE-2026-78661 opt/devops-tools/tools/tofu/1.13.9/tofu pkg:golang/golang.org/x/[email protected]
CVE-2026-78669 opt/devops-tools/tools/kubectl/1.37.2/kubectl pkg:golang/golang.org/x/[email protected]
CVE-2026-78669 opt/devops-tools/tools/tofu/1.13.9/tofu pkg:golang/golang.org/x/[email protected]
CVE-2026-84445 opt/devops-tools/tools/tofu/1.13.9/tofu pkg:golang/google.golang.org/[email protected]
CVE-2026-97054 opt/devops-tools/tools/kubectl/1.37.2/kubectl pkg:golang/[email protected]
CVE-2026-97054 opt/devops-tools/tools/promtool/3.16.0/promtool pkg:golang/[email protected]
CVE-2026-97054 opt/devops-tools/tools/tofu/1.13.9/tofu pkg:golang/[email protected]
CVE-2026-97054 opt/devops-tools/tools/trivy/0.76.2/trivy pkg:golang/[email protected]
CVE-2026-97054 usr/local/bin/actionlint pkg:golang/[email protected]

With the four kubectl paths changed to opt/devops-tools/tools/kubectl/1.37.1/kubectl, the scan exits 1 and reports CVE-2026-78661, CVE-2026-78669, CVE-2026-56851 and CVE-2026-97054 in opt/devops-tools/tools/kubectl/1.37.2/kubectl again.

With the three legacy files on 2026-11-20, the MCP server image fails on CVE-2026-56851 in kubectl: its exp:2026-11-20 entry stopped. So the MCP Server Image scan fails on main for each pull request that changes image content.

Measured times

  • Pull of ghcr.io/aquasecurity/trivy:0.76.2@sha256:8f6bb947... on this host: 5 s.
  • The image jobs lose 'Set up uv toolchain' and 'Install Trivy' (25-28 s for each job, issue body). The CI runs of this pull request give the time on a runner.

Ignore entries (SECURITY.md, A Finding with No Fix)

Each entry moved from a legacy file keeps its date, except one renewal.

Finding Binary Expiry Tracking
CVE-2026-116587, CVE-2026-56864, CVE-2026-56865, CVE-2026-78669, CVE-2026-78661, CVE-2026-84445 tofu 1.13.9 2026-11-21 #5866
CVE-2026-97054 tofu 1.13.9 2026-11-22 #5866
CVE-2026-78661 promtool 3.16.0 2026-11-21 #6365
CVE-2026-97054 promtool 3.16.0 2026-11-22 #6365
CVE-2026-97054 trivy 0.76.2 2026-11-22 #6366
CVE-2026-97054 actionlint 1.17.1 2026-11-22 #6367
CVE-2026-78669, CVE-2026-78661 kubectl 1.37.2 2026-11-21 #6084
CVE-2026-97054 kubectl 1.37.2 2026-11-22 #6084
CVE-2026-56851 kubectl 1.37.2 2026-11-22 (renewed from 2026-11-20) #6084

Proof of the renewal, read on 2026-11-20:

  • Trivy names the fixed version golang.org/x/text 0.41.0 for CVE-2026-56851 (HIGH).
  • The newest stable kubectl release is v1.37.2 (2026-10-28). v1.38.0-beta.0 (2026-11-06) is a pre-release.
  • go.mod of tag v1.37.2 and of branch release-1.37 holds golang.org/x/text v0.40.0.
  • The first entry is of 2026-11-08, so 2026-11-22 is the limit of 14 days in all. After that date, the owner decides.

Notes

@github-advanced-security

Copy link
Copy Markdown
Contributor

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

@dan-petty dan-petty changed the title ci(security): scan each image with one Trivy action and SARIF fix(security): scan each image with one Trivy action and SARIF Nov 20, 2026
@dan-petty
dan-petty force-pushed the ci/6405-image-scan-action-sarif branch from 09f6203 to 24f1e8b Compare November 20, 2026 00:56
@dan-petty

Copy link
Copy Markdown
Owner Author

CI record of head 24f1e8b

All 31 checks that ran passed (4 skipped), the required checks Static Analysis, Tests & Coverage and Semantic PR title included. The docker:// steps run in the composite action in all four jobs that call it.

Job Trivy image pull Scan step (pull, scan, table, SARIF upload) Before (#6472: toolchain, install, scan)
Service Image 1.5 s 33 s 49 s
Runner Image 1.6 s 36 s 56 s
MCP Server Image 2.4 s 44 s 55 s
Third-Party Image Scan 1.7 s 57 s (report only, 573 findings in the table) not measured

The SARIF upload of each job ends with "Analysis upload status is complete". The table pass prints no line on a clean image (--table-mode detailed, commit e32fca8): the first run printed the summary of each target, about 750 lines on the runner and MCP server images.

The title type is fix: the change also edits the comment of src/devops_cli/tools_lock/tools.lock, and the title check refuses a hidden type for a change under src/devops_cli/ (CONTRIBUTING.md, #5224). The change fixes the ignore entries that hid kubectl findings through the OpenTofu entries.

The table pass gets a 30 s timeout, so the scan (3 min), the table pass and the
SARIF upload end before the 4 min step timeout. docs/SDLC.md names the action
path in the trigger of the Third-Party Image Scan. .trivyignore.yaml is a
config root, not a prefix. The proposal says 'no longer name'.
@dan-petty
dan-petty marked this pull request as ready for review November 20, 2026 01:30
@dan-petty
dan-petty merged commit 26e2a99 into main Nov 20, 2026
35 checks passed
@dan-petty
dan-petty deleted the ci/6405-image-scan-action-sarif branch November 20, 2026 01:31
dan-petty-release Bot added a commit that referenced this pull request Nov 20, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.182.1](v0.182.0...v0.182.1)
(2026-11-20)


### Bug Fixes

* **devcontainer:** build the devcontainer image FROM devtools
([#6472](#6472))
([58e7b0d](58e7b0d))
* **security:** scan each image with one Trivy action and SARIF
([#6488](#6488))
([26e2a99](26e2a99))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/security Security linters (trivy, bandit, gitleaks, kubeconform) and Vault type/infra Type infra: the build, CI, images or cluster

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci(security): scan each image with one Trivy action and SARIF

2 participants