[RAC][Rule Registry] Make endpoints for updating alerts consistent #111162
Labels
Team:Detection Alerts
Security Detection Alerts Area Team
Team:Detections and Resp
Security Detection Response Team
Team: SecuritySolution
Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc.
Theme: rac
label obsolete
Parent ticket: #101016
Summary
The single update API endpoint (
x-pack/plugins/rule_registry/server/routes/update_alert_by_id.ts
) accepts a singleindex
parameter which must be the concrete index name of the alert document being updated. The call might fail in certain cases if the corresponding alias is specified.The bulk update API endpoint (
x-pack/plugins/rule_registry/server/routes/bulk_update_alerts.ts
) accepts a singleindex
parameter and an array of alert ids. This is not convenient if you have a list of alerts stored in different concrete indices, and you want to specify the concrete indices and the ids when calling this endpoint. This can be properly implemented on the client side, by it will lead to a few calls instead of 1.Possible solutions
Ideal solution would be:
esClient.updateByQuery
like here. The rest of the logic should also work well with aliases.index
parameter.Another solution could be:
Also, if the ideal solution is possible, we could evaluate the possibility of (and need for) providing a registration context (
observability.logs
,security
) instead of the corresponding full alias (.alerts-observability.logs.alerts
,.alerts-security.alerts
). RuleDataService exposes a method that could be used to find the alias:The text was updated successfully, but these errors were encountered: