Commit Graph
394 Commits
Author SHA1 Message Date
lukaszraczylo a685b71c7f fix(ui): rank most requested packages by the stored download counts
The ranking read in-memory analytics, so it was empty after every restart
while the Downloads chart and the package pages read the database. It now
sums the stored counts per package, counts a Go module once by its zip,
and says which ranking is kept across restarts and which is not.
2026-11-24 02:06:14 +00:00
lukaszraczylo 798fadb4bb fix(ui): load package details from the single-package endpoint
The details page filtered the grouped package list to find its row. It
now requests /api/packages/{registry}/{name}/{version}, which also
resolves Go modules and PyPI release versions.
2026-11-24 02:06:13 +00:00
lukaszraczylo 4b2ec7c45c fix(ui): show stored downloads when analytics hold no record
The Downloads tab hid the stored count when analytics had no record since
the last restart, and it requested a Go file key per version. It now
always shows the stored count, labels the in-memory totals as counted
since the restart, and asks for a Go module by its path. A failed
request is reported instead of a 404 being swallowed.
2026-11-24 02:06:06 +00:00
lukaszraczylo 8b6f1ae4ac feat(api): serve one package version at /api/packages/{registry}/{name}/{version} 2026-11-24 02:05:57 +00:00
lukaszraczylo bc56b97677 fix(api): answer 200 when analytics hold no record for a package
Analytics live in memory and restart empty. A package with no record yet
returned 404, which every browser logs as a failed request on the
Downloads tab. The endpoint now returns a null package.
2026-11-24 02:05:55 +00:00
lukaszraczylo 7470c41560 fix(analytics): keep package names and count artifact downloads only
The proxy passed request-buffer names to the analytics engine, which kept
them. The server reuses those buffers, so later requests rewrote the
stored names (for example lodash became lodas, and API paths appeared as
package names). The engine now copies the names it keeps.

Metadata pages (npm packuments, Go list, info and mod files, PyPI pages)
no longer count as downloads, and a Go module is one analytics key by its
module path. The version count now counts distinct versions.
2026-11-24 02:05:53 +00:00
lukaszraczylo 8b4d4746df feat(ui): show advisory aliases and offer a bypass for each id
The vulnerability table lists the other ids of a finding. The expanded
row links to the bypass form for the id and for each alias.
2026-11-24 01:39:54 +00:00
lukaszraczylo 43e075baf3 feat(scanner): match bypasses and merge findings across advisory aliases
Scanners report one advisory under different ids, such as a GHSA id from
OSV and the CVE id from Trivy. Findings now carry an aliases list.
The merge folds findings that share any id into one finding. A bypass
for any id of a finding now covers it. Stored findings without aliases
still load and match by their own id.
2026-11-24 01:39:51 +00:00
lukaszraczylo 64793f9c7e feat(ui): page, filter and sort packages on the server
The packages and security pages ask for one page of rows instead of the whole cache. Search is debounced, and the filters and sort stay in the URL.
2026-11-24 01:33:30 +00:00
lukaszraczylo 55c60cb8e4 feat(api): serve filtered, sorted pages of package rows
GET /api/packages?layout=rows adds q, registry, verdict, severity, sort, order, page and page_size, and returns total and per-verdict counts. Requests without layout=rows keep the existing response.
2026-11-24 01:33:27 +00:00
lukaszraczylo ad8295455d fix(ui): clearer hold reasons, aligned details and chart states
Render the hold reason as a sentence, pluralise counts, give the details grid a fixed rhythm, use distinct registry colours, label the plotted series, and show a note for a single day of history.
2026-11-24 01:27:22 +00:00
lukaszraczylo 6e8ac5265c fix(prewarming): run a manual cycle on the worker context
TriggerPrewarm passed the request context to a background goroutine, so the cycle stopped when the HTTP request returned. The cycle now uses the worker context and Stop waits for it.
2026-11-24 01:27:20 +00:00
lukaszraczylo 671bb0625b feat(ui): redesign the dashboard as a package checkpoint
Add overview, packages with quick view, package detail tabs, a merged security page, insights, system and restyled bypasses. Old vulnerable and blocked routes redirect to the matching security tab.
2026-11-24 01:13:09 +00:00
lukaszraczylo 45aa4bcace fix(app): serve the dashboard for client-side routes
A reload or shared link such as /packages?verdict=held returned 404 because the static handler had no fallback. Page loads for paths outside the API and proxy prefixes now receive index.html.
2026-11-24 01:13:01 +00:00
lukaszraczylo b248bfed31 fix(api): serve per-package analytics for names with slashes
The route matched one path segment, so scoped npm names and Go module
paths returned 404. It now takes the rest of the path as the name.
2026-11-24 00:49:27 +00:00
lukaszraczylo a511544d7a feat(api): report upstream hosts in /api/system
Each registry upstream shows its scheme and host only. The endpoint
drops credentials, paths and query strings from the configured URL.
2026-11-24 00:44:26 +00:00
lukaszraczylo 6ddc382d5b feat(api): add /api/system and per-package verdicts
Add a read-only /api/system endpoint with the effective scan policy,
scanner health, rescan, cache and pre-warming settings. It exposes no
credentials or paths.

The package list now carries a verdict (cleared, held, bypassed or
pending) with the reason and the applied bypass. /api/stats adds
bypassed_packages. The vulnerability detail response adds the decision,
a per-scanner severity breakdown and detected_by on each finding.
2026-11-24 00:42:44 +00:00
lukaszraczylo 2b6f3bd892 feat(scanner): report per-scanner health and the bypass behind a decision
The manager now exposes the cached health, and the CLI version, of every
registered scanner. A scan decision also names the admin bypass that
applied to the package, so callers can tell a bypassed package from a
cleared one.
2026-11-24 00:42:41 +00:00
lukaszraczylo 916e2b0aa5 fix(proxy): keep package names that start with the registry name
The app mounts each handler behind http.StripPrefix. The npm and PyPI
handlers trimmed the registry prefix a second time. A request for
npm-run-all reached upstream as -run-all, and the npm package itself
became an empty path. PyPI trimmed /simple without a segment check.
v0.1.362
2026-11-24 00:22:49 +00:00
lukaszraczylo 30ebfaae3e chore(deploy): add rescan and scan-wait keys to the example configs
The Helm chart and the Kubernetes configmap listed only rescan_interval.
They now also set rescan_active_window, rescan_concurrency,
rescan_on_access and scan_wait_timeout. The values match the effective
code defaults, so a deploy behaves as before.
2026-11-24 00:20:01 +00:00
lukaszraczylo 3a7ffab4d5 fix(prewarming): start the worker and cache through the proxy path
The pre-warm worker was never started, and its fetch discarded the
response body, so nothing reached the cache. startWorkers now calls
Start. The worker hands each package to a Fetcher. ProxyFetcher calls
the npm, Go and PyPI handlers in-process, resolves the latest version,
and downloads the artifact. The cache and the scan queue then treat it
like a client request.

Pre-warming stays off unless prewarming.enabled is set. Stop is safe on
a worker that never started, and a second Start does nothing.
2026-11-24 00:19:36 +00:00
lukaszraczylo 22f2a8dfb9 fix(trivy): unpack npm tarballs before scanning
Trivy does not read archives, so a bare npm tarball always scanned clean.
The scanner now extracts the tarball into node_modules/<name> in a temp
dir and runs trivy rootfs on it, so the node-pkg analyzer sees the
package.json. Extraction rejects absolute paths, parent segments and
links that leave the tree, and caps the unpacked size at 512 MiB. The
temp dir is removed after the scan.

PyPI wheels and Go module zips share the archive problem and need their
own extractors. This commit does not change them.
2026-11-24 00:16:07 +00:00
lukaszraczylo 4870f243fc docs(lean): record the govulncheck and OSV scanner fixes as GH-27 and GH-28 v0.1.358 2026-11-23 19:54:42 +00:00
lukaszraczylo fac30f59e6 fix(osv): take the fixed version from the queried package range
An advisory can cover several packages. The fixed version came from the first range, so x/net findings showed the stdlib fix 1.26.9 instead of the x/net fix 0.60.0.
2026-11-23 19:54:33 +00:00
lukaszraczylo 775ed8a4aa fix(govulncheck): count findings in the scanned module only
A module was charged with advisories against its dependencies at the minimum versions in its go.mod. A consuming build resolves its own versions, so these findings do not describe the module. On production golang.org/x/net v0.56.0 carried x/crypto and x/text advisories this way. Stdlib findings describe the scanner toolchain and are also dropped.
2026-11-23 19:54:30 +00:00
lukaszraczylo e6d8ed0f2e fix(scanner): reuse a recent scanner health result
Each /health request ran the version command of every scanner. Under rescan load one round took about 1.4 seconds, which exceeds the client probes that use /health to choose the cache. The result is now reused for 30 seconds. A probe that ends with a cancelled context is not stored.
v0.1.355
2026-11-23 19:47:16 +00:00
lukaszraczylo 40ed8f8213 docs(lean): model rescan skip and on-access freshness as GH-26
The rescan worker skip predicate matches the serve path. A hit whose scan is
older than the interval is judged on a fresh scan, or on the previous result
when the rescan times out.
v0.1.354
2026-11-23 19:30:16 +00:00
lukaszraczylo ecf750adbb feat(cache): rescan stale cache hits before serving
With security.rescan_on_access and rescan_interval set, a hit whose scan
result is missing or older than the interval is rescanned before it is
served. Concurrent hits share one scan, and the scan runs under the
manager context so a client disconnect does not abort it. The wait is
bounded by scan_wait_timeout. On a timeout the previous result decides,
or the first-download rule applies when none exists.
2026-11-23 19:27:49 +00:00
lukaszraczylo 41f8369c43 feat(rescan): limit rescans to active packages and run them in parallel
security.rescan_active_window skips packages not requested within the
window. security.rescan_concurrency runs a bounded pool of scans per
cycle. The cycle summary reports skips by reason. Both options default
to the previous behaviour.
2026-11-23 19:26:10 +00:00
lukaszraczylo d6044cdd2e fix(rescan): skip Go .mod and .info rows in the rescan worker
The worker kept its own list of metadata versions and scanned Go module
metadata rows that the serve path never scans. It now uses
metadata.IsMetadataEntry like the cache layer.
2026-11-23 19:25:28 +00:00
lukaszraczylo 1baa6b8e26 docs(lean): model the merge of error results as GH-25
Add the merge model for error-status results and the ledger row. One
error result with one clean result reads clean, all errors read error,
and an error never hides a finding.
v0.1.350
2026-11-23 18:07:30 +00:00
lukaszraczylo 3d6bda3a5f fix(pip-audit): audit the release from a pinned requirement
pip-audit takes a project directory as its positional argument and has
no --pyproject option, so every wheel and sdist scan failed. The scanner
now audits name==version from a requirements file with --no-deps and
--disable-pip.

It reads stdout only, lists each advisory once, and treats a skip_reason
as an error because pip-audit exits 0 for a package it could not audit.
2026-11-23 18:07:27 +00:00
lukaszraczylo e37c797602 fix(govulncheck): scan the module as a dependency and read the stream
govulncheck prints indented JSON objects. The line parser read none of
them, so every module read clean.

govulncheck also never reports advisories against the main module of the
tree it scans. A scan of the x/text 0.3.5 source found nothing. The
module is now a dependency of a wrapper module that imports its
packages, and the scan runs at module level.
2026-11-23 18:07:21 +00:00
lukaszraczylo 157814cf08 fix(npm-audit): audit the package through a wrapper project
npm 11 prints via as an array and metadata.dependencies as an object, so
the parser failed on every report. It now reads both shapes of via and
lists each advisory once.

The lockfile step resolved devDependencies, which took 28 seconds for
dayjs and reported 142 findings in its development tree. The tarball is
now the only dependency of a wrapper project, audited with --omit=dev.
This also audits the package itself, which npm audit skips for a root.
2026-11-23 18:07:00 +00:00
lukaszraczylo 65aa2e25dc fix(grype): parse file sources and scan packages by purl
grype 0.121 prints source.target as a string for file, directory and
purl sources. The parser expected an object and failed every scan.

A bare npm, PyPI or Go archive holds nothing grype can catalog, so a
scan of the archive read minimist 0.0.8 as clean. The scanner now passes
a purl for these registries and falls back to the file for others.
2026-11-23 18:06:57 +00:00
lukaszraczylo 3731ca05ce fix(scanner): leave failed scanner results out of the merge
A scanner that returns a result with status error now counts as a failed
scanner, like one that returns an error. Its result no longer joins the
merge, and the manager counts it as an infrastructure failure or another
failure by its cause.

The merged status is error only when every applicable scanner failed.
The fail_closed setting then decides that case as before. One scanner
failing while another returns clean now reads clean.
2026-11-23 18:06:54 +00:00
lukaszraczylo 8adb1e0c87 build: pin the scanner image tool versions
The scanner image installed trivy and grype from install scripts on the main branch, govulncheck at latest and pip-audit unpinned, so every build could pull different tools. They are now pinned: trivy v0.76.2, grype v0.121.2, govulncheck v1.9.0 and pip-audit 2.10.1, each released at least two weeks ago.
v0.1.344
2026-11-23 17:37:51 +00:00
lukaszraczylo 16fb52ed3e feat(config): make the first-download scan wait configurable
The cache waited a fixed 30 seconds for a first download's scan, and the app never set the wait. Scanners run one after another, so a deployment with several scanners and fail_closed refused most first downloads. security.scan_wait_timeout now sets the wait; 0 keeps 30 seconds.
2026-11-23 17:37:45 +00:00
lukaszraczylo 13abb140d7 docs(lean): record the GH-24 fix commit v0.1.342 2026-11-23 17:24:58 +00:00
lukaszraczylo 378b8731fc fix(app): start the rescan worker
The app created the rescan worker when security.rescan_interval was set but never started it; only Shutdown called Stop. A scan lost to a restart therefore left its package unscanned for good, and old results were never refreshed with new CVEs. startWorkers now starts the worker. The ledger records it as GH-24.
2026-11-23 17:24:55 +00:00
lukaszraczylo a83cc20058 docs(lean): record the GH-23 fix commit v0.1.340 2026-11-23 17:08:24 +00:00
lukaszraczylo 501bf1aec8 fix(pypi): serve pip's PEP 658 metadata requests
pip builds the PEP 658 URL by appending .metadata to the whole link, so the suffix lands on original_url, not the path. The filename binding from GH-01 then rejected the request with 400, and every pip install through the proxy failed. The handler now treats that form as the requested wheel's sidecar and streams it without storing it. A sidecar of another file is still refused. The Lean model and the ledger cover the new form (GH-23).
2026-11-23 17:08:20 +00:00
lukaszraczylo 527c1759f9 fix(frontend): revalidate index.html on every load
nginx sent index.html without Cache-Control, so browsers cached it heuristically. After a deploy, a browser kept loading the previous hashed bundle until the cache expired, and fixes did not appear. The SPA location now sends Cache-Control: no-cache. Hashed assets stay immutable. scripts/check_frontend_html_cache.sh checks both.
v0.1.338
2026-11-23 16:36:10 +00:00
lukaszraczylo 933b5a75c0 fix(ui): read nested stats from stats_update events
The server sends stats_update as {stats, timestamp}, but the realtime store read the counters from the top level of the payload. About 30 seconds after load, the first broadcast replaced the polled stats with undefined values, and the dashboard tiles showed 0. The store now unwraps the nested stats object.
v0.1.337
2026-11-23 16:30:22 +00:00
lukaszraczylo f4cf96e1e8 fix(api): resolve Go module paths to cache keys for vulnerability details
The dashboard links Go packages by module path, but Go rows are stored under cache keys (module/@v/version.zip, .mod, .info). The vulnerability details lookup used the module path, so every Go details page returned 404 "package not found". The handler now falls back to the .zip key, then .mod and .info.
v0.1.336
2026-11-23 15:49:33 +00:00
lukaszraczylo aa8487ad87 build: pull pinned base images from mirror.gcr.io
Docker Hub rate-limited the v0.1.328 release build, so goreleaser kept retrying the base image pulls. The Dockerfiles now pull alpine 3.24.4 and nginx 1.31.9-alpine from mirror.gcr.io, pinned by digest. Those digests are what alpine:latest and nginx:alpine resolved to, so the images are unchanged, and a release no longer moves silently with a floating tag.
2026-11-23 15:28:01 +00:00
lukaszraczylo 2ada975065 fix(ui): name trend series by the packages they count
The severity series now read "Packages with <severity> vulnerabilities",
which matches the severity tiles and the snapshot counts.
v0.1.334
2026-11-23 15:12:15 +00:00
lukaszraczylo b98e761c90 fix(stats): count a package under every severity it holds
The trend snapshot counted each vulnerable package once, under its
highest severity. The Vulnerable packages tiles and the severity
filter count a package under every severity its latest scan holds.
The two views disagreed, for example low 0 against 8 packages.

The snapshot and the backfill now use the filter definition, so a
package with high and low findings counts under both. A test compares
the snapshot with the filter result on one fixture.
2026-11-23 15:12:12 +00:00
lukaszraczylo a457e3d2e8 test(metadata): stop the aggregation worker before counting statements v0.1.332 2026-11-23 14:58:44 +00:00
lukaszraczylo ba8bc392ec feat(cache): purge soft-deleted package rows after a retention period
The cleanup worker now hard-deletes package rows whose deleted_at is
older than cache.deleted_retention. The default is 30 days. A value of
0 keeps the rows. The purge runs in bounded batches, with at most 100
batches per cleanup pass, and removes child rows with the package.

History tables have no foreign key to packages, and stats_snapshots
holds its own counts, so the purge leaves both untouched. The cleanup
log line now reports purged_deleted and deleted_retention.
2026-11-23 14:55:26 +00:00