Skip to content

Commit

Permalink
[8.x] [Search] Basic RBAC for Search Applications & Behavioral An…
Browse files Browse the repository at this point in the history
…alytics (#203335) (#203651)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Search] Basic RBAC for Search Applications & Behavioral
Analytics (#203335)](#203335)

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

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

<!--BACKPORT [{"author":{"name":"Rodney
Norris","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-12-10T17:12:29Z","message":"[Search]
Basic RBAC for Search Applications & Behavioral Analytics
(#203335)\n\n## Summary\r\n\r\nMoved Search Applications & Behavioral
Analytics from the base\r\nKibanaFeature to their own so that they can
be controlled independently\r\nfrom other parts of the search
solution.\r\n\r\n### Checklist\r\n\r\n- [x] Any text added follows
[EUI's
writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\r\nsentence case text and includes
[i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n\r\n---------\r\n\r\nCo-authored-by:
Elastic Machine
<[email protected]>","sha":"91337c74a34efb3fc6df1e14cf1461f125833b89","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:Search","backport:prev-minor","v8.18.0"],"title":"[Search]
Basic RBAC for Search Applications & Behavioral
Analytics","number":203335,"url":"https://github.com/elastic/kibana/pull/203335","mergeCommit":{"message":"[Search]
Basic RBAC for Search Applications & Behavioral Analytics
(#203335)\n\n## Summary\r\n\r\nMoved Search Applications & Behavioral
Analytics from the base\r\nKibanaFeature to their own so that they can
be controlled independently\r\nfrom other parts of the search
solution.\r\n\r\n### Checklist\r\n\r\n- [x] Any text added follows
[EUI's
writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\r\nsentence case text and includes
[i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n\r\n---------\r\n\r\nCo-authored-by:
Elastic Machine
<[email protected]>","sha":"91337c74a34efb3fc6df1e14cf1461f125833b89"}},"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/203335","number":203335,"mergeCommit":{"message":"[Search]
Basic RBAC for Search Applications & Behavioral Analytics
(#203335)\n\n## Summary\r\n\r\nMoved Search Applications & Behavioral
Analytics from the base\r\nKibanaFeature to their own so that they can
be controlled independently\r\nfrom other parts of the search
solution.\r\n\r\n### Checklist\r\n\r\n- [x] Any text added follows
[EUI's
writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\r\nsentence case text and includes
[i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n\r\n---------\r\n\r\nCo-authored-by:
Elastic Machine
<[email protected]>","sha":"91337c74a34efb3fc6df1e14cf1461f125833b89"}},{"branch":"8.x","label":"v8.18.0","branchLabelMappingKey":"^v8.18.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Rodney Norris <[email protected]>
  • Loading branch information
kibanamachine and TattdCodeMonkey authored Dec 10, 2024
1 parent fa03ccc commit bcfa88e
Show file tree
Hide file tree
Showing 6 changed files with 75 additions and 2 deletions.
63 changes: 61 additions & 2 deletions x-pack/plugins/enterprise_search/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { KibanaFeatureScope } from '@kbn/features-plugin/common';
import { FeaturesPluginSetup } from '@kbn/features-plugin/server';
import { GlobalSearchPluginSetup } from '@kbn/global-search-plugin/server';
import type { GuidedOnboardingPluginSetup } from '@kbn/guided-onboarding-plugin/server';
import { i18n } from '@kbn/i18n';
import type { LicensingPluginStart } from '@kbn/licensing-plugin/public';
import { LogsSharedPluginSetup } from '@kbn/logs-shared-plugin/server';
import type { MlPluginSetup } from '@kbn/ml-plugin/server';
Expand Down Expand Up @@ -169,12 +170,10 @@ export class EnterpriseSearchPlugin implements Plugin {
ENTERPRISE_SEARCH_OVERVIEW_PLUGIN.ID,
ENTERPRISE_SEARCH_CONTENT_PLUGIN.ID,
ELASTICSEARCH_PLUGIN.ID,
ANALYTICS_PLUGIN.ID,
...(config.canDeployEntSearch ? [APP_SEARCH_PLUGIN.ID, WORKPLACE_SEARCH_PLUGIN.ID] : []),
SEARCH_EXPERIENCES_PLUGIN.ID,
VECTOR_SEARCH_PLUGIN.ID,
SEMANTIC_SEARCH_PLUGIN.ID,
APPLICATIONS_PLUGIN.ID,
AI_SEARCH_PLUGIN.ID,
];
const isCloud = !!cloud?.cloudId;
Expand Down Expand Up @@ -225,6 +224,66 @@ export class EnterpriseSearchPlugin implements Plugin {
},
},
});
features.registerKibanaFeature({
id: APPLICATIONS_PLUGIN.ID,
name: i18n.translate('xpack.enterpriseSearch.applications.featureName', {
defaultMessage: 'Search Applications',
}),
order: 3,
category: DEFAULT_APP_CATEGORIES.enterpriseSearch,
scope: [KibanaFeatureScope.Spaces, KibanaFeatureScope.Security],
app: ['kibana', APPLICATIONS_PLUGIN.ID],
catalogue: [APPLICATIONS_PLUGIN.ID],
privileges: {
all: {
app: ['kibana', APPLICATIONS_PLUGIN.ID],
api: [],
catalogue: [APPLICATIONS_PLUGIN.ID],
savedObject: {
all: [],
read: [],
},
ui: [],
},
read: {
disabled: true,
savedObject: {
all: [],
read: [],
},
ui: [],
},
},
});
features.registerKibanaFeature({
id: ANALYTICS_PLUGIN.ID,
name: ANALYTICS_PLUGIN.NAME,
order: 4,
category: DEFAULT_APP_CATEGORIES.enterpriseSearch,
scope: [KibanaFeatureScope.Spaces, KibanaFeatureScope.Security],
app: ['kibana', ANALYTICS_PLUGIN.ID],
catalogue: [ANALYTICS_PLUGIN.ID],
privileges: {
all: {
app: ['kibana', ANALYTICS_PLUGIN.ID],
api: [],
catalogue: [ANALYTICS_PLUGIN.ID],
savedObject: {
all: [],
read: [],
},
ui: [],
},
read: {
disabled: true,
savedObject: {
all: [],
read: [],
},
ui: [],
},
},
});

/**
* Register Enterprise Search UI Settings
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ export default function ({ getService }: FtrProviderContext) {
'dev_tools',
'actions',
'enterpriseSearch',
'enterpriseSearchApplications',
'enterpriseSearchAnalytics',
'filesManagement',
'filesSharedImage',
'advancedSettings',
Expand Down Expand Up @@ -154,6 +156,8 @@ export default function ({ getService }: FtrProviderContext) {
'dev_tools',
'actions',
'enterpriseSearch',
'enterpriseSearchApplications',
'enterpriseSearchAnalytics',
'filesManagement',
'filesSharedImage',
'advancedSettings',
Expand Down
2 changes: 2 additions & 0 deletions x-pack/test/api_integration/apis/security/privileges.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,8 @@ export default function ({ getService }: FtrProviderContext) {
'packs_read',
],
enterpriseSearch: ['all', 'read', 'minimal_all', 'minimal_read'],
enterpriseSearchApplications: ['all', 'read', 'minimal_all', 'minimal_read'],
enterpriseSearchAnalytics: ['all', 'read', 'minimal_all', 'minimal_read'],
filesManagement: ['all', 'read', 'minimal_all', 'minimal_read'],
filesSharedImage: ['all', 'read', 'minimal_all', 'minimal_read'],
rulesSettings: [
Expand Down
4 changes: 4 additions & 0 deletions x-pack/test/api_integration/apis/security/privileges_basic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ export default function ({ getService }: FtrProviderContext) {
apm: ['all', 'read', 'minimal_all', 'minimal_read'],
osquery: ['all', 'read', 'minimal_all', 'minimal_read'],
enterpriseSearch: ['all', 'read', 'minimal_all', 'minimal_read'],
enterpriseSearchApplications: ['all', 'read', 'minimal_all', 'minimal_read'],
enterpriseSearchAnalytics: ['all', 'read', 'minimal_all', 'minimal_read'],
ml: ['all', 'read', 'minimal_all', 'minimal_read'],
siem: ['all', 'read', 'minimal_all', 'minimal_read'],
securitySolutionAssistant: ['all', 'read', 'minimal_all', 'minimal_read'],
Expand Down Expand Up @@ -267,6 +269,8 @@ export default function ({ getService }: FtrProviderContext) {
'packs_read',
],
enterpriseSearch: ['all', 'read', 'minimal_all', 'minimal_read'],
enterpriseSearchApplications: ['all', 'read', 'minimal_all', 'minimal_read'],
enterpriseSearchAnalytics: ['all', 'read', 'minimal_all', 'minimal_read'],
rulesSettings: [
'all',
'read',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ export default function ({ getService }: FtrProviderContext) {
monitoring: 0,
apm: 0,
enterpriseSearch: 0,
enterpriseSearchApplications: 0,
enterpriseSearchAnalytics: 0,
searchInferenceEndpoints: 0,
searchPlayground: 0,
siem: 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ export default function navLinksTests({ getService }: FtrProviderContext) {
'monitoring',
'observabilityAIAssistant',
'enterpriseSearch',
'enterpriseSearchApplications',
'enterpriseSearchAnalytics',
'searchPlayground',
'searchInferenceEndpoints',
'guidedOnboardingFeature',
Expand Down

0 comments on commit bcfa88e

Please sign in to comment.