mirror of
https://github.com/j3ssie/osmedeus.git
synced 2026-08-22 23:52:25 +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
114 lines
2.9 KiB
YAML
114 lines
2.9 KiB
YAML
# Sample Workflow: Generate Security Report
|
|
# This workflow demonstrates how to use render_markdown_report() function
|
|
# to generate customized security reports from markdown templates.
|
|
#
|
|
# Usage:
|
|
# osmedeus run -m sample-report-workflow -t example.com
|
|
#
|
|
# Prerequisites:
|
|
# - Template file should exist at the specified path
|
|
# - Database should have scan data (assets, vulnerabilities)
|
|
|
|
name: sample-report-workflow
|
|
kind: module
|
|
description: Generate security report from markdown template
|
|
tags: report,markdown,utility
|
|
|
|
params:
|
|
- name: target
|
|
required: true
|
|
description: Target domain for the report
|
|
|
|
# Variables available in templates:
|
|
# {{TargetSpace}} - Current workspace name (usually the target)
|
|
# {{Target}} - Target domain
|
|
# {{Output}} - Output directory path
|
|
# {{RunUUID}} - Current run UUID
|
|
# {{TaskDate}} - Current date
|
|
# {{Data}} - External data directory
|
|
# {{Binaries}} - External binaries directory
|
|
|
|
steps:
|
|
# Step 1: Create the template directory if it doesn't exist
|
|
- name: setup-template-dir
|
|
type: bash
|
|
command: mkdir -p {{Output}}/templates
|
|
|
|
# Step 2: Create a simple inline template for demonstration
|
|
# In production, you would use a pre-existing template file
|
|
- name: create-demo-template
|
|
type: bash
|
|
command: |
|
|
cat > {{Output}}/templates/demo-report.md << 'TEMPLATE'
|
|
# Security Scan Report
|
|
|
|
**Workspace**: {{TargetSpace}}
|
|
**Target**: {{Target}}
|
|
**Generated**: {{TaskDate}}
|
|
**Run UUID**: {{RunUUID}}
|
|
|
|
---
|
|
|
|
## String Functions Demo
|
|
|
|
```osm-func
|
|
"Uppercase target: " + to_upper_case("{{Target}}")
|
|
```
|
|
|
|
```osm-func
|
|
"Trimmed text: [" + trim(" hello world ") + "]"
|
|
```
|
|
|
|
```osm-func
|
|
"Target length: " + len("{{Target}}")
|
|
```
|
|
|
|
---
|
|
|
|
## Dynamic Content
|
|
|
|
| Function | Result |
|
|
|----------|--------|
|
|
| UUID | ```osm-func
|
|
uuid()
|
|
``` |
|
|
| Random String | ```osm-func
|
|
random_string(8)
|
|
``` |
|
|
| Contains 'example' | ```osm-func
|
|
contains("{{Target}}", "example")
|
|
``` |
|
|
|
|
---
|
|
|
|
## Conditional Logic
|
|
|
|
```osm-func
|
|
contains("{{Target}}", ".com") ? "Target is a .com domain" : "Target is not a .com domain"
|
|
```
|
|
|
|
---
|
|
|
|
*Report generated by Osmedeus*
|
|
TEMPLATE
|
|
|
|
# Step 3: Render the markdown report
|
|
- name: generate-report
|
|
type: function
|
|
function: 'render_markdown_report("{{Output}}/templates/demo-report.md", "{{Output}}/security-report.md")'
|
|
|
|
# Step 4: Verify the report was created
|
|
- name: verify-report
|
|
type: function
|
|
function: 'file_exists("{{Output}}/security-report.md")'
|
|
|
|
# Step 5: Display report path
|
|
- name: show-report-path
|
|
type: function
|
|
function: 'log_info("Report generated at: {{Output}}/security-report.md")'
|
|
|
|
# Step 6: Print report preview (first 50 lines)
|
|
- name: preview-report
|
|
type: bash
|
|
command: head -50 {{Output}}/security-report.md
|