Skip to main content

Overview

RAPTOR’s OSS Forensics system provides evidence-backed investigation of public GitHub repositories through automated evidence collection from multiple tamper-proof sources.

Multi-Source Evidence

Collect from GH Archive, GitHub API, Wayback Machine, and local git repositories

Hypothesis Formation

AI-powered analysis that forms and validates hypotheses based on collected evidence

Verification Pipeline

All evidence is verified against original sources before inclusion in reports

Timeline Reconstruction

Build complete incident timelines with actor attribution and impact assessment

Command Usage

Command Flags

Evidence Sources

1. GitHub Archive (GH Archive)

Tamper-proof event data via BigQuery GitHub Archive provides immutable forensic evidence of all public GitHub events since 2011. This is your ground truth for:
  • Actor attribution: Who performed what actions
  • Timeline reconstruction: When events occurred (UTC timestamps)
  • Deleted content recovery: Issues, PRs, tags, and branches persist in archive
  • Automation vs API abuse detection: Presence/absence of WorkflowRunEvent indicates legitimate workflow vs direct API attack
Always start with GitHub Archive as your first evidence source. It provides the immutable record that other sources are verified against.
Key Event Types:
Example Query Pattern:
BigQuery Credentials RequiredSet GOOGLE_APPLICATION_CREDENTIALS environment variable:
See GitHub Archive skill documentation for setup instructions.

2. GitHub API

Live repository data
  • Current commit content and metadata
  • File contents at specific refs
  • Branch and tag information
  • PR and issue details (if not deleted)
  • Fork relationships
Use Cases:
  • Retrieve commit content after getting SHA from GH Archive
  • Verify current repository state
  • Cross-reference with archived data

3. Wayback Machine

Recover deleted web content
  • Deleted README files and documentation
  • Issue/PR descriptions and comments (Archive Team prioritizes these)
  • Repository metadata snapshots
  • Wiki pages
  • Release notes
What CAN be recovered:
  • README files and repository descriptions
  • Issue titles, bodies, and comments
  • PR conversations (Files Changed tab often unavailable)
  • Commit SHAs from archived commit list pages
What CANNOT be recovered:
  • Private repository content
  • Complete git history or clones
  • Content behind authentication

4. Local Git Repositories

Clone and analyze dangling commits
Dangling commits are “forensic gold” - they reveal force-pushed or deleted commits that attackers tried to hide.

Investigation Workflow

The orchestrator coordinates 17 specialized agents through a structured workflow:

Phase 0: Initialize Investigation

Creates timestamped output directory and initializes empty evidence store:

Phase 1: Parse Research Question

Extracts investigation targets:
  • Repository references (owner/repo)
  • Actor usernames
  • Date ranges
  • Vendor report URLs

Phase 2: Parallel Evidence Collection

Spawns investigators in parallel for efficiency:
Each agent writes evidence to the shared evidence.json store.

Phase 3: Hypothesis Formation Loop

The hypothesis former can request additional evidence:

Phase 4: Evidence Verification

All collected evidence is re-verified against original sources:
Verification checks:
  • GH Archive events re-queried from BigQuery
  • GitHub API observations re-fetched
  • Wayback snapshots re-checked
  • Local git commits re-validated

Phase 5: Hypothesis Validation Loop

Checker validates claims against verified evidence:
  • Every claim must cite evidence by ID
  • Attribution must have HIGH confidence with multiple sources
  • Timeline must have exact UTC timestamps
  • Impact assessment must be evidence-backed

Phase 6: Generate Report

Produces final forensic report with:

Real-World Investigation Patterns

Deleted PR Recovery

Scenario: Media claims attacker submitted malicious PR in “late June” but PR is now deleted. Investigation:
  1. Query GH Archive for PR events:
  1. Outcome:
    • If events found: Claim verified → PR existed, recover details from archive
    • If no events: Claim disproven → No PR activity in claimed timeframe

Force Push Detection

Scenario: Suspicious commits appear then disappear from branch history. Detection: Zero-commit PushEvents indicate force pushes:
The before SHA points to the “deleted” commit, which remains accessible on GitHub.

Automation vs Direct API Attack

Scenario: Commit appears under automation account. Was it legitimate workflow or compromised token? Detection:
Results:
  • Legitimate workflow: WorkflowRunEvent shortly before/after PushEvent
  • Direct API attack: PushEvent with NO WorkflowRunEvent in ±10 minute window
Real Example: Amazon Q investigation proved direct API attack when ZERO workflow events appeared during malicious commit window, despite 18 workflows that day in different time windows.

Cost Management for BigQuery

GitHub Archive queries cost $6.25 per TiB of data scanned.
Unoptimized queries can cost $10-100+A query with SELECT * on one year (githubarchive.year.2025) scans ~400 GB.

Optimization Strategies

1. Select Only Required Columns (50-90% cost reduction)
2. Use Specific Date Ranges (10-100x cost reduction)
3. Filter by Repository (5-50x cost reduction)
4. Always Run Dry Run First
RAPTOR’s agents automatically optimize queries and check costs before execution. Manual optimization is only needed for custom queries.

Output and Evidence Store

All results are saved to .out/oss-forensics-{timestamp}/

evidence.json Structure

Forensic Report Format

The final report includes:
  1. Executive Summary: High-level findings
  2. Timeline: Chronological event sequence with evidence citations
  3. Attribution: Actor identification with confidence levels
  4. Intent Analysis: Evidence-based reasoning about attacker goals
  5. Impact Assessment: Affected systems and scope
  6. IOCs: Extractable indicators for detection rules
  7. Evidence Appendix: Full evidence details with verification status

Best Practices

Good: “Did lkmanka58 create any tags on aws/aws-toolkit-vscode on July 13, 2025?”Bad: “Investigate aws/aws-toolkit-vscode”Specific questions lead to targeted evidence collection and faster results.
All evidence is verified against original sources. Don’t second-guess the verification pipeline - if evidence is in the store with verified_at timestamp, it has been re-checked.
Let the hypothesis former request additional evidence rather than collecting everything upfront. This saves time and BigQuery costs.
Every claim in the final report must cite evidence by ID. No speculation, only evidence-backed conclusions.

Troubleshooting

error
Cause: Missing or invalid GOOGLE_APPLICATION_CREDENTIALSFix:
See GitHub Archive skill setup for credential creation.
warning
Possible causes:
  • Event occurred outside searched date range (check timezone - GH Archive uses UTC)
  • Actor username misspelled (case-sensitive)
  • Repository name incorrect (must be owner/repo format)
Debug: Query broader date range and check for typos
info
Investigation proceeds with current evidence and notes uncertainty in report.To allow more iterations:

Further Reading

GitHub Archive Skill

Full BigQuery query reference and optimization guide

Evidence Kit

Evidence collection and verification API documentation

Wayback Recovery

Deleted content recovery patterns and CDX API reference

Example Reports

Real-world forensic investigation case studies