mirror of
https://github.com/j3ssie/osmedeus.git
synced 2026-10-20 23:11:35 +02:00
Major features: - Add run registry for tracking active runs with PID management - Add API-based run cancellation with process termination - Add event trigger input vars syntax for multi-variable extraction - Add filter_functions with utility function support in triggers - Add event envelope injection for full event context in workflows - Add write coordinator for batched database operations API improvements: - Add logout endpoint and diffs endpoints for assets/vulnerabilities - Add step-results listing endpoint - Update schedule model with target, workspace, params fields - Change run_id to run_uuid across API responses Performance: - Add compiled JS program caching for 60-80% faster loop conditions - Add parallel shard rendering for 20-40% faster workflow startup - Add memory-mapped I/O for large file line counting - Add efficient output buffer combining in runners - Add mtime-based cache invalidation for workflow loader Other changes: - Rename trigger field from trigger to triggers in workflow YAML - Disable pongo2 HTML autoescape for shell command templates - Update JWT expiration default to 1440 minutes (1 day) - Change CORS default to reflect-origin for credentials support - Add source_type field to events (run, eval, api) - Skip copying core Unix tools to external-binaries
Event Workflow Examples
This folder contains sample workflows demonstrating the event trigger and generation system.
Workflows
Emitters (Event Generators)
| File | Description |
|---|---|
simple-emitter.yaml |
Basic event emission with generate_event and generate_event_from_file |
vuln-emitter.yaml |
Simulates a vulnerability scanner emitting structured finding events |
Receivers (Event Triggers)
| File | Description |
|---|---|
simple-receiver.yaml |
Basic event trigger that listens for discovery events |
filtered-receiver.yaml |
Advanced filtering with severity checks and jq extraction |
dedupe-receiver.yaml |
Event deduplication to prevent duplicate processing |
Event Functions
generate_event(workspace, topic, source, data_type, data)
Emit a single event with optional structured data. The workspace parameter identifies the target space for the event.
- type: function
function: |
generate_event("{{TargetSpace}}", "discovery.asset", "my-scanner", "subdomain", "api.example.com")
generate_event_from_file(workspace, topic, source, data_type, file_path)
Emit one event per line from a file. Returns the count of events emitted.
- type: function
functions:
- 'generate_event_from_file("{{TargetSpace}}", "discovery.asset", "my-scanner", "subdomain", "{{Output}}/subdomains.txt")'
Trigger Configuration
Basic Event Trigger
trigger:
- name: on-new-asset
on: event
event:
topic: "discovery.asset"
input:
type: event_data
field: "value"
name: target
enabled: true
Filtered Event Trigger
trigger:
- name: on-high-severity
on: event
event:
topic: "scan.finding"
filters:
- "event.data.severity == 'high'"
- "event.data.confirmed == true"
input:
type: function
function: 'jq("{{event.data}}", ".url")'
name: target
enabled: true
Deduplicated Event Trigger
trigger:
- name: on-url-dedupe
on: event
event:
topic: "crawler.url"
dedupe_key: "{{event.data.url}}"
dedupe_window: "5m"
input:
type: event_data
field: "value"
name: target
enabled: true
Running Examples
# Run the emitter to generate events
osmedeus run -m simple-emitter -t example.com
# The receiver will automatically process events if registered with the scheduler
osmedeus run -m simple-receiver -t example.com