fix: restrict docker commands for ai-worker (SUPERSEDED by PR #65) #64
Reference in New Issue
Block a user
No description provided.
Delete Branch "feat/restrict-docker-commands-for-ai-worker"
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?
Security Fix: Remove ai-worker from docker group
Problem
The
ai-workeruser was a member of thedockergroup, giving unrestricted access to the Docker daemon. This allowed any docker command, including:docker exec— execute arbitrary commands inside running containers (file modification)docker cp— copy files between containers and hostdocker run -v /:/host alpine— full host filesystem escapedocker commit— create images from running containers (data exfiltration)An agent using ai-worker SSH access was able to generate a Gitea admin token via
docker exec -u git gitea gitea admin user generate-access-token -u gortium, bypassing permission controls.Solution
extraGroups = ["docker"]from ai-workerAllowed (via sudo)
docker ps,inspect,logs,images,info,version,stats,start,stop,restart,rm,rmi,wait,pull,build,run,compose,system,network ls,volume lsBlocked (implicitly — not in sudo whitelist)
docker exec,cp,commit,diff,export,import,load,save,attach,push,tag,create,plugin,network create,volume createImpact
host_runmust now be prefixed withsudodocker composeare still functional (compose is allowed)nhornixos-rebuildremains blocked (no sudo for those commands)Files Modified
users/ai-worker.nix— new sudo whitelistmodules/nixos/security/ai-worker-restricted.nix— updated commentsmodules/nixos/security/README-ai-worker.md— updated documentationCloses security incident where agent created Gitea admin token via docker exec.
fix: restrict docker commands for ai-worker user (remove docker group, enforce sudo whitelist)to fix: restrict docker commands for ai-worker (SUPERSEDED by PR #65)Pull request closed