container-security

container-security is a skill for Claude Code, Codex from ShieldNet-360/secure-vibe. It costs 46 tokens per session (3,659 once invoked), scanned C, original, MIT.

Hardening guidance for Dockerfiles, container images, Kubernetes manifests, and Helm charts. Container hardening means reducing what a packaged application can expose if it is compromised.

In plain words
What is it for?
Reviewing or creating multi-stage builds, minimal pinned base images, non-root users, reproducible dependency installs, Docker ignore files, and secure Kubernetes or Helm settings.
Why use it?
It reduces image size, build differences, leaked files, and the damage possible when a container runs with excessive privileges.

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/shieldnet-360/secure-vibe/container-security
Any agent
npx skills add ShieldNet-360/secure-vibe --skill container-security
Clone the repo
git clone --depth 1 https://github.com/ShieldNet-360/secure-vibe

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-security

README.md
[![agentmods](https://agentmods.dev/badge/skills/shieldnet-360/secure-vibe/container-security.svg)](https://agentmods.dev/skills/shieldnet-360/secure-vibe/container-security)
Your own site
<a href="https://agentmods.dev/skills/shieldnet-360/secure-vibe/container-security"><img src="https://agentmods.dev/badge/skills/shieldnet-360/secure-vibe/container-security.svg" alt="Measured on agentmods" height="20"></a>
Per session 46 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,659 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 3 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.00046 $0.03659
Opus 5 $0.00023 $0.01829
Sonnet 5 $0.00009 $0.00732
Haiku 4.5 $0.00005 $0.00366

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

Security

Grade C, and why

container-security scanned grade C with 3 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 3d 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.

Downloads and executes remote codemediumSupply chain

curl | sh runs whatever the server returns today, which is not necessarily what it returned when this was reviewed.

- Run `curl … | sh` or `wget -O- … | sh` in a `RUN` — piping an unverified

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

Recursive force deletemediumDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

apt-get install -y --no-install-recommends pkg=1.2.3 && rm -rf

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.

- Run `curl … | sh` or `wget -O- … | sh` in a `RUN` — piping an unverified
skills/container-security/SKILL.md · 226 lines

How it starts

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

Container Security

Rules (for AI agents)

ALWAYS

  • Use multi-stage builds: separate builder/test stages from the final runtime image so build toolchains and source aren't shipped. The last stage should be a minimal base — gcr.io/distroless/<variant>, scratch, or a versioned -slim / -alpine variant — pinned by SHA256 digest, not just tag. Two bases have nothing to pin: scratch, and a reference to an earlier stage in the same file (FROM base), which is pinned on that stage's own FROM line.
  • Run as a non-root user: set USER explicitly on the final stage, as a number not a name. Omitting it leaves the container running as root. K8s runAsNonRoot rejects UID 0 and cannot resolve a username, so USER appuser fails at startup with "image has non-numeric user"; any non-zero UID passes, and 10000+ by convention also avoids colliding with host accounts.
  • Use npm ci (and equivalents pnpm install --frozen-lockfile, yarn install --frozen-lockfile) in container builds, not npm install. npm install mutates the lockfile and resolves versions per-build, producing non-deterministic images that drift from the lockfile.
  • Add a .dockerignore excluding .git, node_modules, .env, *.pem, *.key, target/, .terraform/, dist/, coverage/.
  • Build with BuildKit (default since Docker Engine 23; DOCKER_BUILDKIT=1 on older engines) so RUN --mount=type=secret,id=<name> is available for build-time credentials. # syntax=docker/dockerfile:1 selects the frontend and does not enable BuildKit by itself.
  • Emit an SBOM (docker buildx --sbom=true / syft) and attach it to the image so downstream scanners can audit the dependency set.
  • Pin apt packages and clean lists in the same layer: apt-get update && apt-get install -y --no-install-recommends pkg=1.2.3 && rm -rf /var/lib/apt/lists/*. The update must be in that same RUN — without it there are no package lists; in an earlier layer it goes stale behind the build cache.
  • Set explicit HEALTHCHECK for long-running services, and separately set livenessProbe / readinessProbe / startupProbe in K8s. Kubernetes never runs the image's HEALTHCHECK — probes are the only mechanism there, so neither one covers the other.
  • Set resource requests and limits on every container (CPU and memory). Without a memory limit, one container can exhaust the node and take down every pod scheduled beside it — the limit is what bounds a runaway's blast radius to its own container.
  • Harden at the container-level securityContext (spec.containers[].securityContext): capabilities.drop: [ALL] then add back only what's needed, readOnlyRootFilesystem: true, allowPrivilegeEscalation: false. These three exist only at container level — under the pod's spec.securityContext they are silently ignored while the manifest still applies, so the control vanishes with nothing to show for it. Use emptyDir for paths that must stay writable.
  • Apply a seccomp profile (seccompProfile.type: RuntimeDefault at minimum) and AppArmor / SELinux where available. This one — like runAsNonRoot and runAsUser — may be set on the pod and inherited by its containers.
  • Scan every image in CI (Trivy, Grype, Snyk, or your registry's scanner) and triage findings on severity, reachability and fix availability together. Fail the build on fixable CRITICAL / HIGH findings; a material vulnerability with no published fix needs mitigation or a recorded risk acceptance, not an automatic pass — "unfixable" is remediation information, not a reason it stopped mattering.
  • Set automountServiceAccountToken: false on every workload that does not call the Kubernetes API. The default mounts a real ServiceAccount token into the container, so an RCE in an app that never needed cluster access still hands the attacker one.
  • For multi-tenant workloads (per-user/per-customer sessions on shared infra), isolate tenants at the kernel boundary: a separate VM — or gVisor / Kata — per tenant, never just separate containers on one shared daemon. Drop privileged, enable user namespaces, and give each tenant its own network. A privileged container on a shared host escapes to the host trivially, so on shared infra that is full compromise of every co-tenant.
  • Expose container orchestration to clients only through a scoped, authenticated broker API that performs the few operations a client may request (start/stop my session). The client must never hold direct daemon or cluster access.
  • Consult iam-best-practices for cluster RBAC and the identity a workload runs as, and supply-chain-security for base-image provenance. This skill owns the container's own configuration, not what it inherits.

Read the full file on GitHub · 226 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 3d ago First seen · 226 lines · 46 tokens per session scan C 41103e18e32f

Subscribe to this mod's changes

container-security is a skill published in the GitHub repository ShieldNet-360/secure-vibe (22 stars, last pushed 20d ago), licensed MIT. It adds 46 tokens to every session and 3,659 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it C with 3 findings (downloads and executes remote code, recursive force delete, makes network calls). 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

wrangler

Cloudflare Workers CLI for deploying, developing, and managing Workers, KV, R2, D1, Vectorize, Hyperdrive, Workers AI, Containers, Queues, Workflows, Pipelines, and Secrets Store. Load before running wrangler commands to ensure correct syntax and best practices. Biases towards retrieval from Cloudflare docs over…

cloudflare/skills · 75 tokens

managing-astro-local-env

Manage local Airflow environment with Astro CLI (Docker and standalone modes). Use when the user wants to start, stop, or restart Airflow, view logs, query the Airflow API, troubleshoot, or fix environment issues. For project setup, see setting-up-astro-project.

astronomer/agents · 63 tokens

aws-cloudformation-ecs

Provides AWS CloudFormation patterns for ECS clusters, task definitions, services, container definitions, auto scaling, blue/green deployments, CodeDeploy integration, ALB integration, service discovery, monitoring, logging, template structure, parameters, outputs, and cross-stack references. Use when creating ECS…

giuseppe-trisciuoglio/developer-kit · 101 tokens

aws-cloudformation-task-ecs-deploy-gh

Provides patterns to deploy ECS tasks and services with GitHub Actions CI/CD. Use when building Docker images, pushing to ECR, updating ECS task definitions, deploying ECS services, integrating with CloudFormation stacks, configuring AWS OIDC authentication for GitHub Actions, and implementing production-ready…

giuseppe-trisciuoglio/developer-kit · 106 tokens

pentest-cloud-infrastructure

Cloud security posture management and container security assessment for AWS, Azure, GCP, and Kubernetes.

jd-opensource/JoySafeter · 25 tokens

defending-kubernetes

Harden and monitor a Kubernetes cluster against the attacks that actually happen — RBAC least privilege and escalation paths, Pod Security Admission enforcement, network policy default-deny, secrets and service-account token exposure, control-plane and kubelet exposure, and audit-log-based detection. Use when…

trilwu/secskills · 98 tokens