Skip to main content

trazas

CI CodeQL OpenSSF Scorecard License: MIT

Realistic, labelled attack logs for testing detection rules — no lab required.

🇪🇸 Leer en español

Writing a detection is easy; proving it works is hard. Most people don't have a lab with domain controllers, attackers and months of baseline traffic. trazas generates that data for you: attack chains mapped to MITRE ATT&CK, mixed with benign noise (including look-alikes that should not fire your rule), with optional ground-truth labels so you can measure true and false positives.

$ pip install trazas
$ trazas generate windows-bruteforce psexec-lateral --seed 42 --labels -o dataset.jsonl
trazas: 248 events, seed=42, start=2026-11-10T23:00:00+00:00

Why look-alikes matter

A typical first rule for LSASS credential dumping flags suspicious access masks:

SecurityEvent
| where EventID == 10 and TargetImage endswith "lsass.exe"
| where GrantedAccess in ("0x1010", "0x1410", "0x1438", "0x143a", "0x1fffff")

Run it on trazas generate lsass-dump --seed 1 --start 2026-01-01T00:00:00Z --noise 2000 --labels and it catches the attack, plus 89 false positives: Defender asks for 0x1010 (the same mask as Mimikatz) and the EDR sensor asks for 0x1fffff. Looking at the CallTrace instead:

SecurityEvent
| where EventID == 10 and TargetImage endswith "lsass.exe"
| where GrantedAccess in ("0x1010", "0x1410", "0x1438", "0x143a", "0x1fffff")
// Look at HOW lsass was opened, not only the access mask:
| where CallTrace has_any ("dbgcore.dll", "dbghelp.dll", "comsvcs.dll")  // minidump APIs
     or CallTrace contains "UNKNOWN("                                     // code running from memory

→ 1 true positive, 0 false positives, across all three dumping variants (seeds 1, 5 and 7 give comsvcs, Mimikatz and procdump). Walkthrough in docs/testing-detections.md.

Features

  • Detection-ready schemas — Windows events use Microsoft Sentinel SecurityEvent column names (EventID, TargetUserName, LogonType, IpAddress…); Linux events are real auth.log lines.
  • Reproducible — same --seed + --start ⇒ byte-identical output. Perfect for regression tests of your rules in CI.
  • Ground truth — --labels adds _trazas.malicious and _trazas.technique to every record.
  • Realistic noise — normal logons, admin share use, honest password typos, and security software touching lsass.exe.
  • Telemetry gaps — --drop-field / --truncate-field remove or cut fields in a share of the events, so you can see what your rule does when the data is incomplete.
  • Safe by design — external IPs come only from RFC 5737 documentation ranges, internal ones from RFC 1918, domains from example.com. Zero runtime dependencies.

Scenarios

ID Platform ATT&CK What happens
windows-bruteforce Windows T1110.001 Burst of 4625 against one account from one external IP, then 4624
windows-spray Windows T1110.003 One password against many accounts (real and invalid), slow, one success
psexec-lateral Windows T1021.002, T1569.002 4624 type 3 → 5140 ADMIN$ → 7045 PSEXESVC → Sysmon 1 recon as SYSTEM
lsass-dump Windows T1003.001 Sysmon 1 dumper (comsvcs MiniDump, procdump -ma or renamed Mimikatz) → Sysmon 10 on lsass.exe → Sysmon 11 .dmp; noise adds benign Defender/EDR lsass access
ssh-bruteforce Linux T1110.001 sshd failures with common usernames, then Accepted password

Run trazas list and trazas describe <id> for details.

Usage

trazas generate SCENARIO [SCENARIO ...]
  -s, --seed INT       PRNG seed (random if omitted; printed so you can reproduce)
  --start ISO8601      start time (default: now, UTC)
  -n, --noise INT      benign events per platform (default: 200)
  -f, --format         jsonl (default) | raw  (raw = native text, Linux only)
  -o, --output PATH    write to file (refuses to overwrite without --force)
  --labels             add ground-truth labels
  --drop-field NAME:RATIO          remove a field from that share of events (e.g. CallTrace:0.3)
  --truncate-field NAME:LEN:RATIO  cut a string field to LEN characters in that share of events

Testing a KQL rule without Sentinel

  1. Create a free Azure Data Explorer cluster.
  2. Generate data: trazas generate windows-bruteforce windows-spray -s 1 --labels -o events.jsonl
  3. Ingest events.jsonl into a table named SecurityEvent (JSON format).
  4. Run your rule. Example:
SecurityEvent
| where EventID == 4625
| summarize Failures = count(), Accounts = dcount(TargetUserName) by IpAddress, bin(TimeGenerated, 10m)
| where Failures > 20 or Accounts > 10

Then compare against _trazas.malicious to count true and false positives. See docs/testing-detections.md.

Contributing

New scenarios are very welcome — see CONTRIBUTING.md. Please report security issues privately as described in SECURITY.md.

License

MIT. Generated data is synthetic; any resemblance to real users is coincidental.

Metadata

Release files for trazas 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for trazas 0.2.0
File Size Uploaded Provenance Actions
trazas-0.2.0.tar.gz 34.9 kB With provenance Details for trazas-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for trazas 0.2.0
File Interpreter ABI Platform Actions
trazas-0.2.0-py3-none-any.whl Python 3 none any Details for trazas-0.2.0-py3-none-any.whl

Total release size: 60.5 kB

Release files / trazas-0.2.0.tar.gz

Download URL trazas-0.2.0.tar.gz
Size 34.9 kB
Tags Source
SHA-256 checksum
How to use checksums
434657edca9cc945b304f7a985b338b337c7ddfcb087436b8354c9cf95d48eda
BLAKE2b-256 checksum
How to use checksums
78af1257d512fe65a0c6e94d6a8d6265ed115b6b7589be35110620dcc8eadf99
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.

Transparency log

Release files / trazas-0.2.0-py3-none-any.whl

Download URL trazas-0.2.0-py3-none-any.whl
Size 25.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
44b3565a82e095148b3c9e7eb35ec77a3ba56cb8e4c6b1414982dd55fa90d134
BLAKE2b-256 checksum
How to use checksums
9c5d6de2c3955333d014879549322f11a4e8fe20cd5acb4af46e0927a4f62b91
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.

Transparency log

Security for trazas 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for trazas-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page