Communitygithub.com

Splunk 보안 로그 분석

Splunk Enterprise Security와 SPL을 활용한 보안 로그 분석 스킬

Splunk 보안 로그 분석란 무엇인가요?

이 스킬은 Splunk Enterprise Security(ES)와 SPL(Search Processing Language)을 사용하여 보안 로그를 심층 분석하는 방법을 제공합니다. 보안 사고 대응 중 여러 로그 소스 간의 상관 분석, 알려진 TTP 및 IOC를 이용한 위협 헌팅, 특정 공격 패턴에 대한 탐지 규칙 구축, 사고 타임라인 재구성, 인증 이상 징후, 측면 이동, 데이터 유출 패턴 분석 등에 활용됩니다. Claude Code, Cursor, Codex와 같은 AI 에이전트가 Splunk 환경에서 SPL 쿼리를 실행하고 결과를 해석하여 보안 분석가에게 실행 가능한 인사이트를 제공하도록 설계되었습니다. 이 스킬은 Windows 이벤트 로그, Sysmon, 방화벽, 프록시, DNS, EDR 등 다양한 로그 소스를 가져와 Splunk CIM(Common Information Model) 데이터 모델과 함께 사용합니다. 또한 Splunk SOAR와 연계한 자동화된 대응 플레이북을 지원하며, 보안 운영 효율성을 크게 향상시킵니다.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/mukul975/Anthropic-Cybersecurity-Skills/tree/main/skills/analyzing-security-logs-with-splunk

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

Splunk로 보안 로그 분석하기

사용 시점

  • 여러 로그 소스 간의 상관 분석이 필요한 보안 사고를 조사할 때
  • 알려진 TTP와 IOC를 사용하여 적대자 활동을 헌팅할 때
  • 특정 공격 패턴에 대한 탐지 규칙을 구축할 때
  • 서로 다른 로그 소스에서 사고 타임라인을 재구성할 때
  • 인증 이상 징후, 측면 이동 또는 데이터 유출 패턴을 분석할 때

다음의 경우에는 사용하지 마십시오: 실시간 패킷 수준 분석이 필요한 경우. 전체 패킷 캡처 분석에는 Wireshark 또는 Zeek를 사용하십시오.

사전 요구 사항

  • ES(Enterprise Security) 앱이 설치된 Splunk Enterprise 또는 Splunk Cloud
  • 수집된 로그 소스: Windows 이벤트 로그(Splunk Universal Forwarder 또는 WEF를 통해), 방화벽, 프록시, DNS, EDR, 이메일 게이트웨이
  • 정규화된 필드 이름을 위한 Splunk CIM(Common Information Model) 데이터 모델 구성
  • 중급 이상의 SPL 숙련도
  • Splunk에서 search 및 accelerate_search 기능이 있는 역할 기반 액세스

워크플로

1단계: Splunk에서 조사 범위 설정

사고 분석 데이터를 기반으로 검색 매개변수를 정의합니다:

| 초기 조사 범위 설정
index=windows OR index=firewall OR index=proxy
  earliest="2025-11-14T00:00:00" latest="2025-11-16T00:00:00"
  (host="WKSTN-042" OR src_ip="10.1.5.42" OR user="jsmith")
| stats count by index, sourcetype, host
| sort -count

이 쿼리는 조사 기간 및 영향을 받은 자산에 대해 어떤 로그 소스에 관련 데이터가 포함되어 있는지 확인합니다.

2단계: 인증 이벤트 분석

Windows 보안 이벤트 로그를 사용하여 의심스러운 인증 패턴을 조사합니다:

| 무차별 대입 및 자격 증명 스터핑 탐지
index=windows sourcetype="WinEventLog:Security" EventCode=4625
  earliest=-24h
| stats count as failed_attempts, values(src_ip) as source_ips,
  dc(src_ip) as unique_sources by TargetUserName
| where failed_attempts > 10
| sort -failed_attempts

| Pass-the-Hash 탐지 (로그온 유형 9 - NewCredentials)
index=windows sourcetype="WinEventLog:Security" EventCode=4624
  Logon_Type=9
| table _time, host, TargetUserName, src_ip, LogonProcessName

| RDP를 통한 측면 이동 탐지
index=windows sourcetype="WinEventLog:Security" EventCode=4624
  Logon_Type=10
| stats count, values(host) as targets by TargetUserName, src_ip
| where count > 3
| sort -count

3단계: 프로세스 실행 추적

Sysmon 로그를 사용하여 프로세스 실행 체인을 재구성합니다:

| 부모 체인이 있는 프로세스 생성 (Sysmon 이벤트 ID 1)
index=sysmon EventCode=1 host="WKSTN-042"
  earliest="2025-11-15T14:00:00" latest="2025-11-15T15:00:00"
| table _time, ParentImage, ParentCommandLine, Image, CommandLine, User, Hashes
| sort _time

| 의심스러운 PowerShell 실행 탐지
index=sysmon EventCode=1 Image="*\\powershell.exe"
  (CommandLine="*-enc*" OR CommandLine="*-encodedcommand*"
   OR CommandLine="*downloadstring*" OR CommandLine="*iex*")
| table _time, host, User, ParentImage, CommandLine
| sort _time

| LSASS 자격 증명 덤핑 탐지
index=sysmon EventCode=10 TargetImage="*\\lsass.exe"
  GrantedAccess=0x1010
| table _time, host, SourceImage, SourceUser, GrantedAccess

4단계: 네트워크 활동 분석

네트워크 로그를 엔드포인트 이벤트와 상호 연관시킵니다:

| C2 비콘 패턴 탐지
index=proxy OR index=firewall dest_ip="185.220.101.42"
| timechart span=1m count by src_ip
| where count > 0

| DNS 터널링 탐지 (단일 도메인에 대한 높은 쿼리 볼륨)
index=dns
| rex field=query "(?<subdomain>[^\.]+)\.(?<domain>[^\.]+\.[^\.]+)$"
| stats count, avg(len(query)) as avg_query_len by domain, src_ip
| where count > 500 AND avg_query_len > 40
| sort -count

| 대용량 데이터 전송 탐지 (잠재적 유출)
index=proxy action=allowed
| stats sum(bytes_out) as total_bytes by src_ip, dest_ip, dest_host
| eval total_MB=round(total_bytes/1024/1024,2)
| where total_MB > 100
| sort -total_MB

5단계: 사고 타임라인 구축

모든 로그 소스에 걸쳐 통합된 타임라인을 재구성합니다:

| 통합 사고 타임라인
index=windows OR index=sysmon OR index=proxy OR index=firewall
  (host="WKSTN-042" OR src_ip="10.1.5.42" OR user="jsmith")
  earliest="2025-11-15T14:00:00" latest="2025-11-15T16:00:00"
| eval event_summary=case(
    sourcetype=="WinEventLog:Security" AND EventCode==4624, "로그온: ".TargetUserName." from ".src_ip,
    sourcetype=="WinEventLog:Security" AND EventCode==4625, "로그온 실패: ".TargetUserName,
    sourcetype=="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" AND EventCode==1,
      "프로세스: ".Image." by ".User,
    sourcetype=="proxy", "웹: ".http_method." ".url,
    1==1, sourcetype.": ".EventCode)
| table _time, sourcetype, host, event_summary
| sort _time

6단계: 탐지 규칙 생성

조사 결과를 지속적인 Splunk 상관 검색으로 변환합니다:

| 상관 검색: Office 응용 프로그램에 의해 실행된 PowerShell
index=sysmon EventCode=1
  Image="*\\powershell.exe"
  (ParentImage="*\\winword.exe" OR ParentImage="*\\excel.exe"
   OR ParentImage="*\\outlook.exe")
| eval severity="high"
| eval mitre_technique="T1059.001"
| collect index=notable_events

주요 개념

용어정의
SPL (Search Processing Language)기계 데이터를 검색, 필터링, 변환 및 시각화하기 위한 Splunk의 쿼리 언어
CIM (Common Information Model)공급업체별 필드 이름을 공통 이름에 매핑하여 교차 소스 쿼리를 가능하게 하는 Splunk의 필드 정규화 표준
Notable Event상관 검색 일치를 기반으로 분석가 검토를 위해 Splunk Enterprise Security에서 플래그가 지정된 이벤트
Data Model가속화된 검색 및 피벗 기반 분석을 가능하게 하는 Splunk에서 인덱싱된 데이터의 구조화된 표현
Sourcetype특정 로그 유형의 형식과 구문 분석 규칙을 정의하는 Splunk의 분류 레이블
Correlation Search조건이 충족될 때 지속적으로 실행되고 notable 이벤트를 생성하는 예약된 Splunk 검색
Timechart패턴, 이상 징후 및 추세를 식별하기 위한 시계열 시각화를 생성하는 SPL 명령

도구 및 시스템

  • Splunk Enterprise Security (ES): 상관 검색, 위험 기반 경고 및 조사 워크벤치를 제공하는 프리미엄 SIEM 애플리케이션
  • Splunk SOAR: 자동화된 대응 플레이북을 위해 Splunk ES와 통합된 오케스트레이션 플랫폼
  • Sysmon: Splunk에 수집되는 상세한 프로세스, 네트워크 및 파일 변경 원격 측정을 제공하는 Microsoft 시스템 모니터링 도구
  • Splunk Attack Analyzer: 의심스러운 파일과 URL을 분석하고 결과를 Splunk에 제공하는 자동화된 위협 분석 도구
  • BOSS of the SOC (BOTS): 사고 조사 SPL 쿼리 연습을 위한 SANS/Splunk 교육 데이터 세트

일반적인 시나리오

시나리오: 계정 탈취로 이어지는 자격 증명 스터핑 조사

상황: 보안 운영에서 30분 이내에 지리적으로 분산된 IP 주소에서 단일 계정으로 여러 번의 성공적인 로그인이 있다는 경고를 받습니다.

접근 방식:

  1. 영향을 받은 계정에 대해 이벤트 ID 4624를 쿼리하여 모든 로그인 소스와 시간을 매핑합니다.
  2. Splunk 조회 테이블을 사용하여 로그인 IP를 위협 인텔리전스 피드와 상호 연관시킵니다.
  3. 인증된 세션에서 의심스러운 활동이 있는지 프록시 로그를 확인합니다.
  4. 손상된 계정에서 측면 이동을 검색합니다(다른 호스트에 대한 이벤트 ID 4624 유형 3).
  5. 자격 증명 스터핑 시도, 성공적인 로그인 및 손상 후 활동을 보여주는 타임라인을 구축합니다.
  6. 다른 계정에서 유사한 패턴을 탐지하는 상관 검색을 만듭니다.

주의 사항:

  • 자격 증명 스터핑이 몇 주에 걸쳐 발생했을 수 있는데 지난 24시간만 검색하는 경우
  • 동일한 계정이 불가능한 이동 거리에서 인증하는 것을 보여줄 수 있는 VPN 로그를 확인하지 않는 경우
  • 서로 다른 시간대의 로그 소스 간에 타임스탬프를 정규화하지 못하는 경우

출력 형식

SPLUNK 조사 보고서
============================
사고:        INC-2025-1547
분석가:         [이름]
조사 기간: 2025-11-14 00:00 UTC - 2025-11-16 00:00 UTC

검색 범위
인덱스:         windows, sysmon, proxy, firewall, dns
호스트:           WKSTN-042, SRV-FILE01
사용자:           jsmith, svc-backup
소스 IP:      10.1.5.42, 10.1.10.15

주요 발견 사항
1. [타임스탬프] - 피싱을 통한 초기 침해 (Sysmon 이벤트 1)
2. [타임스탬프] - C2 설정 (프록시 로그, 비콘 패턴 탐지)
3. [타임스탬프] - 자격 증명 도난 (Sysmon 이벤트 10, LSASS 액세스)
4. [타임스탬프] - SRV-FILE01로 측면 이동 (이벤트 4624 유형 3)
5. [타임스탬프] - 데이터 스테이징 및 유출 (프록시 bytes_out 이상)

사용된 SPL 쿼리
[설명이 포함된 주요 쿼리의 번호 목록]

식별된 탐지 격차
- SRV-FILE01에 Sysmon이 배포되지 않음 (사각지대)
- C2 도메인에 대한 프록시 로그에 SSL 검사 누락
- PowerShell ScriptBlock 로깅이 활성화되지 않음

권장 탐지
1. Office에서 실행된 PowerShell에 대한 상관 검색
2. LSASS 액세스 패턴에 대한 임계값 경고
3. 비콘 간격 네트워크 트래픽에 대한 동작 규칙

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

abusing-dpapi-for-credential-access

Extract and decrypt Windows DPAPI-protected secrets (Credential Manager, browser logins/cookies, Wi-Fi credentials, KeePass keys) online or offline using SharpDPAPI, SharpChrome, Mimikatz, or Impacket

abusing-shadow-credentials-for-privesc

Take over Active Directory accounts by writing attacker-controlled public keys to msDS-KeyCredentialLink (Shadow Credentials) with pyWhisker, Whisker, or Certipy, then authenticate via PKINIT to recover the target

achieving-cmmc-level-2-compliance

>-

acquiring-disk-image-with-dd-and-dcfldd

Create forensically sound bit-for-bit disk images with dd or dcfldd on a Linux forensic workstation, preserving evidence integrity through hash verification (MD5/SHA) during acquisition. Use when imaging a suspect drive, USB device, or memory card for investigation, preserving volatile disk evidence during incident response, or producing a verified copy for legal or law-enforcement proceedings before any destructive analysis.

analyzing-active-directory-acl-abuse

Detect dangerous ACL misconfigurations in Active Directory using ldap3

analyzing-android-malware-with-apktool

Perform static analysis of Android APK malware using apktool for resource decompilation, jadx for Java source recovery, and androguard for manifest inspection, dangerous permission-combination detection, and identification of obfuscated code, dynamic code loading, and reflection-based API calls. Use to statically triage a suspicious APK without executing it or to build mobile malware detection rules.

analyzing-api-gateway-access-logs

Parses API Gateway access logs (AWS API Gateway, Kong, Nginx) to detect

analyzing-apt-group-with-mitre-navigator

Query ATT&CK data with attackcti, mitreattack-python, and stix2, then build MITRE ATT&CK Navigator layers and multi-layer heatmap overlays mapping one or more APT groups

analyzing-azure-activity-logs-for-threats

Queries Azure Monitor activity logs and sign-in logs via azure-monitor-query

analyzing-bootkit-and-rootkit-samples

Analyzes bootkit and advanced rootkit malware infecting the Master

analyzing-browser-forensics-with-hindsight

Parse Chromium-based browser databases with Hindsight to extract and correlate browsing history, downloads, cookies, cached content, autofill data, saved passwords, and extensions from Chrome, Edge, Brave, Opera, and Vivaldi into a unified timeline (XLSX, JSON, or SQLite output). Use during incident response, insider-threat investigations, or criminal cases when you need to reconstruct a user

analyzing-campaign-attribution-evidence

Systematically evaluate cyber-campaign evidence to attribute an operation to a threat actor, using the Diamond Model and Analysis of Competing Hypotheses (ACH) to weigh infrastructure overlaps, TTP consistency, malware code similarity, and timing/language artifacts into confidence-weighted attribution assessments. Use when an incident investigation needs a defensible attribution confidence level.

analyzing-certificate-transparency-for-phishing

Monitor Certificate Transparency logs using crt.sh and Certstream to

analyzing-cloud-storage-access-patterns

Detect abnormal access in AWS S3, GCS, and Azure Blob Storage by analyzing CloudTrail Data Events, GCS audit logs, and Azure Storage Analytics for after-hours bulk downloads, new-IP access, and API-call spikes (e.g. GetObject) via statistical baselines and time-series anomaly detection. Use when investigating suspected cloud data exfiltration or building related detection rules.

analyzing-cobalt-strike-beacon-configuration

Extract and analyze Cobalt Strike beacon configuration from PE files

analyzing-cobaltstrike-malleable-c2-profiles

Parse and analyze Cobalt Strike Malleable C2 profiles with dissect.cobaltstrike (profiles and beacon-payload configs) and pyMalleableC2 (AST parsing) to extract HTTP/DNS transforms, URIs, headers, sleep/jitter, and injection behavior, then generate network detection signatures. Use when reverse-engineering a captured malleable profile or building detections against Cobalt Strike Beacon traffic.

analyzing-command-and-control-communication

Analyzes malware C2 communication over HTTP, HTTPS, DNS, and custom

analyzing-cyber-kill-chain

Analyzes intrusion activity against the Lockheed Martin Cyber Kill Chain

analyzing-disk-image-with-autopsy

Perform comprehensive forensic analysis of raw (dd), E01, or AFF disk images with Autopsy and The Sleuth Kit, recovering deleted files, examining metadata and embedded artifacts, keyword searching, and building investigation timelines with visual reports. Use for structured analysis of a forensic disk image or when stakeholders need visual reports from evidence.

analyzing-dns-logs-for-exfiltration

Analyzes DNS query logs to detect data exfiltration via DNS tunneling,

관련 스킬