Communitygithub.com

Timesketch로 포렌식 인시던트 타임라인 구축

Timesketch를 사용하여 협업형 포렌식 인시던트 타임라인을 구축하고, 다양한 소스의 로그를 수집 및 분석합니다.

Timesketch로 포렌식 인시던트 타임라인 구축란 무엇인가요?

이 스킬은 Google이 개발한 오픈소스 협업 포렌식 타임라인 분석 도구인 Timesketch를 활용하여 인시던트 조사 중 엔드포인트, 서버, 클라우드 서비스에서 수집한 로그와 아티팩트를 하나의 통합된 검색 가능한 타임라인으로 정규화하고 분석하는 방법을 안내합니다. Plaso(log2timeline)와의 통합을 통한 포괄적인 아티팩트 파싱, CSV/JSONL 직접 수집을 통한 신속한 타임라인 구축, Sigma 룰 기반 자동 탐지 등 다양한 수집 방식을 지원합니다. 또한, 내장 분석기, 태깅, 스케치 주석, 스토리 빌딩 등 강력한 분석 기능을 제공하며, 여러 분석가가 동시에 협업할 수 있는 환경을 제공합니다. OpenSearch/Elasticsearch를 백엔드 검색 엔진으로 사용하여 대규모 데이터 세트에서도 빠른 검색과 분석이 가능하며, 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 직접 수집을 통해 활성 인시던트 중 신속한 타임라인 구축이 가능합니다.

사용 시기

  • 환경에서 인시던트 타임라인 구축 기능을 배포하거나 구성할 때
  • 규정 준수 요구사항에 맞춰 보안 제어를 수립할 때
  • 이 도메인의 보안 아키텍처를 구축하거나 개선할 때
  • 이 구현이 필요한 보안 평가를 수행할 때

사전 요구 사항

  • 인시던트 대응 개념 및 도구에 대한 이해
  • 안전한 실행을 위한 테스트 또는 랩 환경 접근 권한
  • 필요한 종속성이 설치된 Python 3.8+
  • 모든 테스트 활동에 대한 적절한 권한

아키텍처 및 구성 요소

핵심 구성 요소

  • Timesketch 서버: 타임라인 관리를 위한 REST API를 제공하는 웹 애플리케이션
  • OpenSearch/Elasticsearch: 타임라인 이벤트를 위한 백엔드 스토리지 및 검색 엔진
  • PostgreSQL: 스케치, 스토리지, 사용자 데이터의 메타데이터 저장소
  • Redis: 백그라운드 처리를 위한 작업 큐 관리
  • Celery 워커: 타임라인 업로드 및 분석기의 비동기 처리

데이터 흐름

증거 소스 --> Plaso/log2timeline --> Plaso 스토리지 파일 (.plaso)
     |                                           |
     v                                           v
  CSV/JSONL --> Timesketch 임포터 --> OpenSearch 인덱스
                                           |
                                           v
                                    Timesketch 웹 UI
                                    (검색, 분석, 스토리)

배포

Docker 배포 (권장)

# Timesketch 저장소 복제
git clone https://github.com/google/timesketch.git
cd timesketch

# 배포 도우미 스크립트 실행
cd docker
sudo docker compose up -d

# 기본 접근: https://localhost:443
# 첫 실행 시 관리자 자격 증명 생성됨

시스템 요구 사항

  • 최소 8GB RAM (대규모 조사 시 16GB+ 권장)
  • 최소 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/

# Plaso 파일을 Timesketch로 가져오기
timesketch_importer -s "Case-2025-001" -t "Endpoint-WKS01" evidence.plaso

방법 2: CSV 가져오기 (빠른 수집)

message,datetime,timestamp_desc,source,hostname
"User login detected","2025-01-15T08:30:00Z","Event Recorded","Security Log","DC01"
"PowerShell execution","2025-01-15T08:31:15Z","Event Recorded","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 웹 인터페이스에 로그인
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프로그램 실행 기록
MFT ($MFT)mft파일 시스템 활동
레지스트리 하이브winreg시스템 구성, 지속성
브라우저 기록chrome/firefox웹 활동, 다운로드
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,

관련 스킬