Skip to content

refactor(ci): drop aquasecurity/trivy-action, use direct trivy binary#1940

Merged
Aureliolo merged 3 commits into
mainfrom
refactor/trivy-direct
May 16, 2026
Merged

refactor(ci): drop aquasecurity/trivy-action, use direct trivy binary#1940
Aureliolo merged 3 commits into
mainfrom
refactor/trivy-direct

Conversation

@Aureliolo
Copy link
Copy Markdown
Owner

Summary

Drops the aquasecurity/trivy-action@v0.36.0 wrapper from all 7 callsites and replaces each with direct trivy image shell invocations. The trivy binary is curl-installed + sha256-verified, with TRIVY_VERSION (.github/workflows/docker.yml:47) as the single source of truth.

Why

  • Drops dual-pinning maintenance: every trivy-action callsite carried a literal version: v0.70.0 plus a Renovate marker, in addition to the curl-installed copy tracked by the TRIVY_VERSION env. Renovate had to keep both in sync.
  • Removes zizmor template-injection ignores: 1 inline # zizmor: ignore[template-injection] block (on the trivy-action with: in build-apko-base) AND 1 workflow-level ignore (template-injection: ignore: docker.yml in .zizmor.yml) gone. The new run: steps consume their refs via env: blocks, which zizmor doesn't flag.
  • Smaller supply-chain surface: one less external action dependency. The curl + sha256 install is the same trust root as the action's bootstrap path.

Callsites replaced (7)

File Step Format
.github/actions/build-apko-base/action.yml Trivy SARIF scan SARIF
.github/actions/build-scan-image/action.yml Trivy scan (amd64) JSON
.github/actions/build-scan-image/action.yml Trivy scan (arm64) JSON
.github/actions/build-scan-image/action.yml Trivy SARIF scan (amd64) SARIF
.github/actions/build-scan-image/action.yml Trivy SARIF scan (arm64) SARIF
.github/workflows/docker.yml Trivy scan (web) JSON
.github/workflows/docker.yml Trivy SARIF scan (web) SARIF

Plumbing

  • New trivy-version input on .github/actions/build-scan-image/action.yml (required, no default). Composites don't inherit workflow env:, so the version is threaded through. Four callers updated in docker.yml: build-backend, build-sandbox, build-sidecar, build-fine-tune matrix.
  • New Install Trivy step (curl + sha256 + tar; identical shape to the existing one at build-apko-base/action.yml:95-103) added to build-scan-image and to docker.yml build-web. build-apko-base already had one.
  • Behaviour preserved byte-for-byte: same output paths, same --severity CRITICAL,HIGH, same --exit-code 0, same --ignorefile .github/.trivyignore.yaml, same SARIF categories on the downstream codeql-action/upload-sarif steps. The JSON scans still feed scripts/evaluate-scan.sh (CRITICAL = fail, HIGH = warn).

Adjacent fix

  • .github/workflows/docker.yml Report image size (build-web): switched ${{ steps.scan-ref.outputs.ref }} from inline interpolation to an env: block. This is a pre-existing template-injection finding that the now-removed workflow-level .zizmor.yml ignore had been masking; the env-block pattern matches the new trivy steps. Without this fix the workflow-level ignore would have to be restored.

Test plan

  • uv run pre-commit run actionlint --all-files passes
  • uv run pre-commit run zizmor --all-files passes with fewer ignores than before (-1 inline, -1 workflow-level)
  • grep -r "trivy-action" .github/ empty
  • grep -r "version: v0.70.0" .github/ empty
  • Live CI: every job under .github/workflows/docker.yml (backend / sandbox / sidecar / fine-tune / web bases + apps + retag) must complete Trivy JSON, SARIF upload, and evaluate-scan.sh steps successfully on this PR. The PR run is the only way to validate end-to-end since the workflow only fires on pull_request: branches: [main] and push: branches: [main].

Review coverage

Pre-reviewed locally by 3 agents:

  • docs-consistency: zero drift; no doc names aquasecurity/trivy-action or describes the dual-pin pattern.
  • comment-quality-rot: no reviewer citations, no issue back-refs, no migration framing in any new comment.
  • infra-reviewer: template-injection wrap verified across all surviving ${{ ... }} interpolations; supply-chain sha256 check is set -e-safe; action SHA pins preserved; composite trivy-version input passed by all 4 callers; no permission broadening; no --no-verify; no secret echoing.

One MINOR finding (infra-reviewer) was addressed in commit f276952e: dropped a redundant env: TRIVY_VERSION: ${{ env.TRIVY_VERSION }} block on the Install Trivy step in build-web (workflow-level env was already visible).

Out of scope

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 16, 2026

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

  • .github/workflows/docker.yml

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 16, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 12e6daef-ee67-49e5-87d7-4478dfd95366

📥 Commits

Reviewing files that changed from the base of the PR and between f276952 and 635ab80.

📒 Files selected for processing (4)
  • .github/.zizmor.yml
  • .github/actions/build-apko-base/action.yml
  • .github/actions/build-scan-image/action.yml
  • .github/workflows/docker.yml
💤 Files with no reviewable changes (1)
  • .github/.zizmor.yml
📜 Recent review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (19)
  • GitHub Check: Build Sidecar
  • GitHub Check: Build Backend
  • GitHub Check: Build Fine-Tune (gpu, fine-tune-gpu)
  • GitHub Check: Build Fine-Tune (cpu, fine-tune-cpu)
  • GitHub Check: Build Sandbox Base (apko)
  • GitHub Check: Build Web Assets (melange)
  • GitHub Check: Dashboard Lint
  • GitHub Check: Dashboard Type Check
  • GitHub Check: Dashboard Build
  • GitHub Check: Runtime Stats Freshness Gate
  • GitHub Check: Dashboard Test
  • GitHub Check: Test (Python 3.14)
  • GitHub Check: Lint
  • GitHub Check: Type Check
  • GitHub Check: Build Preview
  • GitHub Check: Analyze (actions)
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Analyze (python)
  • GitHub Check: Analyze (go)
🔇 Additional comments (15)
.github/actions/build-scan-image/action.yml (6)

92-94: LGTM!


314-323: LGTM!


328-335: LGTM!


344-352: LGTM!


371-379: LGTM!


388-396: LGTM!

.github/actions/build-apko-base/action.yml (2)

103-104: LGTM!


122-131: LGTM!

.github/workflows/docker.yml (7)

535-535: LGTM!


814-824: LGTM!


826-831: LGTM!


836-842: LGTM!


952-952: LGTM!


1015-1015: LGTM!


1102-1102: LGTM!


Walkthrough

This PR replaces aquasecurity/trivy-action with direct trivy CLI invocations across composite actions and workflows. It adds a required trivy-version input, downloads and verifies a pinned Trivy release, installs the trivy binary to /usr/local/bin/trivy, and runs trivy image to produce JSON and SARIF reports (amd64 and optional arm64) using CRITICAL/HIGH severities and the repository ignorefile. Workflows are wired to pass TRIVY_VERSION to the build-scan-image action; the web job installs Trivy and runs JSON evaluation plus an always-run SARIF scan. Zizmor config now ignores cla.yml.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely summarizes the main change: replacing aquasecurity/trivy-action with direct trivy binary invocations across multiple files.
Description check ✅ Passed The description is comprehensive and directly related to the changeset, covering the motivation, implementation details, and testing approach for replacing trivy-action with direct CLI invocations.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request replaces the aquasecurity/trivy-action with manual Trivy CLI installation and execution within the build-apko-base and build-scan-image composite actions. It introduces a new trivy-version input and adds a manual installation step that includes checksum verification. Feedback was provided regarding a potential permission issue in the installation step, as extracting the Trivy binary to /usr/local/bin on standard GitHub-hosted runners typically requires sudo privileges.

curl -sfL --retry 5 --retry-delay 5 --retry-all-errors "https://github.com/aquasecurity/trivy/releases/download/v${TRIVY_VERSION}/trivy_${TRIVY_VERSION}_Linux-64bit.tar.gz" -o "/tmp/trivy_${TRIVY_VERSION}_Linux-64bit.tar.gz"
curl -sfL --retry 5 --retry-delay 5 --retry-all-errors "https://github.com/aquasecurity/trivy/releases/download/v${TRIVY_VERSION}/trivy_${TRIVY_VERSION}_checksums.txt" -o /tmp/trivy_checksums.txt
(cd /tmp && grep "trivy_${TRIVY_VERSION}_Linux-64bit.tar.gz" trivy_checksums.txt | sha256sum -c -)
tar -xzf "/tmp/trivy_${TRIVY_VERSION}_Linux-64bit.tar.gz" -C /usr/local/bin trivy
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The tar command attempts to extract the trivy binary into /usr/local/bin. On standard GitHub-hosted runners (ubuntu-latest), this directory is owned by root and typically requires sudo for write access. Since sudo is used elsewhere in this file (e.g., line 136 for disk cleanup), it should likely be applied here as well to prevent permission denied errors during installation.

        sudo tar -xzf "/tmp/trivy_${TRIVY_VERSION}_Linux-64bit.tar.gz" -C /usr/local/bin trivy

@Aureliolo Aureliolo temporarily deployed to cloudflare-preview May 16, 2026 16:48 — with GitHub Actions Inactive
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/docker.yml:
- Around line 818-823: The "Install Trivy" job currently extracts the tarball
directly into /usr/local/bin (root-owned) which causes a permission error;
change the step to extract into a temporary directory (e.g., /tmp) and then move
or install the binary into /usr/local/bin using sudo (use the "Install Trivy"
step, extract "/tmp/trivy_${TRIVY_VERSION}_Linux-64bit.tar.gz" to /tmp, validate
checksums as before, and then run sudo install or sudo mv to place the trivy
binary into /usr/local/bin so the action no longer fails with Permission
denied).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: b1fb9869-8bc0-44cc-8289-a2790fff2e3c

📥 Commits

Reviewing files that changed from the base of the PR and between d19fae5 and f276952.

📒 Files selected for processing (4)
  • .github/.zizmor.yml
  • .github/actions/build-apko-base/action.yml
  • .github/actions/build-scan-image/action.yml
  • .github/workflows/docker.yml
💤 Files with no reviewable changes (1)
  • .github/.zizmor.yml
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (19)
  • GitHub Check: Build Backend
  • GitHub Check: Build Fine-Tune (cpu, fine-tune-cpu)
  • GitHub Check: Build Fine-Tune (gpu, fine-tune-gpu)
  • GitHub Check: Build Sidecar
  • GitHub Check: Dashboard Type Check
  • GitHub Check: Dashboard Test
  • GitHub Check: Dashboard Build
  • GitHub Check: Dashboard Lint
  • GitHub Check: Test (Python 3.14)
  • GitHub Check: Type Check
  • GitHub Check: Runtime Stats Freshness Gate
  • GitHub Check: Lint
  • GitHub Check: Build Web Assets (melange)
  • GitHub Check: Build Sandbox Base (apko)
  • GitHub Check: Build Preview
  • GitHub Check: Analyze (python)
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Analyze (actions)
  • GitHub Check: Analyze (go)
🔇 Additional comments (8)
.github/actions/build-scan-image/action.yml (6)

92-94: LGTM!


314-322: LGTM!


327-334: LGTM!


343-351: LGTM!


370-378: LGTM!


387-395: LGTM!

.github/actions/build-apko-base/action.yml (1)

121-130: LGTM!

.github/workflows/docker.yml (1)

535-535: LGTM!

Also applies to: 814-816, 826-841, 951-951, 1014-1014, 1101-1101

Comment thread .github/workflows/docker.yml Outdated
@codecov
Copy link
Copy Markdown

codecov Bot commented May 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.14%. Comparing base (d19fae5) to head (635ab80).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1940   +/-   ##
=======================================
  Coverage   85.14%   85.14%           
=======================================
  Files        1846     1846           
  Lines      107752   107752           
  Branches     9287     9287           
=======================================
  Hits        91747    91747           
  Misses      13757    13757           
  Partials     2248     2248           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Aureliolo Aureliolo force-pushed the refactor/trivy-direct branch from f276952 to 635ab80 Compare May 16, 2026 16:58
@Aureliolo Aureliolo temporarily deployed to cloudflare-preview May 16, 2026 17:00 — with GitHub Actions Inactive
@Aureliolo Aureliolo merged commit df1f946 into main May 16, 2026
79 checks passed
@Aureliolo Aureliolo deleted the refactor/trivy-direct branch May 16, 2026 17:14
@Aureliolo Aureliolo temporarily deployed to cloudflare-preview May 16, 2026 17:14 — with GitHub Actions Inactive
Aureliolo pushed a commit that referenced this pull request May 17, 2026
<!-- HIGHLIGHTS_START -->
## Highlights

> _AI-generated summary (model: `openai/gpt-4.1-mini` via GitHub
Models). Commit-based changelog below._

### What you'll notice
- Frontend WP-6 update with UX polish improves user interface and
workflow.
- Dashboard and training endpoint improvements enhance observability and
dispatch behavior.
- Web storybook now supports change detection for more responsive UI
interactions.
- Git hooks now isolated per worktree for cleaner repository management.
- Providers automatically detect native streaming support in Litellm
models.

### What's new
- Added a new pipeline to convert Pydantic DTOs to TypeScript for better
front-end compatibility.

### Under the hood
- Refactored settings to three precedence categories, removing YAML tier
for simpler configuration.
- Completed RootConfig mirror coverage for enhanced configuration
consistency.
- Adopted API conventions with better query performance and forbidden
extra fields for stricter validation.
- Improved persistence, layer discipline, and restart safety in core
work packages.
- CI updated with split test jobs and tightened coverage gates for
better test quality.
- Switched to direct Trivy binary for security scans, removing previous
Trivy action dependency.
- Enhanced memory management with per-call processing options and better
observability during speech-to-text encoding.
- Various dependency updates for Python, infrastructure, and lock files
maintain security and stability.
- Removed TypeScript DTO type-tightening overlays to simplify type
management.
- Codebase audit tightened skill sets to prevent false positivity in
class detection by 2026.

<!-- HIGHLIGHTS_END -->

:robot: I have created a release *beep* *boop*
---


##
[0.8.5](v0.8.4...v0.8.5)
(2026-05-17)


### Features

* **codegen:** pydantic-to-typescript DTO pipeline + parity gate (closes
[#1889](#1889))
([#1909](#1909))
([0265ef5](0265ef5))
* **storybook:** enable changeDetection + trim web/CLAUDE.md
([#1939](#1939))
([3b1f4c0](3b1f4c0))
* **web,setup:** WP-6 frontend + UX polish
([#1941](#1941))
([d9ca76d](d9ca76d))


### Bug Fixes

* correct invalid git for-each-ref syntax in post-merge-cleanup skill
([#1946](#1946))
([69a1649](69a1649))
* dashboard polish, training endpoint dispatch, and observability
cleanup ([#1911](#1911))
([b61e9e8](b61e9e8))
* per-worktree git-hook isolation + hookify gate migration + MSW drift
fix ([#1949](#1949))
([e3f8495](e3f8495))
* **providers:** read supports_native_streaming from litellm model info
([#1942](#1942))
([60364ca](60364ca))
* security and audit coverage (closes
[#1883](#1883))
([#1904](#1904))
([d8ebf55](d8ebf55))


### Performance

* **ci:** mypy --num-workers=4 + enable ruff TID255
([#1944](#1944))
([484c1d3](484c1d3))


### Refactoring

* **ci:** drop aquasecurity/trivy-action, use direct trivy binary
([#1940](#1940))
([df1f946](df1f946))
* **memory:** per-call processing_kwargs + observability for ST encode
([#1943](#1943))
([3aa9d20](3aa9d20))
* Phase 7 follow-up — complete RootConfig mirror coverage (closes
[#1907](#1907))
([#1914](#1914))
([605500b](605500b))
* **settings:** collapse precedence to three categories; drop YAML tier
(closes [#1890](#1890))
([#1910](#1910))
([efd54c9](efd54c9))
* WP-3 API conventions + query performance + project-wide extra=forbid
([#1953](#1953))
([504d579](504d579)),
closes [#1918](#1918)
* WP-4 settings + cross-cutting (clock seam, contextvars, dispatch,
plugin surfaces)
([#1954](#1954))
([7207d92](7207d92))
* **wp1:** persistence + layer discipline + restart safety
([#1945](#1945))
([57586fb](57586fb))


### Documentation

* **wp5:** public-facing truth refresh
([#1924](#1924))
([afb5cc5](afb5cc5))


### CI/CD

* split test job by marker with airtight aggregate coverage gate
([#1948](#1948))
([0b818d5](0b818d5)),
closes [#1938](#1938)
[#1937](#1937)


### Maintenance

* **codebase-audit:** tighten skill to prevent 2026-05-15 FP classes
([#1923](#1923))
([9317ed1](9317ed1))
* Lock file maintenance
([#1913](#1913))
([c08a355](c08a355))
* Lock file maintenance
([#1950](#1950))
([8940ab1](8940ab1))
* remove TS DTO type-tightening overlays
([#1915](#1915))
([d296214](d296214)),
closes [#1906](#1906)
* Update Infrastructure dependencies
([#1928](#1928))
([d19fae5](d19fae5))
* Update Python dependencies
([#1929](#1929))
([75cc2c8](75cc2c8))
* **wp7:** hygiene, stubs, test/CI/tooling, doc gaps, boundary patterns
doc ([#1926](#1926))
([c29eb32](c29eb32))

---
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: synthorg-repo-bot[bot] <279117679+synthorg-repo-bot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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