Skip to content

Add necessary privileges to apps using alerting #60135

@peterschretlen

Description

@peterschretlen

Right now SIEM is the only app with alerting and actions privileges. Until features privileges is fully supported, we should add permissions to:

This snippet shows how it is done for SIEM, we would do the same in other apps:

plugins.features.registerFeature({
id: this.name,
name: i18n.translate('xpack.siem.featureRegistry.linkSiemTitle', {
defaultMessage: 'SIEM',
}),
icon: 'securityAnalyticsApp',
navLinkId: 'siem',
app: ['siem', 'kibana'],
catalogue: ['siem'],
privileges: {
all: {
api: ['siem', 'actions-read', 'actions-all', 'alerting-read', 'alerting-all'],
savedObject: {
all: [
'alert',
'action',
'action_task_params',
noteSavedObjectType,
pinnedEventSavedObjectType,
timelineSavedObjectType,
ruleStatusSavedObjectType,
],
read: ['config'],
},
ui: [
'show',
'crud',
'alerting:show',
'actions:show',
'alerting:save',
'actions:save',
'alerting:delete',
'actions:delete',
],
},
read: {
api: ['siem', 'actions-read', 'actions-all', 'alerting-read', 'alerting-all'],
savedObject: {
all: ['alert', 'action', 'action_task_params'],
read: [
'config',
noteSavedObjectType,
pinnedEventSavedObjectType,
timelineSavedObjectType,
ruleStatusSavedObjectType,
],
},
ui: [
'show',
'alerting:show',
'actions:show',
'alerting:save',
'actions:save',
'alerting:delete',
'actions:delete',
],
},
},
});

Alerting/Actions management UI capabilities have explicit checks on the SIEM feature, this may need some rework:

export function hasShowAlertsCapability(capabilities: any): boolean {
if (capabilities.siem && capabilities.siem['alerting:show']) {
return true;
}
return false;
}
export function hasShowActionsCapability(capabilities: any): boolean {
if (capabilities.siem && capabilities.siem['actions:show']) {
return true;
}
return false;
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions