Skip to content

Commit

Permalink
Merge branch '8.x' into backport/8.x/pr-201290
Browse files Browse the repository at this point in the history
  • Loading branch information
tsullivan authored Dec 9, 2024
2 parents 2094b78 + bf23999 commit e3b4b0b
Show file tree
Hide file tree
Showing 393 changed files with 7,947 additions and 4,225 deletions.
655 changes: 576 additions & 79 deletions .buildkite/package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions .buildkite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"dependencies": {
"@octokit/rest": "^18.10.0",
"axios": "^1.7.4",
"axios": "^1.7.9",
"globby": "^11.1.0",
"js-yaml": "^4.1.0",
"minimatch": "^5.0.1",
Expand All @@ -24,7 +24,7 @@
"@types/mocha": "^10.0.1",
"@types/node": "^15.12.2",
"chai": "^4.3.10",
"mocha": "^10.8.2",
"mocha": "^11.0.1",
"nock": "^12.0.2",
"ts-node": "^10.9.2",
"typescript": "^5.1.6"
Expand All @@ -33,4 +33,4 @@
"#pipeline-utils": "./pipeline-utils/index.ts",
"#pipeline-utils/*": "./pipeline-utils/*"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
steps:
- command: .buildkite/scripts/steps/functional/security_serverless_automatic_import.sh
label: 'Serverless Automatic Import - Security Solution Cypress Tests'
agents:
machineType: n2-standard-4
preemptible: true
depends_on:
- build
- quick_checks
- checks
- linting
- linting_with_types
- check_types
- check_oas_snapshot
timeout_in_minutes: 60
parallelism: 1
retry:
automatic:
- exit_status: '-1'
limit: 1
3 changes: 3 additions & 0 deletions .buildkite/scripts/pipelines/pull_request/pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,9 @@ const getPipeline = (filename: string, removeSteps = true) => {
pipeline.push(
getPipeline('.buildkite/pipelines/pull_request/security_solution/ai_assistant.yml')
);
pipeline.push(
getPipeline('.buildkite/pipelines/pull_request/security_solution/automatic_import.yml')
);
pipeline.push(
getPipeline('.buildkite/pipelines/pull_request/security_solution/detection_engine.yml')
);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash

set -euo pipefail

source .buildkite/scripts/steps/functional/common.sh

export JOB=kibana-security-solution-chrome
export KIBANA_INSTALL_DIR=${KIBANA_BUILD_LOCATION}

echo "--- Automatic Import Cypress Tests on Serverless"

cd x-pack/test/security_solution_cypress

set +e
BK_ANALYTICS_API_KEY=$(vault_get security-solution-ci sec-sol-cypress-bk-api-key)

BK_ANALYTICS_API_KEY=$BK_ANALYTICS_API_KEY yarn cypress:automatic_import:run:serverless; status=$?; yarn junit:merge || :; exit $status
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -1582,6 +1582,7 @@ x-pack/test/api_integration/apis/management/index_management/inference_endpoints
/x-pack/plugins/security_solution/public/assistant @elastic/security-generative-ai
/x-pack/plugins/security_solution/public/attack_discovery @elastic/security-generative-ai
/x-pack/test/security_solution_cypress/cypress/e2e/ai_assistant @elastic/security-generative-ai
/x-pack/test/security_solution_cypress/cypress/e2e/automatic_import @elastic/security-scalability

# Security Solution cross teams ownership
/x-pack/test/security_solution_cypress/cypress/fixtures @elastic/security-detections-response @elastic/security-threat-hunting
Expand Down Expand Up @@ -1687,6 +1688,7 @@ x-pack/test/security_solution_cypress/cypress/tasks/expandable_flyout @elastic/
/x-pack/plugins/security_solution/public/common/components/with_hover_actions @elastic/security-threat-hunting-explore
/x-pack/plugins/security_solution/public/common/containers/matrix_histogram @elastic/security-threat-hunting-explore
/x-pack/plugins/security_solution/public/common/lib/cell_actions @elastic/security-threat-hunting-explore
/x-pack/plugins/security_solution/public/common/hooks/use_form_with_warn @elastic/security-detection-rule-management
/x-pack/plugins/security_solution/public/cases @elastic/security-threat-hunting-explore
/x-pack/plugins/security_solution/public/explore @elastic/security-threat-hunting-explore
/x-pack/plugins/security_solution/public/overview @elastic/security-threat-hunting-explore
Expand Down
3 changes: 0 additions & 3 deletions config/serverless.es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,6 @@ xpack.ml.compatibleModuleType: 'search'

data_visualizer.resultLinks.fileBeat.enabled: false

# Search Playground
xpack.searchPlayground.ui.enabled: true

# Search InferenceEndpoints
xpack.searchInferenceEndpoints.ui.enabled: true

Expand Down
1 change: 1 addition & 0 deletions config/serverless.oblt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ xpack.infra.enabled: true
xpack.uptime.enabled: true
xpack.securitySolution.enabled: false
xpack.search.notebooks.enabled: false
xpack.searchPlayground.enabled: false

## Fine-tune the observability solution feature privileges. Also, refer to `serverless.yml` for the project-agnostic overrides.
xpack.features.overrides:
Expand Down
1 change: 1 addition & 0 deletions config/serverless.security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ xpack.observabilityLogsExplorer.enabled: false
xpack.observability.enabled: false
xpack.observabilityAIAssistant.enabled: false
xpack.search.notebooks.enabled: false
xpack.searchPlayground.enabled: false

## Fine-tune the security solution feature privileges. Also, refer to `serverless.yml` for the project-agnostic overrides.
xpack.features.overrides:
Expand Down
117 changes: 117 additions & 0 deletions docs/settings/ai-assistant-settings.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
[role="xpack"]
[[ai-assistant-settings-kb]]
=== AI Assistant settings in {kib}
++++
<titleabbrev>AI Assistant settings</titleabbrev>
++++

`xpack.productDocBase.artifactRepositoryUrl`::
Url of the repository to use to download and install the Elastic product documentation artifacts for the AI assistants.
Defaults to `https://kibana-knowledge-base-artifacts.elastic.co`

[[configuring-product-doc-for-airgap]]
==== Configuring product documentation for air-gapped environments

Installing product documentation requires network access to its artifact repository.
For air-gapped environments, or environments where remote network traffic is blocked or filtered,
the artifact repository must be manually deployed somewhere accessible by the Kibana deployment.

Deploying a custom product documentation repository can be done in 2 ways: using a S3 bucket, or using a CDN.

===== Deploying using a S3 bucket

*1. Download the artifacts for your current {kib} version*

The artifact names follow this pattern: `kb-product-doc-{productName}-{versionMajor}.{versionMinor}.zip`

The available products are:
- elasticsearch
- kibana
- observability
- security

You must download, from the source repository (`https://kibana-knowledge-base-artifacts.elastic.co/`),
the artifacts for your current version of Kibana.

For example, for Kibana 8.16:
- `kb-product-doc-elasticsearch-8.16.zip`
- `kb-product-doc-kibana-8.16.zip`
- `kb-product-doc-observability-8.16.zip`
- `kb-product-doc-security-8.16.zip`

*2. Upload the artifacts to your local S3 bucket*

Upload the artifact files to your custom S3 bucket, then make sure that they are properly listed in the bucket's index, similar to
the bucket listing displayed when accessing `https://kibana-knowledge-base-artifacts.elastic.co/` in a browser.

*3. Configure {kib} to use the custom repository*

Add the following line to your {kib} configuration file:

[source,yaml]
----
# Replace with the root of your custom bucket
xpack.productDocBase.artifactRepositoryUrl: "https://my-custom-repository.example.com"
----

*4. Restart {kib}*

You should then be able to install the product documentation feature from the AI assistant management page.

===== Deploying using a CDN

Deploying using a CDN is quite similar to the S3 bucket approach. The main difference will be that we will need to manually
generate the bucket listing and set it as the CDN folder's index page.

*1. Download the artifacts for your current {kib} version*

Following the step from the `Deploying using a S3 bucket` section

*2. Upload the artifacts to the CDN*

Create a folder in your CDN, and upload the artifacts to it.

*3. Create and upload the bucket listing*

Generate the S3 bucket listing xml file for the folder.

To do that, copy the following template, and replace the versions in the `<Key>` tags with your current version of {kib}.

For example for {kib} 8.17, replace all `8.16` occurrences in the file with `8.17`.

[source,xml]
----
<ListBucketResult>
<Name>kibana-ai-assistant-kb-artifacts</Name>
<IsTruncated>false</IsTruncated>
<Contents>
<Key>kb-product-doc-elasticsearch-8.16.zip</Key>
</Contents>
<Contents>
<Key>kb-product-doc-kibana-8.16.zip</Key>
</Contents>
<Contents>
<Key>kb-product-doc-observability-8.16.zip</Key>
</Contents>
<Contents>
<Key>kb-product-doc-security-8.16.zip</Key>
</Contents>
</ListBucketResult>
----

Then upload that xml file to the same CDN folder where the artifacts were uploaded, and then configure the folder to have that file
served as the folder's index.

*4. Configure {kib} to use the custom repository*

Add the following line to your {kib} configuration file:

[source,yaml]
----
# Replace with the path to the CDN folder previously configured
xpack.productDocBase.artifactRepositoryUrl: "https://my-custom-repository.example.com"
----

*5. Restart {kib}*

You should then be able to install the product documentation feature from the AI assistant management page.
1 change: 1 addition & 0 deletions docs/setup/settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,7 @@ Set this value to false to disable the Upgrade Assistant UI. *Default: true*
Set this value to change the {kib} interface language.
Valid locales are: `en`, `zh-CN`, `ja-JP`, `fr-FR`. *Default: `en`*

include::{kibana-root}/docs/settings/ai-assistant-settings.asciidoc[]
include::{kibana-root}/docs/settings/alert-action-settings.asciidoc[leveloffset=+1]
include::{kibana-root}/docs/settings/apm-settings.asciidoc[]
include::{kibana-root}/docs/settings/banners-settings.asciidoc[]
Expand Down
2 changes: 2 additions & 0 deletions examples/developer_examples/public/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import {
AppMountParameters,
I18nStart,
ThemeServiceStart,
UserProfileService,
} from '@kbn/core/public';
import { KibanaRenderContextProvider } from '@kbn/react-kibana-context-render';
import { ExampleDefinition } from './types';
Expand All @@ -36,6 +37,7 @@ interface StartServices {
analytics: Pick<AnalyticsServiceStart, 'reportEvent'>;
i18n: I18nStart;
theme: Pick<ThemeServiceStart, 'theme$'>;
userProfile: UserProfileService;
}

interface Props {
Expand Down
4 changes: 2 additions & 2 deletions examples/developer_examples/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ export class DeveloperExamplesPlugin implements Plugin<DeveloperExamplesSetup, v
async mount(params: AppMountParameters) {
const { renderApp } = await import('./app');
const [coreStart] = await core.getStartServices();
const { analytics, i18n, theme } = coreStart;
const { analytics, i18n, theme, userProfile } = coreStart;
return renderApp(
{
startServices: { analytics, i18n, theme },
startServices: { analytics, i18n, theme, userProfile },
examples,
navigateToApp: (appId: string) => coreStart.application.navigateToApp(appId),
getUrlForApp: (appId: string) => coreStart.application.getUrlForApp(appId),
Expand Down
11 changes: 6 additions & 5 deletions examples/embeddable_examples/public/app/register_embeddable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,14 @@ export const RegisterEmbeddable = () => {
<EuiSpacer size="l" />

<EuiText>
<h2>Saved object embeddables</h2>
<h2>
Show saved object type in <em>Add from library</em> menu
</h2>
<p>
Embeddable factories, such as Lens, Maps, Links, that can reference saved objects should
register their saved object types using{' '}
<strong>registerReactEmbeddableSavedObject</strong>. The <em>Add from library</em> flyout
on Dashboards uses this registry to list saved objects. The example function below could
be called from the public start contract for a plugin.
register their saved object types using <strong>registerAddFromLibraryType</strong>. The{' '}
<em>Add from library</em> flyout on Dashboards uses this registry to list saved objects.
The example function below could be called from the public start contract for a plugin.
</p>
</EuiText>
<EuiSpacer size="s" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,13 @@ const MY_SAVED_OBJECT_TYPE = 'mySavedObjectType';
const APP_ICON = 'logoKibana';

export const registerMyEmbeddableSavedObject = (embeddableSetup: EmbeddableSetup) =>
embeddableSetup.registerReactEmbeddableSavedObject({
embeddableSetup.registerAddFromLibraryType({
onAdd: (container, savedObject) => {
container.addNewPanel({
panelType: MY_EMBEDDABLE_TYPE,
initialState: savedObject.attributes,
});
},
embeddableType: MY_EMBEDDABLE_TYPE,
savedObjectType: MY_SAVED_OBJECT_TYPE,
savedObjectName: 'Some saved object',
getIconForSavedObject: () => APP_ICON,
Expand Down
6 changes: 4 additions & 2 deletions examples/routing_example/public/services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import type {
CoreStart,
I18nStart,
ThemeServiceStart,
UserProfileService,
} from '@kbn/core/public';
import type { IHttpFetchError } from '@kbn/core-http-browser';
import {
Expand All @@ -25,6 +26,7 @@ interface StartServices {
analytics: Pick<AnalyticsServiceStart, 'reportEvent'>;
i18n: I18nStart;
theme: Pick<ThemeServiceStart, 'theme$'>;
userProfile: UserProfileService;
}

export interface Services {
Expand All @@ -37,8 +39,8 @@ export interface Services {
}

export function getServices(core: CoreStart): Services {
const { analytics, i18n, theme } = core;
const startServices = { analytics, i18n, theme };
const { analytics, i18n, theme, userProfile } = core;
const startServices = { analytics, i18n, theme, userProfile };

return {
startServices,
Expand Down
2 changes: 1 addition & 1 deletion examples/ui_action_examples/public/hello_world_action.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { toMountPoint } from '@kbn/react-kibana-mount';

export const ACTION_HELLO_WORLD = 'ACTION_HELLO_WORLD';

type StartServices = Pick<CoreStart, 'overlays' | 'analytics' | 'i18n' | 'theme'>;
type StartServices = Pick<CoreStart, 'overlays' | 'analytics' | 'i18n' | 'theme' | 'userProfile'>;

export const createHelloWorldActionDefinition = (
getStartServices: () => Promise<StartServices>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const DYNAMIC_ACTION_ID = `${ACTION_HELLO_WORLD}-Waldo`;

interface Props {
uiActionsStartService: UiActionsStart;
startServices: Pick<CoreStart, 'overlays' | 'analytics' | 'i18n' | 'theme'>;
startServices: Pick<CoreStart, 'overlays' | 'analytics' | 'i18n' | 'theme' | 'userProfile'>;
}

export const HelloWorldExample = ({ uiActionsStartService, startServices }: Props) => {
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1087,7 +1087,7 @@
"archiver": "^7.0.1",
"async": "^3.2.3",
"aws4": "^1.13.2",
"axios": "^1.7.4",
"axios": "^1.7.9",
"base64-js": "^1.3.1",
"bitmap-sdf": "^1.0.3",
"blurhash": "^2.0.1",
Expand Down Expand Up @@ -1695,7 +1695,7 @@
"buildkite-test-collector": "^1.7.0",
"callsites": "^3.1.0",
"chance": "1.0.18",
"chromedriver": "^131.0.0",
"chromedriver": "^131.0.1",
"clean-webpack-plugin": "^3.0.0",
"cli-progress": "^3.12.0",
"cli-table3": "^0.6.1",
Expand Down Expand Up @@ -1821,7 +1821,7 @@
"rxjs-marbles": "^7.0.1",
"sass-embedded": "^1.78.0",
"sass-loader": "^10.5.1",
"selenium-webdriver": "^4.26.0",
"selenium-webdriver": "^4.27.0",
"sharp": "0.32.6",
"simple-git": "^3.16.0",
"sinon": "^7.4.2",
Expand Down
1 change: 1 addition & 0 deletions packages/cloud/connection_details/kibana/global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export interface ConnectionDetailsGlobalDependencies {
http: CoreStart['http'];
application: CoreStart['application'];
overlays: CoreStart['overlays'];
userProfile: CoreStart['userProfile'];
};
plugins: {
cloud?: CloudStart;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export interface OpenConnectionDetailsParams {
i18n: CoreStart['i18n'];
analytics?: CoreStart['analytics'];
theme: CoreStart['theme'];
userProfile: CoreStart['userProfile'];
};
};
}
Expand Down
Loading

0 comments on commit e3b4b0b

Please sign in to comment.