-
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
[Actions] System actions MVP #166267
[Actions] System actions MVP #166267
Conversation
Co-authored-by: Kibana Machine <[email protected]>
…ystem_actions_mvp
In this PR: - Creation of types for the system actions - Creation of a helper function to detect if it is a system action or not - Use the `isSystemAction` in the executor to determine if an action is a system action - Pass the `isSystemConnector` utility function from the actions plugin to the rules factory - Create test utils to help test system actions and connector adapters ### Checklist Delete any items that are not applicable to this PR. - [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 ### For maintainers - [x] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
…#167884) ## Summary This PR enables system actions only to the Create Rule API. Other PRs will follow on a subsequent PR. Depends on: #167871 ### Checklist Delete any items that are not applicable to this PR. - [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 ### For maintainers - [x] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) --------- Co-authored-by: kibanamachine <[email protected]> Co-authored-by: Julia <[email protected]>
…ystem_actions_mvp
…API (#168226) Summarize your PR. If it involves visual changes include a screenshot or gif. Depends on: #167871, #167884 ### Checklist Delete any items that are not applicable to this PR. - [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 ### For maintainers - [x] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) --------- Co-authored-by: kibanamachine <[email protected]> Co-authored-by: Julia Guskova <[email protected]>
…ystem_actions_mvp
Fix: #170097 Meta: #160367 ## Summary This PR enables system actions for the Bulk Disable Rule API. ### Checklist - [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
Fix: #170097 Meta: #160367 ## Summary This PR enables system actions for the Bulk Enable Rule API. ### Checklist - [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 <[email protected]>
…ystem_actions_mvp
…ystem_actions_mvp
@elasticmachine merge upstream |
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! Great job! Left some minor comments in the functional tests.
x-pack/test/alerting_api_integration/security_and_spaces/group1/tests/alerting/find.ts
Outdated
Show resolved
Hide resolved
x-pack/test/alerting_api_integration/security_and_spaces/group1/tests/alerting/get.ts
Outdated
Show resolved
Hide resolved
x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/get_all_system.ts
Show resolved
Hide resolved
x-pack/test/alerting_api_integration/security_and_spaces/group3/tests/alerting/bulk_delete.ts
Outdated
Show resolved
Hide resolved
x-pack/test/alerting_api_integration/security_and_spaces/group3/tests/alerting/bulk_disable.ts
Outdated
Show resolved
Hide resolved
x-pack/test/alerting_api_integration/security_and_spaces/group3/tests/alerting/bulk_enable.ts
Outdated
Show resolved
Hide resolved
x-pack/test/alerting_api_integration/security_and_spaces/group3/tests/alerting/clone.ts
Outdated
Show resolved
Hide resolved
x-pack/test/alerting_api_integration/security_and_spaces/group3/tests/alerting/resolve.ts
Outdated
Show resolved
Hide resolved
x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group1/create.ts
Outdated
Show resolved
Hide resolved
...lugins/triggers_actions_ui/public/application/sections/action_connector_form/action_form.tsx
Show resolved
Hide resolved
...lugins/triggers_actions_ui/public/application/sections/action_connector_form/action_form.tsx
Show resolved
Hide resolved
...lugins/triggers_actions_ui/public/application/sections/action_connector_form/action_form.tsx
Outdated
Show resolved
Hide resolved
...ers_actions_ui/public/application/sections/action_connector_form/system_action_type_form.tsx
Show resolved
Hide resolved
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.
💚 Build Succeeded
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
Public APIs missing exports
Page load bundle
Unknown metric groupsAPI count
ESLint disabled line counts
References to deprecated APIs
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: cc @cnasikas |
## Summary Now that the system actions PR is merged (#166267) we can use the connector adapters to transform the case action params. This PR: - Registers a connector adapter for the case action. - Uses flattened objects in the description and the tags. - Change the integration tests to use an internal router to execute system actions. PR #166267 disabled execution of system actions through the public execute API. - Skip execution of the case action if the grouping did not produce any alerts. - Add references to the cases oracle saved objects. - Remove the owner from the UI and deduct the owner from the rule's consumer in the connector adapter. ### Checklist Delete any items that are not applicable to this PR. - [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 ### For maintainers - [x] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
## Summary Depends on: #166267, #170326, #169484, #173740, #173763, #178068, #178307, #178600, #180437 PRs: - #168370 - #169229 - #171754 - #172709 - #173012 - #175107 - #175452 - #175505 - #177033 - #178277 - #177139 - #179796 Fixes: #153837 ## Testing Run Kibana with `--run-examples` if you want to use the "Always firing" rule. Create a rule with a case action in observability and the stack. The security solution is not supported. You should not be able to assign a case action in a security solution rule. 1. Test the "Reopen closed cases" configuration. 2. Test the "Grouping by" configuration. Only one field is allowed. Not all fields are persisted in alerts. If you select a field not part of the alert the case action will create a case where the grouping value is set to `unknow`. 3. Test the "Time window" feature. You can comment out the validation to test for shorter times. 4. Verify that the case action is experimental. 5. Verify that based on the rule type the case is created in the correct solution. 6. Verify that you cannot create a rule with the case action on the basic license. 7. Verify that the execution of the case action fails if you do not have permission for cases. Pending work on the system actions framework level to not allow users to create rules with system actions where they do not have permission. 8. Stress test the case action by creating multiple rules. ### Checklist Delete any items that are not applicable to this PR. - [x] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [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 ### For maintainers - [x] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) ## Release notes Automatically create cases when an alert is triggered. --------- Co-authored-by: kibanamachine <[email protected]> Co-authored-by: adcoelho <[email protected]> Co-authored-by: Janki Salvi <[email protected]>
Summary
A system action is an action that triggers Kibana workflows—for example, creating a case, running an OsQuery, running an ML job, or logging. In this PR:
notifyWhen
orgroup
.systemActions
. The methods merge the actions with the system actions before persisting the rule to ES. The methods split the actions from the system actions and return two arrays,actions
andsystemActions
.Closes #160367
This PR merges the system actions framework, a culmination of several issues merged to the
system_actions_mvp
feature branch over the past several months.Testing
A system action with ID
system-connector-.system-log-example
will be available to be used by the APIs and the UI if you start Kibana with--run-examples
. Please ensure the following:Checklist