Skip to main content

Reproducible synthetic multilingual threat-intelligence datasets (EN/RU/ZH/DE) with risk labels and ground-truth IOCs.

Project description

synthreat

Reproducible synthetic threat-intelligence datasets — in four languages.

Labeled multilingual security-text corpora barely exist. synthreat generates them on demand: threat-intel sentences in English, Russian, Chinese, and German, each tagged with a risk label (CRITICAL / HIGH / MEDIUM / LOW), named entities, and — optionally — ground-truth indicators of compromise. Seed it and the output is byte-for-byte reproducible.

import synthreat

ds = synthreat.generate(samples_per_language=1000, seed=42, inject_iocs=0.3)

len(ds)            # 4000
ds.stats()         # {'by_language': {...}, 'by_label': {...}, 'with_iocs': ~1200}
ds.save("threats.jsonl")

Zero runtime dependencies — pure Python.

pip install synthreat

Why it's different

Most synthetic-data tools are generic (faker, mimesis) and know nothing about security text. synthreat is purpose-built for threat intelligence, and it's multilingual by construction — not English translated after the fact. Because injected IOCs are known at generation time, every enriched sample carries its indicators as ground truth, so the same dataset benchmarks both a risk classifier and an IOC extractor.

Ground-truth IOCs

With inject_iocs, a fraction of samples get a synthetic IP / email / SHA-256 / CVE embedded in the text and recorded on the sample:

ds = synthreat.generate(samples_per_language=10, seed=1, inject_iocs=1.0)
s = ds[0]
s.text          # "...LEAKED... Contact admin@example.com; C2 at 192.0.2.77; sample 9f...; ref CVE-2021-4242."
s.iocs          # {'ipv4': ['192.0.2.77'], 'email': ['admin@example.com'], 'sha256': ['9f...'], 'cve': ['CVE-2021-4242']}

Every value is synthetic and safe: IPs come from RFC 5737 documentation ranges and domains from RFC 2606 reserved names, so nothing resolves to a real host.

Pairs with osintlens

synthreat produces training/eval data in the exact shape osintlens consumes:

from synthreat import generate
from osintlens.ml import train

ds = generate(samples_per_language=2000, seed=0)
train(ds.as_training_data(), output_path="risk_model.joblib")

And with IOC injection you can measure extractor recall directly, comparing osintlens.extract_iocs(sample.text) against sample.iocs.

Customize

from synthreat import ThreatDataGenerator

gen = ThreatDataGenerator(
    seed=7,
    languages=["en", "de"],
    inject_iocs=0.5,
    vocab_overrides={"ACTORS": {"en": ["MyActor"], "de": ["MeinAkteur"]}},
)
ds = gen.generate(
    samples_per_language=500,
    distribution={"CRITICAL": 0.25, "HIGH": 0.25, "MEDIUM": 0.25, "LOW": 0.25},
)

Command line

synthreat generate -n 5000 --seed 42 -o threats.jsonl
synthreat generate -n 100 --languages en ru --inject-iocs 0.4 --format json
cat <(synthreat generate -n 10 --seed 1)   # prints JSON to stdout

Output schema

Each sample:

{
  "text": "LEAKED: database dump - Fortune 500 company admin credentials exposed",
  "label": "CRITICAL",
  "language": "en",
  "entities": [{"text": "LockBit", "type": "ORG"}, {"text": "Fortune 500 company", "type": "ORG"}],
  "iocs": {}
}

A note on use

The data is fabricated for training, testing, and benchmarking. It is not real intelligence and should never be presented as genuine threat reporting.

Author

Created and maintained by muhammed shazin sadhik kunhi parambath.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

synthreat-0.1.0.tar.gz (14.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

synthreat-0.1.0-py3-none-any.whl (13.1 kB view details)

Uploaded Python 3

File details

Details for the file synthreat-0.1.0.tar.gz.

File metadata

  • Download URL: synthreat-0.1.0.tar.gz
  • Upload date:
  • Size: 14.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.14

File hashes

Hashes for synthreat-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f3621cb8f96f0c9a48179c20386ac0328d9ccbb25f54cdb2379ffa4d24ad1320
MD5 19d508034636f2980fd672e9ee245691
BLAKE2b-256 0540ae5033e57489391034870a6f234eb99a7554b4aef4890abc90b866b52c09

See more details on using hashes here.

File details

Details for the file synthreat-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: synthreat-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 13.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.14

File hashes

Hashes for synthreat-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f0520d5329bed1d9dccb0133c008823cd731f5e52d0bba8f6b5bbada3cc24eab
MD5 a681fdc96db237ea387dd430927e139a
BLAKE2b-256 5c4714f6bcb6669a26bc621e355b02036508515471694f739777bfdaf9f3e1f5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page