Skip to content

[8.19] [Response Ops][Rule Management] Update RulesClient methods to migrate legacy SIEM actions in bulk (#219432) #224114

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

Merged
merged 1 commit into from
Jun 16, 2025

Conversation

kibanamachine
Copy link
Contributor

Backport

This will backport the following commits from main to 8.19:

Questions ?

Please refer to the Backport tool documentation

… legacy SIEM actions in bulk (elastic#219432)

## Summary
Legacy actions context: elastic#112327

This PR modifies legacy SIEM action migration logic to migrate actions
in bulk, significantly improving performance. Response time and # of
requests to ES for SIEM rule management HTTP APIs are both significantly
reduced. When tested on 800 rules, this saves about 1-1.5 seconds per
bulk API call and eliminates hundreds of individual requests to
Elasticsearch. Bulk disable for example goes from taking ~3.3 seconds to
~2.3 seconds, and the APM transaction for the API call no longer drops
spans due to hitting the max span limit.

## Testing
I added a helper function in the quickstart tooling,
`createRuleWithLegacyAction`, to make it easier to get started with
manual testing. The function creates a connector, a rule, and then a
legacy action referencing the connector and the rule. The legacy action
(a `siem.notification` type rule) and rule can be viewed in the alerting
SO index via dev tools:
```
GET .kibana_alerting_cases/_search
{
  "query": {
    "bool": {
      "filter": {
        "term": {
          "type": "alert"
        }
      }
    }
  }
}
```
Viewing the rule details via the Security Solution UI should display
only one rule with the action as part of the rule. After making any kind
of change to the rule (enable, disable, update, etc), the dev tools
command above should show only a single rule with the action inside the
rule instead of as a separate `siem.notification` type rule.

---------

Co-authored-by: Maxim Palenov <maxim.palenov@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 5ce96f4)
@kibanamachine kibanamachine merged commit 8b60489 into elastic:8.19 Jun 16, 2025
11 checks passed
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Unknown metric groups

References to deprecated APIs

id before after diff
alerting 86 61 -25

cc @marshallmain

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