Logo van Kube Audit Kit

Kube Audit Kit

Community
crazygit
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.

Overzicht

Uitgevercrazygit
Repositorykube-audit-kit
Skillnaamkube-audit-kit
Sterren
31
Forks
1
Meegeleverde bestanden
20
Links
  • Instructies in Markdown

    Een SKILL.md-bestand dat het model laadt wanneer nodig, zodat het alleen tokens kost als een verzoek er daadwerkelijk bij past.

  • Werkt met elk LLM

    AI-skills zijn gewone Markdown, geen aanbiederspecifieke code. Daardoor werken ze met GPT, Claude, Gemini, Grok of een lokaal model.

  • 20 meegeleverde bestanden

    Scripts, sjablonen en referentiemateriaal die het model tijdens het werken kan lezen. Bestanden zijn alleen-lezen en worden nooit uitgevoerd.

  • Open source

    Gepubliceerd door crazygit op GitHub. Lees de broninhoud voordat je de skill installeert.

Installatie

Installeer de AI-skill Kube Audit Kit in TypingMind om deze met elke LLM te gebruiken, of voeg de skill toe aan een andere agent die SKILL.md kan lezen.

1

Installeren in TypingMind

TypingMind installeert een skill rechtstreeks vanuit de GitHub-map — het leest SKILL.md, bundelt de bijbehorende bestanden en slaat het resultaat lokaal op.

  1. Open de app en ga naar Plug-ins → Skills.
  2. Kies "Installeren via GitHub".
  3. Plak de onderstaande URL van de skillmap en bevestig.
    https://github.com/crazygit/kube-audit-kit/tree/main
  4. Schakel de skill in elke chat in waarin je deze beschikbaar wilt hebben.
Plug-ins → Skills → Nieuwe skill → Via GitHub-URL. Plak vervolgens de map-URL en druk op Doorgaan.
2

Installeren in een andere agent

Elke agent die het Agent Skills-formaat kan lezen, kan deze skill gebruiken — kopieer de map naar de skillmap van die agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/crazygit/kube-audit-kit.git \
  .claude/skills/kube-audit-kit
Start Claude Code na het kopiëren opnieuw op, zodat de nieuwe skill wordt herkend.

Gebruik deze skill in TypingMind

Schakel Kube Audit Kit in een willekeurige chat in TypingMind in en het model doet de rest. De naam en beschrijving staan in de systeemprompt. Zodra een verzoek erbij past, laadt het model zelf de volledige instructies — je hoeft de skill nooit handmatig aan te roepen en deze kost pas tokens wanneer je de skill daadwerkelijk gebruikt.

Het model laadt Kube Audit Kit automatisch zodra een verzoek erbij past.

Werkt met elk AI-model

AI-skills zijn gewone Markdown-instructies in plaats van aanbiederspecifieke code. Daardoor is Kube Audit Kit niet gebonden aan het model waarvoor de skill is geschreven. Installeer de skill één keer in TypingMind en gebruik deze met GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama of een lokaal model dat je zelf draait — allemaal met je eigen API-sleutels.

  • Alleen geladen wanneer nodig

    De systeemprompt bevat alleen de naam en beschrijving. De instructies worden bij het eerste bijpassende verzoek opgehaald, dus een ongebruikte skill kost niets.

  • Wissel van model tijdens een chat

    Omdat de skill uit instructies bestaat en niet uit code, blijft deze werken als je van model wisselt — het volgende model leest hetzelfde SKILL.md-bestand.

Skillinstructies

Dit is de inhoud van SKILL.md die het model laadt. Lees deze vóór de installatie — een skill bestaat uit instructies die je model zal volgen.

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/list operations, never apply/patch/delete
  • Full coverage: dynamically discover all resource types without hardcoding lists
  • Scripted: core logic runs through Python scripts for stability

Quick Start

Prerequisites

  1. Environment setup:

    bash
    uv sync

    See SETUP.md for details.

  2. Verify kubectl:

    bash
    kubectl config get-contexts

Run an audit

When a user requests an audit, follow these steps strictly:

Set the output directory first (important!):

bash
# 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
bash
# 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
bash
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
bash
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:

bash
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:

  1. Independent analysis: traverse {OUTPUT_BASE}/group/*/ and read all original YAML files
  2. 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., latest images, missing resource limits)
  3. Supplement findings: if sensitive data was missed, append to the CSV files
  4. 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 report

Reference Docs

User Interaction Conventions

Planning Phase

Received. Target: Context `{ctx}`, Namespace `{ns}`.

Execution plan:
1. Set the output directory environment variable: export KUBE_AUDIT_OUTPUT="$(pwd)/output"
2. [Export] Dynamic discovery and full resource export → scripts/export.py
3. [Sanitize] Remove metadata and status fields → scripts/sanitize.py
4. [Group] Associate applications by workload topology → scripts/group_apps.py
5. [Audit] Dual-layer security audit (static scan + AI expert review) → scripts/audit.py

Output directory: $(pwd)/output/{ctx}/{ns}/

Start?

Execution Phase

Output a summary after each step (each command must include the environment variable):

✅ [Export completed] Scanned 32 resource types, exported 150 YAMLs
   Output: output/{ctx}/{ns}/export/

Results Phase

✅ [Audit completed] Static report and AI expert analysis merged

📊 Audit stats:
- Applications: 12
- Critical risks: X (see audit_results.json)
- Warning risks: Y
- Info recommendations: Z

📁 Output directory: output/{ctx}/{ns}/
📄 Full audit report: output/{ctx}/{ns}/audit/audit_report.md

⚠️ Security reminder: the output/ directory contains decrypted Secret data. Please delete it securely after the audit!

Path Conventions

{OUTPUT_BASE} = output/{context}/{namespace}/

Output path mechanism

All paths are computed by get_output_paths() in scripts/utils.py, with the following precedence:

  1. Environment variable KUBE_AUDIT_OUTPUT (recommended)

    • Set in SKILL.md before running: export KUBE_AUDIT_OUTPUT="$(pwd)/output"
    • Ensures output files are created in the user's working directory
    • Avoids writing to the SKILL installation directory
  2. Current working directory (fallback)

    • If the environment variable is not set, use Path.cwd() / "output"
    • Note: when a SKILL runs, cwd may be the SKILL directory

Why the environment variable?

When the SKILL is invoked, the Agent switches to the SKILL installation directory to run scripts. Using Path.cwd() directly would write to the wrong location.

By setting KUBE_AUDIT_OUTPUT="$(pwd)/output" before each command, you ensure:

  • $(pwd) resolves to the user's working directory
  • Python scripts read the environment variable and write to the intended path
  • Output always lands in the user's working directory, regardless of where the SKILL is called

Key Design Decisions

Volume vs EnvVar distinction

ConfigMaps/Secrets usage determines whether sensitive data is scanned:

  • Volume mount: skip sensitive scanning (treated as application config files)
  • EnvVar reference: scan for sensitive data (may include passwords/keys)

config_usage.json records the usage type for each ConfigMap/Secret.

Permission error handling

Scripts use a fault-tolerant approach:

  • If a single resource type is denied, skip it and show a warning
  • Other resource types continue normally
  • The final report notes which checks are missing due to insufficient permissions

Use a dedicated audit service account (see SETUP.md).

Security Reminder

Warning: the output/ directory contains decrypted Secret data.

After the audit:

  • Keep audit_report.md (it does not contain sensitive data)
  • Securely delete other directories or store them encrypted
  • Do not commit output/ to version control

Meegeleverde bestanden

Het model leest deze bestanden wanneer nodig terwijl de skill geladen is. Ze worden beschikbaar gesteld als leesbare bestanden en worden nooit uitgevoerd.

Veelgestelde vragen

Wat doet de AI-skill 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.

Waarom Kube Audit Kit gebruiken in TypingMind?

Omdat je deze skill één keer installeert en met elk model kunt gebruiken. Kube Audit Kit bestaat uit gewone Markdown in plaats van aanbiederspecifieke code. Dezelfde skill werkt dus met GPT-5, Claude, Gemini, Grok of een lokaal model, en je kunt midden in een chat van model wisselen zonder dat de skill niet meer werkt. TypingMind werkt met je eigen API-sleutels, dus je betaalt aanbieders rechtstreeks in plaats van een abonnement per gebruikersplek. Je skills en chats blijven in je eigen opslag.

Hoe installeer ik Kube Audit Kit in TypingMind?

Open Plug-ins → Skills → Installeren vanaf GitHub in TypingMind en plak https://github.com/crazygit/kube-audit-kit/tree/main. TypingMind leest het bestand SKILL.md, bundelt de bijbehorende bestanden en installeert het geheel als een skill die je per chat kunt inschakelen.

Welke AI-modellen kunnen Kube Audit Kit gebruiken?

Elk model dat je in TypingMind koppelt. AI-skills bestaan uit gewone Markdown-instructies in plaats van aanbiederspecifieke code. GPT, Claude, Gemini, Grok en lokale modellen kunnen deze skill dus allemaal laden wanneer een verzoek erbij past.

Hoeveel AI-modellen kan ik met Kube Audit Kit gebruiken?

Zoveel als je wilt. Zolang een model skills ondersteunt, kun je Kube Audit Kit ermee gebruiken: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama en meer. Allemaal in TypingMind met je eigen API-sleutels.

Is de AI-skill Kube Audit Kit gratis?

Deze skill is door crazygit op GitHub gepubliceerd. Bekijk de repository voor de licentievoorwaarden. Je betaalt alleen je eigen AI-aanbieder voor de tokens die je gebruikt.

Wat zijn AI-skills?

Een AI-skill is een herbruikbare bundel instructies die een AI-model leert hoe het één specifieke taak moet uitvoeren. Deze volgt het open Agent Skills-formaat: een bestand met de naam SKILL.md met een naam en beschrijving, plus eventuele scripts, sjablonen of referentiebestanden die het model nodig heeft. Het model leest de instructies alleen als je verzoek bij de skill past. Een geïnstalleerde skill kost dus niets zolang deze niet wordt gebruikt.

Waarin verschillen AI-skills van plug-ins of MCP-servers?

Een plug-in of MCP-server geeft een model nieuwe tools om aan te roepen: code die ergens wordt uitgevoerd en een resultaat teruggeeft. Een AI-skill geeft het model juist kennis en een werkwijze: hoe het een taak moet aanpakken, welke stappen het moet volgen en hoe goede uitvoer eruitziet. Skills bestaan uit gewone Markdown en hebben dus geen server, API-sleutel of runtime nodig. Ze werken met elk model.

Toon alles

Maak nu je eigen AI-werkruimte

Schrijf je in voor onze nieuwsbrief en blijf op de hoogte van nieuwe functies en toekomstige weggeefacties 👇