Repository navigation
Offline advisory DBs older than 7 days read as not checked, not clean - #2551
Merged
Merged
Conversation
review_checks.sh ran osv-scanner and trivy on a provisioned offline DB with no age check, so a weeks-old cache made the weekly forced --full rescan look like a fresh advisory check. provision_tools.sh --age reports the DB age (trivy UpdatedAt, oldest osv zip at any depth); review_checks.sh adds a not-checked row naming the age and the refresh command when it exceeds REVIEW_ADVISORY_MAX_AGE_DAYS (default 7; a non-integer value warns and falls back to 7), and an "of known age" row when the age is unreadable. trivy now scans the same dir that is age-checked (provision_tools.sh --cache trivy-dir) and its hint matches the warm command. audit_sweep.py classifies both rows as ENVGAP. FULL_EVERY comment and docstring corrected. test-scanner-offline-db.sh now expects that warm command as the trivy hint, and test-scanner-sandbox-fallback.sh sets DCR_CACHE_ROOT, so a stale trivy DB in the host cache no longer decides its rows. The real-hub CI job pins its trivy DB by digest, so that DB is older than 7 days by design; the job now sets REVIEW_ADVISORY_MAX_AGE_DAYS=36500, because it checks tool wiring and test-review-checks-advisory-age.sh covers the age gate. Tests: 6/6 audit_sweep_staledb, 13/13 provision-advisory-age, 11/11 review-checks-advisory-age (4 red against the old code), 21/21 scanner-offline-db, 12/12 scanner-sandbox-fallback (red on a host with an 8-day-old trivy DB before the fix), 61/61 provision-tools; 51 other trivy-touching review_checks tests green locally; test-review-checks-real-hub.sh cannot fill the Go build cache in the local sandbox and runs in CI; audit_sweep*.py, osv-fallback, size-ratchet and fragments green Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What:
review_checks.shnow reads an offline osv-scanner or trivy advisory DB older thanREVIEW_ADVISORY_MAX_AGE_DAYS(default 7) asNOT CHECKED, naming its age and the refresh command, instead of reporting a clean pass.Why: a provisioned offline DB had no age check, so a weeks-old cache made the weekly forced
--fullrescan inaudit_sweep.pylook like a fresh advisory check.How:
provision_tools.sh --age trivy|osv DIRprints the DB age in whole days (trivyUpdatedAt; for osv, the oldest zip at any depth).review_checks.shadds a not-checked row when the age is over the limit or cannot be read. A non-integer limit warns and falls back to 7.provision_tools.sh --cache trivy-dir), and its hint matches the warm command.audit_sweep.pyclassifies both rows as ENVGAP.REVIEW_ADVISORY_MAX_AGE_DAYS=36500, because it checks tool wiring;test-review-checks-advisory-age.shcovers the gate.Trade-off: trivy now always gets
--cache-dir, pointing at the dir that is age-checked. WithDCR_CACHE_ROOTset and a DB only in trivy's own default dir, trivy reads as not run and prints the warm command, instead of scanning a cache with no age check. Default installs are unchanged.Tests:
test-review-checks-real-hub.shcannot fill the Go build cache in the local sandbox, so it runs in CI only.🤖 Generated with Claude Code