gtapps/hermitd/docker-security
Claude Code and agent skill by gtapps/hermitd
- community
- ext:[{"type":"config","description":"Configuration overrides"}]
Checking that the SKILL.md file is still in the repository.
Opt-in advanced Docker security hardening beyond the docker-setup baseline — LAN containment with DNS policy, resource bounds with kernel-hygiene sysctls, and a boot-time plugin install audit log. Applied as a reversible docker-compose overlay (does not touch the base compose file) and verified against the live container. Run after /docker-setup; requires bridge networking.
Install
npx vskill@latest install gtapps/hermitd/docker-securitySemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as gtapps/hermitd/docker-security.
Docker Security
Advanced hardening for already-deployed agent containers. Each toggle is opt-in, presented with honest cost/benefit framing, and applied as a docker-compose.security.yml overlay that the hermitd-docker wrapper auto-detects. Reversal: re-run and answer No to every prompt, or turn the toggles off under docker.security in config and run hermitd restart.
Tone: Honest about tradeoffs. Tell operators what each toggle does AND does not protect. Do not oversell.
Each step's commands depend on the previous step's answer, so run them in order.
Templates live in ${CLAUDE_SKILL_DIR}/../../state-templates/docker/security/.
Trust model framing (read to operator at the start of step 2)
Installing a plugin runs that plugin's hooks and skills with the same authority as hermit. The container hardening here reduces what a compromised plugin can do to the host kernel and your local network — it does not vet the plugin's intent, sandbox its file access within the project, or prevent it from acting on your behalf via the agent. A malicious or careless plugin still runs as you.Honest limitation: DNS policy below blocks domain-based exfil/C2. In log-only mode it cannot stop direct-IP egress to a hardcoded public address; enforce mode drops connections to addresses no allowed name returned, except carve-outs.
Plan
0. Refuse to run inside the hermit container
This skill is host-only — it writes a docker-compose.security.yml overlay on the host and recreates the container with stronger isolation.
Run: [ -f /.dockerenv ] || [ -f /run/.containerenv ] && echo container || echo host
If the output is container, stop immediately — do not proceed to step 1. Print:
Runhermitd setup docker-securityfrom a host terminal at the project root. To inspect live security inside the container, run/hermitd:hermit-doctor.
For every direct Compose command, rebuild COMPOSE_FILES immediately before use in the same Bash call:
Use docker compose "${COMPOSE_FILES[@]}": base, security overlay, then operator override. Re-evaluate after writing either overlay.
1. Prerequisites
- Read
.hermit/config.json. If missing: "Run/hermitd:hatchfirst." Stop. - Verify
docker-compose.hermit.ymlexists at the project root. If missing: "Run/hermitd:docker-setupfirst." Stop. - Docker daemon check: run
timeout 10s docker info >/dev/null 2>&1. If it fails or times out: tell the operator "Docker daemon is not reachable or timed out. Start Docker before re-running/docker-security." Stop. - Read
docker.network_modefrom config (default:"bridge"). If"host", setHOST_NETWORK_MODE=trueand surface to operator: "Detectednetwork_mode: hostin your config. The LAN containment toggle (Prompt 1) will be skipped — it would replace host mode and break your HA / host-bound service access. Resource bounds (Prompt 2) will not apply network sysctls in host mode either; Docker rejects them and the container would fail to start." - Detect hermit ports: run
timeout 10s docker compose "${COMPOSE_FILES[@]}" config --format json 2>/dev/nulland parse.services.hermit.ports. Store as in-memorydetected_hermit_ports(array of long-form Compose port objects:{target, published, host_ip, protocol, mode}). If the command fails or returns no JSON, scan the selected Compose files forports:keys and setdetected_hermit_ports_unparsed=trueif found. Either way, a non-empty result means ports are present. - Check whether the container is currently running:
docker compose "${COMPOSE_FILES[@]}" ps --status running --format '{{.Service}}' 2>/dev/null | grep -x hermit. If absent, tell the operator "The wizard will write the overlay. Start the container withhermitd start --buildbefore live verification." - Read current
docker.security.*from config.json. Also readsandbox.enabledfrom the target settings file (samehatch_targetrouting as hatch/docker-setup:hatch_target == "local"→.claude/settings.local.json; else →.claude/settings.json) — display only, hermit does not configure this key. Print a "current posture" summary. Example:
``` Current security posture: LAN containment: off Resource bounds: off Audit log: off Credential proxy: off
Baseline (always on): cap_drop: ALL, no-new-privileges, pids_limit: 2048
Sandbox (bash tool isolation, operator-managed via /sandbox): enabled: true (or: false / not configured) ```
2. Trust model framing
Print the trust-model paragraph from the top of this file (the blockquote). Then continue.
3. Prompt 1 — LAN containment + DNS policy
If HOST_NETWORK_MODE is true, do not present this prompt. Tell the operator: "Skipping LAN containment — incompatible with network_mode: host. Run /hermitd:docker-setup to switch to bridge mode if you want this hardening." Continue to step 4.
Otherwise, ask with AskUserQuestion (header: "LAN containment"):
Map: "Yes — recommended" → dns_mode: "log-only". "Yes — strict" → dns_mode: "enforce". "No" → skip to step 4.
3-pre. Port conflict handling (only if a "Yes" option was selected above)
If the operator selected a "Yes" option AND detected_hermit_ports is non-empty (or detected_hermit_ports_unparsed=true), surface a follow-up AskUserQuestion (header: "Port publishing") immediately:
Options:
"Move ports to netguard (recommended)"— render the sameports:block onhermit-netguardin the overlay. Persist todocker.security.network.publish_ports. After overlay is written (step 6), show a diff and use the Step 7 override auto-fix to clearservices.hermit.ports; never edit the generated base file."Skip LAN containment (keep ports on hermit)"— clear the LAN containment selection (treat as if operator answered No above). Setlan_containment_skipped_due_to_ports=true. Continue to step 4."Cancel"— print "Re-run /docker-security after deciding how to handle your port publishing. See docs/docker-security.md for guidance." Exit. Write nothing.
If operator chose "Skip LAN containment": proceed to step 4 without any LAN containment config. Step 9 final-report notes: "LAN containment skipped — docker-compose.hermit.yml has a ports: block on hermit that is incompatible with network_mode: service:hermit-netguard."
3a. Fleet-aware domain seeding
Scan installed fleet plugins. From the host:
It emits a JSON array of the project-or-local + enabled hermit siblings (each carrying plugin, installPath), already excluding user-scope, disabled, cross-project, and hermitd itself.
For each entry:
- Locate the plugin's installed root using the
installPathfield from the JSON. - Read
<plugin>/skills/hatch/SKILL.mdand look for a## Docker network requirementsheading. Also check<plugin>/DOCKER.md. Stop at the next##heading. - Within that section, parse:
### Domains (DNS allowlist)— bullet entries are domain names. Validate against^[a-z0-9][a-z0-9.-]+$. Reject failing entries with a warning.### LAN allowlist suggestions— bullet entries are either IPv4 CIDRs (validate with regex) OR the special tokenASK_OPERATOR_FOR_HA_IP(or otherASK_OPERATOR_FOR_*_IPpatterns). Reject failing CIDRs.
- Track provenance: each entry remembers which plugin contributed it.
If the deduped fleet list is non-empty, present plain text first:
Then ask once with AskUserQuestion (header: "Fleet network entries"):
"Include all"(Recommended)"Pick each""Skip all"
On "Pick each": loop through each entry with a 2-option AskUserQuestion ("Include" / "Skip").
For every confirmed ASK_OPERATOR_FOR_HA_IP (or similar): immediately follow up with AskUserQuestion (header: "<plugin> IP") — Other field accepting an IPv4 address or CIDR. Validate. Re-prompt on invalid. Replace the token with the typed value.
Confirmed entries are added to in-memory fleet_lan_allowlist and fleet_domains for step 6.
If the fleet list is empty: skip silently.
3b. Extra LAN carve-outs
In enforce mode a carve-out is also how a literal public IP, or the IP behind a pinned hostname, is allowed.
AskUserQuestion (header: "Extra LAN carve-outs"):
"None""Add IPs/ranges"(Other field, comma-separated, IPv4 CIDR validated; re-prompt on invalid)
Persist to lan_allowlist (combined with fleet_lan_allowlist).
3c. Extra domains
First offer the project's remote MCP servers:
It prints { "hosts": [{ "host", "server" }] }. When the list is non-empty, show each host with its server name and ask once (header: "MCP hosts") with the same "Include all" (Recommended) / "Pick each" / "Skip all" flow as 3a. Confirmed hosts join additional_domains.
In enforce mode, also offer the hosts mapped for the credential proxy: run hermitd credproxy status (a host terminal command; skip silently if it fails) and offer each host from its bindings with the same flow. Mapping a host never adds it to the allowlist by itself.
Channel and voice-note hosts are not asked here: the render adds them from config.json for enabled channels and while transcription is enabled.
AskUserQuestion (header: "Extra domains"):
"None (use defaults + fleet)""Add domains"(Other field, comma-separated, domain regex validated; re-prompt on invalid)
Persist to additional_domains (combined with fleet_domains).
3d. Persist Prompt 1 selections
4. Prompt 2 — Resource bounds + kernel hygiene
AskUserQuestion (header: "Resource bounds"):
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingplugins/hermitd/skills/docker-security/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Extension points
configConfiguration overrides
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/gtapps/hermitd/docker-security)