Podman
containers.podman
Protects against destructive Podman operations like system prune, volume prune, and force removal
- 9blocking rules
- 8safe patterns
- 2Critical
- 4High
- 3Medium
[packs]
enabled = ["containers.podman"]Evaluated when a command contains podman, prune.
Blocking rules
Each rule ID is containers.podman:<name>. Use it in allowlists and [policy.rules].
Criticalsystem-resetpodman system reset deletes ALL containers, pods, images, networks and volumes.
Explanation
podman system reset returns Podman storage to its initial state. Unlike system prune it does not stop at unused data: - Every container and pod, running or stopped - Every image, including ones in use - Every volume and the data in it - Every network and the build cache There is no recovery. Safer alternatives: - podman system df: See what is using space - podman system prune: Remove only unused data - podman volume ls: Check for volumes holding data first
Criticalvolume-prunepodman volume prune removes ALL unused volumes and their data permanently.
Explanation
podman volume prune permanently deletes ALL volumes not currently in use by any container. This is extremely dangerous: - Database data in volumes is lost forever - Application state and uploads are destroyed - Volumes from stopped containers are considered 'unused' - No recovery mechanism exists Safer alternatives: - podman volume ls: List all volumes first - podman volume inspect: Check volume contents - podman volume rm <name>: Remove specific volumes
Highrm-forcepodman rm -f forcibly removes containers, potentially losing data.
Explanation
podman rm -f forcibly stops and removes containers. This is dangerous because: - Running processes are killed immediately (SIGKILL) - No graceful shutdown - data may be corrupted - In-flight requests are dropped - Uncommitted data in the container is lost Safer alternatives: - podman stop <container>: Graceful shutdown first - podman rm <container>: Then remove - podman ps: Check container status first
Highrmi-forcepodman rmi -f forcibly removes images even if in use.
Explanation
podman rmi -f forcibly removes images, even if containers reference them. This can cause: - Containers to fail on restart (missing image) - Broken references to deleted layers - Loss of build cache Safer alternatives: - podman ps -a --filter ancestor=<image>: Check what uses the image - podman rmi <image>: Fails safely if in use - podman images: Review images before removal
Highsystem-prunepodman system prune removes ALL unused containers, pods, images. Use 'podman system df' to preview.
Explanation
podman system prune is an aggressive cleanup command that removes: - All stopped containers - All pods without running containers - All dangling images (untagged) - All dangling build cache With -a flag, removes ALL unused images. With --volumes, removes unused volumes. Safer alternatives: - podman system df: Preview disk usage first - podman container prune: Only remove stopped containers - podman image prune: Only remove dangling images
Highvolume-rmpodman volume rm permanently deletes volumes and their data.
Explanation
podman volume rm permanently deletes named volumes and all data stored in them. This is irreversible: - Database files are gone forever - User uploads are lost - Configuration data is destroyed - No trash or undo mechanism Safer alternatives: - podman volume inspect <volume>: Check volume details - podman run --rm -v vol:/data alpine ls -la /data: View contents - Back up before removal
Mediumcontainer-prunepodman container prune removes ALL stopped containers.
Explanation
podman container prune removes all stopped containers. Relatively safe but: - Container logs are lost - Container filesystem layers are deleted - Cannot restart or inspect removed containers Safer alternatives: - podman ps -a: List all containers first - podman rm <container>: Remove specific containers - podman start <container>: Restart instead of removing
Mediumimage-prunepodman image prune removes unused images. Use 'podman images' to review first.
Explanation
podman image prune removes dangling images (untagged layers). With -a flag, removes ALL images not used by existing containers. Consequences: - Build cache layers are deleted (slower rebuilds) - With -a: Base images must be re-pulled Safer alternatives: - podman images -f dangling=true: Preview what would be removed - podman images: Review all images - podman rmi <image>: Remove specific images
Mediumpod-prunepodman pod prune removes ALL stopped pods.
Explanation
podman pod prune removes all pods that are not currently running. Pods group containers together and pruning them: - Removes all containers within the stopped pods - Pod configuration and networking setup is lost - Cannot restart or inspect removed pods Safer alternatives: - podman pod ps -a: List all pods first - podman pod rm <pod>: Remove specific pods - podman pod start <pod>: Restart instead of removing
Safe patterns
Checked first. A command that matches one is never blocked by this pack.
podman-pspodman-imagespodman-logspodman-inspectpodman-buildpodman-pullpodman-runpodman-exec