[Response Ops][Alerting] Implement alert deletion task #208615
Labels
Feature:Alerting
Team:ResponseOps
Label for the ResponseOps team (formerly the Cases and Alerting teams)
We would like to allow users the ability to delete their alerts based on certain configuration conditions. To do this, we would like to create a new task type that is scheduled ad-hoc using an HTTP API. This ability will be controlled by a new rules settings subfeature privilege.
This issue covers the task-related changes required for the alert deletion MVP
Rules settings
We should add a new sub-feature privilege to the rules settings feature privilege to control access to the alert deletion strategy:
When users have
all
access to this setting, they will be able to:When users have
read
access to this setting, they will be able to:The setting should encompass the following configurations:
Task
We should create a new task type that can be scheduled ad-hoc. When it runs, the task will query for all alert deletion rules settings (there are potentially one per space) and build ES requests necessary to fulfill the deletion.
Active alert was created more than N days ago
If this condition is configured, the task will delete alerts in the specified space that match the query:
(event.kind: "open" OR event.kind: "active") AND kibana.alert.start < now - N days AND NOT kibana.alert.end:*.
Inactive alert was recovered, closed or untracked more than N days ago
If this condition is enabled, the task will delete alerts in the specified space that match the query
(event.kind: "close" AND @timestamp < now - N days) OR (kibana.alert.workflow_status:"closed" AND kibana.alert.workflow_status_updated_at < now - N days) OR (kibana.alert.status:"untracked" AND kibana.alert.end < now - N days)
Because ad-hoc tasks are deleted after they run and do not persist state, we should write an event log entry to save the time the task was run, the number of alerts deleted and the success or failure of the run.
Definition of done
The text was updated successfully, but these errors were encountered: