Blocks (some rules ask) when a change to a Dockerfile, Containerfile or compose file adds: an untagged, floating or unresolvable base image; a root final stage; TLS or signature checks off; secret ENV/ARG/environment literals; COPY of key or .env files; remote ADD without checksum (an ARG default URL too); fetch piped to a shell; RUN --security=insecure; chmod 777 or setuid; sudo, sshd, chpasswd; unpinned git clone; ONBUILD RUN; compose privileged, dangerous cap_add, unconfined profiles, devi...
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Dockerfile Compose Security?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/open-coder-ai-dockerfile-compose-security)
---
name: dockerfile-compose-security
description: "Blocks (some rules ask) when a change to a Dockerfile, Containerfile or compose file adds: an untagged, floating or unresolvable base image; a root final stage; TLS or signature checks off; secret ENV/ARG/environment literals; COPY of key or .env files; remote ADD without checksum (an ARG default URL too); fetch piped to a shell; RUN --security=insecure; chmod 777 or setuid; sudo, sshd, chpasswd; unpinned git clone; ONBUILD RUN; compose privileged, dangerous cap_add, unconfined profiles, devices, host namespaces, runtime socket or host-root mounts, DB ports on every interface (a profiled or compose.dev service only notes a port or cap_add SYS_PTRACE). A one-line form goes to a sibling gate only where it is installed; scan-secrets lines always. Misses: digest pinning, build args overriding defaults, ADD of an ARG with no default, an unlisted cap_add, commands in variables, aliases or $'' quoting, bake and k8s files, extends or include, other file names, a self-added profiles:. Friction, not a boundary."
metadata:
chock.artifact: rule
chock.enforcement: block
chock.coverage_without_chock: advisory
---
# Dockerfile and Compose Security
Blocks (some rules ask) when a change to a Dockerfile, Containerfile or compose file adds: an untagged, floating or unresolvable base image; a root final stage; TLS or signature checks off; secret ENV/ARG/environment literals; COPY of key or .env files; remote ADD without checksum (an ARG default URL too); fetch piped to a shell; RUN --security=insecure; chmod 777 or setuid; sudo, sshd, chpasswd; unpinned git clone; ONBUILD RUN; compose privileged, dangerous cap_add, unconfined profiles, devices, host namespaces, runtime socket or host-root mounts, DB ports on every interface (a profiled or compose.dev service only notes a port or cap_add SYS_PTRACE). A one-line form goes to a sibling gate only where it is installed; scan-secrets lines always. Misses: digest pinning, build args overriding defaults, ADD of an ARG with no default, an unlisted cap_add, commands in variables, aliases or $'' quoting, bake and k8s files, extends or include, other file names, a self-added profiles:. Friction, not a boundary.
```
flag(container_change): Dockerfile|Containerfile|compose adds floating image (no tag, latest, stable, edge), root final stage, TLS|signature off, literal secret, key-file COPY, privileged|cap_add|host ns|docker.sock|host-root mount, db port on 0.0.0.0
prefer: pinned tag@sha256, USER <uid>, RUN --mount=type=secret, cap_add narrow, named volumes; waiver: '# chock: allow <rule-id>', person only
```
This skill is advisory: the client reading it has no mechanism to enforce it. The same policy compiled by `chock` blocks at commit, on an agent's file writes and at turn end. See https://github.com/open-coder-ai/chock