Skip to main content

Architecture Overview

Osmedeus is a workflow engine for security automation. It executes YAML-defined workflows with support for multiple execution environments, distributed processing, and extensive customization.

Layered Architecture

Core Packages

Workflow Execution Flow

Step Type Routing

The Step Dispatcher routes steps to the appropriate executor based on type:

Key Types

WorkflowKind

StepType

RunnerType

TriggerType

Step Executors

Template Engine

The template engine provides {{variable}} interpolation:

Function Runtime

Functions are executed via the Goja JavaScript runtime with VM pooling:

Database Schema

Scheduler

The scheduler manages automated workflow triggers:

Decision Routing

Steps support conditional branching using switch/case syntax:
Use goto: _end to terminate the workflow.

Plugin Registry Pattern

Step executors are registered in a plugin registry for extensibility:

Configuration

Configuration is loaded from ~/osmedeus-base/osm-settings.yaml:

Adding New Features

New Step Type

  1. Add constant in internal/core/types.go:
  2. Create executor implementing StepExecutor in internal/executor/:
  3. Register in dispatcher.go:

New Runner

  1. Implement Runner interface in internal/runner/:
  2. Add type constant and register in runner factory.

New Utility Function

  1. Add Go implementation in internal/functions/:
  2. Add constant in constants.go:
  3. Register in goja_runtime.go:

New CLI Command

  1. Create in pkg/cli/:
  2. Add to rootCmd in init().

New API Endpoint

  1. Add handler in pkg/server/handlers/:
  2. Register route in server.go.
  3. Document in docs/api/.