simrun

module
v0.6.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 14, 2026 License: Apache-2.0

README ΒΆ

SimRun

SimRun

An Attack Simulation Platform for detection engineering.
Detonate attacks, verify the alerts fire, and measure exactly which detections you're testing β€” across multiple clouds.

License Release Go Docker


Why SimRun

Detection rules rot silently. A field gets renamed, a log source drifts, an index mapping changes β€” and the alert you were counting on simply stops firing. You don't find out until the breach.

SimRun closes that gap. It runs real attack techniques against your environment, confirms the detections you expect actually fire in your SIEM, and tracks which of your rules are tested and which are blind spots.

It's not a script you wire into CI and forget. It's a platform:

  • 🎯 Coverage you can see. SimRun joins your live Elastic detection rules against your scenarios and their latest pass/fail result, then reports a coverage percentage. You learn what you aren't testing β€” not just whether one test passed. β†’ Rule Coverage
  • ☁️ Multiple clouds, multiple accounts. First-class connectors for AWS, GCP, Azure, and Kubernetes, each backed by managed, encrypted secret groups and selectable per scenario.
  • πŸ§ͺ Three ways to exercise a detection. Detonate a real attack, inject a crafted log to confirm a rule is wired up without touching infrastructure, or collect the raw logs an attack produced to build the next rule.
  • πŸ“¦ A pack ecosystem. Simulations ship as versioned, shareable bundles with a clean Go SDK. Use the first-party packs, wrap Stratus Red Team, or author your own. β†’ Ecosystem
  • πŸ–₯️ Built to operate. Web UI, REST API, and WebSocket interface; PostgreSQL persistence; scheduled runs; optional multi-user OAuth. It all ships as a single Go binary with the SvelteKit UI embedded.

SimRun is primarily focused on Elastic Security β€” that's where coverage analysis, injection, and log collection are richest. Datadog security signals are supported as a matching backend.

How it works

An Assessment is a saved set of scenarios. Running it creates a Run, which executes every scenario in parallel. Each scenario triggers some activity and then asserts that an expected alert appears in your SIEM before a timeout.

flowchart LR
    A[Assessment<br/>scenarios] -->|run| B(Run)
    B --> S1[Scenario 1]
    B --> S2[Scenario 2]
    B --> S3[Scenario N]
    S1 --> D{Trigger}
    D -->|detonate| E[Real attack<br/> from SimRun pack]
    D -->|inject| F[Crafted log<br/>into Elasticsearch]
    E --> M[Matcher polls SIEM<br/>until alert fires or timeout]
    F --> M
    M --> R[(Results + Coverage<br/>Postgres)]
    E -.optional.-> C[Collector<br/>gathers related logs]
    C --> R

Every detonation gets a UUID that SimRun reflects into the generated activity wherever possible (user-agent strings), so an alert maps unambiguously back to the exact attack that caused it.

β†’ Full vocabulary in Concepts.

A scenario, end to end

Build scenarios visually in the assessment editor, or write the YAML directly β€” the editor toggles between a forms-based Builder and raw YAML. This scenario detonates a pack simulation in AWS and asserts the matching Elastic Security rule fires:

targets:
  aws: prod-aws            # an AWS connector you configured in the UI

scenarios:
  - name: S3 public access block disabled
    detonate:
      simrunDetonator:
        pack: simrun-base-pack
        simulation: aws.s3-disable-public-access-block
    expectations:
      - timeout: 5m
        elasticSecurityAlert:
          name: "S3 Public Access Block Disabled"

Swap detonate for inject to test a rule without running an attack, or add a collect block to capture the raw logs the attack produced.

β†’ Scenarios reference.

Quickstart (60 seconds)

Prerequisites: mise (manages Go 1.25 and Node 22), PostgreSQL.

# Build the frontend + binary β†’ dist/simrun
mise run build

# Point it at Postgres and run
export SR_DATABASE_URL="postgres://user:pass@localhost:5432/simrun?sslmode=disable"
./dist/simrun           # serves UI + API on http://localhost:8080

Schema migrations run automatically on startup. Authentication is optional β€” without Google OAuth credentials, SimRun runs unauthenticated.

β†’ Then follow the Walkthrough to run your first detection test.

Rule Coverage

The Coverage view (/rules/coverage) pulls every detection rule from your Elastic deployment and answers the question CI never could: which of these rules does a SimRun scenario actually exercise, and did it pass last time? Rules with no scenario are flagged as blind spots; the summary reports an overall covered-rules percentage.

The pack ecosystem

Simulations are distributed as packs β€” versioned bundles of Terraform modules, scenario definitions, and a manifest. Two first-party packs are maintained alongside SimRun:

Pack What it is
simrun-pack The reference pack and a worked example of authoring simulations in Go (AWS, Kubernetes, Okta injections).
simrun-stratus-adapter Plug-and-play wrapper that exposes the entire Stratus Red Team technique registry as a SimRun pack.

β†’ Ecosystem & authoring guide.

Documentation

Development

mise run build-frontend   # build just the SvelteKit frontend
go test ./...             # run the test suite
mise run lint             # run golangci-lint
go generate ./...         # regenerate mocks (mockery)
mise run parser           # regenerate parser from JSON schemas

Acknowledgments

SimRun stands on excellent prior work in the detection-engineering community:

  • Threatest by Datadog pioneered the detonate-and-verify model for detection testing and shaped how we think about correlating attacks to alerts.
  • Stratus Red Team, also by Datadog, provides the MITRE ATT&CK–mapped cloud attack techniques that SimRun exposes through simrun-stratus-adapter.

Contributing

Issues and pull requests are welcome.

License

Licensed under the Apache License 2.0. See LICENSE.

Directories ΒΆ

Path Synopsis
cmd
simrun command
Command simrun is the ASP server: a web server with an embedded SvelteKit frontend that runs attack simulations and verifies expected security alerts.
Command simrun is the ASP server: a web server with an embedded SvelteKit frontend that runs attack simulations and verifies expected security alerts.
internal
cloud/aws
Package awsauth provides AWS cross-account role assumption for simrun.
Package awsauth provides AWS cross-account role assumption for simrun.
cloud/azure
Package azureauth provides Azure Workload Identity Federation for simrun.
Package azureauth provides Azure Workload Identity Federation for simrun.
cloud/gcp
Package gcpauth provides GCP Workload Identity Federation for simrun.
Package gcpauth provides GCP Workload Identity Federation for simrun.
cloud/k8s
Package k8sconfig generates kubeconfig files for Kubernetes clusters using CSP CLI tools (aws, gcloud, az).
Package k8sconfig generates kubeconfig files for Kubernetes clusters using CSP CLI tools (aws, gcloud, az).
collectors
Package collectors gathers related logs from a SIEM after a simulation runs.
Package collectors gathers related logs from a SIEM after a simulation runs.
config
Package config holds simrun's configuration types: env-only Bootstrap, DB-backed AppConfig, and the in-memory pack shapes used by the parser and runner.
Package config holds simrun's configuration types: env-only Bootstrap, DB-backed AppConfig, and the in-memory pack shapes used by the parser and runner.
connectors/elastic
Package elastic is a minimal client for the Elastic Security detection-engine API, used to validate Elastic connectors.
Package elastic is a minimal client for the Elastic Security detection-engine API, used to validate Elastic connectors.
credentials
Package credentials resolves per-connector credentials into the environment- variable maps consumed by detonators and CLI tools.
Package credentials resolves per-connector credentials into the environment- variable maps consumed by detonators and CLI tools.
crypto
Package crypto provides AES-256-GCM encryption for secret values stored in the database.
Package crypto provides AES-256-GCM encryption for secret values stored in the database.
db
Package db is the PostgreSQL persistence layer (pgx), running embedded migrations on startup.
Package db is the PostgreSQL persistence layer (pgx), running embedded migrations on startup.
detonators
Package detonators executes attack simulations, via simulation packs or the AWS CLI.
Package detonators executes attack simulations, via simulation packs or the AWS CLI.
envutil
Package envutil provides helpers for threaded environment variable management.
Package envutil provides helpers for threaded environment variable management.
injectors
Package injectors writes log documents directly into a SIEM, bypassing detonation.
Package injectors writes log documents directly into a SIEM, bypassing detonation.
matchers
Package matchers verifies that the security alerts expected by a scenario were generated after a simulation.
Package matchers verifies that the security alerts expected by a scenario were generated after a simulation.
matchers/datadog
Package datadog matches expected Datadog security signals.
Package datadog matches expected Datadog security signals.
matchers/elastic
Package elastic matches expected Elastic Security detection alerts.
Package elastic matches expected Elastic Security detection alerts.
packs/executor
Package executor handles pack protocol communication using PackRunners.
Package executor handles pack protocol communication using PackRunners.
packs/locks
Package locks provides a process-global keyed mutex used to serialize mutating filesystem operations on a single pack's cache directory.
Package locks provides a process-global keyed mutex used to serialize mutating filesystem operations on a single pack's cache directory.
packs/resolver
Package resolver provides pack binary resolution and caching.
Package resolver provides pack binary resolution and caching.
packs/runner
Package runner builds and runs pack binaries (local, uploaded, or remote) behind a common interface.
Package runner builds and runs pack binaries (local, uploaded, or remote) behind a common interface.
packs/terraform
Package terraform provides programmatic Terraform execution using terraform-exec.
Package terraform provides programmatic Terraform execution using terraform-exec.
parser
Package parser turns YAML scenario files into Scenario objects.
Package parser turns YAML scenario files into Scenario objects.
results
Package results provides a parallel scenario executor over the shared runner.ScenarioResult / runner.RunResult result types.
Package results provides a parallel scenario executor over the shared runner.ScenarioResult / runner.RunResult result types.
runner
Package runner is the scenario execution engine: it detonates or injects, polls for the expected alerts, and optionally collects related logs.
Package runner is the scenario execution engine: it detonates or injects, polls for the expected alerts, and optionally collects related logs.
testutil/fakes
Package fakes provides in-memory implementations of every db.*Store interface.
Package fakes provides in-memory implementations of every db.*Store interface.
testutil/testserver
Package testserver provides a one-line setup for HTTP-handler tests.
Package testserver provides a one-line setup for HTTP-handler tests.
version
Package version holds build version information for simrun.
Package version holds build version information for simrun.
web
Package web implements the REST API, WebSocket hub, and embedded-frontend HTTP server.
Package web implements the REST API, WebSocket hub, and embedded-frontend HTTP server.
web/auth
Package auth provides Google OAuth login and session-cookie middleware for the web API.
Package auth provides Google OAuth login and session-cookie middleware for the web API.
Package pack is the SDK for building simrun simulation packs β€” standalone binaries that simrun invokes over a JSON stdin/stdout protocol to detonate attacks and report results.
Package pack is the SDK for building simrun simulation packs β€” standalone binaries that simrun invokes over a JSON stdin/stdout protocol to detonate attacks and report results.
aws
Package aws provides AWS SDK helpers for simulation packs.
Package aws provides AWS SDK helpers for simulation packs.
azure
Package azure provides Azure SDK helpers for simulation packs.
Package azure provides Azure SDK helpers for simulation packs.
gcp
Package gcp provides GCP SDK helpers for simulation packs.
Package gcp provides GCP SDK helpers for simulation packs.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL