Enforce remote quarantine for fresh immutable artifacts #170
Reference in New Issue
Block a user
Delete Branch "benvin/remote-quarantine"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Remotes store
quarantine_enabled/quarantine_daysbut the proxy never enforces them, so freshly published (possibly malicious) artifacts are cached immediately.quarantine_daysago with a JSON 403Last-Modifiedcapped at now, else a Redis first-seen key; 503 +Retry-Afterwhen that lookup failsquarantine_days<1; backfill stored<=0to 3quarantine_daysto 3 on create and keep it on updateQuarantineDays <= 0silently disables quarantine whilequarantine_enabled=true; the old create path stored 0 (Go zero, not the column default 3), so existing enabled remotes created withoutquarantine_daysstay unprotected, andPUT {"quarantine_days":0}persists 0 → add a migration settingquarantine_days=3where it is 0 and reject days < 1 when enabled in remotes.go create/update.quarantine_days, and a mirror re-sync that bumps mtime on old files re-quarantines them → clamppublishedtomin(published, now).published = now, so the client gets a 403 claiming a fresh publish with a full-windowavailabletime for what is an infra fault → return 503 (+Retry-After) on FirstSeen failure, keep it fail-closed.quarantine_daysplus the goproxy virtual probe change ride with the engine enforcement → split into 3 PRs: (1) engine+proxy.go enforcement, (2) goproxy_merger probe, (3) remotes.go default/preserve.stale_on_errorwith a quarantined path → add them.%vinto a generic error, losing status and Retry-After → return/wrap with %w and map ProxyError status in the caller.