Skip to content
Security
Skill

/dockerfile-scan

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

From plugin
claude-security-skills
118 skills
Install
$ npx -y skills add NovaCode37/claude-security-skills --skill dockerfile-scan --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/dockerfile-scan

Context preview

The summary Claude sees to decide when to auto-load this skill.

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

SKILL.md

dockerfile-scan.SKILL.md
name: dockerfile-scan
description: >-
  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".
license: MIT

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).

Read more
Ships withclaude-security-skills

Security skills for Claude Code. Install them once and ask Claude, in plain language, to scan a repo for leaked secrets, review Python code, red-team an LLM for prompt injection, or audit HTTP headers, JWTs, Dockerfiles, CORS, and dependencies.

Get the whole plugin
Stats
11
Stars
6
Forks
Active
Maintenance
Python
Language
MIT
License
5d ago
Last commit
3mo ago
Created

Repo: NovaCode37/claude-security-skills

Other skills on claude-security-skills.