Co-authored-by: Josh <josh.rickard@swimlane.com> Co-authored-by: Xavier Mouligneau <189600+XavierM@users.noreply.github.com> Co-authored-by: Christos Nasikas <christos.nasikas@elastic.co> Co-authored-by: Jonathan Buttner <jonathan.buttner@elastic.co> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
124 lines
5 KiB
TypeScript
124 lines
5 KiB
TypeScript
/*
|
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
* 2.0; you may not use this file except in compliance with the Elastic License
|
|
* 2.0.
|
|
*/
|
|
|
|
import type { PublicMethodsOf } from '@kbn/utility-types';
|
|
import { PluginInitializerContext, PluginConfigDescriptor } from '../../../../src/core/server';
|
|
import { ActionsPlugin } from './plugin';
|
|
import { configSchema, ActionsConfig, CustomHostSettings } from './config';
|
|
import { ActionsClient as ActionsClientClass } from './actions_client';
|
|
import { ActionsAuthorization as ActionsAuthorizationClass } from './authorization/actions_authorization';
|
|
|
|
export type ActionsClient = PublicMethodsOf<ActionsClientClass>;
|
|
export type ActionsAuthorization = PublicMethodsOf<ActionsAuthorizationClass>;
|
|
|
|
export type {
|
|
ActionsPlugin,
|
|
ActionResult,
|
|
ActionTypeExecutorOptions,
|
|
ActionType,
|
|
PreConfiguredAction,
|
|
ActionsApiRequestHandlerContext,
|
|
} from './types';
|
|
|
|
export type {
|
|
EmailActionTypeId,
|
|
EmailActionParams,
|
|
IndexActionTypeId,
|
|
IndexActionParams,
|
|
PagerDutyActionTypeId,
|
|
PagerDutyActionParams,
|
|
ServerLogActionTypeId,
|
|
ServerLogActionParams,
|
|
SlackActionTypeId,
|
|
SlackActionParams,
|
|
WebhookActionTypeId,
|
|
WebhookActionParams,
|
|
ServiceNowITSMActionTypeId,
|
|
ServiceNowSIRActionTypeId,
|
|
ServiceNowActionParams,
|
|
JiraActionTypeId,
|
|
JiraActionParams,
|
|
ResilientActionTypeId,
|
|
ResilientActionParams,
|
|
TeamsActionTypeId,
|
|
TeamsActionParams,
|
|
} from './builtin_action_types';
|
|
export type { PluginSetupContract, PluginStartContract } from './plugin';
|
|
|
|
export { asSavedObjectExecutionSource, asHttpRequestExecutionSource } from './lib';
|
|
export { ACTION_SAVED_OBJECT_TYPE } from './constants/saved_objects';
|
|
|
|
export const plugin = (initContext: PluginInitializerContext) => new ActionsPlugin(initContext);
|
|
|
|
export const config: PluginConfigDescriptor<ActionsConfig> = {
|
|
schema: configSchema,
|
|
deprecations: ({ renameFromRoot, unused }) => [
|
|
renameFromRoot('xpack.actions.whitelistedHosts', 'xpack.actions.allowedHosts'),
|
|
(settings, fromPath, addDeprecation) => {
|
|
const customHostSettings = settings?.xpack?.actions?.customHostSettings ?? [];
|
|
if (
|
|
customHostSettings.find(
|
|
(customHostSchema: CustomHostSettings) =>
|
|
!!customHostSchema.ssl && !!customHostSchema.ssl.rejectUnauthorized
|
|
)
|
|
) {
|
|
addDeprecation({
|
|
message:
|
|
`"xpack.actions.customHostSettings[<index>].ssl.rejectUnauthorized" is deprecated.` +
|
|
`Use "xpack.actions.customHostSettings[<index>].ssl.verificationMode" instead, ` +
|
|
`with the setting "verificationMode:full" eql to "rejectUnauthorized:true", ` +
|
|
`and "verificationMode:none" eql to "rejectUnauthorized:false".`,
|
|
correctiveActions: {
|
|
manualSteps: [
|
|
`Remove "xpack.actions.customHostSettings[<index>].ssl.rejectUnauthorized" from your kibana configs.`,
|
|
`Use "xpack.actions.customHostSettings[<index>].ssl.verificationMode" ` +
|
|
`with the setting "verificationMode:full" eql to "rejectUnauthorized:true", ` +
|
|
`and "verificationMode:none" eql to "rejectUnauthorized:false".`,
|
|
],
|
|
},
|
|
});
|
|
}
|
|
},
|
|
(settings, fromPath, addDeprecation) => {
|
|
if (!!settings?.xpack?.actions?.rejectUnauthorized) {
|
|
addDeprecation({
|
|
message:
|
|
`"xpack.actions.rejectUnauthorized" is deprecated. Use "xpack.actions.verificationMode" instead, ` +
|
|
`with the setting "verificationMode:full" eql to "rejectUnauthorized:true", ` +
|
|
`and "verificationMode:none" eql to "rejectUnauthorized:false".`,
|
|
correctiveActions: {
|
|
manualSteps: [
|
|
`Remove "xpack.actions.rejectUnauthorized" from your kibana configs.`,
|
|
`Use "xpack.actions.verificationMode" ` +
|
|
`with the setting "verificationMode:full" eql to "rejectUnauthorized:true", ` +
|
|
`and "verificationMode:none" eql to "rejectUnauthorized:false".`,
|
|
],
|
|
},
|
|
});
|
|
}
|
|
},
|
|
(settings, fromPath, addDeprecation) => {
|
|
if (!!settings?.xpack?.actions?.proxyRejectUnauthorizedCertificates) {
|
|
addDeprecation({
|
|
message:
|
|
`"xpack.actions.proxyRejectUnauthorizedCertificates" is deprecated. Use "xpack.actions.proxyVerificationMode" instead, ` +
|
|
`with the setting "proxyVerificationMode:full" eql to "rejectUnauthorized:true",` +
|
|
`and "proxyVerificationMode:none" eql to "rejectUnauthorized:false".`,
|
|
correctiveActions: {
|
|
manualSteps: [
|
|
`Remove "xpack.actions.proxyRejectUnauthorizedCertificates" from your kibana configs.`,
|
|
`Use "xpack.actions.proxyVerificationMode" ` +
|
|
`with the setting "proxyVerificationMode:full" eql to "rejectUnauthorized:true",` +
|
|
`and "proxyVerificationMode:none" eql to "rejectUnauthorized:false".`,
|
|
],
|
|
},
|
|
});
|
|
}
|
|
},
|
|
],
|
|
};
|