Skip to content

Test: Trivy scan workflow behaviour - #2

Closed
rmoff wants to merge 26 commits into
mainfrom
trivy-test-push
Closed

rmoff wants to merge 26 commits into
mainfrom
trivy-test-push

Conversation

@rmoff

@rmoff rmoff commented Mar 20, 2026

Copy link
Copy Markdown
Owner

Temporary PR to test Trivy scan workflow behaviour across scenarios.
This will be closed after testing.

rmoff and others added 5 commits February 24, 2026 14:07
Scan the built Kafka Connect distribution zip for known
vulnerabilities using Trivy. This runs alongside the existing
tests on PRs and pushes to main/version branches, and also
on release candidate tags, giving visibility into CVEs before
a release vote starts.

- Table output on all runs (visible in CI logs)
- SARIF upload to GitHub Security tab on push events

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Match the convention used in spark-ci.yml for third-party actions.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Address review feedback: move the vulnerability scan steps into the
existing kafka-connect-tests job (gated on JVM 21) instead of running
a separate job that duplicates checkout, setup, and compilation.

Also adds inline comments explaining the scan behaviour and explicit
exit-code: '0' to ensure the scan is report-only (the default would
fail the build on findings).
Change exit-code from 0 to 1 so the scan step fails visibly when
CRITICAL/HIGH CVEs are found, but add continue-on-error: true so
the overall job still passes.
Temporary commit for testing Trivy scan behaviour on fork.
Adds trivy-test-* to push branch triggers to test push events.
Improves inline comments explaining continue-on-error and exit-code.
Removes redundant explicit exit-code: '0' from SARIF scan.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@github-actions github-actions Bot added the INFRA label Mar 20, 2026
rmoff and others added 11 commits March 20, 2026 16:46
Temporary commit — will be reverted after testing.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
The SARIF scan needs explicit exit-code: '0' — trivy defaults to
exiting 1 when findings exist, which failed the SARIF step in the
previous test run.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
The second trivy-action invocation fails during Trivy binary
installation — the binary is already installed by the first scan.
Adding skip-setup-trivy: true avoids the reinstall conflict.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
The trivy-action's setup step fails when invoked twice in the same
job because the binary is already installed at the same path.
Instead, call the trivy CLI directly for the SARIF output — it's
already on PATH from the first action invocation.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
trivy-action installs to $HOME/.local/bin/trivy-bin but doesn't
add it to GITHUB_PATH, so subsequent shell steps can't find it.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Use one trivy-action call that outputs SARIF, then parse it with
jq for human-readable CI log output. Avoids dual-invocation binary
conflict. Updated to trivy-action v0.35.0.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
fs mode doesn't detect CVEs in shaded jars (e.g. jackson-core inside
parquet-jackson). rootfs mode does. This should trigger CVE findings
for scenarios #2 and apache#4.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
- Replace aquasecurity/trivy-action with lhotari/sandboxed-trivy-action
  (v1.0.1, pinned to commit SHA) to address the Trivy supply chain
  compromise. The sandboxed action is ASF-allowlisted and runs Trivy
  inside a locked-down Docker container.
- Remove temporary trivy-test-* branch trigger.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
The previous SHA (c4a7bc33...) was flagged by zizmor as an impostor
commit not found in github/codeql-action's history. Update to v4
(c10b8064...) to match the rest of the repo and use a verified SHA.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
v1.0.2 adds rootfs scan-type support, which was the blocker
for this PR.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@rmoff
rmoff force-pushed the trivy-test-push branch from 96fe23e to 7a40ba6 Compare April 15, 2026 09:40
rmoff and others added 2 commits April 15, 2026 10:47
All current CVEs are HIGH or MEDIUM, so CRITICAL-only will produce
zero findings — testing scenarios #1 (PR, no CVEs) and #3 (push, no CVEs).

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@rmoff
rmoff force-pushed the trivy-test-push branch from 7a40ba6 to 0dcf923 Compare April 15, 2026 10:44
rmoff and others added 8 commits April 15, 2026 11:50
Restore severity to CRITICAL,HIGH and remove trivy-test-* trigger.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Investigating why trivy 0.69.3 --exit-code 1 exits 0 locally
but CI shows exit code 1. Adding direct docker run tests.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Without limit-severities-for-sarif, the sandboxed-trivy-action
unsets TRIVY_SEVERITY when format is SARIF, causing exit-code 1
even for MEDIUM-only findings. This flag preserves the severity
filter so that only CRITICAL/HIGH CVEs trigger the warning.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@rmoff rmoff closed this Apr 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant