100 Commits
Author SHA1 Message Date
lukaszraczyloandGitHub c7f05c426f Update go.mod and go.sum (#101) 2026-07-22 06:55:12 +01:00
lukaszraczyloandGitHub bd3e8f024c Update go.mod and go.sum (#100) 2026-07-21 06:54:11 +01:00
lukaszraczyloandGitHub c390074f1c Update go.mod and go.sum (#99) 2026-07-17 06:46:38 +01:00
lukaszraczyloandGitHub 43d39bb07a Update go.mod and go.sum (#98) 2026-07-14 06:35:56 +01:00
lukaszraczyloandGitHub a95cd85155 Update go.mod and go.sum (#97) 2026-07-13 07:23:08 +01:00
lukaszraczyloandGitHub d48079e859 Update go.mod and go.sum (#96) 2026-07-11 05:05:30 +01:00
lukaszraczylo 12a629c652 fixup! feat: comprehensive audit + Tier 3 wiring (security/correctness/features) 2026-07-10 09:38:46 +01:00
lukaszraczylo e39d6a0f0d feat: comprehensive audit + Tier 3 wiring (security/correctness/features)
Multi-agent audit + fix pass covering bugs, security, dead config wiring,
and missing features. All quality gates green: build/vet/test -race/govulncheck/
golangci-lint. Frontend tests 47/47.

SECURITY & CORRECTNESS

- Scanner pipeline fail-closed: cache.go scan timeout now 503 (was goto servePkg);
  scanner.go all-scanners-fail saves ScanStatusError; CheckVulnerabilities blocks
  on missing/error result instead of allowing.
- Scanner argv corrections: govulncheck source-mode + go.mod discovery;
  npm-audit generates lockfile via npm install --package-lock-only --ignore-scripts;
  pip-audit per-extension dispatch (wheel direct / sdist extract+pyproject).
- GHSA version-range filtering implemented (was always-include); url.QueryEscape
  on package name.
- pypi SSRF closed via host allowlist on original_url; url.QueryEscape on
  rewriteURL output.
- Path traversal: cache temp file uses os.CreateTemp; smb keyToPath sanitized;
  filesystem keyToPath returns error + filepath.Abs prefix-verify.
- Goroutine leaks plugged: cache.cleanupWorker stop channel; auth.ValidationCache
  Stop() with sync.Once; ws.unregister buffered with non-blocking send.
- WebSocket double-close panic fixed via sync.Once Client.closeSend().
- Race conditions: gormstore.registryCache sync.RWMutex (was concurrent map
  panic); auth.LastUsedAt no longer mutated under RLock; analytics strict
  lock-ordering invariant (statsMu before downloadsMu).
- Auth validator fails CLOSED on transport/unknown-status errors (was returning
  true,err 'allow cache fallback').
- Credential cache hash full SHA256 (was 8-byte truncate; eliminates 2^32
  collision risk).
- filesystem.fs.used incremented after successful rename (no quota inflation
  race).
- gormstore aggregation events deleted in same tx as insert (no double-counting).
- gormstore.SavePackage uses Updates(map) so zero-value security flags
  (RequiresAuth=false) can be cleared.
- partition_manager validates partition name regex before DROP TABLE.
- vcs/git: version regex validation rejects --option-injection; checkout uses
  --detach -- separator; removed TrimPrefix(repo,'v') that corrupted vault/
  vitess/vim-go.
- WebSocket CheckOrigin allowlist (was return true; CSWSH closed); same-origin
  default + ServerConfig.AllowedOrigins.
- fiber CVE GO-2026-4543 patched (v2.52.10 -> v2.52.12).

FUNCTIONAL FEATURES

- API key DB persistence: APIKeyModel + migration 202604280002, full CRUD,
  async LastUsedAt updates with WaitGroup-tracked goroutines drained on Close.
- Admin bootstrap via GOHOARDER_BOOTSTRAP_ADMIN_KEY env var; idempotent
  (skipped when non-revoked admin already exists).
- Auth middleware factory in pkg/app: RequireAuth, RequireRole, RequirePermission,
  OptionalAuth. Mounted on proxy + read APIs when Auth.Enabled=true.
  DELETE /api/packages/* requires admin role. /health public for k8s probes.
- NFS storage backend: pkg/storage/nfs wraps filesystem with /proc/mounts
  detection (Linux), post-write fsync, read-after-write health probe.
- WebSocket real-time pipeline: pkg/events Broadcaster interface; cache + scanner
  managers emit EventPackageCached / EventPackageDownloaded / EventScanComplete;
  app.go runs 30s EventStatsUpdate ticker. Frontend has full WS client (reconnect
  with exponential backoff 1s->30s, 25s heartbeat, subscriber pattern), Pinia
  realtime store, Dashboard live indicator + activity feed + reactive stats
  override.
- TLS termination: fiber.ListenTLS when Server.TLS.Enabled.
- Pre-warming: Prewarming.Enabled flag wired (was hardcoded false); Interval,
  MaxConcurrent, TopPackages plumbed.
- NetworkConfig wired (timeouts, retry, rate-limit, circuit-breaker).
- AuthConfig.BcryptCost wired.
- Security.Scanners.Static.MaxPackageSize plumbed to cache.io.LimitReader.
- Handlers.{Go,NPM,PyPI}.Enabled gates route mounting.
- Graceful shutdown: authManager.Close drains async writes.

LINT/HYGIENE

- 80 golangci-lint issues resolved: errcheck (Close/Write/RemoveAll wrapped),
  gofmt, gosec G104/G306, govet shadow renames + fieldalignment reorders,
  staticcheck ST1000 pkg comments + QF1003 tagged switches + QF1008 embedded
  field selectors + QF1001 De Morgan's law.

BEHAVIOR CHANGES

- Scanner now fail-closed: deployments without scanner binaries
  (trivy/govulncheck/npm-audit/pip-audit/grype) BLOCK packages instead of
  serving unscanned. Add binaries or plan a future allow-on-scan-error flag.
- WS origin defaults to same-origin; cross-origin dashboards must set
  server.allowed_origins.
- Validator no longer fails open; private packages won't serve from cache when
  validation can't be performed.
- download_events retention dropped from 24h to ~5min (deleted in agg tx).
  Migration 202604280001 purges pre-upgrade events.
- DELETE /api/packages/* requires admin role when auth enabled.

NEW PACKAGES

- pkg/events  - Broadcaster interface
- pkg/storage/nfs  - NFS-aware filesystem wrapper

DEFERRED (out of scope this pass)

- Static scanner implementation (config defines AllowedLicenses/MaxPackageSize/
  BlockSuspicious but pkg/scanner/static/ does not exist).
- AuthConfig.AuditLog wiring (no audit log infra yet).
- CacheConfig.TTLOverrides passthrough (would touch cache.Config beyond
  integrator scope).
2026-07-10 09:37:55 +01:00
lukaszraczylo 3c8b3eb46c fixup! fix: exclude Go module metadata files from package count stats 2026-07-10 09:35:45 +01:00
lukaszraczylo c8bc8eca8f fix: exclude Go module metadata files from package count stats
The dashboard was showing 335 packages while the packages page showed 141
because GetStats was counting .mod and .info files as separate packages.

Changes:
- Filter out .mod and .info files in GetStats query
- Now only counts actual packages (.zip files)
- Dashboard and packages page counts will match

This fixes the discrepancy where:
- Dashboard (/api/stats): was 335, now will be ~141
- Packages page (/api/packages): already 141 (deduplicated)

Resolves: "Dashboard showing 335 packages but /packages showing 141"
2026-07-10 09:35:45 +01:00
lukaszraczylo d5979a8b88 fix: skip scanning Go module metadata files (.mod, .info)
Go module metadata files (.mod and .info) are not actual packages
and should not be scanned for vulnerabilities. Only .zip files
contain the actual module code.

Changes:
- Added .mod and .info suffix checks to isMetadataEntry filter
- These files are now excluded from database storage
- Scanner won't attempt to scan them during rescan cycles

This fixes OSV scanner 404 errors for metadata files like:
- github.com/mattn/go-isatty/@v/v0.0.20.mod
- github.com/clipperhouse/stringish/@v/v0.1.1.info

Resolves: OSV API errors "The current request is not defined by this API"
for Go module metadata files
2026-07-10 09:35:45 +01:00
lukaszraczyloandGitHub c38d6bec0d Update go.mod and go.sum (#95) 2026-07-09 05:23:50 +01:00
lukaszraczyloandGitHub 1616a7d42d Update go.mod and go.sum (#94) 2026-07-07 05:25:04 +01:00
lukaszraczyloandGitHub ec21194229 Update go.mod and go.sum (#93) 2026-07-05 05:27:13 +01:00
lukaszraczyloandGitHub 8967d313e0 Update go.mod and go.sum (#92) 2026-07-02 05:30:08 +01:00
lukaszraczyloandGitHub 75eda36638 Update go.mod and go.sum (#91) 2026-07-01 05:38:54 +01:00
lukaszraczyloandGitHub 2a3666ae7c Update go.mod and go.sum (#90) 2026-06-30 05:31:08 +01:00
lukaszraczyloandGitHub ab45e2f511 Update go.mod and go.sum (#89) 2026-06-28 05:37:58 +01:00
lukaszraczyloandGitHub 6b8f8443fb Update go.mod and go.sum (#88) 2026-06-27 05:27:45 +01:00
lukaszraczyloandGitHub e451ec5f1f Update go.mod and go.sum (#87) 2026-06-26 05:32:55 +01:00
lukaszraczyloandGitHub 3898756bf6 Update go.mod and go.sum (#86) 2026-06-24 05:31:06 +01:00
lukaszraczyloandGitHub 3c22e53c2e Update go.mod and go.sum (#85) 2026-06-23 05:30:05 +01:00
lukaszraczyloandGitHub 12a75bf77d Update go.mod and go.sum (#84) 2026-06-22 05:38:46 +01:00
lukaszraczyloandGitHub 1211320939 Update go.mod and go.sum (#83) 2026-06-19 05:39:39 +01:00
lukaszraczyloandGitHub 86f7d974e7 Update go.mod and go.sum (#82) 2026-06-18 05:36:29 +01:00
lukaszraczyloandGitHub f0eaf695ab Update go.mod and go.sum (#81) 2026-06-17 05:37:06 +01:00
lukaszraczyloandGitHub cfceb063ee Update go.mod and go.sum (#80) 2026-06-11 05:36:25 +01:00
lukaszraczyloandGitHub 76b38c5c10 Update go.mod and go.sum (#79) 2026-06-09 05:30:46 +01:00
lukaszraczyloandGitHub ae85e74094 Update go.mod and go.sum (#78) 2026-06-06 05:29:56 +01:00
lukaszraczyloandGitHub e08cab3311 Update go.mod and go.sum (#77) 2026-06-05 05:36:18 +01:00
lukaszraczyloandGitHub c9a124e708 Update go.mod and go.sum (#76) 2026-06-04 05:37:15 +01:00
lukaszraczyloandGitHub 640c54201f Update go.mod and go.sum (#75) 2026-06-03 05:37:50 +01:00
lukaszraczyloandGitHub ba632c4c14 Update go.mod and go.sum (#74) 2026-05-30 05:26:59 +01:00
lukaszraczyloandGitHub bd07e45c05 Update go.mod and go.sum (#73) 2026-05-29 05:34:39 +01:00
lukaszraczyloandGitHub 69ef5a478a Update go.mod and go.sum (#72) 2026-05-28 05:33:24 +01:00
lukaszraczyloandGitHub 2b425d4012 Update go.mod and go.sum (#71) 2026-05-27 05:35:38 +01:00
lukaszraczyloandGitHub 875fd9025a Update go.mod and go.sum (#70) 2026-05-23 05:21:35 +01:00
lukaszraczyloandGitHub 1fc61b1ec3 Update go.mod and go.sum (#69) 2026-05-22 05:30:56 +01:00
lukaszraczyloandGitHub c38209d8d1 Update go.mod and go.sum (#68) 2026-05-09 05:14:14 +01:00
lukaszraczyloandGitHub 4ffb17757c Update go.mod and go.sum (#67) 2026-05-07 05:21:07 +01:00
lukaszraczyloandGitHub 5dcf1cf6b0 Update go.mod and go.sum (#66) 2026-05-05 05:08:46 +01:00
lukaszraczyloandGitHub 923651d11a Update go.mod and go.sum (#65) 2026-05-02 05:11:11 +01:00
lukaszraczyloandGitHub fedb40c826 Update go.mod and go.sum (#64) 2026-05-01 05:28:57 +01:00
lukaszraczyloandGitHub b9cd641db3 Update go.mod and go.sum (#63) 2026-04-30 05:20:27 +01:00
lukaszraczyloandGitHub ddad5883fe Update go.mod and go.sum (#62) 2026-04-27 05:19:04 +01:00
lukaszraczyloandGitHub b25dfcd263 Update go.mod and go.sum (#61) 2026-04-26 05:15:01 +01:00
lukaszraczyloandGitHub 8c85532c86 Update go.mod and go.sum (#60) 2026-04-24 05:10:16 +01:00
lukaszraczyloandGitHub 7e9b0067f1 Update go.mod and go.sum (#59) 2026-04-23 05:07:32 +01:00
lukaszraczyloandGitHub 7fb2ed6d8d Update go.mod and go.sum (#58) 2026-04-21 05:07:17 +01:00
lukaszraczyloandGitHub 65446ddbe7 Update go.mod and go.sum (#57) 2026-04-19 05:08:17 +01:00
lukaszraczyloandGitHub 205a8c0ee5 Update go.mod and go.sum (#56) 2026-04-18 05:01:42 +01:00
lukaszraczyloandGitHub 9462c66edf Update go.mod and go.sum (#55) 2026-04-17 05:07:50 +01:00
lukaszraczyloandGitHub 7c727df4f8 Update go.mod and go.sum (#54) 2026-04-16 05:08:18 +01:00
lukaszraczyloandGitHub 26fd95cea9 Update go.mod and go.sum (#53) 2026-04-10 05:06:27 +01:00
lukaszraczyloandGitHub 79c46f3b1e Update go.mod and go.sum (#52) 2026-04-09 05:01:23 +01:00
lukaszraczyloandGitHub 33f371967f Update go.mod and go.sum (#51) 2026-04-08 05:02:55 +01:00
lukaszraczyloandGitHub 7cc93d768d Update go.mod and go.sum (#50) 2026-04-07 05:02:05 +01:00
lukaszraczyloandGitHub a1b7f871bf Update go.mod and go.sum (#49) 2026-04-04 04:52:40 +01:00
lukaszraczyloandGitHub 9ee7df5f50 Update go.mod and go.sum (#48) 2026-04-03 05:00:47 +01:00
lukaszraczyloandGitHub 180254581c Update go.mod and go.sum (#47) 2026-04-01 05:08:29 +01:00
lukaszraczyloandGitHub 28752e7602 Update go.mod and go.sum (#46) 2026-03-31 05:02:26 +01:00
lukaszraczyloandGitHub d589cc0ffa Update go.mod and go.sum (#45) 2026-03-30 05:06:45 +01:00
lukaszraczyloandGitHub 97a1954a1b Update go.mod and go.sum (#44) 2026-03-28 03:52:59 +00:00
lukaszraczyloandGitHub f98ce363dd Update go.mod and go.sum (#43) 2026-03-27 04:02:11 +00:00
lukaszraczyloandGitHub f17f0b3310 Update go.mod and go.sum (#42) 2026-03-25 03:53:18 +00:00
lukaszraczyloandGitHub 140f19ed6f Update go.mod and go.sum (#41) 2026-03-24 03:53:06 +00:00
lukaszraczyloandGitHub 1e9ac2a9f2 Update go.mod and go.sum (#40) 2026-03-23 03:58:55 +00:00
lukaszraczyloandGitHub aeb67f7dd9 Update go.mod and go.sum (#39) 2026-03-22 03:54:22 +00:00
lukaszraczyloandGitHub afc0ece8d0 Update go.mod and go.sum (#38) 2026-03-21 03:48:43 +00:00
lukaszraczyloandGitHub 170d5a9f08 Update go.mod and go.sum (#37) 2026-03-19 03:56:15 +00:00
lukaszraczyloandGitHub 6e351f1a25 Update go.mod and go.sum (#35) 2026-03-17 03:53:16 +00:00
lukaszraczyloandGitHub d67cc0bf8e Update go.mod and go.sum (#34) 2026-03-14 03:51:56 +00:00
lukaszraczyloandGitHub 239b7e1f75 Update go.mod and go.sum (#33) 2026-03-13 03:51:41 +00:00
lukaszraczyloandGitHub 9f1d134d7d Update go.mod and go.sum (#32) 2026-03-12 03:52:18 +00:00
lukaszraczyloandGitHub 2dfad4f4e3 Update go.mod and go.sum (#31) 2026-03-09 03:52:49 +00:00
lukaszraczyloandGitHub defa86573e Update go.mod and go.sum (#30) 2026-03-08 03:51:16 +00:00
lukaszraczyloandGitHub 0880cc45f7 Update go.mod and go.sum (#29) 2026-03-07 03:45:21 +00:00
lukaszraczyloandGitHub 0c2dc0795a Update go.mod and go.sum (#28) 2026-03-06 03:51:06 +00:00
lukaszraczyloandGitHub af81f6c99b Update go.mod and go.sum (#27) 2026-03-04 03:51:01 +00:00
lukaszraczyloandGitHub a46af4b645 Update go.mod and go.sum (#26) 2026-03-01 03:56:38 +00:00
lukaszraczyloandGitHub fe3c0ebb63 Update go.mod and go.sum (#25) 2026-02-28 03:41:31 +00:00
lukaszraczyloandGitHub b3e15180af Update go.mod and go.sum (#24) 2026-02-27 03:51:56 +00:00
lukaszraczyloandGitHub 6735ed2071 Update go.mod and go.sum (#23) 2026-02-26 03:53:37 +00:00
lukaszraczyloandGitHub 2f379efc83 Update go.mod and go.sum (#22) 2026-02-25 03:53:35 +00:00
lukaszraczyloandGitHub 5f8e3b4dee Update go.mod and go.sum (#20) 2026-02-24 03:53:21 +00:00
lukaszraczyloandGitHub 0704a3b7c8 Update go.mod and go.sum (#19) 2026-02-21 03:49:36 +00:00
lukaszraczyloandGitHub b22129fcba Update go.mod and go.sum (#18) 2026-02-19 03:54:06 +00:00
lukaszraczyloandGitHub 210602566e Update go.mod and go.sum (#17) 2026-02-18 03:54:48 +00:00
lukaszraczyloandGitHub 1e39f9f2f4 Update go.mod and go.sum (#16) 2026-02-17 03:52:41 +00:00
lukaszraczyloandGitHub a98ee60d8b Update go.mod and go.sum (#15) 2026-02-11 04:01:31 +00:00
lukaszraczyloandGitHub 1293ca4f9d Update go.mod and go.sum (#13) 2026-02-10 04:03:22 +00:00
lukaszraczyloandGitHub 2e95518d48 Update go.mod and go.sum (#12) 2026-02-09 03:59:00 +00:00
lukaszraczyloandGitHub 0388d99d9e Update go.mod and go.sum (#11) 2026-02-02 03:56:15 +00:00
lukaszraczyloandGitHub 113564b497 Update go.mod and go.sum (#10) 2026-02-01 04:02:13 +00:00
lukaszraczyloandGitHub b78e6e79e3 Update go.mod and go.sum (#9) 2026-01-30 03:50:54 +00:00
lukaszraczyloandGitHub 3b26752e3c Update go.mod and go.sum (#8) 2026-01-29 03:51:11 +00:00
lukaszraczyloandGitHub ec3312d836 Update go.mod and go.sum (#7) 2026-01-25 03:40:38 +00:00
lukaszraczyloandGitHub f1913087e4 Update go.mod and go.sum (#6) 2026-01-19 03:40:28 +00:00
lukaszraczyloandGitHub eae3e33e7e Update go.mod and go.sum (#5) 2026-01-17 03:35:25 +00:00
lukaszraczyloandGitHub 2e8baad645 Update go.mod and go.sum (#4) 2026-01-13 03:37:10 +00:00