Communitygithub.com

Splunkによるセキュリティログ分析

Splunk Enterprise SecurityとSPL(Search Processing Language)を活用して、セキュリティインシデントの調査・分析を行います。

Splunkによるセキュリティログ分析 とは?

このスキルは、Splunk Enterprise Security(ES)とSPL(Search Processing Language)を用いて、セキュリティインシデントの調査、脅威ハンティング、検知ルール作成、インシデントタイムラインの再構築を効率的に行うためのものです。Windowsイベントログ、Sysmon、プロキシ、DNS、ファイアウォールなど複数のログソースを横断的に相関分析し、認証異常、横展開、データ流出などの兆候を発見します。Splunk Cloud / Enterprise環境に対応し、Splunk CIM(Common Information Model)によるフィールド名の正規化を前提としています。ワークフローは、調査範囲の設定、認証イベント解析、プロセス実行トレース、ネットワークアクティビティ分析、統合タイムラインの構築、そして検知ルールの作成までをカバーします。また、実際のインシデント調査シナリオ(クレデンシャルスタッフィングによるアカウント乗っ取りなど)とその際の注意点も含んでおり、セキュリティアナリストが現場で即座に活用できる実践的な内容となっています。

対応~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を使用して完全なパケットキャプチャ分析を行ってください。

前提条件

  • Splunk EnterpriseまたはSplunk Cloud(Enterprise Security(ES)アプリがインストールされていること)
  • 取り込まれているログソース: 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

| パス・ザ・ハッシュの検出 (ログオンタイプ 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", "Web: ".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 Eventを生成するスケジュールされた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つのアカウントへの複数回の成功ログインに関するアラートを受け取ります。

アプローチ:

  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,

関連スキル