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

Enabling risk/observable matching #241

Merged
merged 13 commits into from
Sep 3, 2024
Merged

Conversation

cmcginley-splunk
Copy link
Collaborator

@cmcginley-splunk cmcginley-splunk commented Aug 15, 2024

Context

  • When risk message validation was added, an early version of risk/observable matching was added as well, but kept disabled

Code changes

  • Risk/observable matching enabled
  • Risks are matched against observables using the field extracted from contributing_events_search
  • The following validations are performed
    • All risk events can be matched to an observable
    • All observables are matched to at least one risk event
    • All risk events have the expected typing relative to matched observable
    • All risk events can be matched to only one observable
    • All risk events match observables with valid roles only (e.g. no risk events match Attacker role observables)
      • There is one caveat w/ this validation
      • It's possible, based on timing, that a detection may pass this validation falsely
      • If at the time of checking, the offending risk event matching the Attacker observable has not yet been generated and all other risk events pass validation, then this condition will seemingly be met
      • See Refactor risk/notable querying to pin to a single savedsearch ID #248 for a possible future mitigation for this to ensure this validation is applied more reliably

TODO

  • Remove comment (or annotate w/ GitHub issue) relating to having multiple conflicting roles once I get feedback
  • Deploy to security_content and security-content-automation after merge
  • Disable verbose logging

Testing

Future Work

@cmcginley-splunk cmcginley-splunk marked this pull request as ready for review August 20, 2024 09:11
@cmcginley-splunk cmcginley-splunk changed the title DRAFT: Enabling risk/observable matching Enabling risk/observable matching Aug 20, 2024
@cmcginley-splunk cmcginley-splunk mentioned this pull request Aug 20, 2024
Copy link
Contributor

@pyth0n1c pyth0n1c left a comment

Choose a reason for hiding this comment

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

Initial static review with responses to RFC and followup comments. I will merge Lou's PR, update the branch, then do some runtime testing of the PR.
As such, this is not approved YET.

contentctl/objects/risk_event.py Show resolved Hide resolved
contentctl/objects/risk_event.py Show resolved Hide resolved
contentctl/objects/risk_event.py Show resolved Hide resolved
contentctl/objects/risk_event.py Show resolved Hide resolved
contentctl/objects/risk_event.py Outdated Show resolved Hide resolved
Copy link
Contributor

@pyth0n1c pyth0n1c left a comment

Choose a reason for hiding this comment

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

approved after discussions with dev through comments and slack

@pyth0n1c pyth0n1c merged commit 0862bc6 into main Sep 3, 2024
18 checks passed
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