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

# Backport

This will backport the following commits from `main` to `8.11`:
- [[Connectors][ServiceNow ITOM] Edit required labels and automate
screenshots (#172229)](https://github.com/elastic/kibana/pull/172229)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Lisa
Cawley","email":"lcawley@elastic.co"},"sourceCommit":{"committedDate":"2023-12-04T19:50:07Z","message":"[Connectors][ServiceNow
ITOM] Edit required labels and automate screenshots
(#172229)","sha":"e69063e08256b315175af9f749de762197537ca3","branchLabelMapping":{"^v8.12.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:ResponseOps","docs","Feature:Actions/ConnectorTypes","backport:prev-minor","v8.12.0","v8.12.1"],"number":172229,"url":"https://github.com/elastic/kibana/pull/172229","mergeCommit":{"message":"[Connectors][ServiceNow
ITOM] Edit required labels and automate screenshots
(#172229)","sha":"e69063e08256b315175af9f749de762197537ca3"}},"sourceBranch":"main","suggestedTargetBranches":["8.12"],"targetPullRequestStates":[{"branch":"main","label":"v8.12.0","labelRegex":"^v8.12.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/172229","number":172229,"mergeCommit":{"message":"[Connectors][ServiceNow
ITOM] Edit required labels and automate screenshots
(#172229)","sha":"e69063e08256b315175af9f749de762197537ca3"}},{"branch":"8.12","label":"v8.12.1","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Lisa Cawley <lcawley@elastic.co>
This commit is contained in:
Kibana Machine 2023-12-04 16:02:58 -05:00 committed by GitHub
parent 02784994f2
commit 92746356b6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 191 additions and 99 deletions

View file

@ -12,9 +12,102 @@ 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]
[[define-servicenow-itom-ui]]
=== Create connectors in {kib}
You can create connectors in *{stack-manage-app} > {connectors-ui}*
or as needed when you're creating a rule. You must choose whether to use OAuth for authentication.
[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:
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]]
=== Test connectors
You can test connectors with the <<execute-connector-api,run connector API>> or
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.
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.
[float]
[[servicenow-itom-connector-networking-configuration]]
=== Connector networking configuration
Use the <<action-settings, Action configuration settings>> to customize connector networking configurations, such as proxies, certificates, or TLS settings. You can set configurations that apply to all your connectors or use `xpack.actions.customHostSettings` to set per-host configurations.
[float]
[[configuring-servicenow-itom]]
=== 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
==== 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:
@ -52,69 +145,3 @@ include::servicenow.asciidoc[tag=servicenow-certificate]
include::servicenow.asciidoc[tag=servicenow-endpoint]
[float]
[[define-servicenow-itom-ui]]
=== Create connectors in {kib}
You can create connectors in *{stack-manage-app} > {connectors-ui}*
or as needed when you're creating a rule. You must choose whether to use OAuth for authentication.
[role="screenshot"]
image::management/connectors/images/servicenow-itom-connector-basic.png[{sn-itom} connector using basic auth]
[role="screenshot"]
image::management/connectors/images/servicenow-itom-connector-oauth.png[{sn-itom} connector using OAuth]
[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.
[float]
[[servicenow-itom-action-configuration]]
=== Test connectors
You can test connectors with the <<execute-connector-api,run connector API>> or
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]
{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.
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.
[float]
[[servicenow-itom-connector-networking-configuration]]
=== Connector networking configuration
Use the <<action-settings, Action configuration settings>> to customize connector networking configurations, such as proxies, certificates, or TLS settings. You can set configurations that apply to all your connectors or use `xpack.actions.customHostSettings` to set per-host configurations.
[float]
[[configuring-servicenow-itom]]
=== 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.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 183 KiB

After

Width:  |  Height:  |  Size: 204 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 185 KiB

After

Width:  |  Height:  |  Size: 231 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 255 KiB

After

Width:  |  Height:  |  Size: 143 KiB

Before After
Before After

View file

@ -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();
});
});

View file

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

View file

@ -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<
))}
<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)}
>

View file

@ -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",

View file

@ -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": "送信元",

View file

@ -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": "源",

View file

@ -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'));

View file

@ -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');
});
});
}