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, or --labels-file keeps them in a separate file for blind testing.
  • 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
  --labels-file PATH   write ground truth to a separate file (blind testing, see below)

trazas schema          print the KQL commands that create the tables (run before ingesting)

Every JSON record has a TrazasEventId (1, 2, 3… in output order) that ties it to its ground truth.

Testing a KQL rule without Sentinel

  1. Create a free Azure Data Explorer cluster.
  2. Run trazas schema and execute the commands it prints in the ADX query editor, before the first ingestion. This creates the tables with every column and the right types up front. Otherwise ADX guesses the columns from the first rows and can leave out rarer ones such as Sysmon's CallTrace.
  3. Generate data: trazas generate windows-bruteforce windows-spray -s 1 --labels -o events.jsonl
  4. Ingest events.jsonl into the existing table SecurityEvent (JSON format).
  5. 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.3.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.3.0
File Size Uploaded Provenance Actions
trazas-0.3.0.tar.gz 40.1 kB With provenance Details for trazas-0.3.0.tar.gz

Built distribution (wheel)

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

Total release size: 68.7 kB

Release files / trazas-0.3.0.tar.gz

Download URL trazas-0.3.0.tar.gz
Size 40.1 kB
Tags Source
SHA-256 checksum
How to use checksums
6337fed0381a06969d0b2e700f511ef4a198310bb40356daf4b31dbc0dfd5461
BLAKE2b-256 checksum
How to use checksums
f0418b2bc58155f56e148b3876064bde67d6241d427f3d00736fdd99ce4efcf9
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 13, 2026.

Transparency log

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

Download URL trazas-0.3.0-py3-none-any.whl
Size 28.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4b61167aa177942f2c3088f8d976b6204afaf5f072a817258712662278a305b1
BLAKE2b-256 checksum
How to use checksums
e940196b49dd09f987f5c98993f984e3dbdc01a109d505431778676f129b30dc
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 13, 2026.

Transparency log

Security for trazas 0.3.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.3.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 13, 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