Chuyển đến nội dung
Skillpedia
Bảo mật35k · #7618

analyzing-kubernetes-audit-logs

Skill này làm gì

Công cụ này phân tích nhật ký kiểm toán (audit log) của Kubernetes để tìm hoạt động đáng ngờ. Nó tìm truy cập trái phép, leo thang đặc quyền và các nỗ lực trộm dữ liệu, giúp xác định cluster của bạn có bị xâm nhập hay không.

Khi nào nên dùng

  • ✓Khi bạn nghi ngờ cluster Kubernetes của mình bị xâm nhập.
  • ✓Khi điều tra kẻ tấn công đã làm gì qua API server.
  • ✓Khi tạo quy tắc phát hiện để bảo vệ cluster.

Liên kết skill

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

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/analyzing-kubernetes-audit-logs/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Phân tích nhật ký kiểm toán Kubernetes và cho tôi biết có lần thử truy cập secret hoặc tạo pod có đặc quyền nào không.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Công cụ đọc các file nhật ký, tức là bản ghi mọi hoạt động trong Kubernetes. Nó tìm các mẫu cho thấy hành động nguy hiểm, như ai đó cố vào trong một container hoặc truy cập thông tin nhạy cảm.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

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')}")
Câu hỏi thường gặp

Nhật ký kiểm toán Kubernetes là gì?

Đây là bản ghi chi tiết mọi hành động trong cluster Kubernetes, cho biết ai đã làm gì, lúc nào và với tài nguyên nào.

“exec-into-pod” là gì?

Đây là khi ai đó dùng lệnh để đi vào một container đang chạy trong cluster của bạn, và đó có thể là một hình thức xâm nhập.

Quy tắc phát hiện SIEM là gì?

Đây là các cấu hình trong hệ thống bảo mật (SIEM) để gửi cảnh báo khi phát hiện hoạt động đáng ngờ từ nhật ký.

Chi tiết

Mô tả gốc của tác giả

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

Độ phổ biến

Sao GitHub
35k
Vị trí xếp hạng
#7618
Giấy phép
Apache-2.0
Cập nhật
31/8/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự