container-hardening

container-hardening is a skill for Claude Code, Codex from WrongStack/WrongStack. It costs 92 tokens per session (2,364 once invoked), scanned A, original, MIT.

A container-security guide for reducing the privileges, secret exposure, writable files, resource access, and unnecessary network exposure of an application running in a container.

In plain words
What is it for?
Use it to review non-root execution, filesystem permissions, host mounts, container capabilities, secrets, CPU and memory limits, and image provenance.
Why use it?
It helps improve protection without assuming that every security preference is a confirmed vulnerability. Changes are checked against what the application actually needs so compatibility is not lost.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to review non-root execution, filesystem permissions, host mounts, container capabilities, secrets, CPU and memory limits, and image provenance.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/wrongstack/wrongstack/container-hardening
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add WrongStack/WrongStack --skill container-hardening
Clone the repo
git clone --depth 1 https://github.com/WrongStack/WrongStack

Made for: Claude Code, Codex.

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

agentmods badge for container-hardening

README.md
[![agentmods](https://agentmods.dev/badge/skills/wrongstack/wrongstack/container-hardening/github.svg)](https://agentmods.dev/skills/wrongstack/wrongstack/container-hardening)
Your own site
<a href="https://agentmods.dev/skills/wrongstack/wrongstack/container-hardening"><img src="https://agentmods.dev/badge/skills/wrongstack/wrongstack/container-hardening/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for container-hardening

Your own site · 80×15
<a href="https://agentmods.dev/skills/wrongstack/wrongstack/container-hardening"><img src="https://agentmods.dev/badge/skills/wrongstack/wrongstack/container-hardening.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 92 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,364 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 2 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00092 $0.02364
Opus 5.5 $0.00037 $0.00946
Sonnet 5.5 $0.00018 $0.00473
Haiku 4.5 $0.00009 $0.00236

Measured 1mo ago against content hash d9987434424b, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

container-hardening scanned grade A 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 1mo 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.

Asks for rootlowPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

- **UID change on existing volumes** — switching `USER` leaves old files owned by root; plan a one-time ownership migration instead of `chmod 777`.

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.

- **Distroless healthchecks** — no shell, curl or wget; use a built-in health subcommand (`["/app/server", "healthcheck"]`) or an orchestrator probe.
packages/core/skills/container-hardening/SKILL.md · 113 lines

How it starts

The opening of the file, as written. The whole thing — 113 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Container Hardening

Selection card

  • Task: Reduce container privilege, attack surface and secret exposure without breaking the app.
  • Start: Inspect the image config (docker image inspect), docker history --no-trunc, the Dockerfile and the runtime spec (Compose service or pod spec) as deployed.
  • Finish: the hardened container starts, serves a real request and stops gracefully under the new restrictions, and findings are split into confirmed issues and hardening advice.

Overview

Hardening is a set of restrictions proven against the app's real start, request and shutdown paths: measure what the process needs before taking anything away, or the change gets reverted. Use current Docker/OCI/runtime documentation and the deployed platform version. Checked Docker target: 29.9.2; apply settings supported by the actual runtime. Scanner counts are inputs, not verdicts: what matters is what ships in the final stage and is reachable.

Rules

  1. Inventory runtime needs first (listening ports, written paths, outbound hosts, devices, native libraries, capabilities), then restrict, and retest startup, a real request and docker stop after each change.
  2. Run as a numeric non-root user (USER 10001:10001); Kubernetes runAsNonRoot cannot verify a named user and refuses to start it. Application code stays owned by root and read-only; only data paths belong to the app user.
  3. Drop all capabilities and add back only proven ones; set no-new-privileges; keep the default seccomp/AppArmor profile. Never privileged, host PID/network/IPC, or a Docker socket mount for application workloads (the socket is root on the host).
  4. Keep secrets out of layers and metadata: BuildKit RUN --mount=type=secret,id=npmrc,target=/root/.npmrc, runtime secrets as mounted files, .env and keys listed in .dockerignore. ARG and ENV values persist in history and image config.
  5. Use a read-only root filesystem with explicit tmpfs for scratch paths, plus memory, CPU and pids_limit limits.
  6. Ship a minimal final stage (multi-stage build; distroless, Wolfi/Chainguard or scratch for static binaries) pinned by digest, and automate digest bumps; a pinned base never receives patches on its own.
  7. Triage scanner findings by final-stage presence, reachability and fix availability; report confirmed vulnerabilities separately from defence-in-depth recommendations.
  8. Where the platform verifies supply chain, build with SBOM and provenance and sign by digest; verify signatures at deploy, not only at build.

Read the full file on GitHub · 113 lines

Changes

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.

  1. 1mo ago Changed · +44 lines · +47 tokens per session d9987434424b
  2. 1mo ago Changed · +10 lines e3493c27d5d0
  3. 1mo ago Changed 30bcad4d86ae
  4. 1mo ago First seen · 59 lines · 45 tokens per session scan A cccd1645a5f1

Subscribe to this mod's changes

container-hardening is a skill published in the GitHub repository WrongStack/WrongStack (448 stars, last pushed today), licensed MIT. It adds 92 tokens to every session and 2,364 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it A with 2 findings (asks for root, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-10.

Related

container-hardening compared with skills from other repositories

container-hardening next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
container-hardeningWrongStack/WrongStackSkill448todayMITA92Claude Code, Codex
infra-containers-kubernetesagents-inc/skillsSkill281mo agoMITA21Claude Code, Codex
infra-ci-cd-dockeragents-inc/skillsSkill281mo agoMITA20Claude Code, Codex
docker-expertLiHongwei-cn/lihongwei-cnSkill51mo agoMITA44Claude Code, Codex
agents-v2-pyLiHongwei-cn/lihongwei-cnSkill51mo agoMITA39Claude Code, Codex
local-env-orchestrationLiorCohen/sddSkill439mo agononeA15Claude Code
research-repositoryOwl-Listener/designer-skillsSkill3.6k2d agoMITA43Claude Code, Codex