Skip to content

[New Rules] External Promotion Alerts #4903

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

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open

Conversation

Mikaayenson
Copy link
Contributor

@Mikaayenson Mikaayenson commented Jul 11, 2025

Pull Request

Issue link(s):

Summary - What I changed

  • Added new external alert promotion rules with tags specifically for AI4DSOC
  • Added validation support for data_stream.dataset per integration team guidance
  • Small optimization tweak to unit test

How To Test

  • Some initial testing occurred by shipping a beta package to test the new incoming features.
  • Double check the requirements referenced in the issue (otherwise unit tests should pass)
    • index
    • overrides
    • query
    • severity mappings
Stack Testing

Note: Didn't have test data for:

  • event.kind: alert and data_stream.dataset: google_secops.alert
  • event.kind: alert and data_stream.dataset: splunk.alert

Testing should be coming the week the last week of July.

Testing Data

  • Crowdstrike Data
Screenshot 2025-07-25 at 9 31 57 AM
  • Microsoft Sentinel Data
Screenshot 2025-07-25 at 9 33 28 AM
  • S1 Data
Screenshot 2025-07-25 at 9 34 03 AM
  • Elastic
Screenshot 2025-07-29 at 12 07 44 PM

Checklist

  • Added a label for the type of pr: bug, enhancement, schema, maintenance, Rule: New, Rule: Deprecation, Rule: Tuning, Hunt: New, or Hunt: Tuning so guidelines can be generated
  • Added the meta:rapid-merge label if planning to merge within 24 hours
  • Secret and sensitive material has been managed correctly
  • Automated testing was updated or added to match the most common scenarios
  • Documentation and comments were added for features that require explanation

@Mikaayenson Mikaayenson self-assigned this Jul 11, 2025
@Mikaayenson Mikaayenson added the Rule: New Proposal for new rule label Jul 11, 2025
Copy link
Contributor

github-actions bot commented Jul 11, 2025

Enhancement - Guidelines

These guidelines serve as a reminder set of considerations when addressing adding a new schema feature to the code.

Documentation and Context

  • Describe the feature enhancement in detail (alternative solutions, description of the solution, etc.) if not already documented in an issue.
  • Include additional context or screenshots.
  • Ensure the enhancement includes necessary updates to the documentation and versioning.

Code Standards and Practices

  • Code follows established design patterns within the repo and avoids duplication.
  • Ensure that the code is modular and reusable where applicable.

Testing

  • New unit tests have been added to cover the enhancement.
  • Existing unit tests have been updated to reflect the changes.
  • Provide evidence of testing and validating the enhancement (e.g., test logs, screenshots).
  • Validate that any rules affected by the enhancement are correctly updated.
  • Ensure that performance is not negatively impacted by the changes.
  • Verify that any release artifacts are properly generated and tested.
  • Conducted system testing, including fleet, import, and create APIs (e.g., run make test-cli, make test-remote-cli, make test-hunting-cli)

Additional Schema Related Checks

  • Verify that the enhancement works across all relevant environments (e.g., different OS versions).
  • Link to the relevant Kibana PR or issue provided
  • Test export/import flow:
    • Exported detection rule(s) from Kibana to showcase the feature(s)
    • Converted the exported ndjson file(s) to toml in the detection-rules repo
    • Re-exported the toml rule(s) to ndjson and re-imported into Kibana
  • Updated necessary unit tests to accommodate the feature
  • Incorporated a comprehensive test rule in unit tests for full schema coverage
  • Applied min_compat restrictions to limit the feature to a specified minimum stack version
  • Executed all unit tests locally with a test toml rule to confirm passing
  • Included Kibana PR implementer as an optional reviewer for insights on the feature
  • Implemented requisite downgrade functionality
  • Cross-referenced the feature with product documentation for consistency
  • Confirm that the proper version label is applied to the PR patch, minor, major.

@tradebot-elastic
Copy link

tradebot-elastic commented Jul 11, 2025

⛔️ Test failed

Results
  • ❌ Google SecOps External Alerts (kuery)
    • coverage_issue: no_rta
    • stack_validation_failed: no_rta
  • ❌ Elastic Security External Alerts (kuery)
    • coverage_issue: no_rta
    • stack_validation_failed: no_rta
  • ❌ Microsoft Sentinel External Alerts (kuery)
    • coverage_issue: no_rta
    • stack_validation_failed: no_rta
  • ❌ SentinelOne External Alerts (kuery)
    • coverage_issue: no_rta
    • stack_validation_failed: no_rta
  • ❌ CrowdStrike External Alerts (kuery)
    • coverage_issue: no_rta
    • stack_validation_failed: no_rta
  • ❌ Splunk External Alerts (kuery)
    • coverage_issue: no_rta
    • stack_validation_failed: no_rta

Copy link

@approksiu approksiu left a comment

Choose a reason for hiding this comment

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

LGTM, If we use tag "Promotion: External Alerts" tag, let's also update the "External Alerts" rule tag.

@tradebot-elastic
Copy link

tradebot-elastic commented Jul 22, 2025

⛔️ Test failed

Results
  • ❌ Google SecOps External Alerts (kuery)
    • coverage_issue: no_rta
    • stack_validation_failed: no_rta
  • ❌ Elastic Security External Alerts (kuery)
    • coverage_issue: no_rta
    • stack_validation_failed: no_rta
  • ❌ Microsoft Sentinel External Alerts (kuery)
    • coverage_issue: no_rta
    • stack_validation_failed: no_rta
  • ❌ SentinelOne External Alerts (kuery)
    • coverage_issue: no_rta
    • stack_validation_failed: no_rta
  • ❌ CrowdStrike External Alerts (kuery)
    • coverage_issue: no_rta
    • stack_validation_failed: no_rta
  • ❌ Splunk External Alerts (kuery)
    • coverage_issue: no_rta
    • stack_validation_failed: no_rta

@Mikaayenson
Copy link
Contributor Author

LGTM, If we use tag "Promotion: External Alerts" tag, let's also update the "External Alerts" rule tag.

@peluja1012 will this cause confusion upstream?

@peluja1012
Copy link

LGTM, If we use tag "Promotion: External Alerts" tag, let's also update the "External Alerts" rule tag.

@peluja1012 will this cause confusion upstream?

Hey @Mikaayenson, which rules have the "External alerts" tag currently? We wouldn't want AI4DSOC users to have promotion rule automatically installed that are not relevant for the AI4DSOC use case. Looking at the code, it looks like we are checking for both the presence of the tag AND for a related_integration reference before we automatically install the rule. So if a customer has the Crowdstrike integration installed in AI4DSOC, for example, and there is more than one rule with the tag "Promotion: External alerts" that references the Crowdstrike integration via the related_integrations field, then we would automatically install all of those rules. This would not be ideal.

@Mikaayenson
Copy link
Contributor Author

LGTM, If we use tag "Promotion: External Alerts" tag, let's also update the "External Alerts" rule tag.

@peluja1012 will this cause confusion upstream?

Hey @Mikaayenson, which rules have the "External alerts" tag currently? We wouldn't want AI4DSOC users to have promotion rule automatically installed that are not relevant for the AI4DSOC use case. Looking at the code, it looks like we are checking for both the presence of the tag AND for a related_integration reference before we automatically install the rule. So if a customer has the Crowdstrike integration installed in AI4DSOC, for example, and there is more than one rule with the tag "Promotion: External alerts" that references the Crowdstrike integration via the related_integrations field, then we would automatically install all of those rules. This would not be ideal.

Based on our discussion, if we accidentally add the tag to another rule that meets similar criteria it will cause issues with the AI4DSOC, so we will not add the tag to other rules. cc. @approksiu

@botelastic botelastic bot added the schema label Jul 25, 2025
@tradebot-elastic
Copy link

tradebot-elastic commented Jul 25, 2025

⛔️ Test failed

Results
  • ❌ Google SecOps External Alerts (kuery)
    • coverage_issue: no_rta
    • stack_validation_failed: no_rta
  • ❌ Elastic Security External Alerts (kuery)
    • coverage_issue: no_rta
    • stack_validation_failed: no_rta
  • ❌ Microsoft Sentinel External Alerts (kuery)
    • coverage_issue: no_rta
    • stack_validation_failed: no_rta
  • ❌ SentinelOne External Alerts (kuery)
    • coverage_issue: no_rta
    • stack_validation_failed: no_rta
  • ❌ CrowdStrike External Alerts (kuery)
    • coverage_issue: no_rta
    • stack_validation_failed: no_rta
  • ❌ Splunk External Alerts (kuery)
    • coverage_issue: no_rta
    • stack_validation_failed: no_rta

@tradebot-elastic
Copy link

tradebot-elastic commented Jul 25, 2025

⛔️ Test failed

Results
  • ❌ Google SecOps External Alerts (kuery)
    • coverage_issue: no_rta
    • stack_validation_failed: no_rta
  • ❌ Elastic Security External Alerts (kuery)
    • coverage_issue: no_rta
    • stack_validation_failed: no_rta
  • ❌ Microsoft Sentinel External Alerts (kuery)
    • coverage_issue: no_rta
    • stack_validation_failed: no_rta
  • ❌ SentinelOne External Alerts (kuery)
    • coverage_issue: no_rta
    • stack_validation_failed: no_rta
  • ❌ CrowdStrike External Alerts (kuery)
    • coverage_issue: no_rta
    • stack_validation_failed: no_rta
  • ❌ Splunk External Alerts (kuery)
    • coverage_issue: no_rta
    • stack_validation_failed: no_rta

@tradebot-elastic
Copy link

tradebot-elastic commented Jul 25, 2025

⛔️ Test failed

Results
  • ❌ Google SecOps External Alerts (kuery)
    • coverage_issue: no_rta
    • stack_validation_failed: no_rta
  • ❌ Elastic Security External Alerts (kuery)
    • coverage_issue: no_rta
    • stack_validation_failed: no_rta
  • ❌ Microsoft Sentinel External Alerts (kuery)
    • coverage_issue: no_rta
    • stack_validation_failed: no_rta
  • ❌ SentinelOne External Alerts (kuery)
    • coverage_issue: no_rta
    • stack_validation_failed: no_rta
  • ❌ CrowdStrike External Alerts (kuery)
    • coverage_issue: no_rta
    • stack_validation_failed: no_rta
  • ❌ Splunk External Alerts (kuery)
    • coverage_issue: no_rta
    • stack_validation_failed: no_rta

@tradebot-elastic
Copy link

tradebot-elastic commented Jul 25, 2025

⛔️ Test failed

Results
  • ❌ Google SecOps External Alerts (kuery)
    • coverage_issue: no_rta
    • stack_validation_failed: no_rta
  • ❌ Elastic Security External Alerts (kuery)
    • coverage_issue: no_rta
    • stack_validation_failed: no_rta
  • ❌ Microsoft Sentinel External Alerts (kuery)
    • coverage_issue: no_rta
    • stack_validation_failed: no_rta
  • ❌ SentinelOne External Alerts (kuery)
    • coverage_issue: no_rta
    • stack_validation_failed: no_rta
  • ❌ CrowdStrike External Alerts (kuery)
    • coverage_issue: no_rta
    • stack_validation_failed: no_rta
  • ❌ Splunk External Alerts (kuery)
    • coverage_issue: no_rta
    • stack_validation_failed: no_rta

@tradebot-elastic
Copy link

tradebot-elastic commented Jul 25, 2025

⛔️ Test failed

Results
  • ❌ Google SecOps External Alerts (kuery)
    • coverage_issue: no_rta
    • stack_validation_failed: no_rta
  • ❌ Elastic Security External Alerts (kuery)
    • coverage_issue: no_rta
    • stack_validation_failed: no_rta
  • ❌ Microsoft Sentinel External Alerts (kuery)
    • coverage_issue: no_rta
    • stack_validation_failed: no_rta
  • ❌ SentinelOne External Alerts (kuery)
    • coverage_issue: no_rta
    • stack_validation_failed: no_rta
  • ❌ CrowdStrike External Alerts (kuery)
    • coverage_issue: no_rta
    • stack_validation_failed: no_rta
  • ❌ Splunk External Alerts (kuery)
    • coverage_issue: no_rta
    • stack_validation_failed: no_rta

@tradebot-elastic
Copy link

tradebot-elastic commented Jul 25, 2025

⛔️ Test failed

Results
  • ❌ Google SecOps External Alerts (kuery)
    • coverage_issue: no_rta
    • stack_validation_failed: no_rta
  • ❌ Elastic Security External Alerts (kuery)
    • coverage_issue: no_rta
    • stack_validation_failed: no_rta
  • ❌ Microsoft Sentinel External Alerts (kuery)
    • coverage_issue: no_rta
    • stack_validation_failed: no_rta
  • ❌ SentinelOne External Alerts (kuery)
    • coverage_issue: no_rta
    • stack_validation_failed: no_rta
  • ❌ CrowdStrike External Alerts (kuery)
    • coverage_issue: no_rta
    • stack_validation_failed: no_rta
  • ❌ Splunk External Alerts (kuery)
    • coverage_issue: no_rta
    • stack_validation_failed: no_rta

promotion = true
min_stack_version = "8.18.0"
min_stack_comments = "Introduced support for SentinelOne alert promotion"
updated_date = "2025/08/05"
Copy link
Contributor

Choose a reason for hiding this comment

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

Should these updated dates be in the future? It seems like this is incorrect unless I am missing something.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

place holder until we're ready to merge

Copy link
Contributor

@Aegrah Aegrah left a comment

Choose a reason for hiding this comment

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

LGTM!

interval = "1m"
language = "kuery"
license = "Elastic License v2"
max_signals = 1000
Copy link
Contributor

Choose a reason for hiding this comment

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

Any specific reason we set this to 1000?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

consistency with #4556

field = "event.severity"
operator = "equals"
severity = "low"
value = "1"
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these mappings of 1, 2 and 3 a sentinal_one thing?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

@eric-forte-elastic eric-forte-elastic left a comment

Choose a reason for hiding this comment

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

Once placeholder dates are updated this looks good to merge (ref). Data checks look good too 👍

@Mikaayenson
Copy link
Contributor Author

Just waiting to test the remaining rules and then we can merge.

@tradebot-elastic
Copy link

tradebot-elastic commented Jul 28, 2025

⛔️ Test failed

Results
  • ❌ Google SecOps External Alerts (kuery)
    • coverage_issue: no_rta
    • stack_validation_failed: no_rta
  • ❌ Elastic Security External Alerts (kuery)
    • coverage_issue: no_rta
    • stack_validation_failed: no_rta
  • ❌ Microsoft Sentinel External Alerts (kuery)
    • coverage_issue: no_rta
    • stack_validation_failed: no_rta
  • ❌ SentinelOne External Alerts (kuery)
    • coverage_issue: no_rta
    • stack_validation_failed: no_rta
  • ❌ CrowdStrike External Alerts (kuery)
    • coverage_issue: no_rta
    • stack_validation_failed: no_rta
  • ❌ Splunk External Alerts (kuery)
    • coverage_issue: no_rta
    • stack_validation_failed: no_rta

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport: auto patch python Internal python for the repository Rule: New Proposal for new rule schema
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FR] Update schema validation to use data_stream.dataset
10 participants