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

[8.11] [Connectors][ServiceNow ITOM] Edit required labels and automate screenshots (#172229) #172516

Merged
merged 1 commit into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
147 changes: 87 additions & 60 deletions docs/management/connectors/action-types/servicenow-itom.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -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

. <<servicenow-itom-connector-prerequisites-integration-user,Create a {sn} integration user and assign it the appropriate roles.>>
. If you use open authorization (OAuth), you must also:
.. <<servicenow-itom-connector-prerequisites-rsa-key,Create an RSA keypair and add an X.509 Certificate>>.
.. <<servicenow-itom-connector-prerequisites-endpoint,Create an OAuth JWT API endpoint for external clients with a JWT Verifiers Map>>.

[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}
Expand All @@ -61,27 +21,43 @@ 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]]
==== Connector configuration

{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]]
Expand All @@ -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: `<rule ID>:<alert instance ID>`.
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.

Expand All @@ -118,3 +104,44 @@ Use the <<action-settings, Action configuration settings>> 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

. <<servicenow-itom-connector-prerequisites-integration-user,Create a {sn} integration user and assign it the appropriate roles.>>
. If you use open authorization (OAuth), you must also:
.. <<servicenow-itom-connector-prerequisites-rsa-key,Create an RSA keypair and add an X.509 Certificate>>.
.. <<servicenow-itom-connector-prerequisites-endpoint,Create an OAuth JWT API endpoint for external clients with a JWT Verifiers Map>>.

[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]

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand All @@ -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();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -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',
}
);

Expand Down Expand Up @@ -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',
{
Expand All @@ -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',
}
);

Expand All @@ -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.',
}
);

Expand All @@ -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',
}
);
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -130,7 +130,12 @@ const ServiceNowITOMParamsFields: React.FunctionComponent<
))}
<EuiFormRow
fullWidth
label={i18n.SEVERITY_REQUIRED_LABEL}
label={i18n.SEVERITY_LABEL}
labelAppend={
<EuiText size="xs" color="subdued">
{i18n.REQUIRED_LABEL}
</EuiText>
}
error={errors.severity}
isInvalid={isFieldInvalid(severity, errors.severity)}
>
Expand Down
1 change: 0 additions & 1 deletion x-pack/plugins/translations/translations/fr-FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 0 additions & 1 deletion x-pack/plugins/translations/translations/ja-JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "送信元",
Expand Down
1 change: 0 additions & 1 deletion x-pack/plugins/translations/translations/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "源",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
Expand Down
Loading
Loading