kalilurrahman/kr-claudiator-skills/container-image-hardening
Claude Code and agent skill by kalilurrahman/kr-claudiator-skills
Trust tier 3
- community
Source check pending
Checking that the SKILL.md file is still in the repository.
Harden container images to reduce attack surface. Outputs Dockerfile best practices, distroless migration, SBOM generation, image signing, and scanning pipeline.
Install
npx vskill@latest install kalilurrahman/kr-claudiator-skills/container-image-hardeningSKILL.md
Container Image Hardening
A container image is your application's attack surface. Bloated images contain unnecessary tools that attackers can leverage after a breach. Hardened images are minimal, run as non-root, have no package managers or shells, and are signed and scanned before deployment.
Minimal Base Images
Image Scanning Pipeline
Dockerfile Anti-Pattern Fixes
Image Signing and Verification
Anti-Patterns to Avoid
| Anti-Pattern | Problem | Fix | |
|---|---|---|---|
| FROM latest | Unpredictable; silent updates | Pin to digest: FROM image@sha256:... | |
| Running as root | Container escape easier | Non-root user + fixed UID | |
| Package managers in runtime | apt/yum enable install of tools post-breach | Distroless or remove package managers | |
| Secrets in layers | docker history exposes them | Build args or secrets mounts; never ENV | |
| No image scanning | Vulnerable dependencies ship to production | Scan in CI; block on critical/high CVEs |
10 Rules
- Pin base images to digest — tags are mutable;
@sha256:is immutable. - Non-root user with fixed UID in every production image.
- Distroless or Alpine for production — no shell, no package manager.
- Multi-stage builds — build tools never appear in runtime image.
- Scan every image in CI — block on critical/high CVEs with available fixes.
- Sign images at push; verify at deploy — unsigned images don't run in production.
- Generate SBOM on every build — know what's in your supply chain.
- No secrets in Dockerfile ENV or ARG — use runtime secrets injection.
- Read-only root filesystem in Kubernetes securityContext.
- Lint Dockerfile in CI with Hadolint — catches common mistakes before review.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryChecking05-security/container-image-hardening/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/kalilurrahman/kr-claudiator-skills/container-image-hardening)