kube-audit-kit
БесплатноБез исполняемых скриптовНе проверенPerforms read-only Kubernetes security audits by exporting resources, sanitizing metadata, grouping applications by topology, and generating PSS/NSA-compliant…
от crazygit★ 31 звезда на GitHubОб этом скилле
Kube Audit Kit - Read-Only Kubernetes Security Audit Toolkit
This Skill uses a standardized, scripted workflow to export Kubernetes cluster resources in read-only mode, sanitize them, group applications, and perform a deep security audit. The entire process strictly follows the read-only principle and does not modify any cluster state.
Core Principles
- Read-only: only
get/listoperations, neverapply/patch/delete - Full coverage: dynamically discover all resource types without hardcoding lists
- Scripted: core logic runs through Python scripts for stability
Quick Start
Prerequisites
Environment setup:
uv syncSee SETUP.md for details.
Verify kubectl:
kubectl config get-contexts
Run an audit
When a user requests an audit, follow these steps strictly:
Set the output directory first (important!):
# Set the output directory to output/ under the current working directory
# This ensures output files are generated in the user's working directory, not the SKILL install directory
export KUBE_AUDIT_OUTPUT="$(pwd)/output"
Use the progress checklist:
Audit progress:
- [ ] Step 1: Export - Dynamic discovery and full resource export
- [ ] Step 2: Sanitize - Remove metadata and status fields
- [ ] Step 3: Group - Associate applications by workload topology
- [ ] Step 4: Audit - Dual-layer security audit
Step 1: Export
# Keep the environment variable effective for each command
export KUBE_AUDIT_OUTPUT="$(pwd)/output" && \
uv run python scripts/export.py --context <context> --namespace <namespace>
Output: {OUTPUT_BASE}/export/
Step 2: Sanitize
export KUBE_AUDIT_OUTPUT="$(pwd)/output" && \
uv run python scripts/sanitize.py --context <context> --namespace <namespace>
Output: {OUTPUT_BASE}/sanitize/, {OUTPUT_BASE}/sanitize_fields/
Step 3: Group
export KUBE_AUDIT_OUTPUT="$(pwd)/output" && \
uv run python scripts/group_apps.py --context <context> --namespace <namespace>
Output: {OUTPUT_BASE}/group/, {OUTPUT_BASE}/ungrouped_resources.txt
Step 4: Audit
Phase 1 - Script-based static scan:
export KUBE_AUDIT_OUTPUT="$(pwd)/output" && \
uv run python scripts/audit.py --context <context> --namespace <namespace>
Output:
{OUTPUT_BASE}/audit/audit_results.json- structured audit results{OUTPUT_BASE}/audit/configmap_to_secret.csv- ConfigMap sensitive data{OUTPUT_BASE}/audit/secret_to_configmap.csv- Secret non-sensitive data{OUTPUT_BASE}/audit/rbac_issues.csv- RBAC audit results{OUTPUT_BASE}/audit/network_security.csv- network security audit results{OUTPUT_BASE}/audit/hostpath_mounts.csv- hostPath mount findings{OUTPUT_BASE}/audit/security_policies.csv- seccomp/AppArmor results{OUTPUT_BASE}/audit/pdb_and_secrets.csv- PDB/Secret/ServiceAccount results
Phase 2 - AI expert deep review:
AI independently reviews results without relying on phase 1 output:
- Independent analysis: traverse
{OUTPUT_BASE}/group/*/and read all original YAML files - Deep review: identify risks not covered by script rules
- business logic risks (e.g., plaintext private keys, hardcoded passwords)
- architecture risks (e.g., missing NetworkPolicy, overly broad RBAC)
- configuration drift risks (e.g.,
latestimages, missing resource limits)
- Supplement findings: if sensitive data was missed, append to the CSV files
- Report summary: merge phase 1 findings with AI analysis into
{OUTPUT_BASE}/audit/audit_report.md
Report template: see audit_report_template.md in the same directory.
Key requirements:
- Must read original YAML files, not just audit_results.json
- Every application must have specific analysis; avoid vague statements like "not reviewed"
- If script misses sensitive data, update the CSV files to keep data complete
Output Structure
output/{context}/{namespace}/
├── export/ # raw export data
├── sanitize/ # sanitized data
├── sanitize_fields/ # sanitization records
├── group/ # application grouping
│ └── {app_name}/
│ ├── *.yaml # grouped resource files
│ └── config_usage.json # CM/Secret usage record
├── ungrouped_resources.txt # orphan resources
└── audit/ # audit results
├── audit_results.json # static analysis results
├── configmap_to_secret.csv # sensitive data in ConfigMaps
├── secret_to_configmap.csv # non-sensitive data in Secrets
├── rbac_issues.csv # RBAC audit results
├── network_security.csv # network security audit results
├── hostpath_mounts.csv # hostPath mount findings
├── security_policies.csv # seccomp/AppArmor results
├── pdb_and_secrets.csv # PDB/Secret/ServiceAccount results
└── audit_report.md # final AI-generated
Установить kube-audit-kit в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadWriteBash(python:*)Bash(uv:*)Bash(kubectl:*)Bash(export:*)Вложенные файлы
FAQ
Что делает скилл kube-audit-kit?
Performs read-only Kubernetes security audits by exporting resources, sanitizing metadata, grouping applications by topology, and generating PSS/NSA-compliant audit reports. Use when the user requests auditing Kubernetes clusters, Namespaces, security reviews, or configuration analysis.
Как установить скилл kube-audit-kit?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл kube-audit-kit запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic