Skip to content
alyn
mukul975

Analyzing Kubernetes Audit Logs skill

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: audit policy, audit log, kube-apiserver, exec into pod, RBAC change, anonymous access, detection rules. Do not use for syscall-level detection inside a running container - use detecting-container-runtime-threats-with-falco. '

$npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill analyzing-kubernetes-audit-logs
GitHub stars
35,879
Pack installs
113k
Alyn Score
71/99
Updated
2 months ago
License
Apache-2.0

mukul975

Analyzing Kubernetes Audit Logs

Install Analyzing Kubernetes Audit Logs

Pick your agent. Every command is ready to paste.

$npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill analyzing-kubernetes-audit-logs

The open skills CLI detects your agents (Claude Code, Cursor, Codex and 70+ more) and installs to the right folder. Add -g to install globally.

01

Install it

Run the command above, or upload the folder in Claude.

02

Ask naturally

Describe the task. Your agent loads analyzing-kubernetes-audit-logs when the request matches its description.

03

Name it if needed

If it does not trigger, say “use the analyzing-kubernetes-audit-logs skill”. In Codex, type $analyzing-kubernetes-audit-logs.

The skill itself

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')}")

Tips for Analyzing Kubernetes Audit Logs

  • • Start a fresh session after installing so your agent picks up the new skill.
  • • This skill ships scripts. Read them before the first run, and run it in a project without secrets first.
  • • It bundles reference files. The agent reads them only when needed, so they cost no context until then.
  • • It is part of a pack with 40 skills. Install only the ones you need with --skill to keep triggers precise.
  • • If two skills overlap, mention the one you want by name.

Questions about Analyzing Kubernetes Audit Logs

What does the Analyzing Kubernetes Audit Logs skill do?

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: audit policy, audit log, kube-apiserver, exec into pod, RBAC change, anonymous access, detection rules. Do not use for syscall-level detection inside a running container - use detecting-container-runtime-threats-with-falco. '

How do I install Analyzing Kubernetes Audit Logs?

Run "npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill analyzing-kubernetes-audit-logs" in your project. The skills CLI installs it for Claude Code, Cursor, Codex and 70+ other agents. In Claude on the web, upload the skill folder as a ZIP under Customize > Skills.

Does Analyzing Kubernetes Audit Logs work in Cursor and Codex?

Yes. Analyzing Kubernetes Audit Logs uses the open SKILL.md format, so it works in Claude Code, Claude, Cursor, OpenAI Codex, Gemini CLI, GitHub Copilot and other agents that support agent skills.

Is Analyzing Kubernetes Audit Logs free?

Analyzing Kubernetes Audit Logs is open source on GitHub under the Apache-2.0 license. It is free to install; check the license before commercial use.

Who made Analyzing Kubernetes Audit Logs?

Analyzing Kubernetes Audit Logs is published by mukul975 in the mukul975/Anthropic-Cybersecurity-Skills repository, together with 39 other skills.

Similar skills. From other creators.