

How It Works
- Provision — Create VMs via Pulumi (or reuse existing ones)
- Setup — SSH into each worker, run setup commands (install osmedeus, tools, etc.)
- Execute — Run workflow or custom commands, stream output back in real time
- Sync — Download results to local machine (optional)
- Destroy — Tear down infrastructure (optional, can be automatic)
Supported Providers
| Provider | Config Key | Instance Types |
|---|---|---|
| AWS | aws | t3.medium, t3.large, t3.xlarge |
| DigitalOcean | digitalocean | s-2vcpu-4gb, s-4vcpu-8gb, s-8vcpu-16gb |
| GCP | gcp | n1-standard-2, n1-standard-4 |
| Hetzner | hetzner | cx22, cx32, cx42 |
| Linode | linode | g6-standard-2, g6-standard-4 |
| Azure | azure | Standard_B2s, Standard_D2s_v3 |
Configuration
Cloud config lives in~/.osmedeus/cloud/cloud-settings.yaml. Manage it with:
Required Configuration
Every provider needs four things: cloud enabled, credentials, SSH keys, and setup commands.Optional Configuration
Post-Setup Commands
Post-setup commands run per-worker after the main setup, with template variables expanded:{{public_ip}}, {{private_ip}}, {{worker_name}}, {{worker_id}}, {{infra_id}}, {{provider}}, {{ssh_user}}, {{index}}
Two Execution Modes
Workflow Mode (default)
Runs an osmedeus flow or module on remote workers:Custom Command Mode
Runs arbitrary shell commands on remote workers — no osmedeus workflow required:--custom-cmd is mutually exclusive with -f/-m. See Custom Command Mode below.
Infrastructure Management
Provisioning
Listing
Reusing Existing Infrastructure
Destroying
Target Distribution
When scanning multiple targets across multiple workers, osmedeus splits the target list into chunks:/tmp/osm-targets-{i}.txt on the remote machine.
Custom Command Mode Details
Run any commands on cloud instances without using osmedeus workflows. Commands run in/tmp/osm-custom/ on the remote.
Flags
| Flag | Description |
|---|---|
--custom-cmd | Command to run (repeatable, sequential per worker) |
--custom-post-cmd | Runs after all custom-cmds succeed (repeatable) |
--sync-path | Remote path to download after execution (repeatable) |
--sync-dest | Local base directory for downloads (default: ./osm-sync-back) |
Template Variables
All commands and sync paths support these variables:| Variable | Description | Example |
|---|---|---|
{{Target}} | Target string, or chunk file path with -T | example.com or /tmp/osm-targets-0.txt |
{{public_ip}} | Worker’s public IP | 203.0.113.10 |
{{private_ip}} | Worker’s private IP | 10.0.0.5 |
{{worker_name}} | Resource name | osmw-1775159841-0 |
{{worker_id}} | Cloud resource ID | i-0437adf5... |
{{infra_id}} | Infrastructure ID | cloud-aws-1775159841 |
{{provider}} | Provider name | aws |
{{ssh_user}} | SSH username | ubuntu |
{{index}} | Worker index | 0, 1, 2 |
Execution Rules
- Custom-cmds run sequentially on each worker, but in parallel across workers
- If any
--custom-cmdfails (non-zero exit), remaining commands and all--custom-post-cmdare skipped for that worker - Post-cmd failures are logged but do not affect other workers
Sync-Back
Downloaded files are placed at:<sync-dest>/<worker_name>-<ip>/<remote_path>
For example, --sync-path /tmp/osm-custom/results.txt from worker osmw-0 at 1.2.3.4:
Examples
Syncing Results
Workflow Mode: --sync-back
Exports osmedeus workspaces (including database state) from remote workers and imports them locally:
Custom Mode: --sync-path
Downloads specific files or directories via SFTP:
Cost Management
Pre-Provisioning Estimates
Costs are estimated before provisioning. Set limits to prevent overspending:Spot/Preemptible Instances
Save 70-80% on instance costs:Cost Reference
| Provider | Instance | vCPU | RAM | Hourly |
|---|---|---|---|---|
| Hetzner | cx22 | 2 | 4 GB | ~$0.007 |
| Linode | g6-standard-2 | 2 | 4 GB | $0.018 |
| DigitalOcean | s-2vcpu-4gb | 2 | 4 GB | $0.02232 |
| AWS | t3.medium | 2 | 4 GB | $0.0416 |
| GCP | n1-standard-2 | 2 | 7.5 GB | $0.095 |
| Azure | Standard_B2s | 2 | 4 GB | $0.042 |
Worker Setup
Workers are set up via SSH after provisioning. The setup flow:- Cloud-init (automatic): Installs SSH keys, basic packages
- Setup commands (
setup.commands): Install osmedeus, tools, base data - Post-setup commands (
setup.post_commands): Per-worker configuration with template variables
Ansible Alternative
For complex setups, use Ansible instead of SSH commands:Setup on Existing Machines
Troubleshooting
Workers Not Connecting
Infrastructure Stuck
Cost Exceeded
If cost limits are hit, provisioning is blocked. Adjust limits:Best Practices
- Always set cost limits before running large-scale scans
- Use
--auto-destroyto avoid forgotten instances accruing charges - Use spot instances for non-critical scans (70-80% savings)
- Use
--reuseto avoid re-provisioning for iterative work - Start small — test with 1 instance before scaling up
- Use custom snapshots with tools pre-installed to cut setup time from 5min to 30s
- Check
cloud listregularly to verify no orphaned infrastructure
