Skip to content

Commit

Permalink
Merge branch '8.11' into backport/8.11/pr-167916
Browse files Browse the repository at this point in the history
  • Loading branch information
MadameSheema authored Oct 16, 2023
2 parents aa8b58d + e4df321 commit 6fefd8f
Show file tree
Hide file tree
Showing 40 changed files with 695 additions and 330 deletions.
2 changes: 1 addition & 1 deletion .ci/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# NOTE: This Dockerfile is ONLY used to run certain tasks in CI. It is not used to run Kibana or as a distributable.
# If you're looking for the Kibana Docker image distributable, please see: src/dev/build/tasks/os_packages/docker_generator/templates/dockerfile.template.ts

ARG NODE_VERSION=18.17.1
ARG NODE_VERSION=18.18.2

FROM node:${NODE_VERSION} AS base

Expand Down
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.17.1
18.18.2
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.17.1
18.18.2
12 changes: 6 additions & 6 deletions WORKSPACE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ load("@build_bazel_rules_nodejs//:index.bzl", "node_repositories", "yarn_install
# Setup the Node.js toolchain for the architectures we want to support
node_repositories(
node_repositories = {
"18.17.1-darwin_amd64": ("node-v18.17.1-darwin-x64.tar.gz", "node-v18.17.1-darwin-x64", "b3e083d2715f07ec3f00438401fb58faa1e0bdf3c7bde9f38b75ed17809d92fa"),
"18.17.1-darwin_arm64": ("node-v18.17.1-darwin-arm64.tar.gz", "node-v18.17.1-darwin-arm64", "18ca716ea57522b90473777cb9f878467f77fdf826d37beb15a0889fdd74533e"),
"18.17.1-linux_arm64": ("node-v18.17.1-linux-arm64.tar.xz", "node-v18.17.1-linux-arm64", "2743722f164df953b11663a6c25f9cf35769bf500e712e21a6c20e896177da30"),
"18.17.1-linux_amd64": ("node-v18.17.1-linux-x64.tar.xz", "node-v18.17.1-linux-x64", "4612954fef461bb05ba952112636bd11e51c0a59db94e6c4b26328fee4d4d9ab"),
"18.17.1-windows_amd64": ("node-v18.17.1-win-x64.zip", "node-v18.17.1-win-x64", "afc83f5cf6e8b45a4d3fb842904f604dcd271fefada31ad6654f8302f8da28c9"),
"18.18.2-darwin_amd64": ("node-v18.18.2-darwin-x64.tar.gz", "node-v18.18.2-darwin-x64", "5bb8da908ed590e256a69bf2862238c8a67bc4600119f2f7721ca18a7c810c0f"),
"18.18.2-darwin_arm64": ("node-v18.18.2-darwin-arm64.tar.gz", "node-v18.18.2-darwin-arm64", "9f982cc91b28778dd8638e4f94563b0c2a1da7aba62beb72bd427721035ab553"),
"18.18.2-linux_arm64": ("node-v18.18.2-linux-arm64.tar.xz", "node-v18.18.2-linux-arm64", "8a5a03f6a742159c9aa0ae3a99b368cd938cf62f3a5522a2e5acbe6313710efe"),
"18.18.2-linux_amd64": ("node-v18.18.2-linux-x64.tar.xz", "node-v18.18.2-linux-x64", "f7cf590bc7153f3beaa9e1138d00e50d74df223f0bec61f63e7df65f7315b76a"),
"18.18.2-windows_amd64": ("node-v18.18.2-win-x64.zip", "node-v18.18.2-win-x64", "3bb0e51e579a41a22b3bf6cb2f3e79c03801aa17acbe0ca00fc555d1282e7acd"),
},
node_version = "18.17.1",
node_version = "18.18.2",
node_urls = [
"https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/dist/v{version}/{filename}",
],
Expand Down
35 changes: 1 addition & 34 deletions docs/action-type-template.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -28,42 +28,9 @@ List of user-facing connector configurations. This should align with the fields
Property1:: A short description of this property.
Property2:: A short description of this property with format hints. This can be specified in `this specific format`.

[float]
[[preconfigured-<ACTION-TYPE>-configuration]]
=== Create preconfigured connectors

If you are running {kib} on-prem, you can define connectors by
adding `xpack.actions.preconfigured` settings to your `kibana.yml` file.
For example:

////
Example preconfigured format for this connector type
////

[source,text]
--
xpack.actions.preconfigured:
my-<ACTION-TYPE>:
name: preconfigured-<ACTION-TYPE>-connector-type
actionTypeId: .<ACTION-TYPE>
config:
property1: value1
property2: value2
secrets:
property3: value3
--

////
List of properties from the ConfigSchema and SecretsSchema for this action type.
Add preconfigured settings for this connector type in alert-action-settings.asciidoc and an example in pre-configured-connectors.asciidoc.
////
Config defines information for the connector type.

`property1`:: A short description of this property.
`property2`:: A short descriptionn of this property.

Secrets defines sensitive information for the connector type.

`property3`:: A short descriptionn of this property.

[float]
[[<ACTION-TYPE>-action-configuration]]
Expand Down
2 changes: 1 addition & 1 deletion docs/developer/advanced/upgrading-nodejs.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ These files must be updated when upgrading Node.js:
- {kib-repo}blob/{branch}/WORKSPACE.bazel[`WORKSPACE.bazel`] - The version is specified in the `node_version` property.
Besides this property, the list of files under `node_repositories` must be updated along with their respective SHA256 hashes.
These can be found on the https://nodejs.org[nodejs.org] website.
Example for Node.js v18.17.1: https://nodejs.org/dist/v18.17.1/SHASUMS256.txt.asc
Example for Node.js v18.18.2: https://nodejs.org/dist/v18.18.2/SHASUMS256.txt.asc

See PR {kib-repo}pull/128123[#128123] for an example of how the Node.js version has been upgraded previously.

Expand Down
4 changes: 2 additions & 2 deletions docs/management/action-types.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ Connectors provide a central place to store connection information for services
[cols="2"]
|===

a| <<bedrock-action-type,AWS Bedrock>>
a| <<bedrock-action-type,{bedrock}>>

| Send a request to AWS Bedrock.
| Send a request to {bedrock}.

a| <<d3security-action-type,D3 Security>>

Expand Down
24 changes: 12 additions & 12 deletions docs/management/connectors/action-types/bedrock.asciidoc
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
[[bedrock-action-type]]
== AWS Bedrock connector and action
== {bedrock} connector and action
++++
<titleabbrev>AWS Bedrock</titleabbrev>
<titleabbrev>{bedrock}</titleabbrev>
++++
:frontmatter-description: Add a connector that can send requests to AWS Bedrock.
:frontmatter-description: Add a connector that can send requests to {bedrock}.
:frontmatter-tags-products: [kibana]
:frontmatter-tags-content-type: [how-to]
:frontmatter-tags-user-goals: [configure]


The AWS Bedrock connector uses https://github.com/axios/axios[axios] to send a POST request to AWS Bedrock. The connector uses the <<execute-connector-api,run connector API>> to send the request.
The {bedrock} connector uses https://github.com/axios/axios[axios] to send a POST request to {bedrock}. The connector uses the <<execute-connector-api,run connector API>> to send the request.

[float]
[[define-bedrock-ui]]
Expand All @@ -19,18 +19,18 @@ You can create connectors in *{stack-manage-app} > {connectors-ui}*. For exampl

[role="screenshot"]
// TODO: need logo before screenshot
image::management/connectors/images/bedrock-connector.png[AWS Bedrock connector]
image::management/connectors/images/bedrock-connector.png[{bedrock} connector]

[float]
[[bedrock-connector-configuration]]
==== Connector configuration

AWS Bedrock connectors have the following configuration properties:
{bedrock} connectors have the following configuration properties:

Name:: The name of the connector.
API URL:: The AWS Bedrock request URL.
Default model:: The GAI model for AWS Bedrock to use. Current support is for the Anthropic Claude models, defaulting to Claude 2. The model can be set on a per request basis by including a "model" parameter alongside the request body.
Region:: The AWS Bedrock request URL.
API URL:: The {bedrock} request URL.
Default model:: The GAI model for {bedrock} to use. Current support is for the Anthropic Claude models, defaulting to Claude 2. The model can be set on a per request basis by including a "model" parameter alongside the request body.
Region:: The {bedrock} request URL.
Access Key:: The AWS access key for authentication.
Secret:: The secret for authentication.

Expand All @@ -43,11 +43,11 @@ as you're creating or editing the connector in {kib}. For example:

[role="screenshot"]
// TODO: need logo before screenshot
image::management/connectors/images/bedrock-params.png[AWS Bedrock params test]
image::management/connectors/images/bedrock-params.png[{bedrock} params test]

The AWS Bedrock actions have the following configuration properties.
The {bedrock} actions have the following configuration properties.

Body:: A stringified JSON payload sent to the AWS Bedrock Invoke Model API URL. For example:
Body:: A stringified JSON payload sent to the {bedrock} Invoke Model API URL. For example:
+
[source,text]
--
Expand Down
32 changes: 31 additions & 1 deletion docs/management/connectors/pre-configured-connectors.asciidoc
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
[[pre-configured-connectors]]
== Preconfigured connectors
:frontmatter-description: Define connectors in the {kib} configuration file.
:frontmatter-tags-products: [kibana]
:frontmatter-tags-content-type: [how-to]
:frontmatter-tags-user-goals: [configure]

If you are running {kib} on-prem, you can preconfigure a connector to have all
the information it needs prior to startup by adding it to the `kibana.yml` file.
Expand All @@ -20,6 +24,7 @@ predefined, including the connector name and ID.

Add `xpack.actions.preconfigured` settings to your `kibana.yml` file. The
settings vary depending on which type of connector you're adding.
Refer to <<preconfigured-connector-settings>>.

This example shows a valid configuration for a Slack connector and a Webhook
connector:
Expand Down Expand Up @@ -107,6 +112,7 @@ Index names must start with `kibana-alert-history-` to take advantage of the pre
[[preconfigured-connector-examples]]
=== Examples

* <<preconfigured-bedrock-configuration>>
* <<preconfigured-d3security-configuration>>
* <<preconfigured-email-configuration>>
* <<preconfigured-gen-ai-configuration>>
Expand All @@ -128,6 +134,30 @@ Index names must start with `kibana-alert-history-` to take advantage of the pre
* <<preconfigured-cases-webhook-configuration>>
* <<preconfigured-xmatters-configuration>>

[float]
[[preconfigured-bedrock-configuration]]
==== {bedrock} connectors

The following example creates an <<bedrock-action-type,{bedrock} connector>>:

[source,text]
--
xpack.actions.preconfigured:
my-bedrock:
name: preconfigured-bedrock-connector-type
actionTypeId: .bedrock
config:
apiUrl: https://bedrock.us-east-1.amazonaws.com <1>
defaultModel: anthropic.claude-v2 <2>
secrets:
accessKey: key-value <3>
secret: secret-value <4>
--
<1> The {bedrock} request URL.
<2> The default model to use for requests. Current support is for the Anthropic Claude models, defaulting to Claude 2.
<3> The AWS access key for authentication.
<4> The AWS secret for authentication.

[float]
[[preconfigured-d3security-configuration]]
==== D3 Security connectors
Expand Down Expand Up @@ -302,7 +332,7 @@ xpack.actions.preconfigured:
secrets:
apiKey: superlongapikey <4>
--
<1> The OpenAI request URL
<1> The OpenAI request URL.
<2> The OpenAI API provider, either `OpenAI` or `Azure OpenAI`.
<3> The default model to use for requests. This setting is optional and applicable only when `apiProvider` is `OpenAI`.
<4> The OpenAI or Azure OpenAI API key for authentication.
Expand Down
14 changes: 13 additions & 1 deletion docs/settings/alert-action-settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ For a <<openai-action-type,OpenAI connector>>, specifies the OpenAI API provider
A configuration URL that varies by connector:
+
--
* For an <<bedrock-action-type,{bedrock} connector>>, specifies the {bedrock} request URL.
* For a <<openai-action-type,OpenAI connector>>, specifies the OpenAI request URL.
* For a <<resilient-action-type,{ibm-r} connector>>, specifies the {ibm-r} instance URL.
* For a <<jira-action-type,Jira connector>>, specifies the Jira instance URL.
Expand Down Expand Up @@ -327,7 +328,12 @@ NOTE: If you are using the `xpack.actions.allowedHosts` setting, make sure the h
For a <<cases-webhook-action-type,{webhook-cm} connector>>, specifies a string from the response body of the create case method that corresponds to the external service identifier.

`xpack.actions.preconfigured.<connector-id>.config.defaultModel`::
For a <<openai-action-type,OpenAI connector>>, specifies the default model to use for requests. It is optional and applicable only when `xpack.actions.preconfigured.<connector-id>.config.apiProvider` is `OpenAI`.
The default model to use for requests, which varies by connector:
+
--
* For an <<bedrock-action-type,{bedrock} connector>>, current support is for the Anthropic Claude models. Defaults to `anthropic.claude-v2`.
* For a <<openai-action-type,OpenAI connector>>, it is optional and applicable only when `xpack.actions.preconfigured.<connector-id>.config.apiProvider` is `OpenAI`.
--

`xpack.actions.preconfigured.<connector-id>.config.executionTimeField`::
For an <<index-action-type,index connector>>, a field that indicates when the document was indexed.
Expand Down Expand Up @@ -463,6 +469,9 @@ Sensitive configuration details, such as username, password, and keys, which are
+
TIP: Sensitive properties, such as passwords, should be stored in the <<creating-keystore,{kib} keystore>>.

`xpack.actions.preconfigured.<connector-id>.secrets.accessKey`::
For an <<bedrock-action-type,{bedrock} connector>>, specifies the AWS access key for authentication.

`xpack.actions.preconfigured.<connector-id>.secrets.apikey`::
An API key secret that varies by connector:
+
Expand Down Expand Up @@ -517,6 +526,9 @@ For a <<servicenow-action-type,{sn-itsm}>>, <<servicenow-sir-action-type,{sn-sir
`xpack.actions.preconfigured.<connector-id>.secrets.routingKey`::
For a <<pagerduty-action-type,PagerDuty connector>>, specifies the 32 character PagerDuty Integration Key for an integration on a service, also referred to as the routing key.

`xpack.actions.preconfigured.<connector-id>.secrets.secret`::
For an <<bedrock-action-type,{bedrock} connector>>, specifies the AWS secret for authentication.

`xpack.actions.preconfigured.<connector-id>.secrets.secretsUrl`::
For an <<xmatters-action-type,xMatters connector>> with URL authentication, specifies the request URL for the Elastic Alerts trigger in xMatters with the API key included in the URL.
It is used only when `xpack.actions.preconfigured.<connector-id>.config.usesBasic` is `false`.
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@
"url": "https://github.com/elastic/kibana.git"
},
"engines": {
"node": "18.17.1",
"node": "18.18.2",
"yarn": "^1.22.19"
},
"resolutions": {
"**/@hello-pangea/dnd": "16.2.0",
"**/@types/node": "18.17.5",
"**/@types/node": "18.18.5",
"**/@typescript-eslint/utils": "5.62.0",
"**/chokidar": "^3.5.3",
"**/globule/minimatch": "^3.1.2",
Expand Down Expand Up @@ -1360,7 +1360,7 @@
"@types/multistream": "^4.1.0",
"@types/mustache": "^0.8.31",
"@types/nock": "^10.0.3",
"@types/node": "18.17.5",
"@types/node": "18.18.5",
"@types/node-fetch": "2.6.4",
"@types/node-forge": "^1.3.1",
"@types/nodemailer": "^6.4.0",
Expand Down
1 change: 0 additions & 1 deletion packages/kbn-doc-links/src/get_doc_links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ export const getDocLinks = ({ kibanaBranch }: GetDocLinkOptions): DocLinks => {
connectorsSharepointOnline: `${ENTERPRISE_SEARCH_DOCS}connectors-sharepoint-online.html`,
connectorsSlack: `${ENTERPRISE_SEARCH_DOCS}connectors-slack.html`,
connectorsTeams: `${ENTERPRISE_SEARCH_DOCS}connectors-teams.html`,
connectorsWorkplaceSearch: `${ENTERPRISE_SEARCH_DOCS}workplace-search-connectors.html`,
connectorsZoom: `${ENTERPRISE_SEARCH_DOCS}connectors-zoom.html`,
crawlerExtractionRules: `${ENTERPRISE_SEARCH_DOCS}crawler-extraction-rules.html`,
crawlerManaging: `${ENTERPRISE_SEARCH_DOCS}crawler-managing.html`,
Expand Down
1 change: 0 additions & 1 deletion packages/kbn-doc-links/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ export interface DocLinks {
readonly connectorsSharepointOnline: string;
readonly connectorsTeams: string;
readonly connectorsSlack: string;
readonly connectorsWorkplaceSearch: string;
readonly connectorsZoom: string;
readonly crawlerExtractionRules: string;
readonly crawlerManaging: string;
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-es-archiver/src/lib/progress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const SECOND = 1000;
export class Progress {
private total?: number;
private complete?: number;
private loggingInterval?: NodeJS.Timer;
private loggingInterval?: NodeJS.Timeout;

getTotal() {
return this.total;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/*
* 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 { setMockValues } from '../../../__mocks__/kea_logic';

import React from 'react';

import { mount } from 'enzyme';

import { AppSearchProductCard } from './app_search_product_card';
import { EnterpriseSearchProductCard } from './enterprise_search_product_card';
import { WorkplaceSearchProductCard } from './workplace_search_product_card';

describe('EnterpriseSearchProductCard', () => {
beforeEach(() => {
setMockValues({ config: { canDeployEntSearch: true, host: 'localhost' } });
});

it('renders both services with access', () => {
const wrapper = mount(
<EnterpriseSearchProductCard
hasAppSearchAccess
hasWorkplaceSearchAccess
isWorkplaceSearchAdmin
/>
);

expect(wrapper.find(AppSearchProductCard)).toHaveLength(1);
expect(wrapper.find(WorkplaceSearchProductCard)).toHaveLength(1);
});
it('can render just app search', () => {
const wrapper = mount(
<EnterpriseSearchProductCard
hasAppSearchAccess
hasWorkplaceSearchAccess={false}
isWorkplaceSearchAdmin={false}
/>
);

expect(wrapper.find(AppSearchProductCard)).toHaveLength(1);
expect(wrapper.find(WorkplaceSearchProductCard)).toHaveLength(0);
});
it('can render just workplace search', () => {
const wrapper = mount(
<EnterpriseSearchProductCard
hasAppSearchAccess={false}
hasWorkplaceSearchAccess
isWorkplaceSearchAdmin
/>
);

expect(wrapper.find(AppSearchProductCard)).toHaveLength(0);
expect(wrapper.find(WorkplaceSearchProductCard)).toHaveLength(1);
});
});
Loading

0 comments on commit 6fefd8f

Please sign in to comment.