Files
felhom.eu/documentation/audits/dataloss-hunt-2026-10-20/C1-delete-retention-candidates.md
T

4.0 KiB

C1 reviewer 2 — delete and retention (fresh, read-only; clones at controller 7ca59e2)

# Sev guess harm mechanism
D1 P1 (mech high, reach medium) Shares second-drive copy: one drive group's reconcile deletes ANOTHER drive's share mirrors (on the night a drive is decommissioned/away; or every night when two groups target one drive, then a full re-copy) internal/backup/tier2_shares.go:135 groups by source; :201-202 own destBase/legRels; :230 tier2ReconcileRoots(destBase, sharesTier2DestRoots(destBase), legRels); :266-267 ReadDir lists every drive key on disk; tier2.go:299-329 removes any child not in this group's legs; shares_payload.go:233-251 away/decommissioned drives drop out
D2 P1 optional legs / P2 mandatory; design question with a defect corner A missing or emptied app folder on the drive deletes its second-drive copy within one night; optional legs (audiobooks, comics, ROMs, Immich external library) are in no other tier tier2_capture.go:55-61 missing leg skipped (optional silently) → tier2.go:455 reconcile deletes its mirror; run recorded success :465; emptied → rsync -a --delete tier2.go:751 via :443; catalog optional legs audiobookshelf/.felhom.yml:24-26, komga, romm, immich :32-34; 07 §8.2 „data legs are NOT guarded" covers a leg leaving the class set, not a declared-but-missing leg
D3 P2 high (mech) A host clock ahead during one whole-guest backup silences that tier until real time passes it; the hub reads the same clock and says OK agent internal/localapi/server.go:1178-1190 negative age never due; internal/backup/runner.go:607-629 newest ctime unbounded; hub monitor/deadline_tiers.go:155, deadline.go:243; R-973 cap counts future entries backup_cap.go:61; restic: offbox_window.go:133-136 pinned guard refuses every window → quota fills; NAS tier no guard :209-216; offbox_abandon.go:248,287 set-aside rm on box clock
D4 P2 A failed LOCAL unit restore leaves the app running on mixed data, no undo copy (same as R1 of reviewer 1 — independent agreement) restore_unit.go:430-489; writeSafetyDump only in offbox_reconstitute.go; 07 §6.3 ladder not scoped to off-site
D5 P2 order defect / depth design A dump that fails its own content check has ALREADY replaced last night's good dump; Tier-2 mirrors it an hour later appbackup/dbdump.go:388-397 size-only check, :399 rename, :419 ValidateDump after; backup.go:688-690; volume tars promoted with no content check backup.go:902
D6 P3 med „Megőrzött adatok" can list a RUNNING app's live folder as deletable leftover if its app.yaml is unreadable stacks/manager.go:672; kept.go:220-235 skips `!Deployed
D7 P3 low-med A unit restore can point the app back at an OLD drive; F5 then deletes the current drive's unit restore_unit.go:90-111, 507; cmd/controller/main.go:3252; deploy.go:820; backup.go:1517-1574 pruneStalePrimaryDirs even when this run's capture failed (:726-733)
D8 P3/P4 design local whole-guest keep=1 prunes the only good archive before the new one is proven agent runner.go:229, :139-161, restore-test settle 24 h :462

Checked SAFE (reviewer): hub off-site deletions by exact identity (offsitekeys.go:366-515); pinned off-site retention guard refuses future/too-new snapshots and big plans (offbox_window.go:132-161); dump and tar writes crash-safe (tmp+fsync+rename); R-403 hollow-unit guard; drive migration deletes source only after verify (stacks/migrate.go:614-667); app removal refusals and protected folders (delete.go:136-153, 241-301, 839-846); mirror/undo clean-ups allow-listed/prefix-guarded; agent prune never on PBS unless opted in; restore-test skips unsettled/future/foreign-key archives; ForgetRetiredDrives mount units only; SMB share removal deletes no folder. Not reviewed: agent vzpartial janitor, tenantsync/ep0 prune config, hub RESET beyond PurgeRepos.