--- license: apache-2.0 task_categories: - text-classification - graph-ml language: - en tags: - cybersecurity - intrusion-detection - provenance-graphs - MITRE-ATT&CK - SOAR - security-operations - IDS - network-security - threat-detection - labeled-dataset size_categories: - 1M 0. These events were identified by WitFoo's detection rules as part of attack patterns or suspicious activity chains. - **`benign`**: The event does not appear in any incident, or appears only in incidents classified as false positives. ### Label Distribution | Label | Count | Percentage | |-------|-------|------------| | `malicious` | 34,362 | ~1.8% | | `benign` | ~1.91M | ~98.2% | This imbalanced distribution reflects the reality of production SOC environments where the vast majority of events are benign, and is consistent with published IDS datasets (DARPA TC, LANL). ### MITRE ATT&CK Mappings Attack technique and tactic labels are derived from WitFoo's framework mapping of incident patterns. The `lifecycle_stage` field maps events to the 7-stage APT kill chain used by KnowHow and similar provenance graph detection systems: 1. `initial-compromise` — Initial access to the network 2. `establish-foothold` — Execution and establishing persistence 3. `escalate-privilege` — Privilege escalation attempts 4. `internal-reconnaissance` — Discovery and internal scanning 5. `move-laterally` — Lateral movement between hosts 6. `maintain-persistence` — Command & control and persistence 7. `complete-mission` — Data theft, exfiltration, or impact ## Sanitization Methodology All customer-identifying information has been removed through a comprehensive, iterative multi-layer sanitization pipeline. **Quality was prioritized over processing speed** — the dataset underwent multiple full re-sanitization cycles until convergence (near-zero new PII discoveries per cycle). ### Pipeline Architecture The sanitization pipeline operates in 4 layers, applied iteratively. Each cycle processes all ~2 million records, and the pipeline repeats until Layers 3 and 4 find no (or near-zero) additional PII. A persistent **PII Registry** (SQLite-backed) maintains a global mapping of every original value to its sanitized replacement. The same original value always maps to the same token, preserving graph topology, network relationships, and host behavior patterns across all records. A self-referencing token guard prevents the pipeline from registering its own replacement tokens (e.g., `HOST-0001`, `ORG-1234`) as new PII entries, which would otherwise cause runaway registry inflation during iterative cycles. ### Layer 1: Structured Field Sanitization + Aho-Corasick Sweep **Structured field matching:** Known JSON fields are sanitized based on their semantic meaning using deterministic regex and format-aware type inference: - **IP addresses** → Private IPs remapped deterministically within RFC 1918 ranges using HMAC-based subnet-preserving mapping; public IPs replaced with RFC 5737 TEST-NET addresses (192.0.2.0/24, 198.51.100.0/24, 203.0.113.0/24) - **Organization names** → `ORG-NNNN` - **Hostnames** → `HOST-NNNN` or `host-NNNN.example.internal` - **FQDNs** → `host-NNNN.example.internal` (public domains like google.com, microsoft.com are preserved via allowlist) - **Usernames** → `USER-NNNN` (system accounts like `SYSTEM`, `LOCAL SERVICE`, `NETWORK SERVICE`, `root`, `sshd` are preserved) - **Emails** → `user-NNNN@example.net` - **Domains** → `domain-NNNN.example.net` - **Windows SIDs** → `S-1-5-21-1000000000-2000000000-3000000000-NNNN` (well-known SIDs like `S-1-5-18` are preserved) - **AWS Account IDs** → Sequential 12-digit replacements - **ARNs** → `arn:aws:iam::NNNN:sanitized/NNNN` - **Credentials / API keys** → `CRED-NNNN` - **Machine accounts** → `MACHINE-NNNN$` **Field-agnostic deep scanning:** All unknown or unrecognized JSON fields are inspected value-by-value using type heuristics (IP regex, FQDN patterns, email patterns, SID patterns, hostname conventions) to catch PII in fields not covered by structured parsers. Nested JSON objects and arrays are scanned recursively to arbitrary depth. **Aho-Corasick multi-pattern sweep:** After field-level sanitization, the full serialized record is swept using an [Aho-Corasick automaton](https://en.wikipedia.org/wiki/Aho%E2%80%93Corasick_algorithm) built from all registry entries ≥4 characters. This catches PII values that appear in unexpected contexts — concatenated strings, log message bodies, cross-field references, and embedded JSON. The automaton is rebuilt each cycle as the registry grows. ### Layer 2: Format-Specific Message Parsing Raw log messages (`message_sanitized`) are parsed using 8 format-specific parsers that understand the exact structure of each vendor's log format: - **Cisco ASA syslog** — Regex extraction of `src IFACE:IP/PORT dst IFACE:IP/PORT` patterns from ASA deny/permit messages - **Windows Security Event XML** — DOM parsing of XML elements including `TargetUserName`, `IpAddress`, `WorkstationName`, `Computer`, `SubjectDomainName`, `SubjectUserName`, `TargetDomainName`, `MemberSid` - **WinLogBeat JSON** — Full recursive parsing of nested WinLogBeat JSON structures, including `agent.name`, `host.hostname`, `winlog.event_data.*`, `organization`, `senderHost`, and all `SubjectDomainName`/`SubjectUserName`/`TargetUserName` fields within the embedded event data - **AWS CloudTrail** — Sanitization of `userIdentity.accountId`, `userIdentity.arn`, `sourceIPAddress`, `userName`, `accessKeyId`, and recursive scanning of `requestParameters` and `responseElements` - **Palo Alto Networks CSV** — BSD syslog header hostname extraction plus CSV body field parsing for source/destination IPs, hostnames, and user fields - **VMware ESXi** — BSD syslog header hostname and IP extraction from vCenter/ESXi log formats - **DNS events** — Sanitization of resolved IPs while preserving public domain names (google.com, microsoft.com, etc.) via a curated allowlist of ~1,000 public domains and TLDs - **Generic fallback** — Comprehensive regex battery applied to all unrecognized formats: IP addresses, FQDNs, email addresses, Windows SIDs, machine accounts (`*$` pattern), ARNs, `user=`/`host=`/`domain=` key-value pairs, `\\DOMAIN\user` UNC paths, and BSD syslog header hostnames ### Layer 3: ML/NER Residual Detection After Layers 1–2, machine learning models scan a stratified random sample of 2,000 sanitized records for residual PII that regex and format parsers missed: - **Microsoft Presidio** with spaCy `en_core_web_lg` model — Entity recognition for PERSON, ORGANIZATION, IP_ADDRESS, EMAIL_ADDRESS, with custom `PatternRecognizer` instances for AWS account IDs (12-digit patterns) and machine accounts (`*$` suffix) - **HuggingFace BERT NER** (`dslim/bert-base-NER`) — Transformer-based token classification for PER (person), ORG (organization), and LOC (location) entities, providing a second-opinion cross-check against Presidio's spaCy-based detection All ML findings are filtered against an allowlist of safe values (system accounts, well-known services, public domains) and existing registry entries. New PII discoveries are added to the registry and trigger a **full re-sanitization pass** across all ~2 million records. ### Layer 4: Claude AI Contextual Review A stratified random sample of 500 sanitized records (sampled proportionally across message types and stream names) is submitted to Anthropic's Claude API for contextual PII review. Claude is prompted to identify PII that pattern-based and NER approaches commonly miss: - Organization names, abbreviations, or acronyms embedded in log messages - Internal hostnames that reveal organizational structure or naming conventions - Employee names embedded in file paths, process names, or service descriptions - Custom Active Directory group names, policy names, or OU names that identify the organization - Geographic identifiers tied to specific offices or data centers (e.g., `ATL-DC1`, `NYC-PROD`) - Database instance names containing organization identifiers (e.g., `mssql$acmesql01`) Claude's response is parsed for structured findings, each with a span, category, confidence score, and reasoning. New discoveries are added to the registry and trigger another full re-sanitization pass. ### Iterative Convergence The 4-layer pipeline runs in iterative cycles: 1. **Cycle N**: Layers 1–2 sanitize all records using the current registry → Layer 3 (ML) scans a sample → Layer 4 (Claude) scans a sample → New findings are added to registry → Full re-sanitize if new PII found 2. **Cycle N+1**: Repeat with the enriched registry — Layers 1–2 now catch everything previously found by ML/Claude 3. **Convergence**: Cycles repeat until Layer 3 and Layer 4 find near-zero new entries This iterative approach ensures that PII discovered by expensive ML/AI methods in one cycle is caught cheaply by regex/Aho-Corasick in all subsequent cycles across the full dataset (not just the sampled records). ### Sanitization Registry Statistics The final PII registry contains **~157,000 unique mappings** across 14 categories: | PII Category | Entries Found | Replacement Pattern | |--------------|--------------|---------------------| | Public IPs | ~80,500 | RFC 5737 TEST-NET (deterministic) | | Hostnames | ~21,900 | `HOST-NNNN` | | Private IPs | ~18,000 | HMAC-remapped RFC 1918 (subnet-preserving) | | Credentials | ~13,100 | `CRED-NNNN` | | FQDNs | ~11,100 | `host-NNNN.example.internal` | | Organizations | ~7,500 | `ORG-NNNN` | | Usernames | ~2,400 | `USER-NNNN` | | Windows SIDs | ~1,400 | Standardized replacement SIDs | | Emails | ~575 | `user-NNNN@example.net` | | Machine Accounts | ~350 | `MACHINE-NNNN$` | | Domains | ~23 | `domain-NNNN.example.net` | | AWS Accounts | ~16 | Sequential 12-digit IDs | | Org IDs | 6 | Numeric replacement IDs | | ARNs | 2 | `arn:aws:iam::NNNN:sanitized/NNNN` | ### What Is Preserved The following security-relevant information is intentionally preserved: - **Timestamps** — Event timing, dwell time, and lateral movement sequences - **Port numbers** — Protocol behavior signals - **Protocol types** — TCP/UDP/ICMP classification - **Severity levels** — Event priority and criticality - **Vendor event codes** — Cisco ASA codes, Windows Event IDs, AWS API names - **Action types** — Block, permit, logon, logoff, file access - **MITRE ATT&CK / D3FEND mappings** — Framework technique and tactic IDs - **Graph topology** — Node relationships and connection patterns (via consistent IP/hostname replacement) - **Product/stream identifiers** — Which security tool generated the event ## Intended Uses ### Primary Use Cases 1. **Provenance graph-based intrusion detection research** — Evaluate and benchmark graph-based IDS approaches (KnowHow, NodLink) on production-derived data 2. **AI cyber defense simulation** — Train and evaluate reinforcement learning defense policies in CybORG and similar simulators 3. **Security alert classification** — Build and evaluate ML models for malicious/benign event classification 4. **Attack lifecycle analysis** — Study attack progression patterns mapped to MITRE ATT&CK ### Research Context This dataset was produced in collaboration with the University of Canterbury (New Zealand) Computer Science and Software Engineering department for two research projects: - **AI Cyber-Security Battle Simulator** — Improving CybORG with realistic IDS observations, graph-based defense policies, and AI-driven attacker modeling - **Intrusion Detection based on Provenance Graphs** — Evaluating reproducibility and generalizability of KnowHow and NodLink detection methods ## Limitations - **Label imbalance**: ~98% benign, ~2% malicious — reflects production SOC reality but may require sampling strategies for balanced training - **Temporal scope**: Data covers July–August 2024, a limited time window - **Organization diversity**: Data from 5 organizations, each with different security tool deployments - **Sanitization trade-offs**: Some log message detail is reduced by PII replacement, particularly in free-text fields - **Label derivation**: Binary labels depend on WitFoo's automated detection; some attacks may be unlabeled (false negatives) and some benign events may be incorrectly linked to incidents ## Ethical Considerations - All customer-identifying information has been removed through the 4-layer sanitization process described above - The dataset does not contain personally identifiable information (PII) of any individual - IP addresses, hostnames, usernames, and organization names have been replaced with consistent synthetic tokens - The dataset should be used for defensive security research only ## Citation ```bibtex @dataset{witfoo_precinct6_2025, title={WitFoo Precinct6 Cybersecurity Dataset: Labeled Provenance Graphs and Signal Logs from Production SOC Operations}, author={WitFoo, Inc.}, year={2025}, url={https://huggingface.co/datasets/witfoo/precinct6-cybersecurity}, license={Apache-2.0} } ``` ## License This dataset is released under the [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0).