kubescape-k8s
Skill0 starsChanged 5 months agoMITView on GitHub
This skill should be used when the user asks to "run Kubescape", "scan Kubernetes manifests", "Kubernetes prüfen", "K8s security", "Helm chart security", "cluster posture", "NSA/CIS Kubernetes compliance", or wants to check Kubernetes/Helm/Kustomize files for misconfigurations and compliance. Runs Kubescape in Docker, processed directly in Claude Code. Only relevant for projects with Kubernetes manifests.
In this repository11 other files it gives its agents.
- architecture-analysisSkill
- bearer-privacySkill
- build-verifySkill
- code-audit-suiteSkill
- dast-runtimeSkill
- license-complianceSkill
- megalinter-qualitySkill
- opengrep-sastSkill
- secrets-scanSkill
- sonarqube-qualitySkill
- trivy-securitySkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 39
Use medium to be stricter.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Kubescape K8s
Purpose
Kubernetes-specific posture and compliance analysis: scores manifests, Helm charts and Kustomize against frameworks (NSA-CISA, CIS, MITRE ATT&CK, SOC2, PCI), and analyzes RBAC and privilege configuration.
Relation to Trivy (no needless overlap): Trivy already does basic K8s/IaC
misconfiguration. Kubescape adds more on the K8s axis — framework-based
compliance scoring and RBAC/cluster posture that Trivy does not provide. Use
this skill only when the project actually contains Kubernetes resources;
otherwise Trivy's misconfig scanner is enough.
Core Workflow (drive to zero)
- Scan the directory containing manifests/charts:
~/.claude/skills/kubescape-k8s/scripts/scan.sh [TARGET_DIR] - Fix each failed control in the YAML: drop privileged/root, set
readOnlyRootFilesystem, resource limits,securityContext, network policies, least-privilege RBAC, pinned image digests. - Re-run until controls pass.
Enforcing a gate
The hard gate is the severity threshold — fail if any failed control is
at/above a severity (this is what the audit suite uses by default, high):
KUBESCAPE_SEVERITY=high ~/.claude/skills/kubescape-k8s/scripts/scan.sh [DIR]Use medium to be stricter. This is the only reliable gate: the
compliance-percentage flag (--compliance-threshold) does not fail the scan
with the pinned CLI image (a manifest at 66% compliance still exits 0 even at
threshold 100), so it was removed rather than expose a gate that does not gate.
The gate works by exit code: a failed control at/above the threshold makes kubescape exit 1, which the wrapper maps to
RESULT: FAIL. kubescape logs that verdict as alevel:fatalline ("... exceeds severity threshold ..."); the wrapper does not mistake that for an operational error — only a non-gate fatal (e.g. "no resources found to scan", a Docker/parse error) maps toRESULT: ERROR(exit 125).
Notes
- The container runs
--rmwith no persistent cache volume, so Kubescape re-downloads its frameworks on each run (a few seconds). The pinned CLI image runs as usernonroot, so mount a cache volume to/home/nonroot/.kubescape(not/home/ks, which does not exist in this image) if you want to persist them. - JSON/SARIF output for parsing:
KUBESCAPE_FORMAT=json scan.sh [DIR]. - Live-cluster scanning is possible but out of scope here — this skill targets manifests in the repo (the coding/refactoring workflow).
Resources
scripts/scan.sh— runskubescape scanagainst a manifest directory with an optional severity gate. Exit: 0 = pass, 1 = failed controls (FINDINGS), 125 = operational error (no resources / Docker / parse). Env:KUBESCAPE_FORMAT,KUBESCAPE_SEVERITY(the hard gate),KUBESCAPE_IMAGE.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

