feat: add daemon mode for long-running real-time detection#6
Merged
Conversation
Introduce a `daemon` subcommand that runs rsigma as a persistent service: - Reads NDJSON events from stdin and writes matches to stdout - Exposes HTTP endpoints for health (/healthz, /readyz), Prometheus metrics (/metrics), and management API (/api/v1/status, /api/v1/rules, /api/v1/reload) - Supports hot-reload of Sigma rules via file watcher, SIGHUP, or API - Feature-gated behind `daemon` (enabled by default) with tokio, axum, prometheus, and notify as optional dependencies - Full structured JSON logging via tracing - CI and release workflows now use --all-features Made-with: Cursor
654be5e to
35d1bf9
Compare
mostafa
added a commit
that referenced
this pull request
Mar 10, 2026
Cargo.lock: - aws-lc-sys 0.37.1 -> 0.38.0 (with aws-lc-rs 1.16.0 -> 1.16.1) Addresses alerts #7, #8, #9: - PKCS7_verify Signature Validation Bypass - Timing Side-Channel in AES-CCM Tag Verification - PKCS7_verify Certificate Chain Validation Bypass editors/vscode/package-lock.json: - minimatch 3.1.2 -> 3.1.5 (alert #6: ReDoS via GLOBSTAR segments) - minimatch 10.2.1 -> 10.2.4 (alert #4: ReDoS via extglobs) - underscore 1.13.7 -> 1.13.8 (alert #10: DoS via unlimited recursion)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new
daemonsubcommand that runs rsigma as a persistent, long-running detection service — designed to sit behind a log collector (e.g.hel run | rsigma daemon ...) and process events continuously./healthz,/readyz), Prometheus metrics (/metrics), status and rule introspection (/api/v1/status,/api/v1/rules), and manual reload trigger (POST /api/v1/reload)SIGHUPsignal handler, and API endpoint all trigger rule reloads without restarttracing, configurable withRUST_LOGdaemonfeature (enabled by default) pulls intokio,axum,prometheus, andnotifyas optional dependencies--all-featuresto ensure feature-gated code is always checked, linted, tested, and shippedHow it differs from
evalevaldaemonNew files
daemon/mod.rsrun_daemondaemon/server.rsdaemon/state.rsDaemonEnginewrapper over statelessEngineor statefulCorrelationEnginedaemon/engine.rsdaemon/metrics.rsdaemon/health.rsdaemon/reload.rsTest plan
cargo check --workspace --all-featurespassescargo clippy --workspace --all-targets --all-features -- -D warningscleancargo test --workspace --all-features— 60 tests passrsigma daemon, confirm match output/healthz,/readyz,/metrics,/api/v1/status,/api/v1/rulesresponsesPOST /api/v1/reloadtriggers reloadcargo build -p rsigma --no-default-features