agentleFS
NovaCode37NovaCode37/claude-security-skills/skills/dockerfile-scan/SKILL.md

dockerfile-scan

Skill13 starsChanged 5 months agoMITView on GitHub

Scan a Dockerfile for insecure build patterns — running as root, unpinned or :latest base images, ADD from remote URLs, piping curl/wget into a shell, hardcoded secrets in ENV/ARG, world-writable chmod 777, and sudo usage. Use when the user asks to "review my Dockerfile", "is this container image secure", "lint my Dockerfile for security", or "why does my image run as root".

  • Pipes a download into a shell

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run the scan on the file or repo.

    line 52

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Dockerfile Security Scan

Parses a Dockerfile and flags common security and supply-chain problems, each with a concrete fix. Pure text analysis — no Docker daemon, no network, stdlib only.

When to use this skill

  • "Review this Dockerfile for security issues."
  • "Is my container running as root?"
  • "Lint my Dockerfiles before I push them."

What it checks

  • Base image pinning — missing tag or :latest (docker-no-tag, docker-latest-tag).
  • Runs as root — no USER, or final USER is root (docker-root-user).
  • Remote code execution — curl|wget … | sh (docker-remote-exec).
  • Remote ADD — ADD http://… without integrity checks (docker-add-remote).
  • Hardcoded secrets — ENV/ARG with a secret-looking name and a value (docker-hardcoded-secret).
  • Loose permissions — chmod 777 (docker-chmod-777).
  • sudo usage in RUN (docker-sudo).

How to run it

# Scan one Dockerfile
python skills/dockerfile-scan/scanner.py path/to/Dockerfile

# Scan every Dockerfile under a directory, as JSON
python skills/dockerfile-scan/scanner.py . --json

Exit codes: 0 clean · 1 findings present · 2 usage/IO error.

Recommended workflow for Claude

  1. Run the scan on the file or repo.
  2. Present findings by severity, each with its one-line fix.
  3. Offer a corrected Dockerfile snippet (pinned base image, non-root USER, COPY instead of remote ADD, secrets moved to runtime).

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.