Communitygithub.com

Timesketchを用いたインシデントタイムライン構築

Timesketchを使用して協調的なフォレンジックインシデントタイムラインを構築し、インシデント調査のための証拠をインジェスト、分析します。

Timesketchを用いたインシデントタイムライン構築 とは?

このスキルは、Googleが開発したオープンソースの協調的フォレンジックタイムライン分析ツールであるTimesketchを設定・活用する方法を提供します。Timesketchは、エンドポイント、サーバー、クラウドサービスからのログやアーティファクトをインジェストし、それらを正規化して統一的に検索可能なタイムラインに変換します。組み込みの分析機能、タグ付け、スケッチへの注釈、ストーリー構築などの強力な分析機能を備え、インシデント調査中の迅速なタイムライン構築を可能にします。このスキルでは、Dockerを用いたデプロイ、Plaso(log2timeline)やCSV/JSONLを用いたデータ取り込み、分析ワークフロー、高度な機能であるAPI自動化やDissectとの連携についても説明しており、セキュリティアナリストやフォレンジック担当者にとって有用です。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/mukul975/Anthropic-Cybersecurity-Skills/tree/main/skills/building-incident-timeline-with-timesketch

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

Timesketchを用いたインシデントタイムライン構築 は何をしますか?

概要

Timesketchは、Googleが開発したオープンソースの協調的フォレンジックタイムライン分析ツールです。セキュリティチームがインシデント調査中に複数のソースからの時系列データを可視化し、分析することを可能にします。エンドポイント、サーバー、クラウドサービスからのログやアーティファクトをインジェストし、それらを統一的に検索可能なタイムラインに正規化します。さらに、組み込みのアナライザー、タグ付け、スケッチ注釈、ストーリー構築などの強力な分析機能を提供します。Timesketchは、アーティファクト解析用にPlaso(log2timeline)と統合され、アクティブなインシデント中に迅速なタイムライン構築を行うためのCSV/JSONLの直接インジェストもサポートしています。

使用すべき場面

  • 環境内でTimesketchを用いたインシデントタイムライン構築機能を導入または設定する場合
  • コンプライアンス要件に沿ったセキュリティコントロールを確立する場合
  • このドメインのセキュリティアーキテクチャを構築または改善する場合
  • この実装を必要とするセキュリティ評価を実施する場合

前提条件

  • インシデントレスポンスの概念とツールに関する知識
  • 安全な実行のためのテスト環境またはラボ環境へのアクセス
  • 必要な依存関係がインストールされたPython 3.8+
  • テスト活動に対する適切な認可

アーキテクチャとコンポーネント

コアコンポーネント

  • Timesketchサーバー: タイムライン管理用のREST APIを備えたWebアプリケーション
  • OpenSearch/Elasticsearch: タイムラインイベントのバックエンドストレージと検索エンジン
  • PostgreSQL: スケッチ、ストーリー、ユーザーデータのメタデータストレージ
  • Redis: バックグラウンド処理用のタスクキュー管理
  • Celeryワーカー: タイムラインアップロードとアナライザーの非同期処理

データフロー

証拠ソース --> Plaso/log2timeline --> Plasoストレージファイル(.plaso)
     |                                           |
     v                                           v
  CSV/JSONL --> Timesketchインポーター --> OpenSearchインデックス
                                           |
                                           v
                                    Timesketch Web UI
                                    (検索、分析、ストーリー)

デプロイ

Dockerデプロイ(推奨)

# Timesketchリポジトリのクローン
git clone https://github.com/google/timesketch.git
cd timesketch

# デプロイメントヘルパースクリプトの実行
cd docker
sudo docker compose up -d

# デフォルトアクセス: https://localhost:443
# 初回実行時に管理者認証情報が生成されます

システム要件

  • 最小8 GB RAM(大規模な調査では16+ GB推奨)
  • 最小4 CPUコア
  • OpenSearchインデックス用のSSDストレージ
  • DockerおよびDocker Composeがインストールされていること

データ取り込み方法

方法1: Plaso統合(包括的)

# ディスクイメージのlog2timelineによる処理
log2timeline.py --storage-file evidence.plaso /path/to/disk/image

# Windowsイベントログの処理
log2timeline.py --parsers winevtx --storage-file windows_events.plaso /path/to/evtx/

# 複数の証拠ソースの処理
log2timeline.py --parsers "winevtx,prefetch,amcache,shimcache,userassist" \
  --storage-file full_analysis.plaso /path/to/mounted/image/

# TimesketchへのPlasoファイルのインポート
timesketch_importer -s "Case-2025-001" -t "Endpoint-WKS01" evidence.plaso

方法2: CSVインポート(迅速な取り込み)

message,datetime,timestamp_desc,source,hostname
"ユーザーログインを検出","2025-01-15T08:30:00Z","イベント記録","セキュリティログ","DC01"
"PowerShellの実行","2025-01-15T08:31:15Z","イベント記録","PowerShell","WKS042"
# CSVの直接インポート
timesketch_importer -s "Case-2025-001" -t "Quick-Triage" events.csv

方法3: JSONLインポート(構造化データ)

{"message": "Suspicious logon from 10.1.2.3", "datetime": "2025-01-15T08:30:00Z", "timestamp_desc": "Event Recorded", "source_short": "Security", "hostname": "DC01"}

方法4: Sigmaルール統合

# 自動検出のためのSigmaルールのアップロード
timesketch_importer --sigma-rules /path/to/sigma/rules/

分析ワークフロー

ステップ1: 調査スケッチの作成

1. Timesketch Webインターフェースにログイン
2. 新しいスケッチ(調査ケース)を作成
3. 関連するタイムラインをスケッチに追加
4. スケッチの説明とタグを設定

ステップ2: 組み込みアナライザーの実行

Timesketchには、以下を自動的に識別するアナライザーが含まれています:

  • ブラウザ検索アナライザー: ブラウザ履歴から検索クエリを抽出
  • イベントチェーンアナライザー: 関連イベントをリンク(ダウンロード→実行)
  • ドメインアナライザー: ドメイン名を抽出し分類
  • 特徴抽出アナライザー: IP、URL、ハッシュを識別
  • 地理位置情報アナライザー: イベントを地理的位置にマッピング
  • 類似性スコアラー: タイムライン間で類似イベントを検出
  • Sigmaアナライザー: イベントをSigma検出ルールと照合
  • アカウントファインダー: ユーザーアカウントアクティビティパターンを識別
  • タガー: 事前定義ルールに基づいてラベルを適用

ステップ3: 検索とフィルタリング

# Timesketchクエリ言語での検索例

# 特定のユーザーに関連するすべてのイベントを検索
source_short:Security AND message:"john.admin"

# PowerShell実行イベントの検索
data_type:"windows:evtx:record" AND event_identifier:4104

# 横方向の移動指標の検索
source_short:Security AND event_identifier:4624 AND xml_string:"LogonType">3

# 特定の時間範囲内のイベントの検索
datetime:[2025-01-15T00:00:00 TO 2025-01-15T23:59:59]

# ファイル作成イベントの検索
data_type:"fs:stat" AND timestamp_desc:"Creation Time"

# タグによる検索
tag:"suspicious" OR tag:"lateral_movement"

ステップ4: 調査ストーリーの構築

1. スケッチ内に新しいストーリーを作成
2. 各調査結果を裏付ける検索ビューを追加
3. 主要なイベントに調査担当者のメモを注釈
4. イベントをMITRE ATT&CKテクニックにリンク
5. 攻撃のストーリーを時系列で文書化
6. インシデントレポートに含めるストーリーをエクスポート

高度な機能

協調調査

  • 複数のアナリストが同じスケッチを同時に操作可能
  • イベントに対するコメントと注釈が保持される
  • 保存された検索はチーム全体で共有
  • 調査ストーリーはコンテキスト内で調査結果を文書化

API自動化

from timesketch_api_client import config
from timesketch_api_client import client as ts_client

# Timesketchに接続
ts = ts_client.TimesketchApi(
    host_uri="https://timesketch.local",
    username="analyst",
    password="password"
)

# スケッチを取得
sketch = ts.get_sketch(1)

# イベントを検索
search = sketch.explore(
    query_string='event_identifier:4624 AND LogonType:3',
    return_fields='datetime,message,hostname,source_short'
)

# イベントにタグを追加
for event in search.get('objects', []):
    sketch.tag_event(event['_id'], ['lateral_movement'])

Dissectとの統合

# より高速なアーティファクト解析にDissectを使用(Plasoの代替)
target-query -f timesketch://timesketch.local/case-001 \
  targets/hostname/ -q "windows.evtx" --limit 0

タイムライン構築のための主要なデータソース

ソースパーサー証拠価値
Windowsイベントログ(.evtx)winevtx認証、プロセス実行、サービス
Prefetchファイルprefetchプログラム実行履歴
MFT ($MFT)mftファイルシステムアクティビティ
レジストリハイブwinregシステム構成、永続性
ブラウザ履歴chrome/firefoxWebアクティビティ、ダウンロード
SyslogsyslogLinux/ネットワークデバイスイベント
CloudTrailログjsonlAWS APIアクティビティ
AzureアクティビティログjsonlAzureリソース操作
ファイアウォールログcsv/jsonlネットワーク接続
プロキシログcsv/jsonlHTTP/HTTPSトラフィック

MITRE ATT&CKマッピング

テクニックタイムライン指標
初期アクセス (TA0001)最初の悪意のあるイベント、フィッシングメールの受信
実行 (T1059)PowerShell/CMDイベント、プロセス作成
永続性 (TA0003)レジストリ変更、スケジュールタスク、サービス
横方向の移動 (TA0008)リモートログオン、SMB接続、RDPセッション
データ漏洩 (TA0010)大規模データ転送、クラウドストレージアップロード

参考資料

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,

関連スキル