-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Security Solution][Detections] Add alert source to detection rule action context #85488
[Security Solution][Detections] Add alert source to detection rule action context #85488
Conversation
@elasticmachine merge upstream |
jenkins test this |
@elasticmachine merge upstream |
Reviewed, pulled, and tested that notifications fire. Looks good! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…tion context (elastic#85488) * Adds context.alerts as available parameter for detection rule actions Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* master: (66 commits) [Alerting] fixes broken Alerting Example plugin (elastic#85774) [APM] Service overview instances table (elastic#85770) [Security Solution] Unskip timeline creation Cypress test (elastic#85871) properly recognize enterprise licenses (elastic#85849) [SecuritySolution][Detections] Adds SavedObject persistence to Signals Migrations (elastic#85690) [TSVB] Fix functional tests flakiness and unskip them (elastic#85388) [Fleet] Change permissions for Fleet enroll role (elastic#85802) Gauge visualization can no longer be clicked to filter on values since Kibana 7.10.0 (elastic#84768) [Security Solution][Detections] Add alert source to detection rule action context (elastic#85488) [Discover] Don't display hide/show button for histogram when there's no time filter (elastic#85424) skip flaky suite (elastic#78553) License checks for alerts plugin (elastic#85649) skip flaky suite (elastic#84992) skip 'query return results valid for scripted field' elastic#78553 Allow action types to perform their own mustache variable escaping in parameter templates (elastic#83919) [ML] More machine learning links in doc_links_service.ts (elastic#85365) Removed Alerting & Event Log deprecated fields that should not be using (elastic#85652) Closes elastic#79995 by adding new tab in transaction details to show related trace logs. (elastic#85859) Fix outdated jest snapshot [Maps] Surface on prem EMS (elastic#85729) ...
So this pull request going to give the ability to add following for context fields?
|
@austinsonger Yes, any fields in the document that are present will be able to be used as context for external actions. |
💔 Build Failed
Failed CI Steps
Test FailuresJest Integration Tests.src/core/server/ui_settings/integration_tests.uiSettings/routes doc exists get route returns a 200 and includes userValuesStandard Out
Stack Trace
Jest Integration Tests.src/core/server/ui_settings/integration_tests.uiSettings/routes doc exists set route returns a 200 and all values including updateStandard Out
Stack Trace
Jest Integration Tests.src/core/server/ui_settings/integration_tests.uiSettings/routes doc exists set route returns a 400 if trying to set overridden valueStandard Out
Stack Trace
and 4 more failures, only showing the first 3. Metrics [docs]Async chunks
Distributable file count
Page load bundle
History
To update your PR or re-run it, just comment with: |
Summary
This PR adds the source of the detection alert documents to the rule action context so notification actions can access fields within the detection alerts. The source alerts are available as an array through Mustache templating at
{{context.alerts}}
, e.g.{{context.alerts.0.process.name}}
would get the process.name field of the first alert.Docs update: Alert data is now available in detection rule actions at {{context.alerts}} as an array. This array contains each alert generated since the last time the action executed. Mustache templating can be used to iterate over all alerts in the array and capture information from each one. For example,
{{#context.alerts}}Detection alert for user: {{user.name}}{{/context.alerts}}
would create the stringDetection alert for user: <user.name>
for every alert in the array. Any alerts that don't haveuser.name
will still generate the string but leave<user.name>
blank.Test process:
http://localhost:<some port>
with no auth and no http header, ex/kibana/x-pack/plugins/security_solution/public/detections/components/rules/throttle_select_field/index.tsx
down to 5m or less so you don't have to wait an hour for the action to triggersudo nc -l 392
on ubuntu listens on port 392.Checklist
Delete any items that are not applicable to this PR.
For maintainers