Architecture
Chronos-DFIR provides a FastAPI-based REST API for forensic timeline analysis and DFIR data processing. The API is designed for high-performance streaming operations on large evidence files (6GB+) using:- Polars lazy evaluation for out-of-core processing
- Streaming I/O with chunked uploads/downloads
- Async-first endpoints for concurrent operations
- Chain of custody with SHA256 hashing during upload
Base URL
All API endpoints are served from the application root:The API runs on port 8000 by default. Use
uvicorn app:app --host 0.0.0.0 --port 8000 to start the server.Authentication
Chronos-DFIR does not require authentication for local forensic analysis workflows. The API is designed for:- Local deployment on analyst workstations
- Air-gapped environments for sensitive investigations
- Trusted network access only
Request/Response Format
Content Types
- JSON: Default for all structured data exchanges
- Multipart Form Data: File uploads (
/uploadendpoint) - Binary Streams: Large file downloads
Common Request Headers
Standard Response Schema
Success responses follow this pattern:Pagination
Endpoints returning large datasets use cursor-based pagination:Current page number (1-indexed)
Records per page (max: 1000)
Filtering & Querying
Chronos-DFIR supports unified filtering across all data endpoints:Global Text Search
Case-insensitive search across ALL columns. Uses Polars vectorized string matching.
Column Filters
JSON-encoded object mapping column names to filter values. Supports exact match and regex.
Time Range Filtering
Filter events after this timestamp (inclusive)
Filter events before this timestamp (inclusive)
Row Selection
JSON array of row IDs for subset analysis (e.g.,
["5", "20", "100"])Sorting
Column name to sort by
Sort direction (ascending or descending)
Error Handling
HTTP Status Codes
| Code | Meaning | Example |
|---|---|---|
| 200 | Success | Data retrieved successfully |
| 400 | Bad Request | Invalid filter syntax |
| 404 | Not Found | File does not exist |
| 500 | Internal Error | Processing failure |
| 504 | Gateway Timeout | Enrichment timeout (30s limit) |
Common Error Scenarios
Performance Considerations
Streaming Architecture
Chronos-DFIR uses lazy evaluation with Polarsscan_csv() and sink_csv() to process files larger than available RAM:
- Files are never fully loaded into memory
- Filters are pushed down to the scan layer
- Only requested pages are materialized
Rate Limiting
No built-in rate limiting. For production deployments, use:- Nginx rate limiting (
limit_req_zone) - Traefik middleware
- API Gateway (AWS, Azure)
Concurrent Requests
FastAPI supports async concurrency. The forensic report endpoint usesasyncio.gather() to parallelize:
- Timeline analysis
- Sigma rule matching
- YARA scanning
- Threat intelligence enrichment
Peak parallelism: 9 concurrent tasks in
/api/forensic_reportData Formats
Supported Input Formats
| Format | Extension | Parser |
|---|---|---|
| CSV | .csv | Polars scan_csv |
| Excel | .xlsx | Polars read_excel |
| JSON | .json, .jsonl, .ndjson | Polars read_json |
| Parquet | .parquet | Polars scan_parquet |
| SQLite | .db, .sqlite, .sqlite3 | Cursor + Polars DataFrame |
| Plist | .plist | plistlib + Polars |
| MFT | .mft | Custom binary parser |
| EVTX | .evtx | evtx_dump + Polars |
| Whitespace-delimited | .pslist, .txt, .log | Regex parser |
| ZIP | .zip | Automatic extraction |
Output Formats
- CSV: UTF-8 with BOM (Excel-compatible)
- XLSX:
xlsxwriterwith text formatting for hex values - JSON: Standard array format
[{...}, {...}] - PDF: Multi-method fallback (WeasyPrint → Playwright → xhtml2pdf)
- HTML: Standalone report with embedded Chart.js
Chain of Custody
All file uploads compute SHA256 hash during streaming upload (zero extra I/O):API Endpoint Categories
- Upload: File ingestion with artifact-type routing
- Analysis: Data retrieval, histogram, forensic reports
- Export: Multi-format exports (CSV, XLSX, PDF, HTML, JSON)
Next Steps
Upload Endpoint
Stream forensic artifacts with chain of custody
Analysis Endpoints
Query timelines, generate histograms, run forensic reports
Export Endpoints
Export filtered datasets in CSV, XLSX, PDF, HTML