Skip to content

[9.1] [EDR Workflows][Bug] Show artifact links without endpoint list privilege (#226561)#229057

Merged
kibanamachine merged 1 commit intoelastic:9.1from
kibanamachine:backport/9.1/pr-226561
Jul 23, 2025
Merged

[9.1] [EDR Workflows][Bug] Show artifact links without endpoint list privilege (#226561)#229057
kibanamachine merged 1 commit intoelastic:9.1from
kibanamachine:backport/9.1/pr-226561

Conversation

@kibanamachine
Copy link
Contributor

Backport

This will backport the following commits from main to 9.1:

Questions ?

Please refer to the Backport tool documentation

…ege (elastic#226561)

## Summary

In Serverless, Security solution, under Assets/Endpoints, if user didn't
have access to Endpoints (`endpoint_list_read|all`), the whole Endpoints
group was filtered without showing any other subpage. This can occur
only with custom roles as no pre-built roles exist with these
conditions.

This PR fixes this by simply removing the `link` from the group, so it
won't be filtered when Endpoint access is missing.

<img width="492" alt="image"
src="https://github.com/user-attachments/assets/14af8a2f-2b60-497a-96c7-d6c6da91b453"
/>

A small side effect is that on the breadcrumb, Endpoints won't be
clickable.

| Before | After |
|-|-|
| <img width="422" alt="image"
src="https://github.com/user-attachments/assets/a97d8d0e-81ad-4faa-87fe-e48f038f6018"
/> | <img width="434" alt="image"
src="https://github.com/user-attachments/assets/b9a3cbe4-dc06-4c77-899a-7c020b553c59"
/> |

> [!NOTE]
> The added cypress test does not test this issue actually, as custom
roles cannot be used in cypress tests at the moment. Hopefully this can
be improved in the future.

### How to test

To do some manual tests, you can add the following custom roles to the
file below **before starting up the local serverless instance**:

src/platform/packages/shared/kbn-es/src/serverless_resources/project_roles/security/roles.yml

<details><summary>Custom roles</summary>

```yml
endpoint_list_NONE_artifacts_NONE:
  cluster: []
  indices:
    - names:
        - '.lists-*'
        - '.items-*'
        - '.alerts-security.alerts-*'
        - '.siem-signals*'
      privileges:
        - 'read'
        - 'view_index_metadata'
      allow_restricted_indices: false
  applications:
    - application: 'kibana-.kibana'
      privileges:
        - feature_siemV3.minimal_all
      resources: '*'
  run_as: []

endpoint_list_NONE_artifacts_READ:
  cluster: []
  indices:
    - names:
        - '.lists-*'
        - '.items-*'
        - '.alerts-security.alerts-*'
        - '.siem-signals*'
      privileges:
        - 'read'
        - 'view_index_metadata'
      allow_restricted_indices: false
  applications:
    - application: 'kibana-.kibana'
      privileges:
        - feature_siemV3.minimal_all
        - feature_siemV3.trusted_applications_read
        - feature_siemV3.event_filters_read
        - feature_siemV3.host_isolation_exceptions_read
        - feature_siemV3.blocklist_read
      resources: '*'
  run_as: []

endpoint_list_READ_artifacts_READ:
  cluster: []
  indices:
    - names:
        - '.lists-*'
        - '.items-*'
        - '.alerts-security.alerts-*'
        - '.siem-signals*'
      privileges:
        - 'read'
        - 'view_index_metadata'
      allow_restricted_indices: false
  applications:
    - application: 'kibana-.kibana'
      privileges:
        - feature_siemV3.minimal_all
        - feature_siemV3.endpoint_list_read
        - feature_siemV3.trusted_applications_read
        - feature_siemV3.event_filters_read
        - feature_siemV3.host_isolation_exceptions_read
        - feature_siemV3.blocklist_read
      resources: '*'
  run_as: []

endpoint_list_READ_artifacts_NONE:
  cluster: []
  indices:
    - names:
        - '.lists-*'
        - '.items-*'
        - '.alerts-security.alerts-*'
        - '.siem-signals*'
      privileges:
        - 'read'
        - 'view_index_metadata'
      allow_restricted_indices: false
  applications:
    - application: 'kibana-.kibana'
      privileges:
        - feature_siemV3.minimal_all
        - feature_siemV3.endpoint_list_read
      resources: '*'
  run_as: []

```

</details>

### Todo
- [x] run on MKI before merge

https://buildkite.com/elastic/kibana-serverless-security-solution-quality-gate-defend-workflows/builds/3027/steps/canvas?jid=0197d5be-7b77-44a0-85f2-8f4a37657980

### Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

- [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

(cherry picked from commit 4b9d2c5)
@kibanamachine kibanamachine merged commit 1b69ba9 into elastic:9.1 Jul 23, 2025
10 of 14 checks passed
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Page load bundle

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

id before after diff
securitySolutionEss 30.6KB 30.6KB -22.0B
securitySolutionServerless 44.1KB 44.1KB -29.0B
total -51.0B

cc @gergoabraham

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants