Skip to content
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

[Alert Summaries] Add summary capabilities to the API and execution logic #143376

Closed
Tracked by #143200
ersin-erdal opened this issue Oct 14, 2022 · 13 comments · Fixed by #147360
Closed
Tracked by #143200

[Alert Summaries] Add summary capabilities to the API and execution logic #143376

ersin-erdal opened this issue Oct 14, 2022 · 13 comments · Fixed by #147360
Assignees
Labels
Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams)

Comments

@ersin-erdal
Copy link
Contributor

ersin-erdal commented Oct 14, 2022

Meta: #143200

Blocked by: #143374 and #143368

The rule API and Task Runner should be modified to provide the new Alert Summaries options and functionality.

If an action is a Summary of alerts per rule run, alerts of the current execution context should be injected in to the action context.

If an action is a Summary of alerts on a custom interval and the action is still throttled the action should be skipped.
If not, alerts that are generated within the given time span, should be injected in to the action context. Alerts should be fetched using the developed provider in #143374.

This issue relates to the following functional specifications (#143200): 1, 3, 4, 5, 6, 7.
This issue relates to the following non-functional specifications (#143200): 1.

@mikecote
Copy link
Contributor

Part of this issue, we should also add the new Alert Summaries options.

@mikecote
Copy link
Contributor

mikecote commented Oct 17, 2022

Blocked by #143368 and #143374.

@mikecote mikecote moved this from Awaiting Triage to Todo in AppEx: ResponseOps - Execution & Connectors Oct 17, 2022
@mikecote
Copy link
Contributor

Merging #143380 into this issue.

[Alert Summaries] Build mustache variables differently for summary actions #143380

@mikecote mikecote moved this from Todo to Blocked / On hold in AppEx: ResponseOps - Execution & Connectors Oct 17, 2022
@mikecote mikecote changed the title [Alert Summaries] Change the execution logic to work with the new options [Alert Summaries] Add summary capabilities to the API and execution logic Oct 19, 2022
@mikecote
Copy link
Contributor

@ymao1 @kobelb

With the upcoming alert summary feature, we will soon provide users access to the full AAD document. This allows users to build mustache templates on any field.

It isn’t too late if we want to limit / filter out fields that would be accessible in rule actions. The current plan is to provide access to everything (including kibana.* fields), should we change that?

@kobelb
Copy link
Contributor

kobelb commented Oct 20, 2022

It isn’t too late if we want to limit / filter out fields that would be accessible in rule actions. The current plan is to provide access to everything (including kibana.* fields), should we change that?

Would we be exposing all fields from the existing AAD documents, or only the fields in the forthcoming FAAD schema?

@mikecote
Copy link
Contributor

Would we be exposing all fields from the existing AAD documents, or only the fields in the forthcoming FAAD schema?

In the initial phase, it's hooked up to the rule registry, so all the existing AAD fields / documents.

@mikecote
Copy link
Contributor

mikecote commented Oct 20, 2022

We could look into limiting existing AAD documents to only FAAD fields, if we have finalized/limited the list.

@kobelb
Copy link
Contributor

kobelb commented Oct 20, 2022

Thanks for the clarification, @mikecote. The safest option is to hold off on exposing the kibana.alert.* fields and wait on the forthcoming FAAD schema. Otherwise, we run the risk of users starting to consume fields that we will end up removing. Do you see this being a problem?

@mikecote
Copy link
Contributor

mikecote commented Oct 20, 2022

Thanks for the clarification, @mikecote. The safest option is to hold off on exposing the kibana.alert.* fields and wait on the forthcoming FAAD schema. Otherwise, we run the risk of users starting to consume fields that we will end up removing. Do you see this being a problem?

Shouldn't be a problem from my perspective, it's easier to add later than to remove, so lets filter them out at first.

We will have to migrate the security solution to this feature at a later time, we can see if we need special handing for them, while keeping the fields out elsewhere.

@mikecote
Copy link
Contributor

It might be that we'll need to expose some of the information about the alert if users want to iterate through them and provide a brief description of the alert 🤔 (ex: alert id) but maybe ECS has enough information for those use cases?

@kobelb
Copy link
Contributor

kobelb commented Oct 20, 2022

It might be that we'll need to expose some of the information about the alert if users want to iterate through them and provide a brief description of the alert 🤔 (ex: alert id) but maybe ECS has enough information for those use cases?

I don't think ECS will have enough information. If we know we need certain fields exposed and we're fairly confident that they'll be in the FAAD schema, we can allowlist specific fields.

@mikecote
Copy link
Contributor

I don't think ECS will have enough information. If we know we need certain fields exposed and we're fairly confident that they'll be in the FAAD schema, we can allowlist specific fields.

Sounds good, we will do an exercise to allow list specific kibana.* fields and get feedback. I will create an explicit issue to limit the fields for summaries.

@mikecote
Copy link
Contributor

Removing blocked label as #144130 is now merged.

Repository owner moved this from In Review to Done in AppEx: ResponseOps - Execution & Connectors Dec 15, 2022
ersin-erdal added a commit that referenced this issue Dec 15, 2022
Resolves: #143376

This PR adds the alerts summary capability to the rule execution.
If an action is a summary action and not throttled (Summary of alerts on
a custom interval) alerts summary is fetched from the AAD index and
injected into the action message variables.
Zacqary added a commit that referenced this issue Jan 10, 2023
…ction (#145637)

## Summary

Closes #143369 (~blocked by
#143376)

This PR updates the Stack Management UI and Observability UI to show
Notify When and Throttle parameters at the **action level** instead of
the **rule level**.

The rule-level Check Every dropdown is moved to the end of the rule,
right above the actions form

The Security Solution UX remains unchanged, as it has a unique way of
displaying action notification frequencies at the rule level. Instead,
the API request has changed so that the selected action frequency will
now be stored in each action's `frequency` param instead of at the rule
level.

In all three UIs, existing rules that have legacy rule-level
`notifyWhen` and `frequency` params will have these parameters
seamlessly migrated to the action level when the user edits a rule.

The Rule Details page is also updated to show Notify frequencies in the
Actions column instead of in the first, rule-level column.

### Rule Details Page update
<img width="781" alt="Screen Shot 2022-11-17 at 4 23 02 PM"
src="https://user-images.githubusercontent.com/1445834/202573067-bc55630d-f767-4a93-8d7c-752748da25c2.png">

### Rule Form update
<img width="605" alt="Screen Shot 2022-11-17 at 4 23 10 PM"
src="https://user-images.githubusercontent.com/1445834/202573057-5d50e573-1453-4b63-8e1e-6505fa0261c6.png">
<img width="605" alt="Screen Shot 2022-12-27 at 1 18 12 PM"
src="https://user-images.githubusercontent.com/1445834/209712784-34c2384b-bcc8-4db9-a42d-052d81099a40.png">

### Checklist

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Xavier Mouligneau <xavier.mouligneau@elastic.co>
jennypavlova pushed a commit to jennypavlova/kibana that referenced this issue Jan 13, 2023
…ction (elastic#145637)

## Summary

Closes elastic#143369 (~blocked by
elastic#143376)

This PR updates the Stack Management UI and Observability UI to show
Notify When and Throttle parameters at the **action level** instead of
the **rule level**.

The rule-level Check Every dropdown is moved to the end of the rule,
right above the actions form

The Security Solution UX remains unchanged, as it has a unique way of
displaying action notification frequencies at the rule level. Instead,
the API request has changed so that the selected action frequency will
now be stored in each action's `frequency` param instead of at the rule
level.

In all three UIs, existing rules that have legacy rule-level
`notifyWhen` and `frequency` params will have these parameters
seamlessly migrated to the action level when the user edits a rule.

The Rule Details page is also updated to show Notify frequencies in the
Actions column instead of in the first, rule-level column.

### Rule Details Page update
<img width="781" alt="Screen Shot 2022-11-17 at 4 23 02 PM"
src="https://user-images.githubusercontent.com/1445834/202573067-bc55630d-f767-4a93-8d7c-752748da25c2.png">

### Rule Form update
<img width="605" alt="Screen Shot 2022-11-17 at 4 23 10 PM"
src="https://user-images.githubusercontent.com/1445834/202573057-5d50e573-1453-4b63-8e1e-6505fa0261c6.png">
<img width="605" alt="Screen Shot 2022-12-27 at 1 18 12 PM"
src="https://user-images.githubusercontent.com/1445834/209712784-34c2384b-bcc8-4db9-a42d-052d81099a40.png">

### Checklist

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Xavier Mouligneau <xavier.mouligneau@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams)
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

3 participants