Skip to main content
skill CX Codex

container-image-hardening — Claude Code skill: what it does

container-image-hardening audits Dockerfiles and built images for production safety, then hands back a hardened build. Run it before a container ships.

no license 235 installs updated 2026-08-26

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add securityskills/skills --skill container-image-hardening -a claude-code
Open on GitHub

What container-image-hardening does

The skill walks a Dockerfile against a fixed checklist. It asks which base image you started from and whether the tag or digest is pinned rather than latest, checks that compilers and package managers stayed out of the final stage, confirms a dedicated USER with its own UID, and looks for credentials in ENV blocks or a copied .env. Dependency pinning through lockfiles gets a look too, along with healthchecks and how apt layers were combined.

Scanning relies on tools you already have: trivy image, grype, docker scout cves. The skill sets up a build gate that fails CI when critical CVEs have a fix available, and it flags base image updates through renovate or dependabot. Verification uses docker history, dive and docker run --rm <image> id, where that last command reveals whether the process runs as root. Miss those utilities in your environment and the scan and inspect steps simply won't run.

What comes back: a rewritten Dockerfile, scan results from before and after the changes, and the CI gate config. For runtime the skill writes launch settings — read-only root filesystem, every capability dropped, no new privileges allowed, tmpfs mounted where writes are needed.

What it helps with

  • strip build toolchains from the final image stage
  • catch secrets baked into image layers
  • run the container under a dedicated non-root UID
  • fail the pipeline on critical CVEs
  • lock the root filesystem to read-only

Example prompts for the agent

  • Review my Dockerfile and rewrite it against the hardening checklist
  • Add a trivy image --severity HIGH,CRITICAL --exit-code 1 step to CI for this image
  • Set up the container to run with read_only: true and dropped capabilities

How to install container-image-hardening

1Skills CLI (Vercel)

npx skills add securityskills/skills --skill container-image-hardening -a claude-code

2Manually: put the files in place

~/.claude/skills/container-image-hardening/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/container-image-hardening/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about container-image-hardening

How do I install container-image-hardening in Claude Code?

Run npx skills add securityskills/skills --skill container-image-hardening -a claude-code. The skill file lands at ~/.claude/skills/container-image-hardening/SKILL.md.

What does container-image-hardening do?

It reviews a Dockerfile for security issues and returns a fixed build, a scan report and a CI gate configuration.

Which tools does the image scan need?

The skill calls trivy, grype, docker scout, dive and docker history. Without them the scanning and layer inspection steps cannot complete.

Similar skills

All skills for Security →

From the same set21

The whole set →
bug-bounty-report-writing bug-bounty-report-writing guides agents in drafting vulnerability submissions with verified impact and reproduction steps with CVSS scoring. Useful before sending bug reports to bounty programs. CX Codex +1 290installs bug-bounty-recon-pipeline bug-bounty-recon-pipeline is a skill that outlines a five-stage bug bounty reconnaissance pipeline, from subdomain enumeration and service fingerprinting to attack-surface change tracking. CX Codex +1 288installs incident-response-forensics incident-response-forensics — a skill for collecting and analyzing digital evidence during security incident investigations. Preserves proof without corruption, gathers ephemeral data, and constructs an attack timeline. CX Codex +1 254installs aws-security-review aws-security-review audits AWS accounts for IAM escalation routes, public storage, open administrative ports, and logging gaps. CX Codex +1 251installs kubernetes-security-audit kubernetes-security-audit reviews Kubernetes configuration for access-control, pod, network-policy, and software-supply risks. Use it when assessing a cluster or tightening deployment security. CX Codex +1 244installs ssrf-hunting ssrf-hunting is a Claude Code skill for finding and testing SSRF in features that fetch URLs. It is intended for web assessments and bug bounty work. CX Codex +1 244installs gdpr-data-mapping gdpr-data-mapping builds a GDPR processing registry, tracks system data flows, and structures incident response workflows. CX Codex +1 239installs malware-triage malware-triage — a skill for safe analysis of unknown malware samples. Extracts static indicators, runs code in a sandbox, identifies behavior patterns, and produces detection guidance with IOCs and ATT&CK mapping. CX Codex +1 234installs

Project sponsors

Companies that keep this analytics open