/viperclaw:viper-container-k8s-auditfrom viperclaw
Audits Dockerfiles and Kubernetes manifests against CIS benchmarks and Pod Security Standards. Checks for root containers, privilege escalation, RBAC roles, network policies, and host namespace isolation.
Ships in viperclaw. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
viper-container-k8s-audit)viper_taint_scan, viper_verify_and_reportviperclaw taint . --db .viperclaw/graph.dbflowchart LR
Image["Distroless / Non-Root Image"] --> Pod["PodSecurityContext (Restricted)"] --> RBAC["Scoped ServiceAccount (No Automount)"] --> Net["Default-Deny NetworkPolicy"]
Containers default to running as uid=0 (root) with writable filesystems, inherited Linux capabilities (CAP_NET_RAW, CAP_SYS_ADMIN), and auto-mounted Kubernetes ServiceAccount tokens (/var/run/secrets/kubernetes.io/serviceaccount/token), turning any application RCE or SSRF into a full cluster compromise.
Run the following discovery commands across the target repository before manual code review:
# 1. Automated ViperClaw analysis
viperclaw taint . --db .viperclaw/graph.db
# 2. Rapid static pattern discovery (ripgrep)
rg -n "(privileged:\s*true|hostNetwork:\s*true|hostPID:\s*true|hostPath:|docker\.sock)"
rg -n "(allowPrivilegeEscalation|runAsNonRoot|readOnlyRootFilesystem|automountServiceAccountToken)"
rg -n "^(FROM|USER|ARG|ENV)" Dockerfile*
| Control ID | Audit Verification Target | Pass Criteria | Fail / Vulnerability Indicator |
|---|---|---|---|
K8S-01 | Non-Root Container Execution | Dockerfile declares non-root USER 65532:65532 and K8s sets runAsNonRoot: true, runAsUser: 65532. | Container runs as root (uid=0) or omits runAsNonRoot: true. |
K8S-02 | Privilege Escalation & Capability Drop | allowPrivilegeEscalation: false, privileged: false, and capabilities: { drop: ["ALL"] } enforced. | privileged: true or default Linux capabilities retained. |
K8S-03 | Read-Only Root Filesystem | readOnlyRootFilesystem: true set on containers with ephemeral emptyDir mounted at /tmp. | Writable root filesystem allowing unapproved runtime binary writes or source modification. |
K8S-04 | Host Namespace & docker.sock Isolation | Zero use of hostNetwork: true, hostPID: true, hostIPC: true, or hostPath mounts (/var/run/docker.sock, /etc). | Pod mounts /var/run/docker.sock or host /, enabling trivial node root escape. |
K8S-05 | ServiceAccount Token Automount Disabled | Pods that do not call the K8s API set automountServiceAccountToken: false. | Default ServiceAccount token mounted in web application pod (leaked via LFI/SSRF). |
K8S-06 | RBAC Least Privilege (No Wildcards) | Zero ClusterRoleBinding to cluster-admin for workloads; no verbs: ["*"] or resources: ["secrets"] unless required. | Workload ServiceAccount granted get/list/watch on cluster-wide secrets or pods/exec. |
K8S-07 | Dockerfile Secret & Layer Hygiene | No secrets passed via ARG or ENV in Dockerfile (readable via docker history); use --mount=type=secret. | ARG NPM_TOKEN or ENV DB_PASS baked into image metadata. |
K8S-08 | Resource Requests/Limits & NetworkPolicy | CPU/memory limits defined on all containers and namespace enforces a default-deny ingress/egress NetworkPolicy. | Missing memory limits (Node OOM DoS) or flat cluster network allowing pods to reach cloud IMDS (169.254.169.254). |
| Severity Tier | Baseline CVSS v3.1 Vector | Qualifying Security Impact |
|---|---|---|
| CRITICAL (9.6) | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H | privileged: true, hostPath: /var/run/docker.sock, or workload bound to cluster-admin. |
| HIGH (7.8) | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:N | Container running as root with CAP_SYS_ADMIN or broad RBAC secrets access. |
| MEDIUM (5.3) | CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:N | Missing readOnlyRootFilesystem, automountServiceAccountToken: false, or resource limits. |
# ❌ VULNERABLE: Runs as root, mounts hostPath, and automounts ServiceAccount token
spec:
containers:
- name: api
image: app:latest
# ✅ HARDENED: Kubernetes Restricted Pod Security Standard compliant spec
spec:
automountServiceAccountToken: false
securityContext:
runAsNonRoot: true
runAsUser: 65532
seccompProfile:
type: RuntimeDefault
containers:
- name: api
image: app@sha256:9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities:
drop: ["ALL"]
viperclaw taint and viperclaw verify to confirm zero remaining unmitigated flows in .viperclaw/graph.db.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub zahidoverflow/viperclaw --plugin viperclaw72 skills in this plugin
/viper-agent-skill-supplychainAI Agent Skill, Plugin & MCP Config Supply-Chain Auditor (modeled on NVIDIA SkillSpector & OWASP Agentic Skills Top 10). Audits SKILL.md bundles and MCP JSON configs./viper-ai-llm-guardrailsAI, LLM & MCP Application Security & Guardrails Auditor (OWASP LLM Top 10). Reviews prompt boundaries, RAG data isolation, tool-call authorization, and output sanitization./viper-api-gateway-apigee-kongAPI Gateway, BFF & Rate-Tier Policy Auditor (Kong, AWS API Gateway, Apigee, Envoy Gateway). Reviews JWT authorizers, backend origin lockdown, and route-level quotas./viper-auth-oauth-jwtAuthentication, OAuth 2.0 / OIDC & JWT Security Auditor. Reviews token verification, algorithm allowlisting, claim validation, and OAuth redirect_uri configurations./viper-aws-iam-cloud-auditAWS IAM, STS, S3, KMS & Lambda Security Auditor (modeled on Prowler, Parliament & CloudSplaining). Reviews iam:PassRole escalation, STS ExternalId, S3 policies, and IMDSv2./viper-bola-idorObject & Function-Level Authorization (BOLA / BFLA) Audit Skill. Reviews resource access controls, tenant scoping, and ownership checks across API endpoints and controllers.Other plugins' skills for the same job