fix: restrict docker commands for ai-worker (SUPERSEDED by PR #65) #64
Closed
Hermes
wants to merge 1 commits from
feat/restrict-docker-commands-for-ai-worker into master
pull from: feat/restrict-docker-commands-for-ai-worker
merge into: gortium:master
gortium:master
gortium:fix/hoardingcow-nfs-mount-options
gortium:fix/remove-stale-copy
gortium:fix/hermes-entrypoint-simple
gortium:fix/hermes-s6-overlay-entrypoint-crash
gortium:fix/hermes-submodule-update
gortium:local_changes
gortium:fix/backup-compose-os-upgrade
gortium:uconsole-cm5-incremental
gortium:feat/remote-builders
gortium:hermes-backup-feat-uconsole
gortium:hermes-save-infra
gortium:feat/temp-16tb-btrbk
gortium:feat/home-manager
gortium:feat/fork-nixos-uconsole-cm5-fix
gortium:fix/uconsole-cm5-panel-timing
gortium:feat/hermes43-llamacpp
gortium:archive/uconsole-cm5-v3
gortium:feat/uconsole-cm5-v3
gortium:fix/backup-submodule-update
gortium:feat/worldmonitor
gortium:feat/ups-config
gortium:feat/rollback-sentinel-on-fresh-branch
gortium:fix/honcho-vector-dim-empty
gortium:feat/restrict-docker-blacklist
gortium:fix/hermes-matrix-deps-venv-persist
gortium:fix/update-compose-submodule-matrix-bridge
gortium:feat/nix-deployment-v2
gortium:kvm-pr
gortium:feat/nixos-ci-workflow
gortium:kvm-pr-consolidate
gortium:feat/hermes-workspace-combined
gortium:feat/hyperspace-pods-module
gortium:feat/hermes-workspace
gortium:feat/hermes-workers
gortium:feat/add-paperclip-agent-orchestrator
gortium:hermes-backup-infra-test-sentinel-master
gortium:hermes-backup-master
gortium:hermes-save-infra-test-sentinel-2026-07-01
gortium:feat/syncthing-org-sync
gortium:fix/vpn-iptables-nft-v3
gortium:fix/vpn-iptables-nft-v2
gortium:fix/vpn-iptables-nft-upstream
gortium:feat/nixos-ci
gortium:feat/update-compose-submodule-custom-tools
gortium:feat/kvm-libvirt
gortium:fix/wg-easy-iptables-nft
gortium:feat/compose-submodule-v2
gortium:feat/hermes-fork-dockerfile
gortium:ai-worker-restricted-access
gortium:feat/wireguard-vpn
gortium:feat/k3s-pod-cluster
gortium:feature/server-hardening-clean
gortium:docs/merge-priority-order
gortium:feat/hermes-voice-gpu-support
gortium:feat/uconsole-cm5-v2
gortium:fix/matrix-bridge-v2
gortium:fix/backup-network-v2
gortium:feat/docker-add-qemu-cross-compilation
gortium:feat/docker-add-latex-stack
gortium:feat/docker-add-chromium-browser-deps
gortium:feat/docker-add-curl-poppler-imagemagick
gortium:feat/add-uconsole-host
gortium:home_manager
No Reviewers
Labels
Clear labels
Compat/Breaking
Breaking change that won't be backward compatible
Kind/Bug
Something is not working
Kind/Documentation
Documentation changes
Kind/Enhancement
Improve existing functionality
Kind/Feature
New functionality
Kind/Security
This is security issue
Kind/Testing
Issue or pull request related to testing
Priority
Critical
1
The priority is critical
Priority
High
2
The priority is high
Priority
Low
4
The priority is low
Priority
Medium
3
The priority is medium
Reviewed
Confirmed
1
Issue has been confirmed
Reviewed
Duplicate
2
This issue or pull request already exists
Reviewed
Invalid
3
Invalid issue
Reviewed
Won't Fix
3
This issue won't be fixed
Status
Abandoned
3
Somebody has started to work on this but abandoned work
Status
Blocked
1
Something is blocking this issue or pull request
Status
Need More Info
2
Feedback is required to reproduce issue or to continue work
No Label
Milestone
No items
No Milestone
Projects
Clear projects
No project
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: gortium/infra#64
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking 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