docker-container-security

docker-container-security is a skill for Claude Code, Codex from GoldenWing-360/claude-security-skills. It costs 89 tokens per session (2,300 once invoked), scanned A, original, MIT.

A practical security guide for running Docker containers on a single VPS or small cluster. It covers safer users, filesystems, Linux permissions, secrets, image scanning, small base images, and firewall behavior.

In plain words
What is it for?
Use it when writing Dockerfiles or Compose files for production, installing Docker on a VPS, publishing images, auditing containers, or responding to a base-image security issue.
Why use it?
It helps prevent containers from running with unnecessary access and avoids a common mistake where Docker-published ports can bypass UFW firewall rules. It also addresses secrets accidentally being included in images.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when writing Dockerfiles or Compose files for production, installing Docker on a VPS, publishing images, auditing containers, or responding to a base-image security issue.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/goldenwing-360/claude-security-skills/docker-container-security
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add GoldenWing-360/claude-security-skills --skill docker-container-security
Clone the repo
git clone --depth 1 https://github.com/GoldenWing-360/claude-security-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for docker-container-security

README.md
[![agentmods](https://agentmods.dev/badge/skills/goldenwing-360/claude-security-skills/docker-container-security/github.svg)](https://agentmods.dev/skills/goldenwing-360/claude-security-skills/docker-container-security)
Your own site
<a href="https://agentmods.dev/skills/goldenwing-360/claude-security-skills/docker-container-security"><img src="https://agentmods.dev/badge/skills/goldenwing-360/claude-security-skills/docker-container-security/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for docker-container-security

Your own site · 80×15
<a href="https://agentmods.dev/skills/goldenwing-360/claude-security-skills/docker-container-security"><img src="https://agentmods.dev/badge/skills/goldenwing-360/claude-security-skills/docker-container-security.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 89 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,300 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 2 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00089 $0.02300
Opus 5 $0.00044 $0.01150
Sonnet 5 $0.00018 $0.00460
Haiku 4.5 $0.00009 $0.00230

Measured 10d ago against content hash 89dc4dd5a6bd, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

docker-container-security scanned grade A with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Asks for rootlowPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

sudo wget -O /usr/local/bin/ufw-docker \

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

sudo wget -O /usr/local/bin/ufw-docker \
docker-container-security/SKILL.md · 255 lines

How it starts

The opening of the file, as written. The whole thing — 255 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Docker / Container Security

A pragmatic baseline for Docker on a single VPS or a small cluster. Covers the Dockerfile, the run-time configuration, and the host-side gotchas — particularly the UFW-bypass that catches most people once.

When to invoke

  • Installing Docker on a VPS that has UFW (read the UFW section first — Docker bypasses UFW by default)
  • Writing a new Dockerfile or docker-compose.yml for production
  • Pushing an image to a public registry
  • Periodic audit of running containers
  • After a base-image CVE that affects your stack

The UFW bypass — read this first

Docker manipulates iptables directly. By default, ports published with -p are exposed to the world, even if UFW says they should not be. ufw status will mislead you.

Two options:

Option A — use ufw-docker (community-maintained, robust):

# Install ufw-docker
sudo wget -O /usr/local/bin/ufw-docker \
  https://github.com/chaifeng/ufw-docker/raw/master/ufw-docker
sudo chmod +x /usr/local/bin/ufw-docker
sudo ufw-docker install
sudo systemctl restart ufw

# Then allow per-container:
sudo ufw-docker allow web 80/tcp

Option B — bind to localhost when you front with a reverse proxy:

# docker-compose.yml — bind to 127.0.0.1, not 0.0.0.0
services:
  app:
    ports:
      - "127.0.0.1:9000:9000"   # host nginx proxies to this

Verify:

sudo ss -tlnp | grep docker     # should not show 0.0.0.0:<port> for internal services

Dockerfile baseline

Every production Dockerfile should:

  1. Run as a non-root user
  2. Pin the base image to a specific digest or version tag (not latest)
  3. Drop build tools from the final image
  4. Not contain secrets baked in
# Pin to specific Node version; consider digest pinning for stricter supply chain
FROM node:20.11.1-bookworm-slim AS deps
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci --omit=dev

FROM node:20.11.1-bookworm-slim
WORKDIR /app

# Create non-root user
RUN groupadd -r app && useradd -r -g app -d /app -s /sbin/nologin app

COPY --from=deps /app/node_modules ./node_modules
COPY --chown=app:app . .

USER app
EXPOSE 3000

# Use exec form so the process becomes PID 1 and receives signals
CMD ["node", "server.js"]

Read the full file on GitHub · 255 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 255 lines · 89 tokens per session scan A 89dc4dd5a6bd

Subscribe to this mod's changes

docker-container-security is a skill published in the GitHub repository GoldenWing-360/claude-security-skills (17 stars, last pushed 1mo ago), licensed MIT. It adds 89 tokens to every session and 2,300 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 2 findings (asks for root, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

nemoclaw-setup

Install and configure NVIDIA NemoClaw (sandboxed OpenClaw agent platform) on Linux. Handles cloudflared tunnels, Docker cgroup fixes, OpenShell, sandbox creation, remote access via Cloudflare Tunnel, and known bug workarounds. Use whenever the user mentions installing NemoClaw, setting up OpenClaw, configuring an…

jezweb/claude-skills · 91 tokens

dockerfile-scan

Scan a Dockerfile for insecure build patterns — running as root, unpinned or :latest base images, ADD from remote URLs, piping curl/wget into a shell, hardcoded secrets in ENV/ARG, world-writable chmod 777, and sudo usage. Use when the user asks to "review my Dockerfile", "is this container image secure", "lint my…

NovaCode37/claude-security-skills · 96 tokens

manage-mounts

Configure which host directories agent containers can access. View, add, or remove mount allowlist entries. Triggers on "mounts", "mount allowlist", "agent access to directories", "container mounts".

nanocoai/nanoclaw · 47 tokens

kubernetes-specialist

Use when deploying or managing Kubernetes workloads. Invoke to create deployment manifests, configure pod security policies, set up service accounts, define network isolation rules, debug pod crashes, analyze resource limits, inspect container logs, or right-size workloads. Use for Helm charts, RBAC policies…

Jeffallan/claude-skills · 79 tokens

devops-engineer

Creates Dockerfiles, configures CI/CD pipelines, writes Kubernetes manifests, and generates Terraform/Pulumi infrastructure templates. Handles deployment automation, GitOps configuration, incident response runbooks, and internal developer platform tooling. Use when setting up CI/CD pipelines, containerizing…

Jeffallan/claude-skills · 107 tokens

offensive-container-escape

Container escape and breakout techniques targeting Docker, containerd, and Podman runtimes. Covers privileged container breakout via host filesystem mount and nsenter, Docker socket abuse through /var/run/docker.sock, Linux capability exploitation including CAPSYSADMIN, CAPSYSPTRACE, and CAPNETADMIN, cgroup v1…

SnailSploit/Claude-Red · 196 tokens