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

[Actions] Set system actions on Kibana start #160983

Merged
merged 34 commits into from
Jul 7, 2023

Conversation

cnasikas
Copy link
Member

@cnasikas cnasikas commented Jun 30, 2023

Summary

This PR:

  • Adds the ability to create system action types
  • Creates system connectors on Kibana start from the system action types
  • Prevents system action to be created/updated/deleted
  • Return system actions from the get/getAll endpoints

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@cnasikas cnasikas added release_note:skip Skip the PR/issue when compiling release notes Feature:Actions Feature:Actions/Framework Issues related to the Actions Framework v8.10.0 labels Jun 30, 2023
@cnasikas cnasikas requested review from a team as code owners July 3, 2023 11:02
@cnasikas cnasikas requested a review from pmuellr July 3, 2023 11:03
@cnasikas cnasikas mentioned this pull request Jul 3, 2023
15 tasks
@@ -85,13 +85,15 @@ export const fetchActionTypes = async (): Promise<ActionType[]> => {
enabled_in_license: enabledInLicense,
minimum_license_required: minimumLicenseRequired,
supported_feature_ids: supportedFeatureIds,
is_system_action_type: isSystemActionType,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@botelastic botelastic bot added the Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability label Jul 3, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/uptime (Team:uptime)

Copy link
Contributor

@stephmilovic stephmilovic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Security Assistant changes LGTM, thank you!

@cnasikas cnasikas added the Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) label Jul 6, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops (Team:ResponseOps)

Copy link
Member

@pmuellr pmuellr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, some nits with messages and some questions, no blockers

);
});

it('throws when creating a system connector where the action type is not registered but a system connector exists in the in-memory list', async () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How could this happen? Doesn't seem like it matters that there's an existing inMemoryConnector of this type, which presumably would have had to been registered before hand.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it is impossible for this to happen. I added it in case we introduce a bug in the future and somehow becomes possible. Extreme scenario though 🙂.

x-pack/plugins/actions/server/actions_client.ts Outdated Show resolved Hide resolved
x-pack/plugins/actions/server/actions_client.ts Outdated Show resolved Hide resolved
source: asHttpRequestExecutionSource(request),
});

expect(mockedActionTypeRegistry.ensureActionTypeEnabled).not.toHaveBeenCalled();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm ... this feels like we're not allowing system actions to be deny-listed (by not including them in the allow-list). I guess I can see that, but ... not sure.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We discussed it offline and it seems there is a use-case scenario where you can disallow an action type but not a preconfigured connector. This does not apply to system actions. I will address it in another PR.

@cnasikas cnasikas enabled auto-merge (squash) July 7, 2023 15:01
@cnasikas cnasikas force-pushed the load_system_actions_in_memory branch from 018d83a to 03aab4a Compare July 7, 2023 16:24
@cnasikas cnasikas force-pushed the load_system_actions_in_memory branch from 03aab4a to abc6014 Compare July 7, 2023 16:26
@cnasikas cnasikas merged commit 67fc833 into elastic:main Jul 7, 2023
@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Rules, Alerts and Exceptions ResponseOps Cypress Tests on Security Solution #2 / Export rules shows a modal saying that no rules can be exported if all the selected rules are prebuilt

Metrics [docs]

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
actions 265 266 +1
triggersActionsUi 521 522 +1
total +2

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
securitySolution 11.0MB 11.0MB +176.0B
synthetics 907.1KB 907.2KB +45.0B
uptime 518.8KB 518.9KB +45.0B
total +266.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
triggersActionsUi 86.8KB 86.8KB +45.0B
Unknown metric groups

API count

id before after diff
actions 270 271 +1
triggersActionsUi 547 548 +1
total +2

ESLint disabled line counts

id before after diff
actions 20 21 +1
enterpriseSearch 14 16 +2
securitySolution 410 414 +4
total +7

Total ESLint disabled count

id before after diff
actions 22 23 +1
enterpriseSearch 15 17 +2
securitySolution 489 493 +4
total +7

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @cnasikas

@cnasikas cnasikas deleted the load_system_actions_in_memory branch July 7, 2023 17:39
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Jul 7, 2023
cnasikas added a commit that referenced this pull request Jul 20, 2023
## Summary

This PR adds the ability for system actions to be able to define their
own Kibana privileges that need to be authorized before execution.

Depends on: #160983

### 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: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
dgieselaar pushed a commit to dgieselaar/kibana that referenced this pull request Jul 23, 2023
## Summary

This PR adds the ability for system actions to be able to define their
own Kibana privileges that need to be authorized before execution.

Depends on: elastic#160983

### 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: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
cnasikas added a commit that referenced this pull request Jul 28, 2023
## Summary

This PR:
- Handles the references for system actions in the rule
- Forbids the creation of system actions through the `kibana.yml`
- Adds telemetry for system actions
- Allow system action types to be disabled from the `kibana.yml`

Depends on: #160983,
#161341

### 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: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
ThomThomson pushed a commit to ThomThomson/kibana that referenced this pull request Aug 1, 2023
## Summary

This PR adds the ability for system actions to be able to define their
own Kibana privileges that need to be authorized before execution.

Depends on: elastic#160983

### 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: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
ThomThomson pushed a commit to ThomThomson/kibana that referenced this pull request Aug 1, 2023
## Summary

This PR:
- Handles the references for system actions in the rule
- Forbids the creation of system actions through the `kibana.yml`
- Adds telemetry for system actions
- Allow system action types to be disabled from the `kibana.yml`

Depends on: elastic#160983,
elastic#161341

### 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: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting Feature:Actions/Framework Issues related to the Actions Framework Feature:Actions release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability v8.10.0
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

8 participants