- Home
- Skills
- DevOps & Cloud
- Docker Compose Security and Reliability Review
Works with the AI Agents you already use
Docker Compose Security and Reliability Review
by Saizul Amin
Audit Docker Compose files for UFW firewall bypasses, literal secrets, and production reliability risks.
$4
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
- Remove privileged mode and extra capabilities first.
- Move literal secrets into an env file or Docker secrets and rotate them.
- 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.0that bypass UFW firewalls and exposes internal databases. - Secret Detection flags literal passwords and API keys in environment variables that should be in
.envfiles. - 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.sockexposures, and privileged mode containers.
How it works
- Config Analysis starts by running the script on your
compose.yamlor a resolvedcompose.jsonto inspect service definitions. - Severity Grading categorizes findings from High (data exposure) to Low (reliability improvements).
- UFW Bypass Check specifically validates if published ports are accessible from the public internet despite host firewall rules.
- 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
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
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 2 days ago
- Software
Python 3.8+