本文へスキップ
Skillpedia
セキュリティ35k · #7618

analyzing-kubernetes-audit-logs

できること

このツールは、Kubernetesの監査ログを分析して不審な活動を見つけ出します。不正アクセス、権限昇格、データ窃取の試みなどを探し、クラスターが侵害されていないかを特定する手助けをします。

使う場面

  • ✓Kubernetesクラスターが侵害された可能性があると感じたとき。
  • ✓攻撃者がAPIサーバーを通じて何をしたのかを調べたいとき。
  • ✓クラスターを守るための検知ルールを作成するとき。

スキルのリンク

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/analyzing-kubernetes-audit-logs/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/analyzing-kubernetes-audit-logs/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“Kubernetesの監査ログを分析して、シークレットへのアクセス試行や特権Podの作成がなかったか教えてください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

このツールは、Kubernetesで起きたすべての出来事の記録であるログファイルを読み込みます。そして、コンテナへの侵入や機密情報へのアクセスなど、危険な操作を示す特定のパターンを探します。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

Analyzing Kubernetes Audit Logs

When to Use

  • When investigating security incidents that require analyzing kubernetes audit logs
  • When building detection rules or threat hunting queries for this domain
  • When SOC analysts need structured procedures for this analysis type
  • When validating security monitoring coverage for related attack techniques

Prerequisites

  • Familiarity with container security concepts and tools
  • Access to a test or lab environment for safe execution
  • Python 3.8+ with required dependencies installed
  • Appropriate authorization for any testing activities

Instructions

Parse Kubernetes audit log files (JSON lines format) to detect security-relevant events including unauthorized access, privilege escalation, and data exfiltration.

import json

with open("/var/log/kubernetes/audit.log") as f:
    for line in f:
        event = json.loads(line)
        verb = event.get("verb")
        resource = event.get("objectRef", {}).get("resource")
        user = event.get("user", {}).get("username")
        if verb == "create" and resource == "pods/exec":
            print(f"Pod exec by {user}")

Key events to detect:

  1. pods/exec and pods/attach (shell into containers)
  2. secrets access (get/list/watch)
  3. clusterrolebindings creation (RBAC escalation)
  4. Privileged pod creation
  5. Anonymous or system:unauthenticated access

Examples

# Detect secret enumeration
if verb in ("get", "list") and resource == "secrets":
    print(f"Secret access: {user} -> {event['objectRef'].get('name')}")
よくある質問

Kubernetesの監査ログとは何ですか?

Kubernetesクラスターで行われたすべての操作について、誰が、いつ、どのリソースに対して何をしたかを記録した詳細な記録です。

「exec-into-pod」とは何ですか?

コマンドを使って、クラスター内で動作しているコンテナに入り込むことを指します。これは侵入の一種である可能性があります。

SIEMの検知ルールとは何ですか?

SIEM(セキュリティ情報イベント管理)と呼ばれるセキュリティシステムにおける設定で、ログから特定された不審な活動が発生したときに通知を出すためのものです。

詳細

作者による元の説明

Parses Kubernetes API server audit logs (JSON lines) to detect exec-into-pod, secret access, RBAC modifications, privileged pod creation, and anonymous API access, and builds SIEM detection rules from the event patterns. Use when investigating a suspected cluster compromise, reconstructing what an attacker did through the API server, or writing Kubernetes-specific detection content. Keywords: audi

repo: mukul975/Anthropic-Cybersecurity-Skills

人気

GitHubのスター
35k
ランキング
#7618
ライセンス
Apache-2.0
更新日
2026/8/31

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル