geyanggang opened a new pull request, #14778:
URL: https://github.com/apache/gravitino/pull/14778

   ### What changes were proposed in this pull request?
   
   Add a `CVE Scan` workflow that runs weekly and on manual dispatch. It builds 
the artifacts Gravitino ships and scans each one with Trivy 0.76.1:
   
   - the server distribution and the Iceberg REST and Lance REST server packages
   - 19 shaded jars: the cloud and Iceberg bundles, the client and GVFS 
runtimes, the maintenance jobs, and the Flink and Spark runtimes
   - the 6 Trino connector ranges
   - the lock files of the MCP server, the two web UIs and the Python client
   
   Trivy runs from a digest-pinned image in a hardened container without 
network access. The Trivy DBs are downloaded once per run and shared with the 
scan jobs through a cache. No third-party action is used.
   
   A target fails when a HIGH or CRITICAL finding remains after the exemptions, 
when no valid report is produced, or when an exemption has expired or does not 
follow the policy. The JSON and SARIF reports are uploaded as workflow 
artifacts and, on the main branch of apache/gravitino, to code scanning.
   
   Pre-existing findings are exempted in `.github/trivy/trivyignore.yaml`, each 
scoped to a versioned purl with a tracking issue (#14777, #14712) and a 90-day 
expiry. `.github/trivy/vex.openvex.json` is reserved for findings proven not to 
be exploitable. `.github/trivy/README.md` describes the policy and how to run 
the same scan locally.
   
   ### Why are the changes needed?
   
   Gravitino ships a large transitive dependency tree inside its packages and 
fat jars, and nothing checks it today, so problems are only found when someone 
reports them (for example #14435). This follows the Trivy scan used by Apache 
Iceberg, with two changes for Gravitino: it runs on a schedule rather than on 
every PR, because PR CI now runs in Fork CI, and it starts from an exemption 
baseline so it can be enabled before every pre-existing finding is fixed.
   
   Fix: #13751
   
   ### Does this PR introduce _any_ user-facing change?
   
   No. This only adds a CI workflow and its configuration.
   
   ### How was this patch tested?
   
   - Built all 32 targets locally on main and ran the same 
`.github/trivy/scan.sh` the workflow uses: 0 remaining findings with the 
baseline exemptions.
   - Negative checks: a removed or expired exemption, a missing jar, an invalid 
report and a failed SARIF conversion each fail the run.
   - actionlint, shellcheck, the ASF allowlist check, `node --test 
.github/scripts/tests/*.test.cjs` and RAT pass.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to