crazygit/kube-audit-kit
A Claude Code Skill for non-intrusive security audits of Kubernetes clusters.
Deep Analysis
用于 Kubernetes 集群的非侵入式安全审计 Claude Code Skill,基于行业标准进行全面的安全合规性检查
Core Features
Technical Implementation
- 非侵入式操作 - 仅使用 get/list
- 完整覆盖 - 动态发现所有资源类型
- 基于行业标准 - 遵循 Pod Security Standards、NSA Kubernetes Guidelines、CIS Benchmark
- 智能分组 - 基于工作负载拓扑关联应用资源
- 完整类型注解
- 美观输出 - Rich 库彩色控制台输出
- 生产环境 Kubernetes 集群的安全合规性审计
- 应用部署前的安全检查
- 集群迁移前的安全评估
- 定期安全审计和监控
- RBAC 权限规范化检查
- 网络隔离策略验证
- 需要 kubectl 配置并有权限访问目标集群
- 输出目录包含 Secret 数据,需要安全删除
- 依赖 Python >= 3.14 和 uv 包管理器
- 仅支持在已配置的 kubectl 上下文运行
Kube Audit Kit
Kube Audit Kit is a Claude Code Skill for non-intrusive security audits of Kubernetes clusters.
Kube Audit Kit exports all resources in a specified Context/Namespace, deeply sanitizes them, groups applications intelligently, and generates a comprehensive security audit report based on the following industry standards:
Features
- Non-intrusive: Only
get/listoperations, no changes to cluster state - Full coverage: Dynamically discovers all namespaced resource types, with a small exclude list for low-value resources (e.g., events, bindings)
- Smart grouping: Associates application resources based on workload topology
- Dual audit: Scripted static scan + AI expert deep analysis
- Type safety: Full Python type annotations
- Nice output: Rich-powered colored console output
Security Coverage
🛡️ Pod Security (Based on PSS/NSA)
Based on Pod Security Standards and NSA Kubernetes Guidelines
| Check Item | Description |
|---|---|
| Privileged Mode | Detect privileged: true |
| Host Namespaces | Detect hostNetwork, hostPID, hostIPC |
| Capabilities | Detect dangerous capabilities add/drop |
| Security Context | Detect runAsNonRoot, readOnlyRootFilesystem |
| Resource Limits | Detect CPU/memory requests and limits |
| Health Checks | Detect liveness/readiness/startup probes |
| Image Safety | Detect :latest tag usage |
🔐 RBAC Audit
Based on CIS Kubernetes Benchmark and Kubernetes RBAC
| Check Item | Description |
|---|---|
| Wildcards | Detect * in verbs/resources/apiGroups |
| High Privilege | Detect cluster-admin/admin/edit/view roles |
| Over-privilege | Analyze Role/ClusterRole rule scope |
🌐 Network Security Audit
Based on NSA Network Policy Guidelines and CIS NetworkPolicy
| Check Item | Description |
|---|---|
| NetworkPolicy | Detect namespace network policy protection |
| Service Exposure | Detect LoadBalancer/NodePort/externalIPs |
| Ingress Config | Detect TLS configuration and exposed hosts |
💾 HostPath Mount Detection
Based on CIS Kubernetes Benchmark 5.2.3 and NSA Guidelines Section 3.3
| Check Item | Description |
|---|---|
| hostPath | Detect host path mounts |
| Dangerous Path | Identify docker.sock, /etc, /root, etc. |
| Risk Levels | Rate by Critical/Warning |
🛡️ Security Policy Checks
Based on Kubernetes seccomp and AppArmor Documentation
| Check Item | Description |
|---|---|
| seccomp | Detect seccompProfile configuration |
| AppArmor | Detect AppArmor annotation settings |
🔄 High Availability Configuration
Based on Kubernetes PodDisruptionBudget and CIS Benchmark 5.2.9
| Check Item | Description |
|---|---|
| PodDisruptionBudget | Detect PDB configuration |
| Secret Type | Detect whether Secret type is appropriate |
| ServiceAccount | Detect automountServiceAccountToken |
🔍 Sensitive Data Scan
Based on NSA Guidelines Section 4.2 and CIS Benchmark Secret Management
| Check Item | Description |
|---|---|
| ConfigMap Scan | Detect sensitive keywords and high entropy strings |
| Secret Analysis | Detect non-sensitive data stored in Secret |
| Usage Distinction | Distinguish Volume mounts vs EnvVar refs |
Installation
Option 1: Install as a Personal Skill (Recommended)
Install the skill to your personal directory so it is available in all projects:
git clone https://github.com/crazygit/kube-audit-kit.git ~/.claude/skills/kube-audit-kit
Option 2: Install as a Project Skill
Install the skill in a specific project so it is only available there:
git clone https://github.com/crazygit/kube-audit-kit.git .claude/skills/kube-audit-kit
After Installation
Verify the skill is loaded using either method:
Option 1: Use /skills
/skills
Option 2: Ask Claude
What Skills are available?
If kube-audit-kit appears in the list, the skill is loaded.
Note: The latest Claude Code client supports auto hot-reload, so restart is usually unnecessary. If the skill is missing, try restarting Claude Code.
Usage
A restart is usually unnecessary after installation. If it does not take effect, restart Claude Code.
Trigger the Skill
Based on SKILL.md, you can trigger the skill with prompts like:
"Audit production prod-cluster namespace backend"
"Check payment service in staging cluster staging-cluster"
"Analyze all apps in dev cluster dev-cluster"
Or use more general phrasing:
"Please audit the my-namespace namespace in my-context"
"Help me audit cluster-1"
Claude will detect your intent, use the kube-audit-kit skill, and ask for Context and Namespace.
Full Workflow
The skill executes the following steps:
- Export resources - Use
kubectl get/listto export all resource types - Sanitize resources - Remove status fields and noisy metadata
- Group apps - Associate resources based on workload topology
- Security audit - Static analysis + AI deep analysis to generate reports
Requirements
| Component | Version Requirement |
|---|---|
| Python | >= 3.14 |
| kubectl | Any version (configured cluster) |
| uv | Latest (dependency management) |
Run Scripts Manually
If you want to run scripts without the skill:
# Install dependencies
uv sync
# Run the audit pipeline
CTX=your-context
NS=your-namespace
uv run python scripts/export.py --context $CTX --namespace $NS
uv run python scripts/sanitize.py --context $CTX --namespace $NS
uv run python scripts/group_apps.py --context $CTX --namespace $NS
uv run python scripts/audit.py --context $CTX --namespace $NS
Security Recommendations
🔐 Use a Dedicated Audit Account
Create a dedicated service account with strict RBAC controls. If you are concerned about exposing Secret data during the audit, you can omit Secret permissions; other checks will still work normally.
An example audit service account is provided:
# View example configuration
cat examples/audit-service-account.yaml
# Apply to target namespace (edit Namespace first)
kubectl apply -f examples/audit-service-account.yaml
# Get an audit token (valid for 1 hour)
kubectl -n <namespace> create token audit-service-account --duration=1h
# Configure kubeconfig for the audit context
kubectl config set-credentials audit-service-account --token=<token>
kubectl config set-context audit-context \
--cluster=<your-cluster> \
--user=audit-service-account \
--namespace=<target-namespace>
Permission Notes:
| Permission | Required | Description |
|---|---|---|
| Pod/Deployment/Workload | ✅ Yes | Workload security checks |
| ConfigMap | ✅ Yes | Sensitive data scan |
| Service/Ingress/NetworkPolicy | ✅ Yes | Network security audit |
| RBAC Resources | ✅ Yes | RBAC permission audit |
| Secret | ⚪ Optional | If not granted, Secret checks are skipped |
Impact without Secret permissions:
- ❌ Secret type checks unavailable
- ❌ Cannot detect non-sensitive data stored in Secret
- ✅ All other checks still work (Pod Security, RBAC, network, hostPath, etc.)
Security Best Practices:
- ✅ Least privilege - grant only what is needed for auditing
- ✅ Secret optional - decide based on
Related Skills
wshobson/agents
wshobsonIntelligent automation and multi-agent orchestration for Claude Code
The most comprehensive Claude Code plugin ecosystem, covering full-stack development scenarios with a three-tier model strategy balancing performance and cost.
ComposioHQ/awesome-claude-skills
ComposioHQA curated list of awesome Claude Skills, resources, and tools for customizing Claude AI workflows
The most comprehensive Claude Skills resource list; connect-apps is a killer feature.
code-yeongyu/oh-my-opencode
code-yeongyuThe Best Agent Harness. Meet Sisyphus: The Batteries-Included Agent that codes like you.
Powerful multi-agent coding tool, but note OAuth limitations.
nextlevelbuilder/ui-ux-pro-max-skill
nextlevelbuilderAn AI SKILL that provide design intelligence for building professional UI/UX multiple platforms
Essential for designers; comprehensive UI/UX knowledge base.
thedotmack/claude-mem
thedotmackA Claude Code plugin that automatically captures everything Claude does during your coding sessions, compresses it with AI (using Claude's agent-sdk), and injects relevant context back into future sessions.
A practical solution for Claude's memory issues.
OthmanAdi/planning-with-files
OthmanAdiClaude Code skill implementing Manus-style persistent markdown planning — the workflow pattern behind the $2B acquisition.
Context engineering best practices; an open-source implementation of Manus mode.

