Repository navigation
fix(scanners): skip osv with no sources, ignore Dockerfile stage names - #97
Conversation
Second-model reviewScope: the whole branch ( No blocking finding. Checked:
Leftovers: none. Verdict: approve In plain EnglishSecGate called its dependency scanner "clean" on a project where that scanner had found nothing it could read, which hid the fact that nothing was checked; it now says "skipped" and why. It also tried to download a Docker image named after a build step inside the project's own Dockerfile, failed, and then reported the container scan as broken; it now skips those internal names. Nothing else changes, and version 0.3.2 is ready to tag. The remaining risk is small: unusual Dockerfile forms, such as image names built from variables, are handled as before. |
No issue to close: both problems came from a demo rehearsal of SecGate 0.3.1 on public repositories.
What changed
skipped, notclean(lib/scanners.mjs,runOsvScanner).cleanand scored it 100.skippedwith the reasonno package sources found, and it gets no tool score.266448a: the repository commits no lockfile (.npmrcsetspackage-lock=false).lib/scanners.mjs,extractBaseImages).FROMthat names an earlier stage of the same Dockerfile (FROM node:20 AS base...FROM base AS production) is no longer passed totrivy image.trivy image basefailed, the image scan endederror, and Trivy counted as not run.infrastructure/Dockerfile:14and documenso/documensodocker/Dockerfile:13,34,98.no package sources foundis not a coverage gap (secgate.js,NOT_A_GAP). Likeno package.json in targetfor npm audit, there was nothing for the scanner to read. A run whose only skip is this reason can still PASS, as it did when osv-scanner saidclean; the console, JSON and HTML now show the skip and its reason. The alternative, a gap, would make such a run INCOMPLETE (exit 2), so a repository with no dependencies at all would stop passing.package.jsonandpackage-lock.json;## [0.3.2] - 2026-11-15and compare links;docs/tuning.mdversion line.Proof
test/smoke.mjs. "On main" means the branch's test file run against81d61ad: 53 passed, 2 failed.image scan status: expected clean, got errorosv status: expected skipped, got cleanGate
npm ci && npm run check:deps && npm run lint && npm teston Node 22.23.4 at10d16d7, exit 0:Not changed
FROM ${ARG}image reference, and Dockerfiles with CRLF line endings, are handled as before.