Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deduplication of Detections by Public Id #542

Merged
merged 1 commit into from
Jun 12, 2024

Conversation

coreyogburn
Copy link
Contributor

To support this properly, engines need to process their rules in a deterministic order. If different detections are marked as duplicates from one sync to the next, you never really know which rules your system is executing.

UpdateRepos has been refactored to return an array instead of an unordered map. The array of RepoOnDisk (formerly DirtyRepo) will be in the same order as the repos listed in the config.

Strelka needed even more refactoring as it would parse each rule from beginning to end before going to the next rule. Now it gathers all the detections, dedupes them, then syncs them. Refactored the call to WalkDir to use the IOManager instead of directly calling filepath.WalkDir.

Suricata parses the rules in the order that they exist in the communityRulesFile file. Strelka processes the repos in the order they appear in the config, inside each repo the files are parsed in lexical order.

Some tests needed to be updated to work around the changes to UpdateRepos and other determinism changes. Added a new test for the deduplication process.

To support this properly, engines need to process their rules in a deterministic order. If different detections are marked as duplicates from one sync to the next, you never really know which rules your system is executing.

UpdateRepos has been refactored to return an array instead of an unordered map. The array of RepoOnDisk (formerly DirtyRepo) will be in the same order as the repos listed in the config.

Strelka needed even more refactoring as it would parse each rule from beginning to end before going to the next rule. Now it gathers all the detections, dedupes them, then syncs them. Refactored the call to WalkDir to use the IOManager instead of directly calling filepath.WalkDir.

Some tests needed to be updated to work around the changes to UpdateRepos and other determinism changes. Added a new test for the deduplication process.
@coreyogburn coreyogburn merged commit 4fdd51d into 2.4/dev Jun 12, 2024
3 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jun 12, 2024
@coreyogburn coreyogburn deleted the cogburn/detection-duplicates branch June 12, 2024 19:02
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants