- Home
- Skills
- DevOps & Cloud
- Docker & Container Hardening Suite
Docker & Container Hardening Suite
Audit Dockerfiles, compose setups, and live containers for CIS benchmarks, root escalation, Linux capabilities, and immutable rootfs.
Free
Works with the AI Agents you already use
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
| Severity | Code | Title | Affected File / Line | Recommended Mitigation |
|---|---|---|---|---|
| CRITICAL | DF-NO-USER | Container Runs as Root (UID 0) | Dockerfile:L1 | Add unprivileged USER 10001:10001 |
| HIGH | DC-NO-NEW-PRIV | Missing no-new-privileges | docker-compose.yml:L8 | Add security_opt: [no-new-privileges:true] |
| MEDIUM | DC-NO-CAP-DROP | Capabilities Not Dropped | docker-compose.yml:L10 | Add 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
- Rebuild the image using the new Dockerfile to verify the non-root user has sufficient permissions for your application.
- Run
docker compose upand check logs for any "Read-only file system" errors that might require additionaltmpfspaths. - 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
Dockerfileanddocker-compose.ymlfor 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, andDocklefor a unified vulnerability view.
How it works
- Analyze your local configuration files or repo structure for container assets.
- Audit findings against the 10-point benchmark, covering everything from Linux capabilities to secret hygiene.
- Inspect live running containers via provided shell commands to verify actual effective permissions.
- 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
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
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 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