container-hardening

container-hardening is a skill for Claude Code, Codex from backspace-shmackspace/claude-devkit. It costs 36 tokens per session (893 once invoked), scanned A, original, MIT.

Instructions for making container images and their runtime settings safer. Containers package an application with the software it needs to run.

In plain words
What is it for?
They are for reviewing or hardening Dockerfiles, Containerfiles, Docker Compose files, and Kubernetes pod security settings.
Why use it?
They reduce unnecessary software, avoid uncontrolled image versions, and limit permissions that could be abused.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/backspace-shmackspace/claude-devkit/container-hardening
Any agent
npx skills add backspace-shmackspace/claude-devkit --skill container-hardening
Clone the repo
git clone --depth 1 https://github.com/backspace-shmackspace/claude-devkit

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/backspace-shmackspace/claude-devkit/container-hardening.svg)](https://agentmods.dev/skills/backspace-shmackspace/claude-devkit/container-hardening)
Your own site
<a href="https://agentmods.dev/skills/backspace-shmackspace/claude-devkit/container-hardening"><img src="https://agentmods.dev/badge/skills/backspace-shmackspace/claude-devkit/container-hardening.svg" alt="Measured on agentmods" height="20"></a>
Per session 36 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 893 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00036 $0.00893
Opus 5 $0.00018 $0.00447
Sonnet 5 $0.00007 $0.00179
Haiku 4.5 $0.00004 $0.00089

Measured 5d ago against content hash b169c6bedf81, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

container-hardening scanned grade A with 0 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 5d 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/container-hardening/SKILL.md · 107 lines

How it starts

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

Container Hardening

Base Image Selection

  • Use a Universal Base Image (UBI) from the official Red Hat Container Registry
  • Prefer ubi-minimal (ubi8/ubi-minimal or ubi9/ubi-minimal) to reduce attack surface
  • Use the most up-to-date image available

Image Tagging Strategy

Source Strategy
Red Hat Catalog Omit floating tags to get the latest image; exception: Konflux project uses digest-based pinning with automated updates
Non-Red Hat registries Pin the version or digest to ensure you use the intended image and not a tampered one

Minimize Installed Software

Remove non-essential packages and clean up package manager caches:

RUN microdnf upgrade -y && \
    microdnf install -y <required-packages> && \
    microdnf remove -y <unnecessary-packages> && \
    microdnf clean all

Use microdnf on ubi-minimal images; dnf on full UBI images.

Runtime Security

Privilege Restrictions

Set no-new-privileges to prevent privilege escalation during container execution:

securityContext:
  allowPrivilegeEscalation: false

Or in a compose file:

security_opt:
  - no-new-privileges: true

Read-Only Filesystem

Use read-only root filesystems wherever possible:

securityContext:
  readOnlyRootFilesystem: true

Mount writable tmpfs volumes only where the application requires write access (e.g., /tmp, /var/run).

Read-Only Volumes

Mount volumes as read-only unless the container must write to them:

volumeMounts:
  - name: config
    mountPath: /etc/app
    readOnly: true

Containerfile Linting

Use Hadolint to lint Containerfiles for best-practice violations and inline bash issues:

hadolint Containerfile

Hadolint catches common issues (running as root, missing version pins, unnecessary sudo) but should not be trusted without additional verification.

Read the full file on GitHub · 107 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. 5d ago First seen · 107 lines · 36 tokens per session scan A b169c6bedf81

Subscribe to this mod's changes

container-hardening is a skill published in the GitHub repository backspace-shmackspace/claude-devkit (15 stars, last pushed 11d ago), licensed MIT. It adds 36 tokens to every session and 893 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

agenticx-deployer

Guide for deploying AgenticX agents to production including Docker containerization, Kubernetes orchestration, Volcengine AgentKit cloud deployment, and API server setup. Use when the user wants to deploy agents, containerize applications, set up Kubernetes, configure cloud deployment, or run the AgenticX API server…

DemonDamon/AgenticX · 69 tokens

docker-expert

Use when containerizing an application with Docker, optimizing multi-stage builds and image size, designing Docker Compose services, troubleshooting container networking or volumes, or adding secure image build and CI/CD practices.

seaworld008/Commonly-used-high-value-skills · 42 tokens

grype-syft-sbom-scanner

用于通过 Syft 生成 SBOM,并用 Grype 扫描容器镜像、文件系统、软件包、归档和 SBOM 漏洞。.

seaworld008/Commonly-used-high-value-skills · 45 tokens

kubernetes-specialist

Use when managing Kubernetes clusters, debugging Pods and workloads, designing Helm charts, reviewing manifests, or improving deployment, scaling, and observability practices.

seaworld008/Commonly-used-high-value-skills · 34 tokens

branchbox-devcontainer-guardrails

Use when modifying BranchBox devcontainer/bootstrap workflows, compose templates, feature env-stash behavior, or manual E2E harness/release docs. Apply issue.

branchbox/branchbox · 39 tokens

server-management

Server management principles and decision-making. Process management, monitoring strategy, and scaling decisions. Teaches thinking, not commands.

DDS-Solutions/AI-TadPole-OS · 27 tokens