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가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“Kubernetes 감사 로그를 분석하고, 시크릿에 접근하려 하거나 특권 파드를 만든 시도가 있었는지 알려 주세요.”
매주 새 스킬 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:
- pods/exec and pods/attach (shell into containers)
- secrets access (get/list/watch)
- clusterrolebindings creation (RBAC escalation)
- Privileged pod creation
- 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
인기도
- GitHub 스타
- 35k
- 순위
- #7618
- 라이선스
- Apache-2.0
- 업데이트
- 2026. 8. 31.
댓글
- …
이 저장소의 다른 스킬
abusing-dpapi-for-credential-access
35kAI 에이전트에게 특정 작업을 위한 준비된 지침을 제공해, 더 잘하고 더 빠르게 처리하도록 합니다.
abusing-shadow-credentials-for-privesc
35kAI 에이전트가 명확하고 잘 구성된 텍스트를 쓰도록 가르칩니다.
achieving-cmmc-level-2-compliance
35kCMMC Level 2 규정 준수를 위한 환경을 준비하도록 돕습니다. 보안 요구 사항을 구현하고 필요한 문서를 관리합니다.
acquiring-disk-image-with-dd-and-dcfldd
35k에이전트가 하드 드라이브의 정확한 복사본을 만들도록 돕습니다. 조사 중 정보가 손실되거나 변경되지 않도록 하는 데 유용합니다.