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

[POC] Adopt System action in Osquery and Endpoint actions #175354

Draft
wants to merge 28 commits into
base: main
Choose a base branch
from

Conversation

patrykkopycinski
Copy link
Contributor

Based on #175057

cnasikas and others added 28 commits September 12, 2023 17:07
…ic#167783)

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
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)
…elastic#167884)

## Summary

This PR enables system actions only to the Create Rule API. Other PRs
will follow on a subsequent PR.

Depends on: elastic#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 <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Julia <iuliia.guskova@elastic.co>
…API (elastic#168226)

Summarize your PR. If it involves visual changes include a screenshot or
gif.

Depends on: elastic#167871,
elastic#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 <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Julia Guskova <iuliia.guskova@elastic.co>
Fix: elastic#170097
Meta: elastic#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: elastic#170097
Meta: elastic#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 <42973632+kibanamachine@users.noreply.github.com>
Fix: elastic#170392
Meta: elastic#160367


## Summary

This PR enables system actions for the Bulk Delete 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
## Summary

Summarize your PR. If it involves visual changes include a screenshot or
gif.


- [ ] [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>
# Conflicts:
#	x-pack/plugins/alerting/common/rule.ts
#	x-pack/plugins/alerting/server/application/rule/methods/bulk_edit/bulk_edit_rules.ts
#	x-pack/plugins/alerting/server/application/rule/methods/create/create_rule.ts
#	x-pack/plugins/alerting/server/application/rule/methods/create/schemas/create_rule_data_schema.ts
#	x-pack/plugins/alerting/server/application/rule/schemas/action_schemas.ts
#	x-pack/plugins/alerting/server/data/rule/types/rule_attributes.ts
#	x-pack/plugins/alerting/server/routes/rule/apis/create/transforms/transform_create_body/v1.ts
#	x-pack/plugins/alerting/server/routes/rule/transforms/transform_rule_to_rule_response/v1.ts
#	x-pack/plugins/alerting/server/task_runner/execution_handler.ts
#	x-pack/plugins/alerting/server/task_runner/task_runner.ts
…stem Actions (elastic#172937)

## Summary

Closes elastic#172168

This updates the legacy `rewriteActionsReq` and `rewriteRule` transforms
to be compatible with System Actions, and replaces all uses of legacy
`rewriteActionsRes` with `transformRuleActions`, which is already System
Actions-compliant.

Affected APIs are:

- `_clone`
- `_find`
- `_get`
- `_update`
Towards elastic/response-ops-team#164

Registering alerting example rules with framework AAD. This creates a
new alerts index `.alerts-default.alerts-default` that will eventually
hold alerts for all rules that have not customized their registration.
This index contains only the mappings for the basic alerts as data
documents, no custom context or payload fields.

Run kibana using `--run-examples` flag. Create one of the example rule
types and let it alert and then resolve and see an alert document get
created in the `.alerts-default.alerts-default` index.

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
@patrykkopycinski patrykkopycinski changed the title [POC] Adopt System action in Osquery and Endpoint actions @patrykkopycinski [POC] Adopt System action in Osquery and Endpoint actions Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants