Restic
backup.restic
Protects against destructive restic operations like forgetting snapshots, pruning data, removing keys, and cache cleanup.
- 5blocking rules
- 8safe patterns
- 3Critical
- 1High
- 1Low
[packs]
enabled = ["backup.restic"]Evaluated when a command contains restic.
Blocking rules
Each rule ID is backup.restic:<name>. Use it in allowlists and [policy.rules].
Criticalrestic-forgetrestic forget removes snapshots and can permanently delete backup data.
Explanation
restic forget removes snapshots from repository: - Snapshot metadata removed from repository - Data not deleted until prune is run - Use --keep-* flags to retain recent snapshots - --dry-run shows what would be forgotten Preview first: restic forget --dry-run [options]
Criticalrestic-key-removerestic key remove deletes encryption keys and can make backups unrecoverable.
Explanation
restic key remove deletes repository encryption keys: - Key is permanently deleted from repository - If all keys removed, repository becomes inaccessible - Cannot recover data without a valid key - Always keep at least one key available List keys first: restic key list
Criticalrestic-prunerestic prune removes unreferenced data and is irreversible.
Explanation
restic prune permanently deletes unreferenced data: - Removes data no longer referenced by snapshots - Usually run after 'restic forget' - Cannot be undone - data is permanently deleted - May take a long time for large repositories Consider: restic forget --prune to combine operations
Highrestic-unlock-remove-allrestic unlock --remove-all force-removes repository locks.
Explanation
restic unlock --remove-all force-removes all locks: - Removes locks from potentially active operations - May cause corruption if operations are in progress - Use only when locks are stale/orphaned Check first: ensure no other restic processes are running
Lowrestic-cache-cleanuprestic cache --cleanup removes cached data from disk.
Explanation
restic cache --cleanup removes local cache: - Deletes cached data from local disk - Does not affect repository data - Cache will be rebuilt on next operation - May slow down subsequent operations Lower risk: only affects local cache, not backups
Safe patterns
Checked first. A command that matches one is never blocked by this pack.
restic-snapshotsrestic-lsrestic-statsrestic-checkrestic-diffrestic-findrestic-backuprestic-restore