Skip to content

[Security Solution] Fix the feature app list#191965

Merged
semd merged 11 commits intoelastic:mainfrom
semd:bug/security-solution-ui-app-id-feature
Oct 1, 2024
Merged

[Security Solution] Fix the feature app list#191965
semd merged 11 commits intoelastic:mainfrom
semd:bug/security-solution-ui-app-id-feature

Conversation

@semd
Copy link
Copy Markdown
Contributor

@semd semd commented Sep 3, 2024

Summary

Fixes https://github.com/elastic/kibana-team/issues/1136

The Kibana feature definition for Security Solution was missing the correct plugin ID registered in the app definition. We were still defining the old "securitySolution" app ID in the app property, instead of the new "securitySolutionUI" ID.

The Security Solution plugin ID change ("securitySolution" -> "securitySolutionUI") was done a long time ago, the inconsistency with the Security feature definition is causing the Security app to still be visible in the global search when the Security feature is disabled:

  • In the role features
Security and Cases disabled
  • Or in the space features config
Captura de pantalla 2024-09-03 a les 15 31 09

This is fixed now:

Before:
Security app incorrectly enabled

After:
Security app disabled properly

Caveat

As per this PR changes: #113573
In the Kibana features of the role, under the Security catalog, both Security and Cases features need to be none for the Security Solution plugin to be disabled. Otherwise, we must enable the plugin and make the enabled features available. So, with a role with the following Kibana features:

Security disabled cases enabled

The Security app needs to be available and display only Cases available:

navigation with only cases

@semd semd added bug Fixes for quality problems that affect the customer experience release_note:skip Skip the PR/issue when compiling release notes Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. backport:prev-minor v8.16.0 labels Sep 3, 2024
@semd semd self-assigned this Sep 3, 2024
@semd
Copy link
Copy Markdown
Contributor Author

semd commented Sep 3, 2024

/ci

Comment on lines +341 to +349
// When the user does not have access to SIEM (main Security feature) nor Security Cases feature, the plugin must be inaccessible.
if (!capabilities.siem?.show && !capabilities.securitySolutionCases?.read_cases) {
this.appUpdater$.next(() => ({
status: AppStatus.inaccessible,
visibleIn: [],
}));
// no need to register the links updater when the plugin is inaccessible
return;
}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is the only code addition in this PR, the rest is a small housekeeping refactor.

@semd semd marked this pull request as ready for review September 27, 2024 15:18
@semd semd requested a review from a team as a code owner September 27, 2024 15:18
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/security-solution (Team: SecuritySolution)

Copy link
Copy Markdown
Contributor

@kapral18 kapral18 left a comment

Choose a reason for hiding this comment

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

LGTM

@semd
Copy link
Copy Markdown
Contributor Author

semd commented Sep 30, 2024

@elasticmachine merge upstream

@semd semd enabled auto-merge (squash) September 30, 2024 08:12
@semd
Copy link
Copy Markdown
Contributor Author

semd commented Sep 30, 2024

@elasticmachine merge upstream

@semd
Copy link
Copy Markdown
Contributor Author

semd commented Sep 30, 2024

@elasticmachine merge upstream

@semd
Copy link
Copy Markdown
Contributor Author

semd commented Oct 1, 2024

@elasticmachine merge upstream

@kibana-ci
Copy link
Copy Markdown

💛 Build succeeded, but was flaky

Failed CI Steps

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
securitySolution 124 122 -2

Page load bundle

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

id before after diff
securitySolution 87.9KB 88.2KB +295.0B
Unknown metric groups

API count

id before after diff
securitySolution 193 190 -3

History

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

cc @semd

@semd semd merged commit e373e44 into elastic:main Oct 1, 2024
@kibanamachine
Copy link
Copy Markdown
Contributor

Starting backport for target branches: 8.x

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

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Oct 1, 2024
## Summary

Fixes elastic/kibana-team#1136

The Kibana feature definition for Security Solution was missing the
correct plugin ID registered in the `app` definition. We were still
defining the old _"securitySolution"_ app ID in the `app` property,
instead of the new _"securitySolutionUI"_ ID.

The Security Solution plugin ID change (_"securitySolution"_ ->
_"securitySolutionUI"_) was done a long time ago, the inconsistency with
the Security feature definition is causing the _Security_ app to still
be visible in the global search when the Security feature is disabled:

- In the role features
<img width="737" alt="Security and Cases disabled"
src="https://github.com/user-attachments/assets/146b8205-90f7-4218-9f1a-7b55c3bad563">

- Or in the space features config
<img width="1213" alt="Captura de pantalla 2024-09-03 a les 15 31 09"
src="https://github.com/user-attachments/assets/2563675a-d956-4422-a887-d6d95bcad773">

This is fixed now:

Before:
<img width="1302" alt="Security app incorrectly enabled"
src="https://github.com/user-attachments/assets/8031f054-7cfb-4098-93c2-eac402501887">

After:
<img width="1302" alt="Security app disabled properly"
src="https://github.com/user-attachments/assets/a4f38ec2-fb78-4b1b-8c2d-bac58b97ff99">

### Caveat

As per this PR changes: elastic#113573
In the Kibana features of the role, under the Security catalog, both
Security and Cases features need to be `none` for the Security Solution
plugin to be disabled. Otherwise, we must enable the plugin and make the
enabled features available. So, with a role with the following Kibana
features:

<img width="737" alt="Security disabled cases enabled"
src="https://github.com/user-attachments/assets/aca8288e-9dd9-49d0-b864-e60273d30759">

The Security app needs to be available and display only Cases available:

<img width="247" alt="navigation with only cases"
src="https://github.com/user-attachments/assets/d4866edb-1d1d-4290-a399-76a37536b05c">

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
(cherry picked from commit e373e44)
@kibanamachine
Copy link
Copy Markdown
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

kibanamachine added a commit that referenced this pull request Oct 1, 2024
# Backport

This will backport the following commits from `main` to `8.x`:
- [[Security Solution] Fix the feature app list
(#191965)](#191965)

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

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

<!--BACKPORT [{"author":{"name":"Sergi
Massaneda","email":"sergi.massaneda@elastic.co"},"sourceCommit":{"committedDate":"2024-10-01T10:18:17Z","message":"[Security
Solution] Fix the feature app list (#191965)\n\n## Summary\r\n\r\nFixes
https://github.com/elastic/kibana-team/issues/1136\r\n\r\nThe Kibana
feature definition for Security Solution was missing the\r\ncorrect
plugin ID registered in the `app` definition. We were still\r\ndefining
the old _\"securitySolution\"_ app ID in the `app` property,\r\ninstead
of the new _\"securitySolutionUI\"_ ID.\r\n\r\nThe Security Solution
plugin ID change (_\"securitySolution\"_ ->\r\n_\"securitySolutionUI\"_)
was done a long time ago, the inconsistency with\r\nthe Security feature
definition is causing the _Security_ app to still\r\nbe visible in the
global search when the Security feature is disabled:\r\n\r\n- In the
role features\r\n<img width=\"737\" alt=\"Security and Cases
disabled\"\r\nsrc=\"https://github.com/user-attachments/assets/146b8205-90f7-4218-9f1a-7b55c3bad563\">\r\n\r\n-
Or in the space features config\r\n<img width=\"1213\" alt=\"Captura de
pantalla 2024-09-03 a les 15 31
09\"\r\nsrc=\"https://github.com/user-attachments/assets/2563675a-d956-4422-a887-d6d95bcad773\">\r\n\r\n\r\nThis
is fixed now:\r\n\r\nBefore:\r\n<img width=\"1302\" alt=\"Security app
incorrectly
enabled\"\r\nsrc=\"https://github.com/user-attachments/assets/8031f054-7cfb-4098-93c2-eac402501887\">\r\n\r\nAfter:\r\n<img
width=\"1302\" alt=\"Security app disabled
properly\"\r\nsrc=\"https://github.com/user-attachments/assets/a4f38ec2-fb78-4b1b-8c2d-bac58b97ff99\">\r\n\r\n\r\n###
Caveat\r\n\r\nAs per this PR changes:
https://github.com/elastic/kibana/pull/113573\r\nIn the Kibana features
of the role, under the Security catalog, both\r\nSecurity and Cases
features need to be `none` for the Security Solution\r\nplugin to be
disabled. Otherwise, we must enable the plugin and make the\r\nenabled
features available. So, with a role with the following
Kibana\r\nfeatures:\r\n\r\n<img width=\"737\" alt=\"Security disabled
cases
enabled\"\r\nsrc=\"https://github.com/user-attachments/assets/aca8288e-9dd9-49d0-b864-e60273d30759\">\r\n\r\nThe
Security app needs to be available and display only Cases
available:\r\n\r\n<img width=\"247\" alt=\"navigation with only
cases\"\r\nsrc=\"https://github.com/user-attachments/assets/d4866edb-1d1d-4290-a399-76a37536b05c\">\r\n\r\n---------\r\n\r\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"e373e443770399d4b0401b02abc39f794a3ec321","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:skip","v9.0.0","Team:
SecuritySolution","backport:prev-minor","v8.16.0"],"title":"[Security
Solution] Fix the feature app
list","number":191965,"url":"https://github.com/elastic/kibana/pull/191965","mergeCommit":{"message":"[Security
Solution] Fix the feature app list (#191965)\n\n## Summary\r\n\r\nFixes
https://github.com/elastic/kibana-team/issues/1136\r\n\r\nThe Kibana
feature definition for Security Solution was missing the\r\ncorrect
plugin ID registered in the `app` definition. We were still\r\ndefining
the old _\"securitySolution\"_ app ID in the `app` property,\r\ninstead
of the new _\"securitySolutionUI\"_ ID.\r\n\r\nThe Security Solution
plugin ID change (_\"securitySolution\"_ ->\r\n_\"securitySolutionUI\"_)
was done a long time ago, the inconsistency with\r\nthe Security feature
definition is causing the _Security_ app to still\r\nbe visible in the
global search when the Security feature is disabled:\r\n\r\n- In the
role features\r\n<img width=\"737\" alt=\"Security and Cases
disabled\"\r\nsrc=\"https://github.com/user-attachments/assets/146b8205-90f7-4218-9f1a-7b55c3bad563\">\r\n\r\n-
Or in the space features config\r\n<img width=\"1213\" alt=\"Captura de
pantalla 2024-09-03 a les 15 31
09\"\r\nsrc=\"https://github.com/user-attachments/assets/2563675a-d956-4422-a887-d6d95bcad773\">\r\n\r\n\r\nThis
is fixed now:\r\n\r\nBefore:\r\n<img width=\"1302\" alt=\"Security app
incorrectly
enabled\"\r\nsrc=\"https://github.com/user-attachments/assets/8031f054-7cfb-4098-93c2-eac402501887\">\r\n\r\nAfter:\r\n<img
width=\"1302\" alt=\"Security app disabled
properly\"\r\nsrc=\"https://github.com/user-attachments/assets/a4f38ec2-fb78-4b1b-8c2d-bac58b97ff99\">\r\n\r\n\r\n###
Caveat\r\n\r\nAs per this PR changes:
https://github.com/elastic/kibana/pull/113573\r\nIn the Kibana features
of the role, under the Security catalog, both\r\nSecurity and Cases
features need to be `none` for the Security Solution\r\nplugin to be
disabled. Otherwise, we must enable the plugin and make the\r\nenabled
features available. So, with a role with the following
Kibana\r\nfeatures:\r\n\r\n<img width=\"737\" alt=\"Security disabled
cases
enabled\"\r\nsrc=\"https://github.com/user-attachments/assets/aca8288e-9dd9-49d0-b864-e60273d30759\">\r\n\r\nThe
Security app needs to be available and display only Cases
available:\r\n\r\n<img width=\"247\" alt=\"navigation with only
cases\"\r\nsrc=\"https://github.com/user-attachments/assets/d4866edb-1d1d-4290-a399-76a37536b05c\">\r\n\r\n---------\r\n\r\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"e373e443770399d4b0401b02abc39f794a3ec321"}},"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/191965","number":191965,"mergeCommit":{"message":"[Security
Solution] Fix the feature app list (#191965)\n\n## Summary\r\n\r\nFixes
https://github.com/elastic/kibana-team/issues/1136\r\n\r\nThe Kibana
feature definition for Security Solution was missing the\r\ncorrect
plugin ID registered in the `app` definition. We were still\r\ndefining
the old _\"securitySolution\"_ app ID in the `app` property,\r\ninstead
of the new _\"securitySolutionUI\"_ ID.\r\n\r\nThe Security Solution
plugin ID change (_\"securitySolution\"_ ->\r\n_\"securitySolutionUI\"_)
was done a long time ago, the inconsistency with\r\nthe Security feature
definition is causing the _Security_ app to still\r\nbe visible in the
global search when the Security feature is disabled:\r\n\r\n- In the
role features\r\n<img width=\"737\" alt=\"Security and Cases
disabled\"\r\nsrc=\"https://github.com/user-attachments/assets/146b8205-90f7-4218-9f1a-7b55c3bad563\">\r\n\r\n-
Or in the space features config\r\n<img width=\"1213\" alt=\"Captura de
pantalla 2024-09-03 a les 15 31
09\"\r\nsrc=\"https://github.com/user-attachments/assets/2563675a-d956-4422-a887-d6d95bcad773\">\r\n\r\n\r\nThis
is fixed now:\r\n\r\nBefore:\r\n<img width=\"1302\" alt=\"Security app
incorrectly
enabled\"\r\nsrc=\"https://github.com/user-attachments/assets/8031f054-7cfb-4098-93c2-eac402501887\">\r\n\r\nAfter:\r\n<img
width=\"1302\" alt=\"Security app disabled
properly\"\r\nsrc=\"https://github.com/user-attachments/assets/a4f38ec2-fb78-4b1b-8c2d-bac58b97ff99\">\r\n\r\n\r\n###
Caveat\r\n\r\nAs per this PR changes:
https://github.com/elastic/kibana/pull/113573\r\nIn the Kibana features
of the role, under the Security catalog, both\r\nSecurity and Cases
features need to be `none` for the Security Solution\r\nplugin to be
disabled. Otherwise, we must enable the plugin and make the\r\nenabled
features available. So, with a role with the following
Kibana\r\nfeatures:\r\n\r\n<img width=\"737\" alt=\"Security disabled
cases
enabled\"\r\nsrc=\"https://github.com/user-attachments/assets/aca8288e-9dd9-49d0-b864-e60273d30759\">\r\n\r\nThe
Security app needs to be available and display only Cases
available:\r\n\r\n<img width=\"247\" alt=\"navigation with only
cases\"\r\nsrc=\"https://github.com/user-attachments/assets/d4866edb-1d1d-4290-a399-76a37536b05c\">\r\n\r\n---------\r\n\r\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"e373e443770399d4b0401b02abc39f794a3ec321"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Sergi Massaneda <sergi.massaneda@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Fixes for quality problems that affect the customer experience release_note:skip Skip the PR/issue when compiling release notes Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. v8.16.0 v9.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants