Getting it into your agent
It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.
git clone --depth 1 https://github.com/HermeticOrmus/LibreSecOps-Claude-Codenpx agentmods add skills/hermeticormus/libresecops-claude-code/dockerfile-hardeningWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/hermeticormus/libresecops-claude-code/dockerfile-hardening)<a href="https://agentmods.dev/skills/hermeticormus/libresecops-claude-code/dockerfile-hardening"><img src="https://agentmods.dev/badge/skills/hermeticormus/libresecops-claude-code/dockerfile-hardening.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00000 | $0.02147 |
| Opus 5 | $0.00000 | $0.01073 |
| Sonnet 5 | $0.00000 | $0.00429 |
| Haiku 4.5 | $0.00000 | $0.00215 |
Grade B, and why
dockerfile-hardening scanned grade B with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Recursive force deletemediumDestructive command
rm -rf with a variable or a broad path is one typo away from removing the wrong tree.
&& rm -rf /var/cache/apk/* Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.
Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
CMD wget --no-verbose --tries=1 --spider http://localhost:8080/health || exit 1 How it starts
The opening of the file, as written. The whole thing — 255 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Dockerfile Hardening
Secure Dockerfile patterns, multi-stage builds, minimal base images, and build-time security practices.
Knowledge Base
Container Image Security Model
A container image is a stack of filesystem layers. Each Dockerfile instruction creates a layer. Security implications:
- Layers are permanent. Even if you
RUN rm /secretin a later layer, the file exists in the layer where it was created. Anyone withdocker historyordivecan extract it. - Layers are shared. If two images share a base, they share layers. A vulnerability in the base affects all derived images.
- The build context is sent to the daemon. Without
.dockerignore, your entire directory (including.env,.git,node_modules) is sent to the Docker daemon.
Base Image Hierarchy (Most to Least Secure)
| Base | Size | Packages | Debug Tools | Use Case |
|---|---|---|---|---|
scratch |
0 MB | None | None | Statically compiled Go/Rust binaries |
gcr.io/distroless/* |
2-20 MB | Runtime only (glibc, libssl) | None | Java, Python, Node.js runtimes |
cgr.dev/chainguard/* |
5-30 MB | Minimal, hardened, daily-patched | Minimal | Production workloads needing updates |
alpine |
5 MB | musl, busybox, apk | Basic shell | General purpose, small footprint |
debian-slim |
75 MB | glibc, apt, basic utils | Some | When Alpine compatibility issues arise |
ubuntu |
75 MB | Full distribution | Full | Development, not recommended for production |
Patterns
Pattern 1: Multi-Stage Build (Node.js)
# Stage 1: Build
FROM node:22-alpine AS builder
WORKDIR /app
# Install dependencies first (cache optimization)
COPY package.json package-lock.json ./
RUN npm ci --only=production
# Copy source and build
COPY src/ ./src/
COPY tsconfig.json ./
RUN npm run build
# Stage 2: Runtime (distroless)
FROM gcr.io/distroless/nodejs22-debian12:nonroot
WORKDIR /app
# Copy only production artifacts
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/dist ./dist
# Distroless already runs as nonroot (uid 65532)
EXPOSE 3000
CMD ["dist/server.js"]
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 7d ago First seen · 255 lines · 0 tokens per session scan B 78b1db6c1558
dockerfile-hardening is a skill published in the GitHub repository HermeticOrmus/LibreSecOps-Claude-Code (4 stars, last pushed 3mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,147 tokens. A static security scan graded it B with 2 findings (recursive force delete, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
building-devsecops-pipeline-with-gitlab-ci
Design and implement a comprehensive DevSecOps pipeline in GitLab CI/CD integrating SAST, DAST, container scanning, dependency scanning, and secret detection.
building-devsecops-pipeline-with-gitlab-ci
Design and implement a comprehensive DevSecOps pipeline in GitLab CI/CD integrating SAST, DAST, container scanning, dependency scanning, and secret detection.
building-devsecops-pipeline-with-gitlab-ci
Design and implement a comprehensive DevSecOps pipeline in GitLab CI/CD integrating SAST, DAST, container scanning, dependency scanning, and secret detection.
building-devsecops-pipeline-with-gitlab-ci
Design and implement a comprehensive DevSecOps pipeline in GitLab CI/CD integrating SAST, DAST, container scanning, dependency scanning, and secret detection.
building-devsecops-pipeline-with-gitlab-ci
Design and implement a comprehensive DevSecOps pipeline in GitLab CI/CD integrating SAST, DAST, container scanning, dependency scanning, and secret detection.
implementing-devsecops-security-scanning
Integrates Static Application Security Testing (SAST), Dynamic Application Security Testing (DAST), and Software Composition Analysis (SCA) into CI/CD pipelines using open-source tools. Covers Semgrep for SAST, Trivy for SCA and container scanning, OWASP ZAP for DAST, and Gitleaks for secrets detection. Activates for…