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

[Rule Tuning] Port Scan Rules #4443

Merged
merged 1 commit into from
Feb 5, 2025
Merged

[Rule Tuning] Port Scan Rules #4443

merged 1 commit into from
Feb 5, 2025

Conversation

Aegrah
Copy link
Contributor

@Aegrah Aegrah commented Feb 4, 2025

Summary

These rules have been tuned several times, and in one tuning, I bricked the rule logic:

Through community slack, concerns about this rule were presented:

This PR addresses these issues by:

  • Removing Elastic Defend from the rule entirely (this is needed, as Elastic Defend does not properly log the network connections needed to detect this port scanning behavior without being prone to FPs)
  • Add the network_flow event.action field to ensure flow data captured by the NPC is used to trigger the rule. I kept PANW integration, as I checked rules such as this, which seem to be compatible with the same event.action. I don't have a dataset to test this with myself, however.
  • I addressed the rule tunings in the rule descriptions, as these were not yet reflected.
  • I fixed the indices that are queried, the associated tags, and the formatting of the rules.

Copy link
Contributor

github-actions bot commented Feb 4, 2025

Rule: Tuning - Guidelines

These guidelines serve as a reminder set of considerations when tuning an existing rule.

Documentation and Context

  • Detailed description of the suggested changes.
  • Provide example JSON data or screenshots.
  • Provide evidence of reducing benign events mistakenly identified as threats (False Positives).
  • Provide evidence of enhancing detection of true threats that were previously missed (False Negatives).
  • Provide evidence of optimizing resource consumption and execution time of detection rules (Performance).
  • Provide evidence of specific environment factors influencing customized rule tuning (Contextual Tuning).
  • Provide evidence of improvements made by modifying sensitivity by changing alert triggering thresholds (Threshold Adjustments).
  • Provide evidence of refining rules to better detect deviations from typical behavior (Behavioral Tuning).
  • Provide evidence of improvements of adjusting rules based on time-based patterns (Temporal Tuning).
  • Provide reasoning of adjusting priority or severity levels of alerts (Severity Tuning).
  • Provide evidence of improving quality integrity of our data used by detection rules (Data Quality).
  • Ensure the tuning includes necessary updates to the release documentation and versioning.

Rule Metadata Checks

  • updated_date matches the date of tuning PR merged.
  • min_stack_version should support the widest stack versions.
  • name and description should be descriptive and not include typos.
  • query should be inclusive, not overly exclusive. Review to ensure the original intent of the rule is maintained.

Testing and Validation

  • Validate that the tuned rule's performance is satisfactory and does not negatively impact the stack.
  • Ensure that the tuned rule has a low false positive rate.

Copy link
Contributor

@Mikaayenson Mikaayenson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work. Thank you!

@Aegrah Aegrah merged commit 32975e5 into main Feb 5, 2025
26 checks passed
@Aegrah Aegrah deleted the network-scan-rule-tunings branch February 5, 2025 14:40
r0ot added a commit to VigilantSec/detection-rules that referenced this pull request Feb 5, 2025
* [Rule Tuning] Port Scan Rules (elastic#4443)

* [New Hunt] General Kernel Manipulation (elastic#4403)

* [New Hunt] General Kernel Manipulation

* Update index.yml

* [New Hunt] Persistence via PolicyKit (elastic#4406)

* [New Hunt] Persistence via PolicyKit

* ++

* [New Hunt] Persistence via Desktop Bus (D-Bus) (elastic#4407)

* [Rule Tuning] Remote Execution via File Shares (elastic#4448)

* [Rule Tuning] Tighten Up Elastic Defend Indexes - MacOS (elastic#4447)

* tags (#4)

Co-authored-by: peterydzynski <peter.rydzynski1@gmail.com>

---------

Co-authored-by: Ruben Groenewoud <78494512+Aegrah@users.noreply.github.com>
Co-authored-by: Jonhnathan <26856693+w0rk3r@users.noreply.github.com>
Co-authored-by: peterydzynski <peter.rydzynski1@gmail.com>
@r0ot r0ot mentioned this pull request Feb 5, 2025
5 tasks
r0ot added a commit to VigilantSec/detection-rules that referenced this pull request Feb 5, 2025
* [Rule Tuning] Port Scan Rules (elastic#4443)

* [New Hunt] General Kernel Manipulation (elastic#4403)

* [New Hunt] General Kernel Manipulation

* Update index.yml

* [New Hunt] Persistence via PolicyKit (elastic#4406)

* [New Hunt] Persistence via PolicyKit

* ++

* [New Hunt] Persistence via Desktop Bus (D-Bus) (elastic#4407)

* [Rule Tuning] Remote Execution via File Shares (elastic#4448)

* [Rule Tuning] Tighten Up Elastic Defend Indexes - MacOS (elastic#4447)

* tags (#4)



---------

Co-authored-by: Ruben Groenewoud <78494512+Aegrah@users.noreply.github.com>
Co-authored-by: Jonhnathan <26856693+w0rk3r@users.noreply.github.com>
Co-authored-by: peterydzynski <peter.rydzynski1@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants