Dockerfile Security Gate
by Prateek
Scores a Dockerfile for root users, leaked secrets, unpinned images and risky build steps, with the line to change.
Free
What it does
- Finds secrets left in ENV and ARG
- Flags root users and privileged build steps
- Catches unpinned images and pipe-to-shell downloads
- Scores the file and gives each fix by line number
Who it's for
Developers shipping to production
Find security holes and hidden secrets in your container images before you deploy.
Try asking: “Check this Dockerfile for security issues.”
DevOps teams managing build pipelines
Enforce best practices and reduce image size across your team's projects.
Try asking: “Audit the Dockerfiles in this folder and show me which ones fail.”
Security reviewers and auditors
Quickly spot dangerous patterns like root users or leaked credentials in build files.
Try asking: “Run a security scan on this Dockerfile and give it a grade.”
Dockerfile Security Gate
Example session with this skill installed
Please review my Dockerfile for security problems. I want to make sure I am not leaking secrets or running as root.
- Read your context and instructions
- Compiled the dockerfile security gate
I have reviewed your Dockerfile for security and reliability. Here is the report:
Score: 45/100 (Grade: F)
Verdict: FAIL
Findings
| Line | Severity | Rule | Why | Fix |
|---|---|---|---|---|
| 1 | Medium | Unpinned Image | Using latest can break builds | Use a version tag or digest |
| 4 | Critical | Leaked Secret | DB_PASSWORD found in ENV | Use build secrets or runtime config |
| 8 | High | Root User | No non-root user defined | Add a USER instruction |
| 10 | Low | Image Bloat | Missing apt cleanup | Add --no-install-recommends |
Hardened Snippet
Here are the suggested changes for your file:
# Pin your version for stability
FROM python:3.11-slim
# Remove secrets from ENV and clean up layers
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc \
&& rm -rf /var/lib/apt/lists/*
# Create and use a non-root user
RUN useradd -m appuser
USER appuser
CMD ["python", "app.py"]
Would you like me to explain how to move that password into a safe runtime configuration?
Connects securely to your tools. The creator never sees your data.
About this skill
This skill checks your Dockerfile for common mistakes that make containers slow, heavy, or easy to hack. It looks at how you build your images and points out exactly which lines are dangerous, like running as a root user or leaving passwords in the code.
How it works
- You provide a Dockerfile or the text of one.
- The skill runs a check against a set of security and reliability rules.
- You get a security score from 0 to 100 and a letter grade.
- You see a table of every problem found, including the line number and how to fix it.
- You receive a corrected version of the risky parts of your code.
Frameworks & tools
This skill uses a Python script to analyze your text files.
Why this beats prompting it yourself
While a standard chat might give general advice, this skill uses a specific set of rules to score your file objectively. It checks for technical details that are easy to miss, like missing install flags that make your images too large or unsafe download methods that could let in viruses.
Use cases
- Fix a Dockerfile that failed a company security scan
- Find and remove secrets or API keys accidentally left in your build files
- Make your container images smaller by cleaning up install steps
- Stop containers from running with root privileges
Known limitations
This skill only reads the text in your file. It cannot run the build or see inside the files you are copying into the image.
Built to analyze Dockerfile instructions using a Python linter script (lint_dockerfile.py). It checks for security risks (root usage, secrets in ENV/ARG), reliability (unpinned images, ADD vs COPY), and optimization (apt-get cleanup, HEALTHCHECK). Supports multi-stage builds by focusing runtime rules on the final stage. Outputs a structured report with a 0-100 score, severity-based findings table, and a corrected code snippet.
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 1 day ago
- Free with an Agensi account
- Software
Python 3.9+
Permissions
File Scopes
Read-only. The image is never built.
What's inside
Frequently Asked Questions
New in Security
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Security.