Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    Docker Compose Security and Reliability Review

    by Saizul Amin

    1

    Audit Docker Compose files for UFW firewall bypasses, literal secrets, and production reliability risks.

    $4

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned
    Docker Compose Security and Reliability Review

    Docker Compose Security and Reliability Review

    Example session with this skill installed

    Review my docker-compose file for security and reliability problems before I deploy it to my VPS.

    • Read your context and instructions
    • Compiled the docker compose security

    I ran the bundled script from the docker-compose-review skill and reviewed its findings.

    Demo data: this is the real, unedited output of the skill's script on the test fixture that ships with its source repo.

    Script output

    [HIGH  ] agent: privileged: true gives the container full control of the host
             fix: Remove privileged; add only the specific cap_add/devices needed
    [HIGH  ] agent: cap_add SYS_ADMIN weakens container isolation
             fix: Drop it unless strictly required
    [HIGH  ] agent: environment API_TOKEN has a literal value in the compose file (value hidden)
             fix: Use API_TOKEN: ${API_TOKEN} with an untracked .env file, or Compose secrets and API_TOKEN_FILE: /run/secrets/...
    [HIGH  ] agent: Mounts sensitive host path /
             fix: Mount only the specific subdirectory the service needs
    [HIGH  ] db: PostgreSQL port 5432->5432 is published on all interfaces (Docker bypasses UFW)
             fix: ports: ["127.0.0.1:5432:5432"]  or remove ports and use the internal network
    [HIGH  ] db: environment POSTGRES_PASSWORD has a literal value in the compose file (value hidden)
             fix: Use POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} with an untracked .env file, or Compose secrets and POSTGRES_PASSWORD_FILE: /run/secrets/...
    [HIGH  ] redis: Redis port 6379->6379 is published on all interfaces (Docker bypasses UFW)
             fix: ports: ["127.0.0.1:6379:6379"]  or remove ports and use the internal network
    [HIGH  ] web: Mounts the Docker socket (read-only does not help): root on the host if the container is compromised
             fix: Use a socket proxy (e.g. tecnativa/docker-socket-proxy) with minimal API access
    [MEDIUM] agent: network_mode: host exposes every port the app opens on the host
             fix: Use a bridge network and publish only the needed ports on 127.0.0.1
    [MEDIUM] db: Image postgres:latest is not pinned (floating tag :latest)
             fix: Pin a version tag (postgres:16.4) or a digest (image@sha256:...)
    [MEDIUM] web: Image nginx is not pinned (no tag (means :latest))
             fix: Pin a version tag (postgres:16.4) or a digest (image@sha256:...)
    [MEDIUM] web: Port 8080->8080 is published on all interfaces (Docker bypasses UFW)
             fix: Bind to localhost behind a reverse proxy: "127.0.0.1:8080:8080"
    [LOW   ] agent: No healthcheck in compose (fine only if the image defines HEALTHCHECK)
             fix: healthcheck: {test: ["CMD", "curl", "-fsS", "http://localhost/health"], interval: 30s, timeout: 5s, retries: 3}
    [LOW   ] agent: No restart policy (container stays down after a crash or reboot)
             fix: restart: unless-stopped
    [LOW   ] agent: No memory limit (one leak can trigger the host OOM killer)
             fix: mem_limit: 512m  # or deploy.resources.limits.memory
    [LOW   ] agent: json-file logs without max-size grow until the disk is full
             fix: logging: {driver: json-file, options: {max-size: "10m", max-file: "3"}}  (or set it once in /etc/docker/daemon.json)
    [LOW   ] db: No healthcheck in compose (fine only if the image defines HEALTHCHECK)
             fix: healthcheck: {test: ["CMD", "curl", "-fsS", "http://localhost/health"], interval: 30s, timeout: 5s, retries: 3}
    [LOW   ] db: No restart policy (container stays down after a crash or reboot)
             fix: restart: unless-stopped
    [LOW   ] db: No memory limit (one leak can trigger the host OOM killer)
             fix: mem_limit: 512m  # or deploy.resources.limits.memory
    [LOW   ] db: json-file logs without max-size grow until the disk is full
             fix: logging: {driver: json-file, options: {max-size: "10m", max-file: "3"}}  (or set it once in /etc/docker/daemon.json)
    [LOW   ] redis: No healthcheck in compose (fine only if the image defines HEALTHCHECK)
             fix: healthcheck: {test: ["CMD", "curl", "-fsS", "http://localhost/health"], interval: 30s, timeout: 5s, retries: 3}
    [LOW   ] redis: No restart policy (container stays down after a crash or reboot)
             fix: restart: unless-stopped
    [LOW   ] redis: No memory limit (one leak can trigger the host OOM killer)
             fix: mem_limit: 512m  # or deploy.resources.limits.memory
    [LOW   ] redis: json-file logs without max-size grow until the disk is full
             fix: logging: {driver: json-file, options: {max-size: "10m", max-file: "3"}}  (or set it once in /etc/docker/daemon.json)
    [LOW   ] web: No healthcheck in compose (fine only if the image defines HEALTHCHECK)
             fix: healthcheck: {test: ["CMD", "curl", "-fsS", "http://localhost/health"], interval: 30s, timeout: 5s, retries: 3}
    [LOW   ] web: No restart policy (container stays down after a crash or reboot)
             fix: restart: unless-stopped
    [LOW   ] web: No memory limit (one leak can trigger the host OOM killer)
             fix: mem_limit: 512m  # or deploy.resources.limits.memory
    [LOW   ] web: json-file logs without max-size grow until the disk is full
             fix: logging: {driver: json-file, options: {max-size: "10m", max-file: "3"}}  (or set it once in /etc/docker/daemon.json)
    [INFO  ] -: Top-level 'version' is obsolete and ignored by Compose v2
             fix: Delete the version: line
    Summary: 8 high, 4 medium, 16 low, 1 info
    

    Next steps

    1. Remove privileged mode and extra capabilities first.
    2. Move literal secrets into an env file or Docker secrets and rotate them.
    3. Add healthchecks, restart policies and resource limits, then re-run the review.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Docker Compose files often contain silent configuration errors that lead to data exposure, disk exhaustion, or production downtime. This skill audits your docker-compose.yml for security vulnerabilities and stability risks before you deploy to a VPS.

    What it does

    • Network Security Audit identifies ports published on 0.0.0.0 that bypass UFW firewalls and exposes internal databases.
    • Secret Detection flags literal passwords and API keys in environment variables that should be in .env files.
    • Resource Management checks for missing memory limits, log rotation policies, and restart configurations.
    • Stability Analysis detects unpinned image tags and missing healthchecks that cause silent service failures.
    • Privilege Review finds dangerous host mounts, docker.sock exposures, and privileged mode containers.

    How it works

    1. Config Analysis starts by running the script on your compose.yaml or a resolved compose.json to inspect service definitions.
    2. Severity Grading categorizes findings from High (data exposure) to Low (reliability improvements).
    3. UFW Bypass Check specifically validates if published ports are accessible from the public internet despite host firewall rules.
    4. Remediation Proposal generates a hardened version of your Compose file with corrected network bindings and resource constraints.

    Frameworks & tools

    This skill utilizes python3 for the auditing script and docker-compose for configuration validation. It works with standard YAML compose files or JSON output from docker compose config.

    Why this beats prompting it yourself

    Generic LLMs often overlook the specific way Docker manipulates iptables, leading to false confidence in UFW rules. This skill follows a strict severity guide and provides a structured diff that maintains your service names and network architecture while fixing deep infrastructure flaws.

    Use cases

    • Hardening a fresh VPS deployment to ensure no databases are publicly reachable.
    • Adding log rotation to prevent containers from filling up the host disk.
    • Auditing a legacy stack for hardcoded secrets and privileged escalation risks.
    • Improving container reliability with proper healthchecks and memory limits.

    Known limitations

    Does not scan images for CVEs or audit Kubernetes manifests. Requires PyYAML for direct YAML parsing or a Docker environment to generate JSON config.


    Open source: saizul/vps-devops-skills on GitHub (MIT licence, by Saizul Amin).

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for DevOps & Cloud.

    Does not scan image layers for CVEs. Direct YAML parsing requires PyYAML. Focused on single-host VPS deployments rather than Swarm or Kubernetes orchestration.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Frequently Asked Questions

    Standard UFW rules are often bypassed by Docker's direct manipulation of iptables. This skill specifically identifies exposed '0.0.0.0' bindings and provides the exact syntax needed to bind services to the local loopback or specific internal interfaces.

    This skill is compatible with any AI agent capable of executing Python scripts or analyzing structured YAML/JSON data. It is designed to process standard 'docker-compose.yml' files or the output from the 'docker compose config' command.

    You receive the auditing engine, a set of severity-graded security policies, and a remediation template. It includes logic to detect resource leaks, unpinned images, and hardcoded secrets while generating a hardened version of your original file.

    No, this skill focuses strictly on the configuration and orchestration layer. It audits how containers interact with the host and network, but it does not perform deep binary scanning for vulnerabilities within the container images themselves.

    The skill requires a Python 3 environment and the PyYAML library if you are parsing YAML files directly. For the most accurate results, it is recommended to have Docker installed so the skill can analyze the 'resolved' configuration via 'docker compose config'.

    The skill provides a structured diff and a remediation proposal. It suggests specific fixes—such as log rotation limits, memory constraints, and healthchecks—allowing you to review and apply the hardening measures without losing your custom network architecture.

    New in DevOps & Cloud