fix: Change bulk rule actions by updating deprecated rule_ids to ids#5711
fix: Change bulk rule actions by updating deprecated rule_ids to ids#5711IOITI wants to merge 2 commits intoelastic:mainfrom
rule_ids to ids#5711Conversation
Kibana’s bulk action API for detection rules has changed: the `rule_ids` field is no longer valid and has been replaced by `ids`. Without this update, any bulk action request using rule IDs is interpreted as targeting *all* rules, which can unintentionally delete or disable the entire rule set instead of just the intended subset. This update ensures bulk actions correctly apply only to the specified rule IDs.
|
I expect there will need to be more updates that just what is currently in the PR. We may also need to change the ndjson payload handling as well 🤔 |
|
Just for reference for reviewers, this is an update request for the This function is not used in any DaC workflows, etc. that path has already been updated to the rule_ids route. The primary consideration for this PR is whether we should keep unused commands up to date or remove them. DaC path uses (ref) |
|
@eric-forte-elastic As community testimony, we use many of theses class methods inside our internal MSSP DaC tool. graph LR
user@{ label: "👨💻 SOC Analyst", shape: stadium}
cicd@{ label: "⚙️ CI/CD", shape: stadium }
user -. "interacts with frequently" ..-> UI
subgraph "MSSP DaC System"
UI["UI<br/>(React + Elastic UI)"]
API["API<br/>(FastAPI)"]
CLI["CLI<br/>(Python Click / library)"]
end
cicd -. "interacts for validation and deployment" .-> CLI
subgraph "Elastic library"
DR["detection-rules<br/>(Python library)"]
end
user -. "interacts with to export rules from Kibana" .-> DR
UI -- "/api/*" --> API
API <-- "reads / writes" --> REPO["Git Repository<br/>rules · customers_dac · custom_rules"]
CLI <-- "reads / writes" --> REPO
CLI -- "ask validation / upload / import ..." --> DR
DR -- "reads / writes" --> REPO
API -- "delegates" --> CLI
DR -- "Kibana REST" --> KIBANA["Kibana"]
(the tool will be presented in demo to @approksiu on 03/26/2026, if you're interested) And we done the cleaning of Kibana by this call to method: RuleResource.bulk_delete(rule_ids=kibana_ids_to_delete)For us, it's very usefull to have this code part maintened by your team, it's litteraly a "trust the editor". Maybe kibana will have an official python library in the future ? |
|
Thanks for the detailed diagram @IOITI ! If it is used by the community (clearly based on your input it is), then I absolutely agree we should maintain these. Will review/approve this shortly and create a broader issue to track making other updates as needed to these functions (I think there are a few other things we may want to do as well). |
Pull Request
Issue link(s): N/A
Summary - What I changed
Kibana’s bulk action API for detection rules has changed: the
rule_idsfield is no longer valid and has been replaced byids.Without this update, any bulk action request using rule IDs is interpreted as targeting all rules, which can unintentionally delete or disable the entire rule set instead of just the intended subset.
This update ensures bulk actions correctly apply only to the specified rule IDs.
How To Test
Checklist
Contributor checklist