diff --git a/docs/management/connectors/action-types/servicenow-itom.asciidoc b/docs/management/connectors/action-types/servicenow-itom.asciidoc index 3f104006cd1e7..70ee48ccccd7b 100644 --- a/docs/management/connectors/action-types/servicenow-itom.asciidoc +++ b/docs/management/connectors/action-types/servicenow-itom.asciidoc @@ -12,46 +12,6 @@ The {sn-itom} connector uses the https://docs.servicenow.com/bundle/rome-it-operations-management/page/product/event-management/task/send-events-via-web-service.html[event API] to create {sn} events. You can use the connector for rule actions. -[float] -[[servicenow-itom-connector-prerequisites]] -=== Prerequisites - -. <> -. If you use open authorization (OAuth), you must also: -.. <>. -.. <>. - -[float] -[[servicenow-itom-connector-prerequisites-integration-user]] -==== Create a {sn} integration user - -To ensure authenticated communication between Elastic and {sn}, create a {sn} integration user and assign it the appropriate roles. - -. In your {sn} instance, go to *System Security -> Users and Groups -> Users*. -. Click *New*. -. Complete the form, then right-click on the menu bar and click *Save*. -. Go to the *Roles* tab and click *Edit*. -. Assign the integration user the following roles: -* `personalize_choices`: Allows the user to retrieve Choice element options, such as Severity. -* `evt_mgmt_integration`: Enables integration with external event sources by allowing the user to create events. -. Click *Save*. - -[float] -[[servicenow-itom-connector-prerequisites-rsa-key]] -==== Create an RSA keypair and add an X.509 Certificate - -This step is required to use OAuth for authentication between Elastic and {sn}. - -include::servicenow.asciidoc[tag=servicenow-rsa-key] - -include::servicenow.asciidoc[tag=servicenow-certificate] - -[float] -[[servicenow-itom-connector-prerequisites-endpoint]] -==== Create an OAuth JWT API endpoint for external clients with a JWT Verifiers Map - -include::servicenow.asciidoc[tag=servicenow-endpoint] - [float] [[define-servicenow-itom-ui]] === Create connectors in {kib} @@ -61,9 +21,11 @@ or as needed when you're creating a rule. You must choose whether to use OAuth f [role="screenshot"] image::management/connectors/images/servicenow-itom-connector-basic.png[{sn-itom} connector using basic auth] +// NOTE: This is an autogenerated screenshot. Do not edit it directly. [role="screenshot"] image::management/connectors/images/servicenow-itom-connector-oauth.png[{sn-itom} connector using OAuth] +// NOTE: This is an autogenerated screenshot. Do not edit it directly. [float] [[servicenow-itom-connector-configuration]] @@ -71,17 +33,31 @@ image::management/connectors/images/servicenow-itom-connector-oauth.png[{sn-itom {sn-itom} connectors have the following configuration properties: -Name:: The name of the connector. -Is OAuth:: The type of authentication to use. -URL:: {sn} instance URL. -Username:: Username for HTTP Basic authentication. -Password:: Password for HTTP Basic authentication. -User Identifier:: Identifier to use for OAuth type authentication. This identifier should be the *User field* you selected during setup. For example, if the selected *User field* is *Email*, the user identifier should be the user's email address. -Client ID:: The client ID assigned to your OAuth application. -Client Secret:: The client secret assigned to your OAuth application. -JWT Key ID:: The key ID assigned to the JWT verifier map of your OAuth application. -Private Key:: The RSA private key generated during setup. -Private Key Password:: The password for the RSA private key generated during setup, if set. +Client ID:: +The client identifier assigned to your OAuth application. +Client secret:: +The client secret assigned to your OAuth application. +JWT key ID:: +The key identifier assigned to the JWT verifier map of your OAuth application. +Connector name:: +The name is used to identify a connector in the management UI connector listing or in the connector list when configuring an action. +Password:: +The password for HTTP basic authentication. +Private key:: +The RSA private key that you created for use in ServiceNow. +Private key password:: +The password for the RSA private key. +This value is required when you set a password for your private key. +{sn} instance URL:: +The full URL for the {sn} instance. +Use OAuth authentication:: +By default, basic authentication is used instead of open authorization (OAuth). +User identifier:: +The identifier to use for OAuth type authentication. +This identifier should be the user field you selected when you created an OAuth JWT API endpoint for external clients in your ServiceNow instance. +For example, if the selected user field is `Email`, the user identifier should be the user's email address. +Username:: +The username for HTTP basic authentication. [float] [[servicenow-itom-action-configuration]] @@ -92,18 +68,28 @@ as you're creating or editing the connector in {kib}. For example: [role="screenshot"] image::management/connectors/images/servicenow-itom-params-test.png[{sn-itom} params test] +// NOTE: This is an autogenerated screenshot. Do not edit it directly. {sn-itom} actions have the following configuration properties. -Source:: The name of the event source type. -Node:: The Host that the event was triggered for. -Type:: The type of event. -Resource:: The name of the resource. -Metric name:: Name of the metric. -Source instance (event_class):: Specific instance of the source. -Message key:: All actions sharing this key will be associated with the same {sn} alert. Default value: `:`. -Severity:: The severity of the event. -Description:: The details about the event. +Description:: +The details about the event. +Message key:: +All actions sharing this key are associated with the same {sn} alert. The default value is `{{rule.id}}:{{alert.id}}`. +Metric name:: +The name of the metric. +Node:: +The host that the event was triggered for. +Resource:: +The name of the resource. +Severity:: +The severity of the event. +Source:: +The name of the event source type. +Source instance:: +A specific instance of the source. +Type:: +The type of event. Refer to https://docs.servicenow.com/bundle/rome-it-operations-management/page/product/event-management/task/send-events-via-web-service.html[{sn} documentation] for more information about the properties. @@ -118,3 +104,44 @@ Use the <> to customize connecto === Configure {sn-itom} {sn} offers free https://developer.servicenow.com/dev.do#!/guides/madrid/now-platform/pdi-guide/obtaining-a-pdi[Personal Developer Instances], which you can use to test incidents. + +[float] +[[servicenow-itom-connector-prerequisites]] +==== Prerequisites + +. <> +. If you use open authorization (OAuth), you must also: +.. <>. +.. <>. + +[float] +[[servicenow-itom-connector-prerequisites-integration-user]] +==== Create a {sn} integration user + +To ensure authenticated communication between Elastic and {sn}, create a {sn} integration user and assign it the appropriate roles. + +. In your {sn} instance, go to *System Security -> Users and Groups -> Users*. +. Click *New*. +. Complete the form, then right-click on the menu bar and click *Save*. +. Go to the *Roles* tab and click *Edit*. +. Assign the integration user the following roles: +* `personalize_choices`: Allows the user to retrieve Choice element options, such as Severity. +* `evt_mgmt_integration`: Enables integration with external event sources by allowing the user to create events. +. Click *Save*. + +[float] +[[servicenow-itom-connector-prerequisites-rsa-key]] +==== Create an RSA keypair and add an X.509 Certificate + +This step is required to use OAuth for authentication between Elastic and {sn}. + +include::servicenow.asciidoc[tag=servicenow-rsa-key] + +include::servicenow.asciidoc[tag=servicenow-certificate] + +[float] +[[servicenow-itom-connector-prerequisites-endpoint]] +==== Create an OAuth JWT API endpoint for external clients with a JWT Verifiers Map + +include::servicenow.asciidoc[tag=servicenow-endpoint] + diff --git a/docs/management/connectors/images/servicenow-itom-connector-basic.png b/docs/management/connectors/images/servicenow-itom-connector-basic.png index fb5c73bb82785..eaa3f5a9c7ded 100644 Binary files a/docs/management/connectors/images/servicenow-itom-connector-basic.png and b/docs/management/connectors/images/servicenow-itom-connector-basic.png differ diff --git a/docs/management/connectors/images/servicenow-itom-connector-oauth.png b/docs/management/connectors/images/servicenow-itom-connector-oauth.png index 2e5d2c430d1ae..32e64b7620527 100644 Binary files a/docs/management/connectors/images/servicenow-itom-connector-oauth.png and b/docs/management/connectors/images/servicenow-itom-connector-oauth.png differ diff --git a/docs/management/connectors/images/servicenow-itom-params-test.png b/docs/management/connectors/images/servicenow-itom-params-test.png index 8d7b1e075911a..86b86071b0a23 100644 Binary files a/docs/management/connectors/images/servicenow-itom-params-test.png and b/docs/management/connectors/images/servicenow-itom-params-test.png differ diff --git a/x-pack/plugins/stack_connectors/public/connector_types/lib/servicenow/credentials.test.tsx b/x-pack/plugins/stack_connectors/public/connector_types/lib/servicenow/credentials.test.tsx index 2e1ae98a10886..25245802b9d4c 100644 --- a/x-pack/plugins/stack_connectors/public/connector_types/lib/servicenow/credentials.test.tsx +++ b/x-pack/plugins/stack_connectors/public/connector_types/lib/servicenow/credentials.test.tsx @@ -39,11 +39,11 @@ describe('Credentials', () => { expect(screen.getByLabelText('Password')).toBeInTheDocument(); expect(screen.queryByLabelText('Client ID')).not.toBeInTheDocument(); - expect(screen.queryByLabelText('User Identifier')).not.toBeInTheDocument(); - expect(screen.queryByLabelText('JWT Verifier Key ID')).not.toBeInTheDocument(); - expect(screen.queryByLabelText('Client Secret')).not.toBeInTheDocument(); - expect(screen.queryByLabelText('Private Key')).not.toBeInTheDocument(); - expect(screen.queryByLabelText('Private Key Password')).not.toBeInTheDocument(); + expect(screen.queryByLabelText('User identifier')).not.toBeInTheDocument(); + expect(screen.queryByLabelText('JWT verifier key ID')).not.toBeInTheDocument(); + expect(screen.queryByLabelText('Client secret')).not.toBeInTheDocument(); + expect(screen.queryByLabelText('Private key')).not.toBeInTheDocument(); + expect(screen.queryByLabelText('Private key password')).not.toBeInTheDocument(); }); it('switches to oauth form', async () => { @@ -64,10 +64,10 @@ describe('Credentials', () => { expect(screen.queryByLabelText('Password')).not.toBeInTheDocument(); expect(screen.getByLabelText('Client ID')).toBeInTheDocument(); - expect(screen.getByLabelText('User Identifier')).toBeInTheDocument(); - expect(screen.getByLabelText('JWT Verifier Key ID')).toBeInTheDocument(); - expect(screen.getByLabelText('Client Secret')).toBeInTheDocument(); - expect(screen.getByLabelText('Private Key')).toBeInTheDocument(); - expect(screen.getByLabelText('Private Key Password')).toBeInTheDocument(); + expect(screen.getByLabelText('User identifier')).toBeInTheDocument(); + expect(screen.getByLabelText('JWT verifier key ID')).toBeInTheDocument(); + expect(screen.getByLabelText('Client secret')).toBeInTheDocument(); + expect(screen.getByLabelText('Private key')).toBeInTheDocument(); + expect(screen.getByLabelText('Private key password')).toBeInTheDocument(); }); }); diff --git a/x-pack/plugins/stack_connectors/public/connector_types/lib/servicenow/translations.ts b/x-pack/plugins/stack_connectors/public/connector_types/lib/servicenow/translations.ts index f55a82b4ce00c..f2c9a712def55 100644 --- a/x-pack/plugins/stack_connectors/public/connector_types/lib/servicenow/translations.ts +++ b/x-pack/plugins/stack_connectors/public/connector_types/lib/servicenow/translations.ts @@ -63,7 +63,7 @@ export const INCIDENT = i18n.translate('xpack.stackConnectors.components.service export const SECURITY_INCIDENT = i18n.translate( 'xpack.stackConnectors.components.serviceNowSIR.title', { - defaultMessage: 'Security Incident', + defaultMessage: 'Security incident', } ); @@ -276,13 +276,6 @@ export const SEVERITY_REQUIRED = i18n.translate( } ); -export const SEVERITY_REQUIRED_LABEL = i18n.translate( - 'xpack.stackConnectors.components.serviceNow.severityRequiredSelectFieldLabel', - { - defaultMessage: 'Severity (required)', - } -); - export const CLIENTID_LABEL = i18n.translate( 'xpack.stackConnectors.components.serviceNow.clientIdTextFieldLabel', { @@ -293,35 +286,35 @@ export const CLIENTID_LABEL = i18n.translate( export const CLIENTSECRET_LABEL = i18n.translate( 'xpack.stackConnectors.components.serviceNow.clientSecretTextFieldLabel', { - defaultMessage: 'Client Secret', + defaultMessage: 'Client secret', } ); export const KEY_ID_LABEL = i18n.translate( 'xpack.stackConnectors.components.serviceNow.keyIdTextFieldLabel', { - defaultMessage: 'JWT Verifier Key ID', + defaultMessage: 'JWT verifier key ID', } ); export const USER_IDENTIFIER_LABEL = i18n.translate( 'xpack.stackConnectors.components.serviceNow.userEmailTextFieldLabel', { - defaultMessage: 'User Identifier', + defaultMessage: 'User identifier', } ); export const PRIVATE_KEY_LABEL = i18n.translate( 'xpack.stackConnectors.components.serviceNow.privateKeyTextFieldLabel', { - defaultMessage: 'Private Key', + defaultMessage: 'Private key', } ); export const PRIVATE_KEY_PASSWORD_LABEL = i18n.translate( 'xpack.stackConnectors.components.serviceNow.privateKeyPassTextFieldLabel', { - defaultMessage: 'Private Key Password', + defaultMessage: 'Private key password', } ); @@ -342,21 +335,21 @@ export const CLIENTID_REQUIRED = i18n.translate( export const PRIVATE_KEY_REQUIRED = i18n.translate( 'xpack.stackConnectors.components.serviceNow.requiredPrivateKeyTextField', { - defaultMessage: 'Private Key is required.', + defaultMessage: 'Private key is required.', } ); export const KEYID_REQUIRED = i18n.translate( 'xpack.stackConnectors.components.serviceNow.requiredKeyIdTextField', { - defaultMessage: 'JWT Verifier Key ID is required.', + defaultMessage: 'JWT verifier key ID is required.', } ); export const USER_IDENTIFIER_REQUIRED = i18n.translate( 'xpack.stackConnectors.components.serviceNow.requiredUserIdentifierTextField', { - defaultMessage: 'User Identifier is required.', + defaultMessage: 'User identifier is required.', } ); @@ -370,10 +363,24 @@ export const PASSWORD_REQUIRED = i18n.translate( export const CLIENTSECRET_REQUIRED = i18n.translate( 'xpack.stackConnectors.components.serviceNow.requiredClientSecretTextField', { - defaultMessage: 'Client Secret is required.', + defaultMessage: 'Client secret is required.', } ); export const IS_OAUTH = i18n.translate('xpack.stackConnectors.components.serviceNow.useOAuth', { defaultMessage: 'Use OAuth authentication', }); + +export const OPTIONAL_LABEL = i18n.translate( + 'xpack.stackConnectors.components.serviceNow.optionalLabel', + { + defaultMessage: 'Optional', + } +); + +export const REQUIRED_LABEL = i18n.translate( + 'xpack.stackConnectors.components.serviceNow.requiredLabel', + { + defaultMessage: 'Required', + } +); diff --git a/x-pack/plugins/stack_connectors/public/connector_types/servicenow_itom/servicenow_itom_params.tsx b/x-pack/plugins/stack_connectors/public/connector_types/servicenow_itom/servicenow_itom_params.tsx index 3b9d8f34deefe..bc059fb8e592e 100644 --- a/x-pack/plugins/stack_connectors/public/connector_types/servicenow_itom/servicenow_itom_params.tsx +++ b/x-pack/plugins/stack_connectors/public/connector_types/servicenow_itom/servicenow_itom_params.tsx @@ -6,7 +6,7 @@ */ import React, { useCallback, useEffect, useRef, useMemo } from 'react'; -import { EuiFormRow, EuiSpacer, EuiTitle, EuiSelect } from '@elastic/eui'; +import { EuiFormRow, EuiSpacer, EuiTitle, EuiText, EuiSelect } from '@elastic/eui'; import type { ActionParamsProps } from '@kbn/triggers-actions-ui-plugin/public'; import { TextAreaWithMessageVariables, @@ -130,7 +130,12 @@ const ServiceNowITOMParamsFields: React.FunctionComponent< ))} + {i18n.REQUIRED_LABEL} + + } error={errors.severity} isInvalid={isFieldInvalid(severity, errors.severity)} > diff --git a/x-pack/plugins/translations/translations/fr-FR.json b/x-pack/plugins/translations/translations/fr-FR.json index 7583d873032af..427b142051eb3 100644 --- a/x-pack/plugins/translations/translations/fr-FR.json +++ b/x-pack/plugins/translations/translations/fr-FR.json @@ -39342,7 +39342,6 @@ "xpack.stackConnectors.components.serviceNow.requiredUsernameTextField": "Le nom d'utilisateur est requis.", "xpack.stackConnectors.components.serviceNow.resourceTextAreaFieldLabel": "Ressource", "xpack.stackConnectors.components.serviceNow.setupDevInstance": "configurer une instance de développeur", - "xpack.stackConnectors.components.serviceNow.severityRequiredSelectFieldLabel": "Sévérité (requise)", "xpack.stackConnectors.components.serviceNow.severitySelectFieldLabel": "Sévérité", "xpack.stackConnectors.components.serviceNow.snInstanceLabel": "Instance ServiceNow", "xpack.stackConnectors.components.serviceNow.sourceTextAreaFieldLabel": "Source", diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index 6d33962b57d0a..96e02c7bab8f5 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -39340,7 +39340,6 @@ "xpack.stackConnectors.components.serviceNow.requiredUsernameTextField": "ユーザー名が必要です。", "xpack.stackConnectors.components.serviceNow.resourceTextAreaFieldLabel": "リソース", "xpack.stackConnectors.components.serviceNow.setupDevInstance": "開発者インスタンスを設定", - "xpack.stackConnectors.components.serviceNow.severityRequiredSelectFieldLabel": "重要度(必須)", "xpack.stackConnectors.components.serviceNow.severitySelectFieldLabel": "深刻度", "xpack.stackConnectors.components.serviceNow.snInstanceLabel": "ServiceNowインスタンス", "xpack.stackConnectors.components.serviceNow.sourceTextAreaFieldLabel": "送信元", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index 00645f7c4ec17..1ac7f9be873b3 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -39334,7 +39334,6 @@ "xpack.stackConnectors.components.serviceNow.requiredUsernameTextField": "“用户名”必填。", "xpack.stackConnectors.components.serviceNow.resourceTextAreaFieldLabel": "资源", "xpack.stackConnectors.components.serviceNow.setupDevInstance": "设置开发者实例", - "xpack.stackConnectors.components.serviceNow.severityRequiredSelectFieldLabel": "严重性(必需)", "xpack.stackConnectors.components.serviceNow.severitySelectFieldLabel": "严重性", "xpack.stackConnectors.components.serviceNow.snInstanceLabel": "ServiceNow 实例", "xpack.stackConnectors.components.serviceNow.sourceTextAreaFieldLabel": "源", diff --git a/x-pack/test/screenshot_creation/apps/response_ops_docs/stack_connectors/index.ts b/x-pack/test/screenshot_creation/apps/response_ops_docs/stack_connectors/index.ts index c3bc4ba0f4f09..9acb3600587c3 100644 --- a/x-pack/test/screenshot_creation/apps/response_ops_docs/stack_connectors/index.ts +++ b/x-pack/test/screenshot_creation/apps/response_ops_docs/stack_connectors/index.ts @@ -62,6 +62,7 @@ export default function ({ loadTestFile, getService }: FtrProviderContext) { loadTestFile(require.resolve('./opsgenie_connector')); loadTestFile(require.resolve('./pagerduty_connector')); loadTestFile(require.resolve('./server_log_connector')); + loadTestFile(require.resolve('./servicenow_itom_connector')); loadTestFile(require.resolve('./slack_connector')); loadTestFile(require.resolve('./webhook_connector')); loadTestFile(require.resolve('./xmatters_connector')); diff --git a/x-pack/test/screenshot_creation/apps/response_ops_docs/stack_connectors/servicenow_itom_connector.ts b/x-pack/test/screenshot_creation/apps/response_ops_docs/stack_connectors/servicenow_itom_connector.ts new file mode 100644 index 0000000000000..7aaf43d26bdbc --- /dev/null +++ b/x-pack/test/screenshot_creation/apps/response_ops_docs/stack_connectors/servicenow_itom_connector.ts @@ -0,0 +1,55 @@ +/* + * 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 { FtrProviderContext } from '../../../ftr_provider_context'; + +export default function ({ getService, getPageObjects }: FtrProviderContext) { + const commonScreenshots = getService('commonScreenshots'); + const screenshotDirectories = ['response_ops_docs', 'stack_connectors']; + const pageObjects = getPageObjects(['common', 'header']); + const actions = getService('actions'); + const testSubjects = getService('testSubjects'); + + describe('servicenow itom connector', function () { + beforeEach(async () => { + await pageObjects.common.navigateToApp('connectors'); + await pageObjects.header.waitUntilLoadingHasFinished(); + }); + + it('servicenow itom connector screenshots', async () => { + await pageObjects.common.navigateToApp('connectors'); + await pageObjects.header.waitUntilLoadingHasFinished(); + await actions.common.openNewConnectorForm('servicenow-itom'); + await testSubjects.setValue('nameInput', 'ServiceNow ITOM test connector'); + await testSubjects.setValue('credentialsApiUrlFromInput', 'https://dev123.service-now.com'); + await testSubjects.click('input'); + await commonScreenshots.takeScreenshot( + 'servicenow-itom-connector-oauth', + screenshotDirectories, + 1920, + 1400 + ); + await testSubjects.click('input'); + await testSubjects.setValue('connector-servicenow-username-form-input', 'testuser'); + await testSubjects.setValue('connector-servicenow-password-form-input', 'testpassword'); + await commonScreenshots.takeScreenshot( + 'servicenow-itom-connector-basic', + screenshotDirectories + ); + await testSubjects.click('create-connector-flyout-save-test-btn'); + await testSubjects.click('toastCloseButton'); + await testSubjects.click('toastCloseButton'); + await commonScreenshots.takeScreenshot( + 'servicenow-itom-params-test', + screenshotDirectories, + 1920, + 1400 + ); + await testSubjects.click('euiFlyoutCloseButton'); + }); + }); +}