Feat: Improved IO handling for YARA and hot-reload#94
Conversation
|
Thanks for the PR. The problem is real: the old hot-reload poller fingerprints rule/IOC files every 2s by default, so replacing that with filesystem events makes sense. I would ask for a few changes before merging:
Allowing an intentionally empty Sigma/YARA folder is fine, but right now a folder containing only invalid rules can also rebuild to zero loaded rules and replace the last good detector. That could silently disable detection after a bad rule deploy. I think reload should allow “no rule files found”, but reject “rule files found and none compiled/loaded”.
The PR says watcher failure falls back to a 60s poll, but the code polls as fast as
The PR watches IOC files directly. Some editors/config tools update files via temp-file-plus-rename, which can make direct file watches unreliable. Watching the parent directory non-recursively and keeping the existing fingerprint comparison would be more robust.
It still says Overall: good direction and the core issue is valid, but I would not merge as-is until at least points 1 and 2 are fixed. |
|
Thanks for the review! I have addressed all points:
|
Summary
This PR addresses unnecessary IO load when running on slower HDDs. It performs thee changes:
Type of change
feat/enhancement- new featurebug- bug fixrefactor- refactoring, no behaviour changedocumentation- docs onlyci- CI/CD changesdependencies- dependency updateTest plan
cargo test)Checklist