Skip to content

[Examples] Add end-to-end local demo script (fixes #75)#83

Open
Ayush7614 wants to merge 3 commits into
Karib0u:mainfrom
Ayush7614:ayush1
Open

[Examples] Add end-to-end local demo script (fixes #75)#83
Ayush7614 wants to merge 3 commits into
Karib0u:mainfrom
Ayush7614:ayush1

Conversation

@Ayush7614

@Ayush7614 Ayush7614 commented Jun 15, 2026

Copy link
Copy Markdown

Summary

  • Add examples/demo/run-local-demo.sh and run-local-demo.ps1 to verify prerequisites, fire the bundled whoami trigger, poll for a new ECS alert, and print pretty JSON on success.
  • Add examples/demo/README.md with usage, expected output, SIEM next-step hints, and macOS experimental notes.
  • Link the demo helper from docs/getting-started.md.

Test plan

  • Start Rustinel on Linux (sudo ./rustinel run), run ./examples/demo/run-local-demo.sh, confirm exit 0 and alert JSON printed.
  • Run with agent stopped — confirm clear error pointing to sudo ./rustinel run.
  • Run ./examples/demo/run-local-demo.sh --siem elastic — confirm next-step commands print.
  • On Windows, run .\examples\demo\run-local-demo.ps1 with agent running and confirm alert output.
  • Run with --trigger-only / -TriggerOnly when agent checks should be skipped.

@Ayush7614

Copy link
Copy Markdown
Author

cc: @Karib0u

@Karib0u

Karib0u commented Jun 21, 2026

Copy link
Copy Markdown
Owner

Thanks for the PR. I am going to request changes for now.

The direction matches #75, but the implementation is not ready to merge:

  • The branch currently conflicts with main.
  • The Linux/macOS helper uses GNU-specific date behavior, so the macOS path is likely broken.
  • Both helpers hardcode logs/alerts.json* instead of respecting alerts.directory and alerts.filename from config.toml.
  • The shell helper iterates glob output through command substitution, which breaks paths containing spaces.
  • This adds a large amount of script logic without automated checks or tests.

Please rebase on main, make the helpers config-aware and portable, add at least basic automated validation for argument parsing/path handling, and keep the docs/scripts consistent with the repo style.

Ayush7614 and others added 3 commits June 22, 2026 12:12
Provide cross-platform helpers that verify prerequisites, fire the demo
trigger, poll for new ECS alerts, and optionally print SIEM next steps.

Fixes Karib0u#75

Co-authored-by: Cursor <cursoragent@cursor.com>
Read alerts.directory and alerts.filename from config.toml, watch today's
alert file, fix macOS-safe timing, iterate globs safely, and add validate.sh.

Co-authored-by: Cursor <cursoragent@cursor.com>
Run examples/demo/validate.sh on Ubuntu to cover config parsing and CLI checks.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Ayush7614

Copy link
Copy Markdown
Author

Thanks for the review @Karib0u — addressed all requested changes in the latest push:

  • Rebased on main and resolved the docs/getting-started.md conflict (demo helper links now sit under the updated “Verify The Demo Rule” section for Windows/Linux/macOS).
  • Config-aware alert paths — both helpers read [alerts].directory and [alerts].filename from config.toml (defaults: logs / alerts.json) and watch today's {directory}/{filename}.{YYYY-MM-DD} file.
  • Portable timing — removed GNU date +%s%N; now_ms() uses python3 or second-granularity fallback (macOS-safe).
  • Safe glob iteration — replaced for file in $(...) with nullglob array expansion in lib.sh.
  • Automated validation — added examples/demo/validate.sh plus a demo-validate CI job for config parsing and CLI checks.

Happy to adjust anything else during review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants