Skip to content

Commit

Permalink
Merge branch 'master' into top-hits-fields
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasolson committed Sep 13, 2021
2 parents 99e1f63 + 17150b2 commit 9393509
Show file tree
Hide file tree
Showing 393 changed files with 11,359 additions and 2,543 deletions.
3 changes: 3 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
/src/plugins/chart_expressions/expression_tagcloud/ @elastic/kibana-vis-editors
/src/plugins/url_forwarding/ @elastic/kibana-vis-editors
/packages/kbn-tinymath/ @elastic/kibana-vis-editors
/x-pack/test/functional/apps/lens @elastic/kibana-vis-editors
/test/functional/apps/visualize/ @elastic/kibana-vis-editors

# Application Services
/examples/bfetch_explorer/ @elastic/kibana-app-services
Expand Down Expand Up @@ -146,6 +148,7 @@
/src/plugins/vis_type_markdown/ @elastic/kibana-presentation
/src/plugins/presentation_util/ @elastic/kibana-presentation
/test/functional/apps/dashboard/ @elastic/kibana-presentation
/test/functional/apps/dashboard_elements/ @elastic/kibana-presentation
/x-pack/plugins/canvas/ @elastic/kibana-presentation
/x-pack/plugins/dashboard_enhanced/ @elastic/kibana-presentation
/x-pack/test/functional/apps/canvas/ @elastic/kibana-presentation
Expand Down
17 changes: 17 additions & 0 deletions docs/setup/access.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,21 @@ image::images/kibana-status-page-7_14_0.png[Kibana server status page]

For JSON-formatted server status details, use the `localhost:5601/api/status` API endpoint.

[float]
[[not-ready]]
=== {kib} not ready

If you receive an error that the {kib} `server is not ready`, check the following:

* The {es} connectivity:
+
[source,sh]
----
`curl -XGET elasticsearch_ip_or_hostname:9200/`
----
* The {kib} logs:
** Linux, DEB or RPM package: `/var/log/kibana/kibana.log`
** Linux, tar.gz package: `$KIBANA_HOME/log/kibana.log`
** Windows: `$KIBANA_HOME\log\kibana.log`
* The health status of `.kibana*` indices

10 changes: 10 additions & 0 deletions docs/setup/docker.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,16 @@ services:
- ./kibana.yml:/usr/share/kibana/config/kibana.yml
--------------------------------------------

==== Persist the {kib} keystore

By default, {kib] auto-generates a keystore file for secure settings at startup. To persist your {kibana-ref}/secure-settings.html[secure settings], use the `kibana-keystore` utility to bind-mount the parent directory of the keystore to the container. For example:

[source,sh]
----
docker run -it --rm -v full_path_to/config:/usr/share/kibana/config -v full_path_to/data:/usr/share/kibana/data docker.elastic.co/kibana/kibana:7.14.0 bin/kibana-keystore create
docker run -it --rm -v full_path_to/config:/usr/share/kibana/config -v full_path_to/data:/usr/share/kibana/data docker.elastic.co/kibana/kibana:7.14.0 bin/kibana-keystore add test_keystore_setting
----

[float]
[[environment-variable-config]]
==== Environment variable configuration
Expand Down
2 changes: 2 additions & 0 deletions docs/user/dashboard/tsvb.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ The index pattern mode unlocks many new features, such as:

* Interactive filters for time series visualizations

* Custom field formats

* Better performance

[float]
Expand Down
3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@
"**/pdfkit/crypto-js": "4.0.0",
"**/react-syntax-highlighter": "^15.3.1",
"**/react-syntax-highlighter/**/highlight.js": "^10.4.1",
"**/request": "^2.88.2",
"**/trim": "1.0.1",
"**/typescript": "4.1.3",
"**/underscore": "^1.13.1"
Expand Down Expand Up @@ -368,7 +367,6 @@
"regenerator-runtime": "^0.13.3",
"remark-parse": "^8.0.3",
"remark-stringify": "^9.0.0",
"request": "^2.88.0",
"require-in-the-middle": "^5.0.2",
"reselect": "^4.0.0",
"resize-observer-polyfill": "^1.5.0",
Expand Down Expand Up @@ -606,7 +604,6 @@
"@types/recompose": "^0.30.6",
"@types/reduce-reducers": "^1.0.0",
"@types/redux-actions": "^2.6.1",
"@types/request": "^2.48.2",
"@types/seedrandom": ">=2.0.0 <4.0.0",
"@types/selenium-webdriver": "^4.0.9",
"@types/semver": "^7",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ export class CiStatsReporter {
throw error;
}

if (error?.response && error.response.status < 502) {
if (error?.response && error.response.status < 500) {
// error response from service was received so warn the user and move on
this.log.warning(
`error reporting ${bodyDesc} [status=${error.response.status}] [resp=${inspect(
Expand Down
19 changes: 13 additions & 6 deletions packages/kbn-pm/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27495,16 +27495,23 @@ function isIdentifierChar(code) {
function isIdentifierName(name) {
let isFirst = true;

for (let _i = 0, _Array$from = Array.from(name); _i < _Array$from.length; _i++) {
const char = _Array$from[_i];
const cp = char.codePointAt(0);
for (let i = 0; i < name.length; i++) {
let cp = name.charCodeAt(i);

if ((cp & 0xfc00) === 0xd800 && i + 1 < name.length) {
const trail = name.charCodeAt(++i);

if ((trail & 0xfc00) === 0xdc00) {
cp = 0x10000 + ((cp & 0x3ff) << 10) + (trail & 0x3ff);
}
}

if (isFirst) {
isFirst = false;

if (!isIdentifierStart(cp)) {
return false;
}

isFirst = false;
} else if (!isIdentifierChar(cp)) {
return false;
}
Expand Down Expand Up @@ -59643,7 +59650,7 @@ class CiStatsReporter {
throw error;
}

if (error !== null && error !== void 0 && error.response && error.response.status < 502) {
if (error !== null && error !== void 0 && error.response && error.response.status < 500) {
// error response from service was received so warn the user and move on
this.log.warning(`error reporting ${bodyDesc} [status=${error.response.status}] [resp=${(0, _util.inspect)(error.response.data)}]`);
return;
Expand Down
15 changes: 15 additions & 0 deletions renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,21 @@
labels: ['Feature:Vega', 'Team:VisEditors'],
enabled: true,
},
{
groupName: 'platform security modules',
packageNames: [
'broadcast-channel',
'jsonwebtoken', '@types/jsonwebtoken',
'node-forge', '@types/node-forge',
'require-in-the-middle',
'tough-cookie', '@types/tough-cookie',
'xml-crypto', '@types/xml-crypto'
],
reviewers: ['team:kibana-security'],
matchBaseBranches: ['master', '7.x'],
labels: ['Team:Security'],
enabled: true,
},
],
},
}
2 changes: 1 addition & 1 deletion src/core/public/_variables.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@import '@elastic/eui/src/global_styling/variables/header';

// height of the header banner
$kbnHeaderBannerHeight: $euiSizeXL;
$kbnHeaderBannerHeight: $euiSizeXL; // This value is also declared in `/x-pack/plugins/canvas/common/lib/constants.ts`
// total height of the header (when the banner is *not* present)
$kbnHeaderOffset: $euiHeaderHeightCompensation * 2;
// total height of the header when the banner is present
Expand Down
6 changes: 6 additions & 0 deletions src/core/public/rendering/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@

&.kbnBody--hasHeaderBanner {
@include kbnAffordForHeader($kbnHeaderOffsetWithBanner);

// Prevents banners from covering full screen data grids
.euiDataGrid--fullScreen {
height: calc(100vh - #{$kbnHeaderBannerHeight});
top: $kbnHeaderBannerHeight;
}
}
&.kbnBody--chromeHidden {
@include kbnAffordForHeader(0);
Expand Down
18 changes: 18 additions & 0 deletions src/core/server/elasticsearch/deprecations/deprecation_provider.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* 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 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

import type { RegisterDeprecationsConfig } from '../../deprecations';
import { getScriptingDisabledDeprecations } from './scripting_disabled_deprecation';

export const getElasticsearchDeprecationsProvider = (): RegisterDeprecationsConfig => {
return {
getDeprecations: async (context) => {
return [...(await getScriptingDisabledDeprecations({ esClient: context.esClient }))];
},
};
};
9 changes: 9 additions & 0 deletions src/core/server/elasticsearch/deprecations/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
* 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 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

export { getElasticsearchDeprecationsProvider } from './deprecation_provider';
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
/*
* 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 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

import { estypes } from '@elastic/elasticsearch';
import { elasticsearchServiceMock } from '../../elasticsearch/elasticsearch_service.mock';
import { isInlineScriptingDisabled } from './is_scripting_disabled';

describe('isInlineScriptingDisabled', () => {
let client: ReturnType<typeof elasticsearchServiceMock.createElasticsearchClient>;

beforeEach(() => {
client = elasticsearchServiceMock.createElasticsearchClient();
});

const mockSettingsValue = (settings: estypes.ClusterGetSettingsResponse) => {
client.cluster.getSettings.mockReturnValue(
elasticsearchServiceMock.createSuccessTransportRequestPromise(settings)
);
};

it('returns `false` if all settings are empty', async () => {
mockSettingsValue({
transient: {},
persistent: {},
defaults: {},
});

expect(await isInlineScriptingDisabled({ client })).toEqual(false);
});

it('returns `false` if `defaults.script.allowed_types` is `inline`', async () => {
mockSettingsValue({
transient: {},
persistent: {},
defaults: {
'script.allowed_types': ['inline'],
},
});

expect(await isInlineScriptingDisabled({ client })).toEqual(false);
});

it('returns `true` if `defaults.script.allowed_types` is `none`', async () => {
mockSettingsValue({
transient: {},
persistent: {},
defaults: {
'script.allowed_types': ['none'],
},
});

expect(await isInlineScriptingDisabled({ client })).toEqual(true);
});

it('returns `true` if `defaults.script.allowed_types` is `stored`', async () => {
mockSettingsValue({
transient: {},
persistent: {},
defaults: {
'script.allowed_types': ['stored'],
},
});

expect(await isInlineScriptingDisabled({ client })).toEqual(true);
});

it('respect the persistent->defaults priority', async () => {
mockSettingsValue({
transient: {},
persistent: {
'script.allowed_types': ['inline'],
},
defaults: {
'script.allowed_types': ['stored'],
},
});

expect(await isInlineScriptingDisabled({ client })).toEqual(false);
});

it('respect the transient->persistent priority', async () => {
mockSettingsValue({
transient: {
'script.allowed_types': ['stored'],
},
persistent: {
'script.allowed_types': ['inline'],
},
defaults: {},
});

expect(await isInlineScriptingDisabled({ client })).toEqual(true);
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* 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 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

import { ElasticsearchClient } from '../../elasticsearch';

const scriptAllowedTypesKey = 'script.allowed_types';

export const isInlineScriptingDisabled = async ({
client,
}: {
client: ElasticsearchClient;
}): Promise<boolean> => {
const { body: settings } = await client.cluster.getSettings({
include_defaults: true,
flat_settings: true,
});

// priority: transient -> persistent -> default
const scriptAllowedTypes: string[] =
settings.transient[scriptAllowedTypesKey] ??
settings.persistent[scriptAllowedTypesKey] ??
settings.defaults![scriptAllowedTypesKey] ??
[];

// when unspecified, the setting as a default `[]` value that means that both scriptings are allowed.
const scriptAllowed = scriptAllowedTypes.length === 0 || scriptAllowedTypes.includes('inline');

return !scriptAllowed;
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* 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 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

export const isInlineScriptingDisabledMock = jest.fn();
jest.doMock('./is_scripting_disabled', () => ({
isInlineScriptingDisabled: isInlineScriptingDisabledMock,
}));
Loading

0 comments on commit 9393509

Please sign in to comment.