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

[EDR Workflows] Workflow Insights - RBAC #205088

Merged
merged 13 commits into from
Jan 7, 2025

Conversation

szwarckonrad
Copy link
Contributor

@szwarckonrad szwarckonrad commented Dec 23, 2024

Access Control for Endpoint Workflow Insights

This PR adds access control to the Endpoint Workflow Insights functionality. Both the UI and API are gated based on the following conditions. If these conditions are not met, the content will not render, and direct API calls will return errors.

Access Conditions

1. Serverless: Requires the Endpoint Complete Tier.
2. ESS: Requires an Enterprise License.
3. User Privileges:
    3.1 Endpoint Insights Privilege must be enabled:
        3.1.1 Endpoint Insights All: Grants full access.
	3.1.2 Endpoint Insights Read:
	    3.1.2.1 Allows users to view generated insights but prevents triggering new scans.
	    3.1.2.2 With Trusted Applications privilege: Users can remediate already generated insights.
	    3.1.2.3 Without Trusted Applications privilege: No actions can be taken.
	3.1.3Endpoint Insights None: The section is not rendered.

Predefined serverless roles that should include endpoint insights privilege(as defined here):

  • Tier 3 analyst
  • Rule Author
  • SOC Manager
  • Endpoint Operations Analyst
  • Endpoint Policy Manager
  • Platform Engineer

Once this PR is merged and changes make it to canary release, this follow-up PR should be merged.

Note on Testing and Local Setup

To test these changes locally, the defendInsights assistant feature must be enabled. You can do this by updating the following line in the code: Enable defendInsights here.

Cypress Tests

Cypress tests in this PR are currently skipped because the defendInsights feature is not enabled by default. These tests should be enabled once the feature is turned on in the main branch. Successful run with all cypress tests enabled can be found here.

Screenshots

396870292-b5bbedad-330f-4ef5-8281-29699cf01a98
b
a
c
Screenshot 2024-12-23 at 13 32 57

@szwarckonrad szwarckonrad marked this pull request as ready for review December 23, 2024 17:37
@szwarckonrad szwarckonrad requested review from a team as code owners December 23, 2024 17:37
Copy link
Member

@jbudz jbudz left a comment

Choose a reason for hiding this comment

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

Changes to packages/kbn-es/src/serverless_resources/project_roles/security/roles.yml LGTM

@botelastic botelastic bot added the Team:Fleet Team label for Observability Data Collection Fleet team label Dec 23, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

Copy link
Contributor

@juliaElastic juliaElastic left a comment

Choose a reason for hiding this comment

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

Fleet change LGTM

@szwarckonrad szwarckonrad self-assigned this Dec 27, 2024
@szwarckonrad szwarckonrad added release_note:skip Skip the PR/issue when compiling release notes v9.0.0 Team:Defend Workflows “EDR Workflows” sub-team of Security Solution backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) v8.18.0 labels Dec 27, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-defend-workflows (Team:Defend Workflows)

@joeypoon joeypoon enabled auto-merge (squash) January 6, 2025 13:26
@joeypoon joeypoon merged commit 2f61892 into elastic:main Jan 7, 2025
8 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

https://github.com/elastic/kibana/actions/runs/12648868586

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

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

id before after diff
securitySolution 22.1MB 22.1MB +4.1KB

Page load bundle

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

id before after diff
fleet 170.9KB 171.2KB +242.0B
securitySolutionServerless 26.4KB 26.5KB +85.0B
total +327.0B

History

cc @szwarckonrad

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jan 7, 2025
## Access Control for Endpoint Workflow Insights

This PR adds access control to the Endpoint Workflow Insights
functionality. Both the UI and API are gated based on the following
conditions. If these conditions are not met, the content will not
render, and direct API calls will return errors.

Access Conditions
```
1. Serverless: Requires the Endpoint Complete Tier.
2. ESS: Requires an Enterprise License.
3. User Privileges:
    3.1 Endpoint Insights Privilege must be enabled:
        3.1.1 Endpoint Insights All: Grants full access.
	3.1.2 Endpoint Insights Read:
	    3.1.2.1 Allows users to view generated insights but prevents triggering new scans.
	    3.1.2.2 With Trusted Applications privilege: Users can remediate already generated insights.
	    3.1.2.3 Without Trusted Applications privilege: No actions can be taken.
	3.1.3Endpoint Insights None: The section is not rendered.
```

Predefined serverless roles that should include endpoint insights
privilege(as defined
[here](elastic/security-team#11460)):
- Tier 3 analyst
- Rule Author
- SOC Manager
- Endpoint Operations Analyst
- Endpoint Policy Manager
- Platform Engineer

Once this PR is merged and changes make it to canary release, [this
follow-up
PR](elastic/elasticsearch-controller#816) should
be merged.

Note on Testing and Local Setup

To test these changes locally, the `defendInsights` assistant feature
must be enabled. You can do this by updating the following line in the
code: [Enable defendInsights
here](https://github.com/elastic/kibana/blob/2ae68bdaac180c62750798c148bed4fd01de07fe/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/capabilities/index.ts#L23).

Cypress Tests

Cypress tests in this PR are currently skipped because the
`defendInsights` feature is not enabled by default. These tests should
be enabled once the feature is turned on in the main branch. Successful
run with all cypress tests enabled can be found
[here](https://buildkite.com/elastic/kibana-pull-request/builds/262774#0193f3c2-eddd-48b6-9103-fb7338304f15).

<details>
<summary>Screenshots</summary>

![396870292-b5bbedad-330f-4ef5-8281-29699cf01a98](https://github.com/user-attachments/assets/586745d4-9e8d-42b4-8d70-e32737285f5c)

![b](https://github.com/user-attachments/assets/0926b696-37ef-48e8-9dfb-d6f735033583)

![a](https://github.com/user-attachments/assets/afa799bd-7e07-4a1a-b63e-6448ae56b21a)

![c](https://github.com/user-attachments/assets/cc3a2e07-0955-4348-a954-1914c5a85e81)
![Screenshot 2024-12-23 at 13 32
57](https://github.com/user-attachments/assets/fbb28bce-eedd-4a6e-85c3-b2a07f40ab27)
</details>

---------

Co-authored-by: kibanamachine <[email protected]>
(cherry picked from commit 2f61892)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

Copy link
Contributor

@tomsonpl tomsonpl left a comment

Choose a reason for hiding this comment

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

LGTM 👍 Left a nit question, thanks!

return response.forbidden({
body: {
message:
'Your license does not support Defend Workflows. Please upgrade your license.',
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this be in i18n?

return response.forbidden({
body: {
message:
'Your license does not support Defend Workflows. Please upgrade your license.',
Copy link
Contributor

Choose a reason for hiding this comment

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

And this?

kibanamachine added a commit that referenced this pull request Jan 7, 2025
# Backport

This will backport the following commits from `main` to `8.x`:
- [[EDR Workflows] Workflow Insights - RBAC
(#205088)](#205088)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Konrad
Szwarc","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-01-07T09:33:25Z","message":"[EDR
Workflows] Workflow Insights - RBAC (#205088)\n\n## Access Control for
Endpoint Workflow Insights\r\n\r\nThis PR adds access control to the
Endpoint Workflow Insights\r\nfunctionality. Both the UI and API are
gated based on the following\r\nconditions. If these conditions are not
met, the content will not\r\nrender, and direct API calls will return
errors.\r\n\r\nAccess Conditions\r\n```\r\n1. Serverless: Requires the
Endpoint Complete Tier.\r\n2. ESS: Requires an Enterprise License.\r\n3.
User Privileges:\r\n 3.1 Endpoint Insights Privilege must be
enabled:\r\n 3.1.1 Endpoint Insights All: Grants full access.\r\n\t3.1.2
Endpoint Insights Read:\r\n\t 3.1.2.1 Allows users to view generated
insights but prevents triggering new scans.\r\n\t 3.1.2.2 With Trusted
Applications privilege: Users can remediate already generated
insights.\r\n\t 3.1.2.3 Without Trusted Applications privilege: No
actions can be taken.\r\n\t3.1.3Endpoint Insights None: The section is
not rendered.\r\n```\r\n\r\nPredefined serverless roles that should
include endpoint insights\r\nprivilege(as
defined\r\n[here](https://github.com/elastic/security-team/issues/11460)):\r\n-
Tier 3 analyst\r\n- Rule Author\r\n- SOC Manager\r\n- Endpoint
Operations Analyst\r\n- Endpoint Policy Manager\r\n- Platform
Engineer\r\n\r\nOnce this PR is merged and changes make it to canary
release,
[this\r\nfollow-up\r\nPR](elastic/elasticsearch-controller#816)
should\r\nbe merged.\r\n\r\nNote on Testing and Local Setup\r\n\r\nTo
test these changes locally, the `defendInsights` assistant
feature\r\nmust be enabled. You can do this by updating the following
line in the\r\ncode: [Enable
defendInsights\r\nhere](https://github.com/elastic/kibana/blob/2ae68bdaac180c62750798c148bed4fd01de07fe/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/capabilities/index.ts#L23).\r\n\r\nCypress
Tests\r\n\r\nCypress tests in this PR are currently skipped because
the\r\n`defendInsights` feature is not enabled by default. These tests
should\r\nbe enabled once the feature is turned on in the main branch.
Successful\r\nrun with all cypress tests enabled can be
found\r\n[here](https://buildkite.com/elastic/kibana-pull-request/builds/262774#0193f3c2-eddd-48b6-9103-fb7338304f15).\r\n\r\n<details>\r\n<summary>Screenshots</summary>\r\n\r\n\r\n![396870292-b5bbedad-330f-4ef5-8281-29699cf01a98](https://github.com/user-attachments/assets/586745d4-9e8d-42b4-8d70-e32737285f5c)\r\n\r\n![b](https://github.com/user-attachments/assets/0926b696-37ef-48e8-9dfb-d6f735033583)\r\n\r\n![a](https://github.com/user-attachments/assets/afa799bd-7e07-4a1a-b63e-6448ae56b21a)\r\n\r\n![c](https://github.com/user-attachments/assets/cc3a2e07-0955-4348-a954-1914c5a85e81)\r\n![Screenshot
2024-12-23 at 13
32\r\n57](https://github.com/user-attachments/assets/fbb28bce-eedd-4a6e-85c3-b2a07f40ab27)\r\n</details>\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<[email protected]>","sha":"2f61892e84b31ebd4774cae2686ebd6c4c2cab89","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Fleet","v9.0.0","Team:Defend
Workflows","backport:prev-minor","v8.18.0"],"title":"[EDR Workflows]
Workflow Insights - RBAC
","number":205088,"url":"https://github.com/elastic/kibana/pull/205088","mergeCommit":{"message":"[EDR
Workflows] Workflow Insights - RBAC (#205088)\n\n## Access Control for
Endpoint Workflow Insights\r\n\r\nThis PR adds access control to the
Endpoint Workflow Insights\r\nfunctionality. Both the UI and API are
gated based on the following\r\nconditions. If these conditions are not
met, the content will not\r\nrender, and direct API calls will return
errors.\r\n\r\nAccess Conditions\r\n```\r\n1. Serverless: Requires the
Endpoint Complete Tier.\r\n2. ESS: Requires an Enterprise License.\r\n3.
User Privileges:\r\n 3.1 Endpoint Insights Privilege must be
enabled:\r\n 3.1.1 Endpoint Insights All: Grants full access.\r\n\t3.1.2
Endpoint Insights Read:\r\n\t 3.1.2.1 Allows users to view generated
insights but prevents triggering new scans.\r\n\t 3.1.2.2 With Trusted
Applications privilege: Users can remediate already generated
insights.\r\n\t 3.1.2.3 Without Trusted Applications privilege: No
actions can be taken.\r\n\t3.1.3Endpoint Insights None: The section is
not rendered.\r\n```\r\n\r\nPredefined serverless roles that should
include endpoint insights\r\nprivilege(as
defined\r\n[here](https://github.com/elastic/security-team/issues/11460)):\r\n-
Tier 3 analyst\r\n- Rule Author\r\n- SOC Manager\r\n- Endpoint
Operations Analyst\r\n- Endpoint Policy Manager\r\n- Platform
Engineer\r\n\r\nOnce this PR is merged and changes make it to canary
release,
[this\r\nfollow-up\r\nPR](elastic/elasticsearch-controller#816)
should\r\nbe merged.\r\n\r\nNote on Testing and Local Setup\r\n\r\nTo
test these changes locally, the `defendInsights` assistant
feature\r\nmust be enabled. You can do this by updating the following
line in the\r\ncode: [Enable
defendInsights\r\nhere](https://github.com/elastic/kibana/blob/2ae68bdaac180c62750798c148bed4fd01de07fe/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/capabilities/index.ts#L23).\r\n\r\nCypress
Tests\r\n\r\nCypress tests in this PR are currently skipped because
the\r\n`defendInsights` feature is not enabled by default. These tests
should\r\nbe enabled once the feature is turned on in the main branch.
Successful\r\nrun with all cypress tests enabled can be
found\r\n[here](https://buildkite.com/elastic/kibana-pull-request/builds/262774#0193f3c2-eddd-48b6-9103-fb7338304f15).\r\n\r\n<details>\r\n<summary>Screenshots</summary>\r\n\r\n\r\n![396870292-b5bbedad-330f-4ef5-8281-29699cf01a98](https://github.com/user-attachments/assets/586745d4-9e8d-42b4-8d70-e32737285f5c)\r\n\r\n![b](https://github.com/user-attachments/assets/0926b696-37ef-48e8-9dfb-d6f735033583)\r\n\r\n![a](https://github.com/user-attachments/assets/afa799bd-7e07-4a1a-b63e-6448ae56b21a)\r\n\r\n![c](https://github.com/user-attachments/assets/cc3a2e07-0955-4348-a954-1914c5a85e81)\r\n![Screenshot
2024-12-23 at 13
32\r\n57](https://github.com/user-attachments/assets/fbb28bce-eedd-4a6e-85c3-b2a07f40ab27)\r\n</details>\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<[email protected]>","sha":"2f61892e84b31ebd4774cae2686ebd6c4c2cab89"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/205088","number":205088,"mergeCommit":{"message":"[EDR
Workflows] Workflow Insights - RBAC (#205088)\n\n## Access Control for
Endpoint Workflow Insights\r\n\r\nThis PR adds access control to the
Endpoint Workflow Insights\r\nfunctionality. Both the UI and API are
gated based on the following\r\nconditions. If these conditions are not
met, the content will not\r\nrender, and direct API calls will return
errors.\r\n\r\nAccess Conditions\r\n```\r\n1. Serverless: Requires the
Endpoint Complete Tier.\r\n2. ESS: Requires an Enterprise License.\r\n3.
User Privileges:\r\n 3.1 Endpoint Insights Privilege must be
enabled:\r\n 3.1.1 Endpoint Insights All: Grants full access.\r\n\t3.1.2
Endpoint Insights Read:\r\n\t 3.1.2.1 Allows users to view generated
insights but prevents triggering new scans.\r\n\t 3.1.2.2 With Trusted
Applications privilege: Users can remediate already generated
insights.\r\n\t 3.1.2.3 Without Trusted Applications privilege: No
actions can be taken.\r\n\t3.1.3Endpoint Insights None: The section is
not rendered.\r\n```\r\n\r\nPredefined serverless roles that should
include endpoint insights\r\nprivilege(as
defined\r\n[here](https://github.com/elastic/security-team/issues/11460)):\r\n-
Tier 3 analyst\r\n- Rule Author\r\n- SOC Manager\r\n- Endpoint
Operations Analyst\r\n- Endpoint Policy Manager\r\n- Platform
Engineer\r\n\r\nOnce this PR is merged and changes make it to canary
release,
[this\r\nfollow-up\r\nPR](elastic/elasticsearch-controller#816)
should\r\nbe merged.\r\n\r\nNote on Testing and Local Setup\r\n\r\nTo
test these changes locally, the `defendInsights` assistant
feature\r\nmust be enabled. You can do this by updating the following
line in the\r\ncode: [Enable
defendInsights\r\nhere](https://github.com/elastic/kibana/blob/2ae68bdaac180c62750798c148bed4fd01de07fe/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/capabilities/index.ts#L23).\r\n\r\nCypress
Tests\r\n\r\nCypress tests in this PR are currently skipped because
the\r\n`defendInsights` feature is not enabled by default. These tests
should\r\nbe enabled once the feature is turned on in the main branch.
Successful\r\nrun with all cypress tests enabled can be
found\r\n[here](https://buildkite.com/elastic/kibana-pull-request/builds/262774#0193f3c2-eddd-48b6-9103-fb7338304f15).\r\n\r\n<details>\r\n<summary>Screenshots</summary>\r\n\r\n\r\n![396870292-b5bbedad-330f-4ef5-8281-29699cf01a98](https://github.com/user-attachments/assets/586745d4-9e8d-42b4-8d70-e32737285f5c)\r\n\r\n![b](https://github.com/user-attachments/assets/0926b696-37ef-48e8-9dfb-d6f735033583)\r\n\r\n![a](https://github.com/user-attachments/assets/afa799bd-7e07-4a1a-b63e-6448ae56b21a)\r\n\r\n![c](https://github.com/user-attachments/assets/cc3a2e07-0955-4348-a954-1914c5a85e81)\r\n![Screenshot
2024-12-23 at 13
32\r\n57](https://github.com/user-attachments/assets/fbb28bce-eedd-4a6e-85c3-b2a07f40ab27)\r\n</details>\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<[email protected]>","sha":"2f61892e84b31ebd4774cae2686ebd6c4c2cab89"}},{"branch":"8.x","label":"v8.18.0","branchLabelMappingKey":"^v8.18.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Konrad Szwarc <[email protected]>
kowalczyk-krzysztof pushed a commit to kowalczyk-krzysztof/kibana that referenced this pull request Jan 7, 2025
## Access Control for Endpoint Workflow Insights

This PR adds access control to the Endpoint Workflow Insights
functionality. Both the UI and API are gated based on the following
conditions. If these conditions are not met, the content will not
render, and direct API calls will return errors.

Access Conditions
```
1. Serverless: Requires the Endpoint Complete Tier.
2. ESS: Requires an Enterprise License.
3. User Privileges:
    3.1 Endpoint Insights Privilege must be enabled:
        3.1.1 Endpoint Insights All: Grants full access.
	3.1.2 Endpoint Insights Read:
	    3.1.2.1 Allows users to view generated insights but prevents triggering new scans.
	    3.1.2.2 With Trusted Applications privilege: Users can remediate already generated insights.
	    3.1.2.3 Without Trusted Applications privilege: No actions can be taken.
	3.1.3Endpoint Insights None: The section is not rendered.
```

Predefined serverless roles that should include endpoint insights
privilege(as defined
[here](elastic/security-team#11460)):
- Tier 3 analyst
- Rule Author
- SOC Manager
- Endpoint Operations Analyst
- Endpoint Policy Manager
- Platform Engineer

Once this PR is merged and changes make it to canary release, [this
follow-up
PR](elastic/elasticsearch-controller#816) should
be merged.

Note on Testing and Local Setup

To test these changes locally, the `defendInsights` assistant feature
must be enabled. You can do this by updating the following line in the
code: [Enable defendInsights
here](https://github.com/elastic/kibana/blob/2ae68bdaac180c62750798c148bed4fd01de07fe/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/capabilities/index.ts#L23).

Cypress Tests

Cypress tests in this PR are currently skipped because the
`defendInsights` feature is not enabled by default. These tests should
be enabled once the feature is turned on in the main branch. Successful
run with all cypress tests enabled can be found
[here](https://buildkite.com/elastic/kibana-pull-request/builds/262774#0193f3c2-eddd-48b6-9103-fb7338304f15).

<details>
<summary>Screenshots</summary>


![396870292-b5bbedad-330f-4ef5-8281-29699cf01a98](https://github.com/user-attachments/assets/586745d4-9e8d-42b4-8d70-e32737285f5c)

![b](https://github.com/user-attachments/assets/0926b696-37ef-48e8-9dfb-d6f735033583)

![a](https://github.com/user-attachments/assets/afa799bd-7e07-4a1a-b63e-6448ae56b21a)

![c](https://github.com/user-attachments/assets/cc3a2e07-0955-4348-a954-1914c5a85e81)
![Screenshot 2024-12-23 at 13 32
57](https://github.com/user-attachments/assets/fbb28bce-eedd-4a6e-85c3-b2a07f40ab27)
</details>

---------

Co-authored-by: kibanamachine <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) release_note:skip Skip the PR/issue when compiling release notes Team:Defend Workflows “EDR Workflows” sub-team of Security Solution Team:Fleet Team label for Observability Data Collection Fleet team v8.18.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants