fix: restrict docker commands for ai-worker (wrapper blacklist — exec, cp, commit, etc. blocked) #65
Open
Hermes
wants to merge 1 commits from
feat/restrict-docker-blacklist into master
pull from: feat/restrict-docker-blacklist
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-commands-for-ai-worker
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#65
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-blacklist"
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: Block dangerous docker commands for ai-worker
Problem
The
ai-workeruser is in thedockergroup, giving unrestricted access to ALL Docker commands. An agent was able to generate a Gitea admin token viadocker exec -u git gitea gitea admin user generate-access-token -u gortium.This PR
Keeps ai-worker in the
dockergroup (sodocker ps,docker compose,docker build,docker run, etc. still work), but wraps thedockerbinary with a script that blocks dangerous subcommands.BLOCKED commands
exec,cp,commit,diff,export,import,load,save,attach,push,tagALLOWED commands
ps,images,inspect,logs,start,stop,restart,rm,rmi,pull,build,run,compose,system,network ls,volume lsHow it works
A wrapper script intercepts
dockercalls, parses the subcommand, and rejects blocked ones. The wrapper is installed both as a system package and in ai-worker's personal profile so it takes precedence over the real Docker binary.Fixes
Closes the security incident where the agent created a Gitea admin token via docker exec.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.