Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup alerting / actions feature controls #52286

Merged
merged 11 commits into from
Dec 13, 2019
24 changes: 0 additions & 24 deletions x-pack/legacy/plugins/actions/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,30 +69,6 @@ export class Plugin {
this.adminClient = await core.elasticsearch.adminClient$.pipe(first()).toPromise();
this.defaultKibanaIndex = (await this.kibana$.pipe(first()).toPromise()).index;

plugins.xpack_main.registerFeature({
id: 'actions',
name: 'Actions',
app: ['actions', 'kibana'],
privileges: {
all: {
savedObject: {
all: ['action', 'action_task_params'],
read: [],
},
ui: [],
api: ['actions-read', 'actions-all'],
},
read: {
savedObject: {
all: ['action_task_params'],
read: ['action'],
},
ui: [],
api: ['actions-read'],
},
},
});

// Encrypted attributes
// - `secrets` properties will be encrypted
// - `config` will be included in AAD
Expand Down
24 changes: 0 additions & 24 deletions x-pack/legacy/plugins/alerting/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,30 +60,6 @@ export class Plugin {
): Promise<PluginSetupContract> {
this.adminClient = await core.elasticsearch.adminClient$.pipe(first()).toPromise();

plugins.xpack_main.registerFeature({
id: 'alerting',
name: 'Alerting',
app: ['alerting', 'kibana'],
privileges: {
all: {
savedObject: {
all: ['alert'],
read: [],
},
ui: [],
api: ['alerting-read', 'alerting-all'],
},
read: {
savedObject: {
all: [],
read: ['alert'],
},
ui: [],
api: ['alerting-read'],
},
},
});

// Encrypted attributes
plugins.encryptedSavedObjects.registerType({
type: 'alert',
Expand Down
15 changes: 11 additions & 4 deletions x-pack/legacy/plugins/siem/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,24 @@ export class Plugin {
catalogue: ['siem'],
privileges: {
all: {
api: ['siem'],
api: ['siem', 'actions-read', 'actions-all', 'alerting-read', 'alerting-all'],
savedObject: {
all: [noteSavedObjectType, pinnedEventSavedObjectType, timelineSavedObjectType],
all: [
'alert',
'action',
'action_task_params',
noteSavedObjectType,
pinnedEventSavedObjectType,
timelineSavedObjectType,
],
read: ['config'],
},
ui: ['show'],
},
read: {
api: ['siem'],
api: ['siem', 'actions-read', 'actions-all', 'alerting-read', 'alerting-all'],
savedObject: {
all: [],
all: ['alert', 'action', 'action_task_params'],
read: [
'config',
noteSavedObjectType,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,30 @@ export default function(kibana: any) {
require: ['actions'],
name: NAME,
init: (server: Hapi.Server) => {
server.plugins.xpack_main.registerFeature({
id: 'actions',
name: 'Actions',
app: ['actions', 'kibana'],
privileges: {
all: {
savedObject: {
all: ['action', 'action_task_params'],
read: [],
},
ui: [],
api: ['actions-read', 'actions-all'],
},
read: {
savedObject: {
all: ['action_task_params'],
read: ['action'],
},
ui: [],
api: ['actions-read'],
},
},
});

initSlack(server, getExternalServiceSimulatorPath(ExternalServiceSimulator.SLACK));
initWebhook(server, getExternalServiceSimulatorPath(ExternalServiceSimulator.WEBHOOK));
initPagerduty(server, getExternalServiceSimulatorPath(ExternalServiceSimulator.PAGERDUTY));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,30 @@ export default function(kibana: any) {
require: ['actions', 'alerting', 'elasticsearch'],
name: 'alerts',
init(server: any) {
server.plugins.xpack_main.registerFeature({
id: 'alerting',
name: 'Alerting',
app: ['alerting', 'kibana'],
privileges: {
all: {
savedObject: {
all: ['alert'],
read: [],
},
ui: [],
api: ['alerting-read', 'alerting-all'],
},
read: {
savedObject: {
all: [],
read: ['alert'],
},
ui: [],
api: ['alerting-read'],
},
},
});

// Action types
const noopActionType: ActionType = {
id: 'test.noop',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,6 @@ export default function({ getService }: FtrProviderContext) {
'maps',
'uptime',
'siem',
'alerting',
'actions',
].sort()
);
});
Expand Down
2 changes: 0 additions & 2 deletions x-pack/test/api_integration/apis/security/privileges.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ export default function({ getService }: FtrProviderContext) {
uptime: ['all', 'read'],
apm: ['all', 'read'],
siem: ['all', 'read'],
actions: ['all', 'read'],
alerting: ['all', 'read'],
},
global: ['all', 'read'],
space: ['all', 'read'],
Expand Down