شعار Kube Audit Kit

Kube Audit Kit

المجتمع
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.

نظرة عامة

الناشرcrazygit
المستودعkube-audit-kit
اسم المهارةkube-audit-kit
النجوم
31
التفريعات
1
الملفات المرفقة
20
الروابط
  • تعليمات بصيغة Markdown

    ملف SKILL.md يُحمّله النموذج عند الحاجة، فلا يستهلك توكنات إلا عندما يَرِد طلب ذو صلة فعلًا.

  • تعمل مع أي نموذج لغوي كبير

    مهارات الذكاء الاصطناعي مكتوبة بصيغة Markdown وليست شيفرة خاصة بمزوّد معيّن، لذا تعمل مع GPT أو Claude أو Gemini أو Grok أو نموذج محلي.

  • الملفات المرفقة: 20

    نصوص برمجية وقوالب ومراجع يمكن للنموذج قراءتها أثناء عمله. الملفات للقراءة فقط ولا تُنفّذ أبدًا.

  • مفتوحة المصدر

    نشرها crazygit على GitHub. اطّلع على المصدر قبل تثبيتها.

التثبيت

ثبّت مهارة الذكاء الاصطناعي Kube Audit Kit في TypingMind لاستخدامها مع أي نموذج لغوي كبير، أو أضفها إلى وكيل ذكاء اصطناعي آخر يقرأ SKILL.md.

1

التثبيت في TypingMind

يُثبّت TypingMind المهارة مباشرةً من مجلدها على GitHub — فيقرأ SKILL.md، ويجمع ملفات الموارد في حزمة، ويحفظ النتيجة محليًا.

  1. افتح التطبيق وانتقل إلى الإضافات → المهارات.
  2. اختر «تثبيت من GitHub».
  3. الصق رابط مجلد المهارة الموضّح أدناه وأكّد التثبيت.
    https://github.com/crazygit/kube-audit-kit/tree/main
  4. فعّل المهارة في كل محادثة تريد إتاحتها فيها.
الإضافات → المهارات → إضافة مهارة → من رابط GitHub، ثم الصق رابط المجلد واضغط على «متابعة».
2

التثبيت في وكيل ذكاء اصطناعي آخر

يمكن لأي وكيل ذكاء اصطناعي يقرأ تنسيق Agent Skills استخدام هذه المهارة — انسخ المجلد إلى مجلد المهارات الخاص بذلك الوكيل.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/crazygit/kube-audit-kit.git \
  .claude/skills/kube-audit-kit
أعد تشغيل Claude Code بعد النسخ ليتعرّف على المهارة الجديدة.

استخدمها في TypingMind

فعّل Kube Audit Kit في أي محادثة على TypingMind وسيتولى النموذج الباقي. تتضمن مطالبة النظام اسمها ووصفها، وبمجرد ورود طلب ذي صلة، يُحمّل النموذج التعليمات الكاملة تلقائيًا — فلا تحتاج إلى استدعائها يدويًا، ولا تستهلك أي توكنات حتى تُستخدم فعليًا.

يُحمّل النموذج Kube Audit Kit تلقائيًا بمجرد ورود طلب ذي صلة بها.

تعمل مع أي نموذج ذكاء اصطناعي

مهارات الذكاء الاصطناعي هي تعليمات بصيغة Markdown وليست شيفرة خاصة بمزوّد معيّن، لذا لا ترتبط Kube Audit Kit بالنموذج الذي كُتبت له. ثبّتها مرة واحدة في TypingMind واستخدمها مع GPT-5 أو Claude أو Gemini أو Grok أو DeepSeek أو Mistral أو Llama أو نموذج محلي تشغّله بنفسك — كل ذلك باستخدام مفاتيح API الخاصة بك.

  • تُحمَّل عند الحاجة فقط

    تتضمن مطالبة النظام الاسم والوصف فقط. وتُجلب التعليمات عند أول طلب ذي صلة، لذا لا تترتب أي تكلفة على المهارة غير المستخدمة.

  • بدّل النماذج أثناء المحادثة

    لأن المهارة تعليمات وليست شيفرة، فإن تغيير النموذج لا يعطّلها — فالنموذج التالي يقرأ ملف SKILL.md نفسه.

تعليمات المهارة

هذا هو محتوى SKILL.md الذي يُحمّله النموذج. اقرأه قبل التثبيت — فالمهارة عبارة عن تعليمات سيتبعها نموذجك.

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

الملفات المرفقة

يقرأ النموذج هذه الملفات عند الحاجة أثناء تحميل المهارة. وهي متاحة للقراءة ولا تُنفّذ أبدًا.

الأسئلة الشائعة

ماذا تفعل مهارة الذكاء الاصطناعي 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 على TypingMind؟

لأنك تثبّتها مرة واحدة وتستخدمها مع أي نموذج. مهارة Kube Audit Kit عبارة عن نص Markdown وليست شيفرة خاصة بمزود بعينه، لذا تعمل المهارة نفسها مع GPT-5 أو Claude أو Gemini أو Grok أو نموذج محلي، ويمكنك تبديل النموذج أثناء المحادثة دون تعطّل المهارة. يعمل TypingMind بمفاتيح API الخاصة بك، فتدفع للمزودين مباشرةً بدلًا من اشتراك لكل مقعد، وتبقى مهاراتك ومحادثاتك في مساحة التخزين الخاصة بك.

كيف أثبّت Kube Audit Kit في TypingMind؟

افتح الإضافات → المهارات → التثبيت من GitHub في TypingMind والصق https://github.com/crazygit/kube-audit-kit/tree/main. يقرأ TypingMind ملف SKILL.md الخاص بها، ويجمع ملفاتها ويثبّتها كمهارة يمكنك تفعيلها لكل محادثة على حدة.

ما نماذج الذكاء الاصطناعي التي يمكنها استخدام Kube Audit Kit؟

أي نموذج تربطه في TypingMind. مهارات الذكاء الاصطناعي عبارة عن تعليمات Markdown وليست شيفرة خاصة بمزود بعينه، لذا يمكن لكل من GPT وClaude وGemini وGrok والنماذج المحلية تحميل هذه المهارة عندما يتوافق الطلب معها.

كم نموذج ذكاء اصطناعي يمكنني استخدامه مع Kube Audit Kit؟

أي عدد تريده. ما دام النموذج يدعم المهارات، يمكنك استخدام Kube Audit Kit معه، سواء كان GPT أو Claude أو Gemini أو Grok أو DeepSeek أو Mistral أو Llama أو غيرها، وكل ذلك على TypingMind باستخدام مفاتيح API الخاصة بك.

هل مهارة الذكاء الاصطناعي Kube Audit Kit مجانية؟

نشرها crazygit على GitHub. راجع المستودع للاطلاع على شروط الترخيص. لا تدفع إلا لمزود الذكاء الاصطناعي الخاص بك مقابل التوكنات التي تستخدمها.

ما هي مهارات الذكاء الاصطناعي؟

مهارة الذكاء الاصطناعي حزمة تعليمات قابلة لإعادة الاستخدام تعلّم نموذج الذكاء الاصطناعي كيفية تنفيذ مهمة محددة. وتتبع تنسيق Agent Skills المفتوح: ملف SKILL.md يتضمن اسمًا ووصفًا، إلى جانب أي نصوص برمجية أو قوالب أو ملفات مرجعية قد يحتاج إليها النموذج. لا يقرأ النموذج التعليمات إلا عندما يتوافق طلبك مع المهارة، لذا لا تترتب على المهارة المثبتة أي تكلفة حتى تُستخدم.

كيف تختلف مهارات الذكاء الاصطناعي عن الإضافات أو موصلات MCP؟

تمنح الإضافة أو موصل MCP النموذج أدوات جديدة يمكنه استدعاؤها، وهي شيفرة تُنفَّذ في مكان ما وتُرجع نتيجة. أما مهارة الذكاء الاصطناعي فتزوّد النموذج بالمعرفة ومنهجية العمل: كيفية التعامل مع مهمة، والخطوات التي ينبغي اتباعها، وما ينبغي أن تكون عليه المخرجات الجيدة. المهارات عبارة عن نصوص Markdown، لذا لا تحتاج إلى خادم أو مفتاح API أو بيئة تشغيل، وتعمل مع أي نموذج.

عرض الكل

أنشئ مساحة عملك للذكاء الاصطناعي الآن

اشترك في نشرتنا البريدية لتصلك أخبار الميزات الجديدة والهدايا القادمة 👇