building-incident-timeline-with-timesketch skill (Anthropic-Cybersecurity-Skills)

From Public Agent Wiki
Contents
  1. Install
  2. SKILL.md (verbatim)
  3. Overview
  4. When to Use
  5. Prerequisites
  6. Architecture and Components
  7. Core Components
  8. Data Flow
  9. Deployment
  10. Docker Deployment (Recommended)
  11. System Requirements
  12. Data Ingestion Methods
  13. Method 1: Plaso Integration (Comprehensive)
  14. Method 2: CSV Import (Quick Ingestion)
  15. Method 3: JSONL Import (Structured Data)
  16. Method 4: Sigma Rule Integration
  17. Analysis Workflow
  18. Step 1: Create Investigation Sketch
  19. Step 2: Run Built-in Analyzers
  20. Step 3: Search and Filter
  21. Step 4: Build Investigation Story
  22. Advanced Features
  23. Collaborative Investigation
  24. API Automation
  25. Integration with Dissect
  26. Key Data Sources for Timeline Building
  27. MITRE ATT&CK Mapping
  28. References
  29. Other files in this skill
  30. assets/template.md (verbatim)
  31. Case Information
  32. Evidence Sources
  33. Investigation Objectives
  34. Attack Timeline Summary
  35. Key Findings
  36. Finding 1: [Title]
  37. Analyzers Run
  38. Saved Views
  39. IOC Summary
  40. IP Addresses
  41. Domains
  42. File Hashes
  43. User Accounts
  44. Recommendations
  45. Appendix
  46. references/api-reference.md (verbatim)
  47. Authentication
  48. Sketch Endpoints
  49. Timeline Upload
  50. Event Search (Explore)
  51. Event Annotation
  52. Supported Timeline Formats
  53. Event Fields
  54. Analyzers
  55. Python Client
  56. references/standards.md (verbatim)
  57. NIST SP 800-86 - Guide to Integrating Forensic Techniques
  58. SANS FOR508 - Advanced Incident Response, Threat Hunting, and Digital Forensics
  59. RFC 3339 / ISO 8601 - Timestamp Standardization
  60. DFRWS (Digital Forensic Research Workshop) Standards
  61. Plaso/log2timeline Documentation
  62. OpenSearch/Elasticsearch Indexing Standards
  63. Sigma Detection Standard
  64. MITRE ATT&CK Framework Integration
  65. references/workflows.md (verbatim)
  66. Workflow 1: Evidence Processing Pipeline
  67. Workflow 2: Rapid Triage Timeline
  68. Workflow 3: Multi-Source Correlation
  69. Workflow 4: Collaborative Team Investigation

What it does. Build collaborative forensic incident timelines using Timesketch to ingest, Part of mukul975/Anthropic-Cybersecurity-Skills (817 security skills) (mukul975/Anthropic-Cybersecurity-Skills).

Upstream mukul975/Anthropic-Cybersecurity-Skills
Skill file skills/building-incident-timeline-with-timesketch/SKILL.md
License Apache-2.0 (skill folder LICENSE)
Author mukul975
Fetched 2026-09-10

Install

  • npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill building-incident-timeline-with-timesketch, or copy the skill folder into ~/.claude/skills/building-incident-timeline-with-timesketch/.
  • Raw file: curl -sL https://raw.githubusercontent.com/mukul975/Anthropic-Cybersecurity-Skills/HEAD/skills/building-incident-timeline-with-timesketch/SKILL.md

SKILL.md (verbatim)

name: building-incident-timeline-with-timesketch
description: Build collaborative forensic incident timelines using Timesketch to ingest,
  normalize, and analyze multi-source event data (including Plaso output) for attack
  chain reconstruction and investigation documentation. Use when reconstructing the
  sequence of events during an incident investigation or when multiple analysts need
  to jointly tag, annotate, and search a shared DFIR timeline.
domain: cybersecurity
subdomain: incident-response
tags:
- timesketch
- timeline-analysis
- forensic-timeline
- plaso
- dfir
- incident-investigation
- collaborative-forensics
mitre_attack:
- T1059.001
- T1021.002
- T1547.001
- T1053.005
- T1070.006
version: '1.0'
author: mahipal
license: Apache-2.0
d3fend_techniques:
- Executable Denylisting
- Execution Isolation
- File Metadata Consistency Validation
- Content Format Conversion
- File Content Analysis
nist_csf:
- RS.MA-01
- RS.MA-02
- RS.AN-03
- RC.RP-01

Building Incident Timeline with Timesketch

Overview

Timesketch is an open-source collaborative forensic timeline analysis tool developed by Google that enables security teams to visualize and analyze chronological data from multiple sources during incident investigations. It ingests logs and artifacts from endpoints, servers, and cloud services, normalizes them into a unified searchable timeline, and provides powerful analysis capabilities including built-in analyzers, tagging, sketch annotations, and story building. Timesketch integrates with Plaso (log2timeline) for artifact parsing and supports direct CSV/JSONL ingestion for rapid timeline construction during active incidents.

When to Use

  • When deploying or configuring building incident timeline with timesketch capabilities in your environment
  • When establishing security controls aligned to compliance requirements
  • When building or improving security architecture for this domain
  • When conducting security assessments that require this implementation

Prerequisites

  • Familiarity with incident response 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

Architecture and Components

Core Components

  • Timesketch Server: Web application with REST API for timeline management
  • OpenSearch/Elasticsearch: Backend storage and search engine for timeline events
  • PostgreSQL: Metadata storage for sketches, stories, and user data
  • Redis: Task queue management for background processing
  • Celery Workers: Asynchronous processing of timeline uploads and analyzers

Data Flow

Evidence Sources --> Plaso/log2timeline --> Plaso storage file (.plaso)
     |                                           |
     v                                           v
  CSV/JSONL --> Timesketch Importer --> OpenSearch Index
                                           |
                                           v
                                    Timesketch Web UI
                                    (Search, Analyze, Story)

Deployment

# Clone Timesketch repository
git clone https://github.com/google/timesketch.git
cd timesketch

# Run deployment helper script
cd docker
sudo docker compose up -d

# Default access: https://localhost:443
# Admin credentials generated during first run

System Requirements

  • Minimum 8 GB RAM (16+ GB recommended for large investigations)
  • 4 CPU cores minimum
  • SSD storage for OpenSearch indices
  • Docker and Docker Compose installed

Data Ingestion Methods

Method 1: Plaso Integration (Comprehensive)

# Process disk image with log2timeline
log2timeline.py --storage-file evidence.plaso /path/to/disk/image

# Process Windows event logs
log2timeline.py --parsers winevtx --storage-file windows_events.plaso /path/to/evtx/

# Process multiple evidence sources
log2timeline.py --parsers "winevtx,prefetch,amcache,shimcache,userassist" \
  --storage-file full_analysis.plaso /path/to/mounted/image/

# Import Plaso file into Timesketch
timesketch_importer -s "Case-2025-001" -t "Endpoint-WKS01" evidence.plaso

Method 2: CSV Import (Quick Ingestion)

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"
# Import CSV directly
timesketch_importer -s "Case-2025-001" -t "Quick-Triage" events.csv

Method 3: JSONL Import (Structured Data)

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

Method 4: Sigma Rule Integration

# Upload Sigma rules for automated detection
timesketch_importer --sigma-rules /path/to/sigma/rules/

Analysis Workflow

Step 1: Create Investigation Sketch

1. Log into Timesketch web interface
2. Create new sketch (investigation case)
3. Add relevant timelines to the sketch
4. Set sketch description and tags

Step 2: Run Built-in Analyzers

Timesketch includes analyzers that automatically identify:

  • Browser Search Analyzer: Extracts search queries from browser history
  • Chain of Events Analyzer: Links related events (download -> execute)
  • Domain Analyzer: Extracts and categorizes domain names
  • Feature Extraction Analyzer: Identifies IPs, URLs, hashes
  • Geo Location Analyzer: Maps events to geographic locations
  • Similarity Scorer: Finds similar events across timelines
  • Sigma Analyzer: Matches events against Sigma detection rules
  • Account Finder: Identifies user account activity patterns
  • Tagger: Applies labels based on predefined rules

Step 3: Search and Filter

# Search examples in Timesketch query language

# Find all events related to specific user
source_short:Security AND message:"john.admin"

# Find PowerShell execution events
data_type:"windows:evtx:record" AND event_identifier:4104

# Find lateral movement indicators
source_short:Security AND event_identifier:4624 AND xml_string:"LogonType\">3"

# Find events within specific time range
datetime:[2025-01-15T00:00:00 TO 2025-01-15T23:59:59]

# Find file creation events
data_type:"fs:stat" AND timestamp_desc:"Creation Time"

# Search with tags
tag:"suspicious" OR tag:"lateral_movement"

Step 4: Build Investigation Story

1. Create new story within the sketch
2. Add search views that support each finding
3. Annotate key events with investigator notes
4. Link events to MITRE ATT&CK techniques
5. Document the attack narrative chronologically
6. Export story for inclusion in incident report

Advanced Features

Collaborative Investigation

  • Multiple analysts work on the same sketch simultaneously
  • Comments and annotations persist on events
  • Saved searches shared across the team
  • Investigation stories document findings in context

API Automation

from timesketch_api_client import config
from timesketch_api_client import client as ts_client

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

# Get sketch
sketch = ts.get_sketch(1)

# Search events
search = sketch.explore(
    query_string='event_identifier:4624 AND LogonType:3',
    return_fields='datetime,message,hostname,source_short'
)

# Add tags to events
for event in search.get('objects', []):
    sketch.tag_event(event['_id'], ['lateral_movement'])

Integration with Dissect

# Use Dissect for faster artifact parsing (alternative to Plaso)
target-query -f timesketch://timesketch.local/case-001 \
  targets/hostname/ -q "windows.evtx" --limit 0

Key Data Sources for Timeline Building

Source Parser Evidence Value
Windows Event Logs (.evtx) winevtx Authentication, process execution, services
Prefetch Files prefetch Program execution history
MFT ($MFT) mft File system activity
Registry Hives winreg System configuration, persistence
Browser History chrome/firefox Web activity, downloads
Syslog syslog Linux/network device events
CloudTrail Logs jsonl AWS API activity
Azure Activity Logs jsonl Azure resource operations
Firewall Logs csv/jsonl Network connections
Proxy Logs csv/jsonl HTTP/HTTPS traffic

MITRE ATT&CK Mapping

Technique Timeline Indicators
Initial Access (TA0001) First malicious event, phishing email receipt
Execution (T1059) PowerShell/CMD events, process creation
Persistence (TA0003) Registry modifications, scheduled tasks, services
Lateral Movement (TA0008) Remote logons, SMB connections, RDP sessions
Exfiltration (TA0010) Large data transfers, cloud storage uploads

References

Other files in this skill

assets/template.md (verbatim)

Forensic Timeline Investigation Report Template

Case Information

Field Details
Case ID
Sketch Name
Lead Investigator
Date Started
Timesketch Instance
Number of Timelines
Total Events Indexed

Evidence Sources

Timeline Name Source Type Host/System Events Time Range
Windows EVTX
Plaso Full
Cloud Logs
Network Logs

Investigation Objectives

  1. Determine initial access vector
  2. Identify compromised accounts
  3. Map lateral movement paths
  4. Identify persistence mechanisms
  5. Determine data access and exfiltration
  6. Establish complete attack timeline

Attack Timeline Summary

Time (UTC) Event Source Host ATT&CK Technique Tags

Key Findings

Finding 1: [Title]

  • Timesketch Search: [query string]
  • Events: [count]
  • Time Range: [start] to [end]
  • Description: [analysis]
  • Impact: [assessment]

Analyzers Run

Analyzer Results Findings
Sigma Rules
Domain Analyzer
Chain of Events
Feature Extraction

Saved Views

View Name Query Purpose

IOC Summary

IP Addresses

Domains

File Hashes

User Accounts

Recommendations

Appendix

  • Timesketch sketch export
  • Full query list
  • Plaso parser configuration

references/api-reference.md (verbatim)

API Reference: Incident Timeline Building with Timesketch

Authentication

POST /login/
Content-Type: application/x-www-form-urlencoded
Body: username=USER&password=PASS

Sketch Endpoints

Method Endpoint Description
GET /api/v1/sketches/ List all sketches
POST /api/v1/sketches/ Create new sketch
GET /api/v1/sketches/{id}/ Get sketch details
DELETE /api/v1/sketches/{id}/ Delete sketch

Timeline Upload

POST /api/v1/upload/
Content-Type: multipart/form-data
Fields: name, sketch_id, file (Plaso/CSV/JSONL)

Event Search (Explore)

POST /api/v1/sketches/{id}/explore/
{
  "query": "source_short:EVT AND message:*logon*",
  "limit": 500,
  "fields": ["datetime", "timestamp_desc", "message", "source_short"],
  "filter": {
    "chips": [
      {"type": "datetime_range", "value": "2024-01-01T00:00:00,2024-01-31T23:59:59", "active": true}
    ]
  }
}

Event Annotation

POST /api/v1/sketches/{id}/event/annotate/
{
  "annotation": "suspicious,lateral-movement",
  "annotation_type": "tag",
  "events": {"event_id": "abc123"}
}

Supported Timeline Formats

Format Extension Description
Plaso .plaso log2timeline output
CSV .csv Timesketch CSV (datetime, message, timestamp_desc)
JSONL .jsonl One JSON event per line

Event Fields

Field Description
datetime Event timestamp (ISO 8601)
timestamp_desc Timestamp meaning (e.g., "Creation Time")
message Human-readable event description
source_short Source type (EVT, FILE, LOG, REG)
source_long Full source name

Analyzers

POST /api/v1/sketches/{id}/analyzer/
{"analyzer_names": ["domain", "similarity_scorer", "tagger"]}

Python Client

from timesketch_api_client import config as ts_config
from timesketch_api_client import client as ts_client

ts = ts_client.TimesketchApi(host, username, password)
sketch = ts.get_sketch(sketch_id)
results = sketch.explore(query="*", return_fields="datetime,message")

references/standards.md (verbatim)

Standards and Frameworks for Timeline Analysis

NIST SP 800-86 - Guide to Integrating Forensic Techniques

  • Provides guidelines for collecting, examining, and analyzing digital evidence
  • Emphasizes importance of timeline reconstruction in incident investigation
  • Defines evidence handling procedures for forensic analysis

SANS FOR508 - Advanced Incident Response, Threat Hunting, and Digital Forensics

  • Super timeline creation methodology
  • Evidence source prioritization for timeline building
  • Plaso/log2timeline artifact parsing techniques
  • Timeline analysis for APT detection

RFC 3339 / ISO 8601 - Timestamp Standardization

  • Standard format for representing dates and times in timelines
  • Timesketch normalizes all timestamps to UTC ISO 8601 format
  • Ensures consistent chronological ordering across diverse sources

DFRWS (Digital Forensic Research Workshop) Standards

  • Forensic timeline analysis research and best practices
  • Timesketch presented at DFRWS conferences as reference implementation
  • Evidence integrity and chain of custody in digital forensics

Plaso/log2timeline Documentation

  • Official parser documentation for 200+ artifact types
  • Filter file syntax for targeted evidence collection
  • Output format specifications for Timesketch integration
  • Reference: https://plaso.readthedocs.io/

OpenSearch/Elasticsearch Indexing Standards

  • Event storage and retrieval optimization
  • Index lifecycle management for large investigations
  • Query DSL for advanced timeline searching

Sigma Detection Standard

  • Open signature format for SIEM systems
  • Timesketch Sigma analyzer integration
  • Community detection rules for common attack patterns
  • Reference: https://github.com/SigmaHQ/sigma

MITRE ATT&CK Framework Integration

  • Mapping timeline events to ATT&CK techniques
  • Tactic-based timeline segmentation
  • Attack chain reconstruction methodology

references/workflows.md (verbatim)

Timesketch Timeline Building Workflows

Workflow 1: Evidence Processing Pipeline

START: Evidence Collection Complete
  |
  v
[Mount Evidence / Extract Artifacts]
  |-- Mount disk image (read-only)
  |-- Extract event logs from triage package
  |-- Collect cloud service logs
  |-- Gather network device logs
  |
  v
[Process with Plaso/log2timeline]
  |-- Select appropriate parsers
  |-- Configure filter files for scope
  |-- Run log2timeline on each source
  |-- Verify output .plaso files
  |
  v
[Import into Timesketch]
  |-- Create sketch for investigation
  |-- Upload each timeline with descriptive name
  |-- Wait for indexing to complete
  |-- Verify event counts per timeline
  |
  v
[Run Automated Analyzers]
  |-- Domain analyzer
  |-- Sigma rule analyzer
  |-- Chain of events analyzer
  |-- Feature extraction analyzer
  |
  v
[Manual Analysis and Tagging]
  |-- Search for key indicators
  |-- Tag events by attack phase
  |-- Add investigator annotations
  |-- Build investigation story
  |
  v
END: Timeline Ready for Analysis

Workflow 2: Rapid Triage Timeline

START: Incident Detected - Quick Timeline Needed
  |
  v
[Collect Quick-Win Artifacts]
  |-- Windows Event Logs (Security, System, PowerShell)
  |-- Prefetch files
  |-- Browser history
  |-- Recent file access (NTUSER.DAT)
  |
  v
[Fast Processing]
  |-- Targeted Plaso parsers only
  |   (winevtx, prefetch, chrome_history)
  |-- Or convert logs to CSV format
  |-- Import directly into Timesketch
  |
  v
[Initial Analysis]
  |-- Search for known IOCs
  |-- Run Sigma analyzer for quick wins
  |-- Identify suspicious time periods
  |-- Tag initial findings
  |
  v
[Expand if Needed]
  |-- Add additional evidence sources
  |-- Run full parser set
  |-- Broaden search scope
  |
  v
END: Initial Triage Complete

Workflow 3: Multi-Source Correlation

START: Multiple Evidence Sources Available
  |
  v
[Normalize Timestamps]
  |-- Ensure all sources use UTC
  |-- Account for clock skew between systems
  |-- Document any time synchronization issues
  |
  v
[Import All Sources as Separate Timelines]
  |-- Timeline 1: Endpoint logs (Plaso)
  |-- Timeline 2: Network logs (CSV)
  |-- Timeline 3: Cloud logs (JSONL)
  |-- Timeline 4: Email logs (CSV)
  |-- Timeline 5: Firewall logs (CSV)
  |
  v
[Cross-Source Correlation]
  |-- Search across all timelines simultaneously
  |-- Identify same events seen from different perspectives
  |-- Build complete picture of attacker activity
  |-- Tag correlated events with shared labels
  |
  v
[Build Attack Narrative]
  |-- Create story in Timesketch
  |-- Link saved views for each attack phase
  |-- Add context and analysis notes
  |-- Export for final report
  |
  v
END: Correlated Timeline Analysis Complete

Workflow 4: Collaborative Team Investigation

START: Investigation Assigned to Team
  |
  v
[Sketch Setup by Lead Investigator]
  |-- Create sketch with case details
  |-- Import initial timeline data
  |-- Define investigation objectives
  |-- Assign analysis areas to team members
  |
  v
[Parallel Analysis by Team]
  |-- Analyst 1: Network traffic analysis
  |-- Analyst 2: Endpoint artifact analysis
  |-- Analyst 3: Cloud/identity analysis
  |-- Each analyst tags and annotates findings
  |
  v
[Consolidation]
  |-- Review all tagged events
  |-- Resolve conflicting findings
  |-- Build unified attack narrative
  |-- Create investigation story
  |
  v
[Quality Review]
  |-- Lead reviews complete timeline
  |-- Verify attack chain is complete
  |-- Ensure all IOCs documented
  |-- Export findings for report
  |
  v
END: Team Investigation Complete

Back to mukul975/Anthropic-Cybersecurity-Skills (817 security skills) or Agent skills.