Repository navigation
Add CVE Watch scanner and isolated CI workflow - #26
Conversation
Import the standalone scanner from shjala/eve-cvewatch at 28cc815e253a996d203396435620db717c908542. Keep tools and documentation under cvewatch while exposing the reusable workflow at the repository root. Build PR and baseline inputs in isolated jobs and scan their data on a fresh runner. Preserve the source scanner behavior and adapt workflow paths and regression tests for the new layout. Validation: 71 local regressions, Bash syntax, and actionlint with only its documented workflow context warnings excluded. The source commit was also validated with published EVE release and master images. Signed-off-by: Shahriyar Jalayeri <shahriyar@posteo.de>
Resolve the base branch tip before builds and use the same commit for baseline inputs and the exception policy. Fetch .cve-ignore directly from Git in the trusted scanner job, ignoring policy files supplied by either build artifact. Require exception changes to be reviewed and merged into the base branch before they can suppress findings in another PR. Document the separate-PR workflow. Fail on policy retrieval errors and retain policy commit provenance with reports. Validation: 80 regressions including real local Git and gate bypass cases; successful policy fetch against EVE master; Bash syntax and workflow lint. Signed-off-by: Shahriyar Jalayeri <shahriyar@posteo.de>
eriknordmark
left a comment
There was a problem hiding this comment.
The trust split looks right: fork code builds on a disposable read-only runner, the scan runs on a fresh runner from the workflow's own checkout, and .cve-ignore is read from Git at a base SHA pinned before either build. I found no way for a PR to apply its own exceptions. Points below; 2 and 9 may belong on lf-edge/eve#7073 rather than here, since they are about how the caller invokes this workflow.
Before merge
-
"Re-run failed jobs" likely can't work. Artifacts are named
cve-input-{role}-${{ github.run_attempt }}. Re-running onlypr-scanlooks forcve-input-pr-2while the un-rerun builds uploaded-1, and it reusesresolve's oldbase_sha, so a newly merged exception still wouldn't apply. (Reasoned from re-run semantics, not tested.) Either document "Re-run all jobs" in the exception flow, or havepr-scanfail with a message saying so. -
The PR author chooses the baseline.
base_refcomes frompull_request.base.ref, and the caller doesn't passeve-base-ref. Retargeting the PR to another lf-edge/eve branch changes both the baseline (an older branch with more known CVEs hides new ones) and which.cve-ignoreapplies. With thepull_request_reviewtrigger, retarget → review → retarget back to master leaves the green result in place. Ancient branches likely fail to build (fails closed), but recent*-stablebranches would build. Suggest accepting onlymasterand*-stableinresolve_inputs.py, and/or having the caller pin the base. -
Exceptions are global per vulnerability ID.
is_ignoredmatches ID and aliases only, so an entry approved for CVE-X in package A also suppresses CVE-X in package B, and a GHSA entry suppresses its aliased CVE. Consider scoping entries to a package (e.g.CVE-X pkg:apk/alpine/foo), or at least documenting it. An optional reason/expiry column would keep the list from only growing.
Hardening / minor
-
The checkout relies on
job.workflow_repository/job.workflow_shabeing non-empty. If either ever evaluates empty,actions/checkoutfalls back to the caller repo at the PR ref, and a PR addingcvewatch/ci/*to EVE would run its own scanner in the trusted job. A one-line guard step that fails on empty values closes this. -
The fork build has sudo on a hosted runner and can read the runner's
ACTIONS_RUNTIME_TOKEN, so it could uploadcve-input-base-Nahead of the base job. That only makes the base upload collide and the gate fail, and gains nothing over faking its own SBOM, but it is worth a line in the threat-model docs. -
The master baseline SBOM comes from the published image (
docker run … sbom) while the PR side ismake … pkgs sbomfrom source. Differences between the two generators show up as noise or misses;scanner-parity-review.mdtouches this, but it would help to say which side is authoritative. -
lfedge/eve:0.0.0-master-<sha8>-kvm-amd64usually isn't published until a while after merge, so scans in that window silently build master from source. Correct but slow; worth logging prominently. The "immutable image identity" comment inget_sbom.shis a mutable tag. -
New files carry
Copyright (c) 2026 Zededa, Inc.; check that matches eve-tools convention. Consider addingcvewatch/owners toMAINTAINERS.md. -
Caller-side, pre-existing: triggering on
pull_request_review: submittedmeans commits pushed after the last review are never scanned. Worth fixing while #7073 changes the caller.
Signed-off-by: Shahriyar Jalayeri <shahriyar@posteo.de>
Signed-off-by: Shahriyar Jalayeri <shahriyar@posteo.de>
Signed-off-by: Shahriyar Jalayeri <shahriyar@posteo.de>
eriknordmark
left a comment
There was a problem hiding this comment.
LGTM.
I manually ran it throrugh the same workflow linters as we use in EVE with no noticable issues.
EVE's CVE gate currently depends on a workflow in a personal repository and accepts exceptions from the PR being scanned. This imports the standalone CVE Watch scanner into
eve-toolsand requires approved base-branch exceptions, so a PR cannot suppress its own new findings.The scanner is imported from
shjala/eve-cvewatchcommit28cc815e253a996d203396435620db717c908542(merged PR #5). Tools, tests, and documentation live undercvewatch/;.github/workflows/cve-scan.ymlexposes the reusable gate..cve-ignoreto that same full SHA..cve-ignoreindependently from Git in the trusted scanner job without checking out or executing source code. Ignore policy files supplied by either build artifact. Missing policy means no exceptions; retrieval errors and invalid files fail the run. Include the applied policy and commit provenance in the report artifact.Validation: all 83 local regressions pass, including real Git branch-tip/pinning checks, build/scan isolation, policy retrieval failures, and a comparison test proving PR/build-artifact exceptions cannot bypass the gate. A live policy fetch against EVE master also passed without checking out its source. Bash syntax and
git diff --checkpass. Actionlint 1.7.12 passes with only its unknown-property warnings for GitHub.com's documentedjob.workflow_repositoryandjob.workflow_shacontexts excluded.The imported source commit previously passed simulated CI with published EVE release and master images and live feeds, including positive/negative/ignore gates and malformed-input failure. That live-feed simulation and full EVE source builds were not repeated for this migration.
Untrusted builds can still fabricate their own SBOM; source review remains necessary. They cannot supply the exception policy used by the trusted scan job. The reusable workflow requires GitHub.com. This PR does not switch EVE's caller; the dependent draft lf-edge/eve#7073 will pin the merged upstream commit before activation.
The dependent EVE draft #7073 also now runs for new commits and PR edits and cancels superseded PR checks. It remains a draft with the upstream pin/base-input switch pending merge. Package-scoped exceptions and enforced expiry remain deferred format changes; no scanner matching behavior was changed.