Skip to main content

A generator for simulated OCSF (Open Cybersecurity Schema Framework) event streams

Project description

OCSF Simulator

A Python library and CLI that generates simulated OCSF (Open Cybersecurity Schema Framework) event streams. Useful for testing streaming pipelines, security analytics tools, SIEMs, and detection rules with realistic synthetic data.

Install

pip install .

Optional extras:

pip install ".[ocsf]"    # use the real ocsf-lib schema
pip install ".[kafka]"   # enable Kafka output
pip install ".[all]"

Use as a CLI

By default, events are written as JSON lines to stdout:

ocsf-sim --interval 1.0 --batch-size 5 --max-events 20

Send events to Kafka instead:

ocsf-sim --enable-kafka --kafka-servers localhost:9092 --kafka-topic ocsf-events

Common flags:

Flag Description
--interval Seconds between batches (default 1.0)
--batch-size Events per batch (default 10)
--max-events Stop after generating N events
--duration Stop after N minutes
--event-classes OCSF class UIDs to generate (default 3002 4001 1007 2001)
--profiles OCSF profiles to apply (default cloud security_control)
--ocsf-version OCSF schema version (default 1.1.0)
--enable-kafka Publish events to Kafka

Run ocsf-sim --help for the full list.

Use as a library

from ocsf_simulator import JSONSchemaFaker, stream_ocsf_events

# One-shot event generation
faker = JSONSchemaFaker(ocsf_version="1.1.0")
event = faker.generate_ocsf_event(3002, profiles=["host", "security_control"])

# Streaming generator (yields events forever)
for event in stream_ocsf_events(event_classes=[3002, 4001], interval=1.0):
    print(event)

Supported event classes

The simulator can generate events for any OCSF class, with richer dedicated generators for these commonly-used ones:

UID Class
1001 File System Activity
1007 Process Activity
2001 Security Finding
3002 Authentication
4001 Network Activity

License

Apache-2.0

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

timeplus_ocsf_simulator-0.1.0.tar.gz (2.6 MB view details)

Uploaded Source

Built Distribution

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

timeplus_ocsf_simulator-0.1.0-py3-none-any.whl (2.6 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: timeplus_ocsf_simulator-0.1.0.tar.gz
  • Upload date:
  • Size: 2.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for timeplus_ocsf_simulator-0.1.0.tar.gz
Algorithm Hash digest
SHA256 88a5bc689148d2e1a1999cfba9163ad3340f38929750f30d50e0450793c1d88c
MD5 a5ebdcf45bc003f892da46b257d1560d
BLAKE2b-256 f9ae4550dc260bc119790c200429124211ade6d581dd6f0b9a290daaf82b36bd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for timeplus_ocsf_simulator-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b25e74635859b24c2e303c5b40f516c746c759b847af204d1b6a23efa2935e07
MD5 4c7b678dc50e3aa470d59035a6669bdf
BLAKE2b-256 a2347d36c96884bb5a75cc0acdc03743e9a079e721e4310a75c067ece1c897d0

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