Docker & Container Hardening Suite

    1

    Audit Dockerfiles, compose setups, and live containers for CIS benchmarks, root escalation, Linux capabilities, and immutable rootfs.

    Free

    Security scanned

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    Docker & Container Hardening Suite

    Example session with this skill installed

    Audit the Dockerfile and docker-compose.yml in this project for CIS compliance and provide a hardened version that eliminates root execution and drops all capabilities.

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

    I have audited your container configuration files against the CIS Docker Benchmark v1.6.0. The current setup allows root execution and lacks capability restrictions, creating a high risk for host breakout.

    🛡️ Docker Security Audit: Project Root

    SeverityCodeTitleAffected File / LineRecommended Mitigation
    CRITICALDF-NO-USERContainer Runs as Root (UID 0)Dockerfile:L1Add unprivileged USER 10001:10001
    HIGHDC-NO-NEW-PRIVMissing no-new-privilegesdocker-compose.yml:L8Add security_opt: [no-new-privileges:true]
    MEDIUMDC-NO-CAP-DROPCapabilities Not Droppeddocker-compose.yml:L10Add cap_drop: [ALL]

    Hardened Configuration

    
    # Hardened Dockerfile
    FROM python:3.11-slim@sha256:7f0c1a4b95f2694b8e8f8564f9bf51737e1b9b91c13d7ff43a5796a5dd608bfa
    WORKDIR /app
    RUN groupadd -g 10001 appgroup && \
        useradd -u 10001 -g appgroup -s /usr/sbin/nologin -M appuser
    COPY --chown=appuser:appgroup . .
    USER 10001:10001
    HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
      CMD curl -f http://localhost:8080/health || exit 1
    ENTRYPOINT ["python", "main.py"]
    
    
    # Hardened docker-compose.yml
    services:
      web:
        build: .
        read_only: true
        security_opt:
          - no-new-privileges:true
        cap_drop:
          - ALL
        tmpfs:
          - /tmp:rw,noexec,nosuid,size=64m
        deploy:
          resources:
            limits:
              memory: 512M
    

    Next steps

    1. Rebuild the image using the new Dockerfile to verify the non-root user has sufficient permissions for your application.
    2. Run docker compose up and check logs for any "Read-only file system" errors that might require additional tmpfs paths.
    3. Verify the healthcheck status using docker ps.

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

    About this skill

    Containers are the weakest link in your production environment if left unconfigured. This skill stops the trial-and-error approach to container security by auditing your stack against the CIS Docker Benchmark v1.6.0. It identifies root execution risks, privilege escalation paths, and dangerous host mounts that lead to host breakouts.

    What it does

    • CIS Benchmark Auditing evaluates configurations against 10 security pillars including root execution and resource limits.
    • Static Analysis scans Dockerfile and docker-compose.yml for misconfigurations like missing healthchecks or unpinned base images.
    • Runtime Triage provides specific commands to inspect kernel capabilities and SUID binaries inside live containers.
    • Auto-Remediation generates copy-pasteable hardened configurations with non-root users and immutable filesystems.
    • Tool Orchestration integrates outputs from Trivy, Hadolint, and Dockle for a unified vulnerability view.

    How it works

    1. Analyze your local configuration files or repo structure for container assets.
    2. Audit findings against the 10-point benchmark, covering everything from Linux capabilities to secret hygiene.
    3. Inspect live running containers via provided shell commands to verify actual effective permissions.
    4. Remediate by applying a Hardening Audit Report with a full findings matrix and corrected code blocks.

    Frameworks & tools

    This skill works with Docker, Docker Compose, and Kubernetes manifests. It utilizes security tools including Trivy, Hadolint, and Dockle, along with a custom Python auditor for zero-dependency scans.

    Why this beats prompting it yourself

    Generic security prompts often miss specific CIS benchmark IDs or fail to provide the exact UID/GID syntax for non-root execution. This skill uses a structured 10-point methodology to ensure nothing like a leaked Docker socket or an inherited CAP_NET_RAW capability is overlooked.

    Use cases

    • Auditing a legacy Dockerfile to remove root execution and add healthchecks.
    • Preparing containerized workloads for a production Kubernetes or AWS ECS deployment.
    • Performing live incident response triage to check for container escape vulnerabilities.
    • Integrating automated security linting into GitHub Actions or GitLab CI pipelines.

    Known limitations

    Requires manual execution of triage commands if an agent does not have direct terminal access to the running container. Static analysis is limited to files present in the provided context.

    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.

    Manual execution of triage commands is required if the agent lacks direct terminal access to the container. Static analysis only covers files in the immediate workspace.

    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 6 days ago

    • Free with an Agensi account

    Software
    Python

    Permissions

    Terminal / Shell
    Read Files
    Write Files
    Listed6 days ago

    What's inside

    Frequently Asked Questions

    The auditor performs a deep scan against the CIS Docker Benchmark v1.6.0, identifying high-risk configurations like root execution, dangerous host mounts, and missing resource limits that could lead to container escapes.

    Yes, the skill is designed to audit individual Dockerfiles, Docker Compose files, and Kubernetes manifests, providing specific remediation code for each format.

    You receive the core auditing logic, a pre-configured workflow for benchmark analysis, and a suite of remediation templates to fix identified vulnerabilities.

    No direct access is required; the skill performs static analysis on your configuration files and provides you with specific shell commands to run manually for live runtime triage.

    The skill is regularly updated to include the latest CIS Benchmark standards and to maintain compatibility with new versions of integrated tools like Trivy and Hadolint.

    Unlike basic prompts, this skill uses a structured 10-point auditing methodology and specific benchmark IDs to ensure that complex issues like SUID binaries and Linux kernel capabilities aren't overlooked.

    New in DevOps & Cloud

    Free