Skip to content

Commit

Permalink
Merge branch 'main' of github.com:elastic/kibana into audit-session-c…
Browse files Browse the repository at this point in the history
…leanup
  • Loading branch information
thomheymann committed Jan 12, 2022
2 parents 52d61cd + 116d74a commit 9e70295
Show file tree
Hide file tree
Showing 481 changed files with 9,748 additions and 19,059 deletions.
2 changes: 0 additions & 2 deletions .buildkite/pipelines/hourly.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
env:
REPORT_FAILED_TESTS_TO_GITHUB: 'true'
steps:
- command: .buildkite/scripts/lifecycle/pre_build.sh
label: Pre-Build
Expand Down
4 changes: 2 additions & 2 deletions .buildkite/scripts/steps/package_testing/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ set -euo pipefail
.buildkite/scripts/bootstrap.sh

echo "--- Build Kibana Distribution"
node scripts/build --all-platforms --debug
node scripts/build --all-platforms --debug --skip-docker-cloud --skip-docker-ubi --skip-docker-contexts

cd target
buildkite-agent artifact upload "./kibana-[0-9]*-docker-image.tar.gz;./*.deb;./*.rpm"
buildkite-agent artifact upload "./*-docker-image.tar.gz;./*.deb;./*.rpm"
cd ..
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=16.13.0
ARG NODE_VERSION=16.13.2

FROM node:${NODE_VERSION} AS base

Expand Down
3 changes: 1 addition & 2 deletions .i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@
"visTypeVega": "src/plugins/vis_types/vega",
"visTypeVislib": "src/plugins/vis_types/vislib",
"visTypeXy": "src/plugins/vis_types/xy",
"visualizations": "src/plugins/visualizations",
"visualize": "src/plugins/visualize"
"visualizations": "src/plugins/visualizations"
},
"translations": []
}
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.13.0
16.13.2
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.13.0
16.13.2
14 changes: 7 additions & 7 deletions WORKSPACE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ check_rules_nodejs_version(minimum_version_string = "3.8.0")
# we can update that rule.
node_repositories(
node_repositories = {
"16.13.0-darwin_amd64": ("node-v16.13.0-darwin-x64.tar.gz", "node-v16.13.0-darwin-x64", "37e09a8cf2352f340d1204c6154058d81362fef4ec488b0197b2ce36b3f0367a"),
"16.13.0-darwin_arm64": ("node-v16.13.0-darwin-arm64.tar.gz", "node-v16.13.0-darwin-arm64", "46d83fc0bd971db5050ef1b15afc44a6665dee40bd6c1cbaec23e1b40fa49e6d"),
"16.13.0-linux_arm64": ("node-v16.13.0-linux-arm64.tar.xz", "node-v16.13.0-linux-arm64", "93a0d03f9f802353cb7052bc97a02cd9642b49fa985671cdc16c99936c86d7d2"),
"16.13.0-linux_s390x": ("node-v16.13.0-linux-s390x.tar.xz", "node-v16.13.0-linux-s390x", "49e972bf3e969d621157df4c8f2fa18ff748c167d5ebd0efc87e1b9f0c6541cc"),
"16.13.0-linux_amd64": ("node-v16.13.0-linux-x64.tar.xz", "node-v16.13.0-linux-x64", "a876ce787133149abd1696afa54b0b5bc5ce3d5ae359081d407ff776e39b7ba8"),
"16.13.0-windows_amd64": ("node-v16.13.0-win-x64.zip", "node-v16.13.0-win-x64", "5a39ec5d4786c2814a6c04488bebac6423c2aaa12832b24f0882456f2e4674e1"),
"16.13.2-darwin_amd64": ("node-v16.13.2-darwin-x64.tar.gz", "node-v16.13.2-darwin-x64", "900a952bb77533d349e738ff8a5179a4344802af694615f36320a888b49b07e6"),
"16.13.2-darwin_arm64": ("node-v16.13.2-darwin-arm64.tar.gz", "node-v16.13.2-darwin-arm64", "09d300008ad58792c12622a5eafdb14c931587bb88713df4df64cdf4ff2188d1"),
"16.13.2-linux_arm64": ("node-v16.13.2-linux-arm64.tar.xz", "node-v16.13.2-linux-arm64", "a3cf8e4e9fbea27573eee6da84720bf7227ddd22842b842d48049d6dfe55fb03"),
"16.13.2-linux_s390x": ("node-v16.13.2-linux-s390x.tar.xz", "node-v16.13.2-linux-s390x", "c4ba46fc19366f7377d28a60a98f741bfa38045d7924306244c51d1660afcc8d"),
"16.13.2-linux_amd64": ("node-v16.13.2-linux-x64.tar.xz", "node-v16.13.2-linux-x64", "7f5e9a42d6e86147867d35643c7b1680c27ccd45db85666fc52798ead5e74421"),
"16.13.2-windows_amd64": ("node-v16.13.2-win-x64.zip", "node-v16.13.2-win-x64", "107e3ece84b7fa1e80b3bdf03181d395246c7867e27b17b6d7e6fa9c7932b467"),
},
node_version = "16.13.0",
node_version = "16.13.2",
node_urls = [
"https://nodejs.org/dist/v{version}/{filename}",
],
Expand Down
2 changes: 0 additions & 2 deletions docs/CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ Review important information about the {kib} 8.0.0 releases.
[[release-notes-8.0.0-rc1]]
== {kib} 8.0.0-rc1

coming::[8.0.0-rc1]

Review the {kib} 8.0.0-rc1 changes, then use the <<upgrade-assistant,Upgrade Assistant>> to complete the upgrade.

[float]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -514,4 +514,13 @@ macOS users on a machine with a discrete graphics card may see significant speed
* In the General tab, under the "Magic" section, ensure "GPU rendering" is checked
* Open "Advanced GPU Settings..."
* Uncheck the "Prefer integrated to discrete GPU" option
* Restart iTerm
* Restart iTerm

[discrete]
== Flaky Test Runner

If your functional tests are flaky then the Operations team might skip them and ask that you make them less flaky before enabling them once again. This process usually involves looking at the failures which are logged on the relevant Github issue and finding incorrect assumptions or conditions which need to be awaited at some point in the test. To determine if your changes make the test fail less often you can run your tests in the Flaky Test Runner. This tool runs up to 500 executions of a specific ciGroup. To start a build of the Flaky Test Runner create a PR with your changes and then visit https://ci-stats.kibana.dev/trigger_flaky_test_runner, select your PR, choose the CI Group that your tests are in, and trigger the build.

This will take you to Buildkite where your build will run and tell you if it failed in any execution.

A flaky test may only fail once in 1000 runs, so keep this in mind and make sure you use enough executions to really prove that a test isn't flaky anymore.
6 changes: 1 addition & 5 deletions docs/developer/plugin-list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ management section itself.
|{kib-repo}blob/{branch}/src/plugins/maps_ems/README.md[mapsEms]
|Configuration of kibana-wide EMS settings and some higher level utilities.
|Utility plugin:
|{kib-repo}blob/{branch}/src/plugins/navigation/README.md[navigation]
Expand Down Expand Up @@ -342,10 +342,6 @@ The plugin exposes the static DefaultEditorController class to consume.
|WARNING: Missing README.
|{kib-repo}blob/{branch}/src/plugins/visualize[visualize]
|WARNING: Missing README.
|===
[discrete]
Expand Down
8 changes: 4 additions & 4 deletions docs/setup/settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -370,10 +370,10 @@ used by the tile service. Specify the position of the subdomain the URL with
the token `{s}`.

| [[tilemap-url]] `map.tilemap.url:` {ess-icon}
| The URL to the tileservice that {kib} uses
to display map tiles in tilemap visualizations. By default,
{kib} reads this URL from an external metadata service, but users can
override this parameter to use their own Tile Map Service. For example:
| The URL to the service that {kib} uses
as the default basemap in <<maps, maps>> and <<vega-with-a-map, vega maps>>. By default,
{kib} sets a basemap from the <<maps-connect-to-ems, Elastic Maps Service>>, but users can
point to their own Tile Map Service. For example:
`"https://tiles.elastic.co/v2/default/{z}/{x}/{y}.png?elastic_tile_service_tos=agree&my_app_name=kibana"`

| `migrations.batchSize:`
Expand Down
3 changes: 3 additions & 0 deletions docs/user/dashboard/lens-advanced.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,9 @@ image::images/lens_time_shift.png[Line chart with week-over-week sales compariso

. Click *Save and return*.

Time shifts can be used on any metric. The special shift *previous* will show the time window preceding the currently selected one in the time picker in the top right, spanning the same duration.
For example, if *Last 7 days* is selected in the time picker, *previous* will show data from 14 days ago to 7 days ago. This mode can't be used together with date histograms.

[float]
[[compare-time-as-percent]]
==== Analyze the percent change between time ranges
Expand Down
2 changes: 1 addition & 1 deletion docs/user/dashboard/make-dashboards-interactive.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ To create *Controls* panels:

. Select the control panel type from the dropdown, then click *Add*.

. Enter the *Control Label*, then select the *{Data-Source}* and *Field*.
. Enter the *Control Label*, then select the *{data-source-caps}* and *Field*.

. If you are adding a *Range slider*, enter the *Step Size* and *Decimal Places*.

Expand Down
16 changes: 13 additions & 3 deletions docs/user/production-considerations/production.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ separate from your {es} data or master nodes. To distribute {kib}
traffic across the nodes in your {es} cluster,
you can configure {kib} to use a list of {es} hosts.

[WARNING]
====
{kib} does not support rolling upgrades, and deploying mixed versions of {kib} can result in data loss or upgrade failures. Please shut down all instances of {kib} before performing an upgrade, and ensure all running {kib} instances have matching versions.
====

[float]
[[load-balancing-kibana]]
=== Load balancing across multiple {kib} instances
Expand Down Expand Up @@ -68,13 +73,18 @@ bin/kibana -c config/instance2.yml
=== Accessing multiple load-balanced {kib} clusters

To access multiple load-balanced {kib} clusters from the same browser,
set `xpack.security.cookieName` in the configuration.
explicitly set `xpack.security.cookieName` to the same value in the {kib} configuration
of each {kib} instance.

Each {kib} cluster must have a different value of `xpack.security.cookieName`.

This avoids conflicts between cookies from the different {kib} instances.

In each cluster, {kib} instances should have the same `cookieName`
value. This will achieve seamless high availability and keep the session
This will achieve seamless high availability and keep the session
active in case of failure from the currently used instance.



[float]
[[high-availability]]
=== High availability across multiple {es} nodes
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"url": "https://github.com/elastic/kibana.git"
},
"engines": {
"node": "16.13.0",
"node": "16.13.2",
"yarn": "^1.21.1"
},
"resolutions": {
Expand Down
1 change: 1 addition & 0 deletions packages/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ filegroup(
srcs = [
"//packages/elastic-apm-synthtrace:build_types",
"//packages/elastic-datemath:build_types",
"//packages/elastic-safer-lodash-set:build_types",
"//packages/kbn-ace:build_types",
"//packages/kbn-alerts:build_types",
"//packages/kbn-analytics:build_types",
Expand Down
12 changes: 12 additions & 0 deletions packages/elastic-safer-lodash-set/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,15 @@ filegroup(
],
visibility = ["//visibility:public"],
)

alias(
name = "npm_module_types",
actual = PKG_BASE_NAME,
visibility = ["//visibility:public"],
)

alias(
name = "build_types",
actual = "build",
visibility = ["//visibility:public"],
)
2 changes: 1 addition & 1 deletion packages/kbn-apm-config-loader/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ RUNTIME_DEPS = [
]

TYPES_DEPS = [
"//packages/elastic-safer-lodash-set",
"//packages/elastic-safer-lodash-set:npm_module_types",
"//packages/kbn-utils:npm_module_types",
"@npm//@elastic/apm-rum",
"@npm//@types/jest",
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-config/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ RUNTIME_DEPS = [
]

TYPES_DEPS = [
"//packages/elastic-safer-lodash-set",
"//packages/elastic-safer-lodash-set:npm_module_types",
"//packages/kbn-config-schema:npm_module_types",
"//packages/kbn-logging",
"//packages/kbn-std:npm_module_types",
Expand Down
1 change: 0 additions & 1 deletion packages/kbn-optimizer/limits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ pageLoadAssetSize:
visTypeVislib: 242838
visTypeXy: 113478
visualizations: 90000
visualize: 57431
watcher: 43598
runtimeFields: 41752
stackAlerts: 29684
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-ui-shared-deps-src/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ RUNTIME_DEPS = [

TYPES_DEPS = [
"//packages/elastic-datemath:npm_module_types",
"//packages/elastic-safer-lodash-set",
"//packages/elastic-safer-lodash-set:npm_module_types",
"//packages/kbn-analytics:npm_module_types",
"//packages/kbn-i18n:npm_module_types",
"//packages/kbn-i18n-react:npm_module_types",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -435,10 +435,6 @@ describe('CoreUsageDataService', () => {
);
}

it('returns expected usage data for elastic.username "elastic"', async () => {
return doTest({ username: 'elastic', expectedPrincipal: 'elastic_user' });
});

it('returns expected usage data for elastic.username "kibana"', async () => {
return doTest({ username: 'kibana', expectedPrincipal: 'kibana_user' });
});
Expand Down
1 change: 0 additions & 1 deletion src/core/server/core_usage_data/core_usage_data_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,6 @@ function getEsPrincipalUsage({ username, serviceAccountToken }: ElasticsearchCon
let value: CoreConfigUsageData['elasticsearch']['principal'] = 'unknown';
if (isConfigured.string(username)) {
switch (username) {
case 'elastic': // deprecated
case 'kibana': // deprecated
case 'kibana_system':
value = `${username}_user` as const;
Expand Down
19 changes: 4 additions & 15 deletions src/core/server/elasticsearch/elasticsearch_config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -318,15 +318,6 @@ describe('throws when config is invalid', () => {
});

describe('deprecations', () => {
it('logs a warning if elasticsearch.username is set to "elastic"', () => {
const { messages } = applyElasticsearchDeprecations({ username: 'elastic' });
expect(messages).toMatchInlineSnapshot(`
Array [
"Kibana is configured to authenticate to Elasticsearch with the \\"elastic\\" user. Use a service account token instead.",
]
`);
});

it('logs a warning if elasticsearch.username is set to "kibana"', () => {
const { messages } = applyElasticsearchDeprecations({ username: 'kibana' });
expect(messages).toMatchInlineSnapshot(`
Expand Down Expand Up @@ -370,19 +361,17 @@ describe('deprecations', () => {
});
});

test('#username throws if equal to "elastic", only while running from source', () => {
test('#username throws if equal to "elastic"', () => {
const obj = {
username: 'elastic',
};
expect(() => config.schema.validate(obj, { dist: false })).toThrowErrorMatchingInlineSnapshot(
`"[username]: value of \\"elastic\\" is forbidden. This is a superuser account that can obfuscate privilege-related issues. You should use the \\"kibana_system\\" user instead."`
);
expect(() => config.schema.validate(obj, { dist: true })).not.toThrow();

expect(() => config.schema.validate(obj)).toThrow('[username]: value of "elastic" is forbidden');
});

test('serviceAccountToken throws if username is also set', () => {
const obj = {
username: 'elastic',
username: 'kibana',
serviceAccountToken: 'abc123',
};

Expand Down
28 changes: 12 additions & 16 deletions src/core/server/elasticsearch/elasticsearch_config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,17 @@ export const configSchema = schema.object({
defaultValue: 'http://localhost:9200',
}),
username: schema.maybe(
schema.conditional(
schema.contextRef('dist'),
false,
schema.string({
validate: (rawConfig) => {
if (rawConfig === 'elastic') {
return (
'value of "elastic" is forbidden. This is a superuser account that can obfuscate ' +
'privilege-related issues. You should use the "kibana_system" user instead.'
);
}
},
}),
schema.string()
)
schema.string({
validate: (rawConfig) => {
if (rawConfig === 'elastic') {
return (
'value of "elastic" is forbidden. This is a superuser account that cannot write to system indices that Kibana needs to ' +
'function. Use a service account token instead. Learn more: ' +
'https://www.elastic.co/guide/en/elasticsearch/reference/8.0/service-accounts.html' // we don't have a way to pass a branch into the config schema; hardcoding this one link to the 8.0 docs is OK
);
}
},
})
),
password: schema.maybe(schema.string()),
serviceAccountToken: schema.maybe(
Expand Down Expand Up @@ -178,7 +174,7 @@ const deprecations: ConfigDeprecationProvider = () => [
return;
}

if (es.username === 'elastic' || es.username === 'kibana') {
if (es.username === 'kibana') {
const username = es.username;
addDeprecation({
configPath: `${fromPath}.username`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ import { setTimeout as setTimeoutPromise } from 'timers/promises';

const requestWaitDelay = 25;

describe('ServerMetricsCollector', () => {
// FLAKY: https://github.com/elastic/kibana/issues/59234
describe.skip('ServerMetricsCollector', () => {
let server: HttpService;
let collector: ServerMetricsCollector;
let hapiServer: HapiServer;
Expand Down
Loading

0 comments on commit 9e70295

Please sign in to comment.