skills/infra-security/SKILL.md
# OWASP Kubernetes / Infrastructure Security Skill > Threat analysis for container and infrastructure deployments against OWASP Kubernetes Top 10 (2025). Covers workload hardening, RBAC, secrets management, network segmentation, and cloud lateral movement. ## Trigger Invoke when: a task involves Dockerfiles, docker-compose, Kubernetes manifests, Helm charts, CI/CD pipelines, deployment scripts, systemd/launchd services, infrastructure-as-code, or cloud configuration. ## Input Contract ```js
npx skillsauth add bigeasyfreeman/adlc skills/infra-securityInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Threat analysis for container and infrastructure deployments against OWASP Kubernetes Top 10 (2025). Covers workload hardening, RBAC, secrets management, network segmentation, and cloud lateral movement.
Invoke when: a task involves Dockerfiles, docker-compose, Kubernetes manifests, Helm charts, CI/CD pipelines, deployment scripts, systemd/launchd services, infrastructure-as-code, or cloud configuration.
{
"task_spec": "TaskSpec from Build Brief",
"repo_map": "Cached codebase research output",
"deployment_artifacts": ["list of infra files created or modified"],
"target_environment": "docker | k8s | systemd | launchd | cloud"
}
Applicable to both Kubernetes deployments and Docker/container deployments. Items marked [K8s-only] can be skipped for Docker-only deployments.
USER directive in Dockerfile)--privileged flag (common failure: sandboxing tools fail in privileged Docker)--cap-drop=ALL, add back only what's needed)Project-specific example: Dockerfiles must run services as a non-root user. If your executor needs specific capabilities (e.g., for sandboxing), document exactly which ones and drop all others. Resource limits must prevent a runaway process from consuming the host.
Project-specific example: If deployed to K8s, backend service pods need read access to their own namespace only. Internal API server pods need network access to the backend but not to the K8s API. Gateway/edge pods need external network but not internal cluster access.
Project-specific example: If your project has an in-app vault (e.g., security/vault.py, security/credential_gateway.py), use it. For infrastructure: API keys must not be in docker-compose.yml or .env committed to git. K8s secrets must use external-secrets-operator or similar. Project config files must not contain credentials.
Project-specific example: If deployed to K8s, enforce restricted pod security. If executor pods need a specific exception for sandboxing capabilities, this must be the ONLY exception, explicitly documented.
Project-specific example: For Docker: backend services, internal APIs, and state stores should be on an internal Docker network. Only the gateway/edge service should have port exposure. For K8s: NetworkPolicies must restrict gateway-to-backend (API only), backend-to-executor (task dispatch only), and block executor-to-state-store access.
Project-specific example: Internal API servers must listen on internal-only ports. The gateway/edge service is the only public-facing port. Health endpoints (/healthz) must return only status, not configuration or state details.
Project-specific example: Dockerfiles that install runtimes, CLIs, and agent binaries expand the attack surface. Pin versions. Scan the built image. The apt-get install step must not leave package caches in the image.
Project-specific example: If deployed in cloud K8s, executor pods must NOT have access to cloud metadata. A compromised executor (running arbitrary code) could pivot to cloud credentials via IMDS.
Project-specific example: Internal API servers must require authentication. Gateways must authenticate WebSocket connections. In multi-instance mode, cross-instance communication must use mutual TLS or signed tokens.
Project-specific example: Structured logging output (e.g., structlog) must produce JSON for log aggregation. Application-level audit trails complement container-level logging. Container logs must capture executor subprocess output. Alerting must exist for: executor timeout spikes, gate failures, anomalies, and auth failures.
{
"task_id": "string",
"infra_threat_assessment": {
"K01_workload_config": { "risk": "HIGH|MEDIUM|LOW|N/A", "findings": [], "mitigations": [] },
"K02_authorization": { "...": "..." },
"K03_secrets": { "...": "..." },
"K04_policy_enforcement": { "...": "..." },
"K05_network_segmentation": { "...": "..." },
"K06_exposed_components": { "...": "..." },
"K07_vulnerable_components": { "...": "..." },
"K08_lateral_movement": { "...": "..." },
"K09_authentication": { "...": "..." },
"K10_logging_monitoring": { "...": "..." }
},
"target_environment": "docker | k8s | systemd | launchd",
"overall_risk": "HIGH|MEDIUM|LOW",
"blocking_findings": [],
"advisory_findings": []
}
--privileged, root user, or host namespace sharing is an automatic HIGH finding requiring explicit justificationcontract_version and semver compatibility enforcement.docs/schemas/security-assessment.schema.json; reject invalid structures before downstream use.unsupported_scope, missing_repo_map, schema_mismatch).development
Discovers and records repo-local approved build paths so agents reuse proven patterns instead of inventing parallel architectures.
development
Scoped maintenance for docs/solutions entries when stale signals, refactors, or explicit user scope require refresh.
documentation
Conditionally captures verified reusable ADLC learnings into docs/solutions after successful closeout.
development
Uses Graphify as ADLC's graph-backed research layer and Beads as an optional dependency-aware task memory layer. Produces evidence for compatibility, reuse, accuracy, dark-code hotspots, and long-horizon handoff.