feat(macos): add macOS as a supported platform#42
Conversation
Add Platform::MacOS and resolve the exhaustive matches it forces: sigma logsource tuples and DNS alias generation, plus ECS host.os mapping using the darwin OS family. Shared test fixtures gain macOS arms that mirror the Linux POSIX model.
Give macOS its own allowlist defaults (system and Applications paths) and route path normalization through the POSIX branch, which previously fell through to the Windows backslash handling on non-Linux unix.
Reuse the Linux SIGKILL termination path on macOS and add libc to the macOS target dependencies.
Add the macOS main, runtime builder, and run_macos_edr mirroring the Linux path, backed by a no-op placeholder sensor so the shared detection pipeline runs end to end. Extend the shared imports and init_logging to macOS and narrow the unsupported-platform catch-all accordingly.
/Applications holds user-installed software and is a common location for macOS malware, so allowlisting it by default would blind YARA scanning, IOC hashing, and active response there. Keep only OS-shipped directories, matching the Linux defaults' OS-only philosophy.
|
Thanks for this — the production side is clean, well-commented, and it builds + clippies green on macOS locally. One blocker before merge, plus a coverage suggestion and a heads-up on CI. Blocker:
|
|
Update on the CI side — please pull both reference commits into this PR, not just the test fix. I initially planned to land the So the macOS CI job and the macOS code are coupled and should land together. Both reference commits are on the same branch: With both applied, this PR builds + lints + tests green on macOS in CI, and you get the |
The reload integration test rebuilds its Sigma engine via current_platform(), which now resolves to Platform::MacOS on macOS, but host_platform() and the rule fixture still emitted a `linux` product — so the reloaded network rule no longer matched and sigma_reload_swaps_valid_rules_and_rejects_empty_rules failed on macOS. Teach host_platform() and the product fixture about MacOS, and add Platform::MacOS to the sigma/mapping pipeline loops so the shared pipeline is actually covered on macOS. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add clippy-macos and test-macos jobs (mirroring the self-contained Windows jobs; no eBPF artifact needed) and wire them into the release gate, so the newly supported macOS target can't regress. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Thanks for the detailed review and the reference commits. I've cherry-picked both into this PR (authorship preserved):
Verified locally on macOS arm64:
Agreed on coupling the macOS CI with the macOS code. The Heads-up for the rest of the #41 series: the later PRs add the macOS release build and signing jobs on top of these |
|
Merged! 🙌 Thanks again Mostafa, really glad to have you on this. Solid first piece, can't wait to see where you take the next steps. |
|
Thanks for building this. 🙏 |
Summary
Introduces macOS as a first-class platform so the project builds, lints, tests, and runs the shared detection pipeline on macOS, ahead of the native sensors that follow. No telemetry is collected yet: a no-op placeholder sensor keeps the runtime exercised end to end.
Platform::MacOSand route it through Sigma logsource handling, DNS alias generation, and ECShost.osmapping (using thedarwinOS family).SIGKILLactive-response path on macOS.main, runtime builder,run_macos_edr) mirroring the Linux path, backed by a placeholder sensor.Type of change
feat/enhancement- new featureTest plan
cargo test)Note: all changes are gated to macOS, so Windows and Linux behavior is unchanged.
Checklist
Notes
This is the first PR from a series of four, all part of #41.