Repository navigation
fix(security): remove Trivy scanner warning/notice drift from required workflow #2107
Description
Fresh downstream evidence
Naruon central Security Scan run 34686593891 at exact ContextualWisdomLab/naruon@17c0a5c9198eeda95f6a7d86f6a35a8b05abe774 checked out the exact head correctly, but its shared trivy-fs lane emitted two non-finding diagnostics before the real vulnerability gate:
WARN [pip] Unable to find python `site-packages` directory. License detection is skipped. err="site-packages directory not found"
Notices:
- Version 0.74.0 of Trivy is now available, current version is 0.70.0
The same run then correctly failed on three inherited frontend findings (CVE-2026-75604, GHSA-2xp9-vwfh-vxw4, GHSA-rgj7-g3m4-5g8c), so this issue is not a request to weaken the vulnerability gate or to fix Naruon dependency ownership here.
Problem
The required security workflow currently accepts scanner/runtime warning and version-drift output as routine noise. CWL execution policy treats warnings/deprecation/notice drift as actionable evidence: either remove the root cause or track it explicitly. Leaving it in every downstream run makes real regressions harder to distinguish and leaves the scanner freshness policy implicit.
Required owner repair
- Determine why the central Trivy filesystem configuration attempts Python license detection without a materialized
site-packagestree. - Choose and document the intended contract:
- if license evidence is required, materialize the dependency metadata deterministically before scan; or
- if license evidence is not part of this lane, configure the scanner so it does not enter an unsupported license-detection path. Do not merely hide stderr.
- Re-evaluate the pinned Trivy
v0.70.0against currentv0.74.0; upgrade through the normal pinned-SHA/versioned owner path if compatible, with fixtures proving SARIF/fail-closed parity. If the old pin is deliberately retained, record the compatibility reason and an explicit freshness/revisit condition rather than tolerating the update notice indefinitely. - Preserve exact-head checkout verification,
CRITICAL,HIGH,MEDIUMfail-closed findings, SARIF upload, and shared-base remediation ownership. - Add an executable regression that fails if the required lane emits unexpected
WARN/deprecation/version-drift diagnostics.
GREEN acceptance
- a current exact-head downstream Security Scan is warning/notice-clean before actual findings;
- vulnerability findings still fail the gate and retain their severity/location evidence;
- scanner version/pin provenance is explicit and reproducible;
- no consumer repository copies or locally patches the central workflow to obtain silence.
Activity
seonghobae commentedon Sep 12, 2026
Upstream-root RCA — 2026-09-12
The two diagnostics have different causes and must not be “fixed” by one blanket quiet flag.
Version notice. The pinned
trivy-action@a9c7b0f…is the latest immutable action release, v0.36.0 (2026-04-22), but its declared default is Trivyv0.70.0. The current upstream Trivy release is v0.74.0 (2026-08-14). The action already supports an explicitversioninput, so freshness can be repaired without changing the action identity. Trivy's officialscan.skip-version-checkconfig is specifically defined to suppress update notices; use it only after the binary is explicitly current/pinned and record the revisit condition.Python license warning. Upgrading alone does not remove it. Current Trivy v0.74.0 still unconditionally calls
pythonSitePackagesDir()in the pip post-analyzer and logs the warning when nosite-packagestree exists: upstream source. The central lane requests onlyvuln,secret,misconfig, yet this analyzer still attempts optional license enrichment forrequirements.txt.Therefore:
hide-progress,--quiet, stderr redirection, an empty fake venv, or skip Python requirement files;vuln,secret,misconfig, MEDIUM+, SARIF, and exact-head gates;No source PR is opened from this RCA because a naïve version bump demonstrably leaves half of the acceptance failure, while quieting or dependency installation would weaken the security boundary. This issue remains the canonical owner; no consumer workaround is authorized.
seonghobae commentedon Sep 13, 2026
Fresh downstream reproduction on Naruon #1674 exact
24e6e80bc7341cfd4fc3a1b0af09a21f7b6eafe1, Security Scan run34733739231, trivy-fs job103661531163(2026-09-13):WARN [pip] Unable to find python site-packages directory. License detection is skipped.0.70.0, available0.74.0.CVE-2026-75604,GHSA-2xp9-vwfh-vxw4,GHSA-rgj7-g3m4-5g8c).This confirms the warning/version-drift noise persists independently of the real vulnerability failure. No Naruon-local suppression or workflow copy was added.
seonghobae commentedon Sep 13, 2026
Root-cause check against the scanner source (read-only, 2026-09-13):
site-packagesWARN is not gated by the license scanner. In Trivy v0.70.0 (the version the pinnedtrivy-action@a9c7b0f…v0.36.0 currently runs)pkg/fanal/analyzer/language/python/pip/pip.gocallspythonSitePackagesDir()unconditionally at the top ofPostAnalyzeand logsUnable to find python \site-packages` directory. License detection is skipped.whenever no venv/python executable is found — before it even looks at--scanners. Ourtrivy-fslane runsscanners: vuln,secret,misconfig, so license detection is never requested, yet the analyzer still attempts it. The same code is unchanged in v0.74.0 (pip.go:58-61`), so a version bump alone does not remove this warning.aquasecurity/trivy-actionlatest release is still v0.36.0 (2026-04-22), i.e. our action pin is current, but the action'sversioninput selects the Trivy binary; the run used 0.70.0 while 0.74.0 is available.Options that do not weaken the gate (materializing
site-packagesjust to silence a license path we do not use is not one of them):pythonSitePackagesDir()unless the license scanner is enabled (--scanners license/--license-full). That is the root-cause fix for warning 1; until it lands, the warning is an accepted-with-owner upstream defect and should stay tracked here, not suppressed.versioninput explicitly to the current Trivy release after checking its changelog for scanner/SARIF behaviour changes, and add the pin to the existing runner/image contract tests so drift becomes a test failure rather than a log notice. This removes warning 2 only.Not changed in this session:
security-scan.ymlis currently being modified by #2143 (OSV flags, same file), so a Trivy edit should sequence after it to avoid a hot-file conflict. Next review date for this issue: 2026-09-20 (same as #2142, both aresecurity-scan.ymlruntime-quality items).