Skip to content

Commit 89beb03

Browse files
[Security Solution] - remove alerts subfeature UI from behind feature flag (#108450) (#108626)
### Summary This removes the feature flag check for showing the alerts subfeature under security solution Kibana roles UI. Co-authored-by: Yara Tercero <yctercero@users.noreply.github.com>
1 parent 27f2b11 commit 89beb03

File tree

3 files changed

+15
-13
lines changed

3 files changed

+15
-13
lines changed

x-pack/plugins/security_solution/server/features.ts

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export const getAlertsSubFeature = (ruleTypes: string[]): SubFeatureConfig => ({
7676
all: [],
7777
read: [],
7878
},
79-
ui: [],
79+
ui: ['crud_alerts', 'read_alerts'],
8080
},
8181
{
8282
id: 'alerts_read',
@@ -93,17 +93,14 @@ export const getAlertsSubFeature = (ruleTypes: string[]): SubFeatureConfig => ({
9393
all: [],
9494
read: [],
9595
},
96-
ui: [],
96+
ui: ['read_alerts'],
9797
},
9898
],
9999
},
100100
],
101101
});
102102

103-
export const getKibanaPrivilegesFeaturePrivileges = (
104-
ruleTypes: string[],
105-
isRuleRegistryEnabled: boolean
106-
): KibanaFeatureConfig => ({
103+
export const getKibanaPrivilegesFeaturePrivileges = (ruleTypes: string[]): KibanaFeatureConfig => ({
107104
id: SERVER_APP_ID,
108105
name: i18n.translate('xpack.securitySolution.featureRegistry.linkSecuritySolutionTitle', {
109106
defaultMessage: 'Security',
@@ -117,9 +114,7 @@ export const getKibanaPrivilegesFeaturePrivileges = (
117114
},
118115
alerting: ruleTypes,
119116
cases: [APP_ID],
120-
subFeatures: isRuleRegistryEnabled
121-
? [{ ...CASES_SUB_FEATURE }, { ...getAlertsSubFeature(ruleTypes) }]
122-
: [{ ...CASES_SUB_FEATURE }],
117+
subFeatures: [{ ...CASES_SUB_FEATURE }, { ...getAlertsSubFeature(ruleTypes) }],
123118
privileges: {
124119
all: {
125120
app: [APP_ID, 'kibana'],

x-pack/plugins/security_solution/server/plugin.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -310,9 +310,7 @@ export class Plugin implements IPlugin<PluginSetup, PluginStart, SetupPlugins, S
310310
...(isRuleRegistryEnabled ? racRuleTypes : []),
311311
];
312312

313-
plugins.features.registerKibanaFeature(
314-
getKibanaPrivilegesFeaturePrivileges(ruleTypes, isRuleRegistryEnabled)
315-
);
313+
plugins.features.registerKibanaFeature(getKibanaPrivilegesFeaturePrivileges(ruleTypes));
316314

317315
// Continue to register legacy rules against alerting client exposed through rule-registry
318316
if (this.setupPlugins.alerting != null) {

x-pack/test/api_integration/apis/security/privileges.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,16 @@ export default function ({ getService }: FtrProviderContext) {
3232
actions: ['all', 'read'],
3333
stackAlerts: ['all', 'read'],
3434
ml: ['all', 'read'],
35-
siem: ['all', 'read', 'minimal_all', 'minimal_read', 'cases_all', 'cases_read'],
35+
siem: [
36+
'all',
37+
'read',
38+
'minimal_all',
39+
'minimal_read',
40+
'cases_all',
41+
'cases_read',
42+
'alerts_all',
43+
'alerts_read',
44+
],
3645
observabilityCases: ['all', 'read'],
3746
uptime: ['all', 'read'],
3847
infrastructure: ['all', 'read'],

0 commit comments

Comments
 (0)