Use in CI

Run Tracemill as part of a CI pipeline.

The CLI is a single static binary with no account or login, so it runs in any CI system. Typical uses are checking your own scenarios and jobs on every change, and sending a fixed set of events to a test SIEM.

Install the binary

Download a release archive and put the binary on the PATH. Pin a version so a pipeline does not change behavior when a new CLI is released:

VERSION=0.11.10
curl -fsSL "https://dl.tracemill.io/cli/${VERSION}/tracemill_linux_amd64.tar.gz" | tar -xz tracemill
sudo mv tracemill /usr/local/bin/
tracemill version

Replace ${VERSION} with latest to always take the newest release. See Installation for the other platforms.

Install the content library

Scenarios and jobs reference event types, and usually library scenarios, by content ID. Install the library before validating or running:

tracemill update

This installs to ~/.tracemill/library/ and downloads nothing when the installed copy is already the latest version.

The CLI downloads a missing library by itself only for tracemill run <content-id>. tracemill validate, and tracemill run given a file path, do not, so a pipeline that works on your own files needs this step.

Cache the library

To keep the library in a directory your CI system caches between runs, install it there and point the other commands at it:

export TRACEMILL_LIBRARY="$PWD/.tracemill-library"
tracemill update --library "$TRACEMILL_LIBRARY"

Without a terminal, update installs to a non-default directory only when it is passed with --library; the other commands read the environment variable.

Validate content on every change

tracemill validate --dir checks every scenario, job, pool, and event type under a directory, and renders each scenario and job once to check its events against their schemas. Nothing is delivered.

tracemill validate --dir ./content

Run and deliver

Pass credentials from your CI system's secret store, and disable the statistics overlay to keep logs readable:

tracemill run ./content/jobs/my-detection.yaml \
  --hec-url "$SPLUNK_HEC_URL" \
  --hec-token "$SPLUNK_HEC_TOKEN" \
  --no-stats

Use --dry-run instead of a destination to execute a job without sending events.

Exit codes

Every command exits 0 on success and non-zero on failure, with the error on stderr, so a failed validation or delivery fails the pipeline step. See Exit codes.

A successful run means the events were delivered. It does not mean a detection fired on them; the CLI does not query your SIEM. Tracemill Cloud verifies alerts and runs Tests on a schedule.