Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    Docker & Compose Production Linter

    1

    Audit Dockerfiles and Compose files for root containers, leaked secrets, missing healthchecks, and unsafe privileges—with a zero-dependency read-only Python linter and approval-gated hardened diffs.

    Free

    Security scanned
    Docker & Compose Production Linter

    Docker & Compose Production Linter

    Example session with this skill installed

    Audit our Dockerfile and docker-compose.yml for production readiness before we deploy our Node.js + Postgres + Redis app. Flag critical security issues first and show hardened fixes before editing any files.

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

    Docker & Compose Production Readiness Report

    Verdict: FAIL · Grade: F (0/100) · Findings: 3 Critical, 4 High, 5 Medium, 1 Low

    RuleSeverityLocationFindingRemediation
    DKR-002CriticalDockerfile:1Final stage runs as root (no non-root USER)Add dedicated non-root USER 1001:1001
    DKR-003CriticalDockerfile:6Credential-like literal in ENV API_SECRET=[REDACTED]Remove from image; inject at runtime via secrets
    CMP-001Criticaldocker-compose.yml:14Service api sets privileged: trueRemove privileged: true; add cap_drop: [ALL]
    CMP-002Criticaldocker-compose.yml:18Docker socket /var/run/docker.sock mounted into appRemove host socket mount immediately
    CMP-004Highdocker-compose.yml:29Postgres port 5432:5432 exposed on all interfacesBind to 127.0.0.1:5432:5432 or internal network only
    DKR-004HighDockerfile:1Missing HEALTHCHECK in final stageAdd lightweight HTTP /healthz check

    Proposed Hardened Dockerfile (Multi-Stage, Non-Root)

    FROM node:20.18.1-alpine AS builder
    WORKDIR /app
    COPY package.json package-lock.json ./
    RUN npm ci
    COPY . .
    RUN npm run build
    
    FROM node:20.18.1-alpine AS runner
    WORKDIR /app
    RUN addgroup -S app && adduser -S app -G app
    COPY --from=builder --chown=app:app /app/dist ./dist
    COPY --from=builder --chown=app:app /app/node_modules ./node_modules
    USER app
    HEALTHCHECK --interval=30s --timeout=3s CMD wget -qO- http://127.0.0.1:3000/healthz || exit 1
    CMD ["node", "dist/server.js"]
    

    Next Steps (Approval Required)

    1. Rotate any credentials previously baked into image layers.
    2. Reply

    "Apply hardened patches" to write the updated Dockerfile, docker-compose.yml, and .dockerignore (bringing the stack to

    Grade A / 100/100).

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

    About this skill

    Stop Shipping Insecure Containers to Production

    Docker & Compose Production Linter gives your AI coding agent a senior DevOps review workflow plus a zero-dependency, strictly read-only Python static analyzer (scripts/lint_docker.py) that catches 17 high-impact container misconfigurations with exact file paths, line numbers, and PR-ready hardened patches.

    What It Catches (17 Deterministic Rules)

    • Dockerfile Hardening (DKR-001–DKR-009): Unpinned :latest base images, missing non-root USER, baked-in secrets in ENV/ARG (automatically [REDACTED]), missing HEALTHCHECK, unsafe ADD usage, bloated apt-get layers, piped curl | sh installs, missing .dockerignore, and heavy single-stage builds.
    • Docker Compose Safety (CMP-001–CMP-008): privileged: true, mounted /var/run/docker.sock, network_mode: host / pid: host, publicly exposed database/cache ports (0.0.0.0:5432), missing restart policies or resource limits, missing service healthchecks, hardcoded inline credentials, and unpinned image tags.

    How to Use

    Ask your AI agent naturally in any repo containing a Dockerfile or docker-compose.yml:

    • "Audit my Dockerfile and docker-compose.yml for production readiness."
    • "Harden our container stack before deploying to production—show me the risk scorecard first."
    • "Check if our Docker setup has root containers, exposed DB ports, or secret leaks."

    Or run the bundled read-only analyzer directly:

    python3 scripts/lint_docker.py --path . --format markdown
    

    What's Inside (16 Files)

    • SKILL.md — Deterministic 5-step audit workflow with A–F readiness grading and explicit approval gate before any file edit
    • scripts/lint_docker.py — Pure Python 3 stdlib static analyzer (zero pip installs, JSON & Markdown output, --fail-on CI gate)
    • references/ — Dockerfile hardening guide, Compose production checklist, and full 17-rule catalog
    • templates/ — Executive audit report & approval-gated hardened patch plan
    • examples/ — Worked Node.js + Postgres + Redis before/after audit
    • tests/ — Vulnerable & hardened fixtures plus runnable unit tests

    Security & Privacy Guarantee

    • 100% read-only by default — never modifies files without your explicit confirmation.
    • Zero .env reading, zero network calls, zero shell execution inside the analyzer script.
    • Any suspected credential value is automatically masked as [REDACTED].

    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.

    Performs static analysis on Dockerfile and Docker Compose YAML files; does not inspect live Docker daemon runtime state or binary image layers.

    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

    Free to use

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed 2 days ago

    • Free with an Agensi account

    Software
    Python 3.9+ (stdlib only)

    Permissions

    Terminal / Shell
    Read Files
    Write Files

    Bundled analyzer is 100% read-only with zero network or env-var access. Write Files is only used after explicit user approval to apply hardened diffs.

    Listed2 days ago

    What's inside

    Frequently Asked Questions

    The skill performs a deep static analysis of your Dockerfiles and Compose stacks to identify 17 critical risks, including root-user vulnerabilities, missing resource limits, and insecure socket mounts that generic LLM prompts often overlook.

    This skill is designed for any AI agent or platform that supports Python-based execution or file-system access, as it uses a self-contained engine with zero external network dependencies.

    No, the skill operates purely via static analysis; it audits your configuration code without executing containers or pulling remote images, ensuring your environment remains secure during the review.

    You receive the core static analysis engine, the 17-rule production security rubric, the readiness scoring system, and the automated patch generation module for instant remediation.

    The linter provides a deterministic A-F readiness score and a PASS/FAIL gate, allowing you to set an objective standard for whether a configuration is safe enough for production deployment.

    To protect your sensitive data, the skill is intentionally blocked from reading the actual values inside .env or credential files, focusing instead on the structural security of how those files are referenced.

    New in DevOps & Cloud

    Free