Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into kbn-45393-capabil…
Browse files Browse the repository at this point in the history
…ities-service
  • Loading branch information
pgayvallet committed Dec 3, 2019
2 parents c4e313f + 609a7f5 commit f66b237
Show file tree
Hide file tree
Showing 125 changed files with 1,645 additions and 1,171 deletions.
12 changes: 12 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,21 @@
/src/plugins/kibana_react/ @elastic/kibana-app-arch
/src/plugins/kibana_utils/ @elastic/kibana-app-arch
/src/plugins/navigation/ @elastic/kibana-app-arch
/src/plugins/share/ @elastic/kibana-app-arch
/src/plugins/ui_actions/ @elastic/kibana-app-arch
/src/plugins/visualizations/ @elastic/kibana-app-arch
/x-pack/plugins/advanced_ui_actions/ @elastic/kibana-app-arch
/src/legacy/core_plugins/data/ @elastic/kibana-app-arch
/src/legacy/core_plugins/embeddable_api/ @elastic/kibana-app-arch
/src/legacy/core_plugins/interpreter/ @elastic/kibana-app-arch
/src/legacy/core_plugins/kibana_react/ @elastic/kibana-app-arch
/src/legacy/core_plugins/kibana/public/management/ @elastic/kibana-app-arch
/src/legacy/core_plugins/kibana/server/field_formats/ @elastic/kibana-app-arch
/src/legacy/core_plugins/kibana/server/routes/api/management/ @elastic/kibana-app-arch
/src/legacy/core_plugins/kibana/server/routes/api/suggestions/ @elastic/kibana-app-arch
/src/legacy/core_plugins/visualizations/ @elastic/kibana-app-arch
/src/legacy/server/index_patterns/ @elastic/kibana-app-arch
/src/legacy/server/url_shortening/ @elastic/kibana-app-arch

# APM
/x-pack/legacy/plugins/apm/ @elastic/apm-ui
Expand Down
8 changes: 4 additions & 4 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ stage("Kibana Pipeline") { // This stage is just here to help the BlueOcean UI a
'kibana-intake-agent': kibanaPipeline.legacyJobRunner('kibana-intake'),
'x-pack-intake-agent': kibanaPipeline.legacyJobRunner('x-pack-intake'),
'kibana-oss-agent': kibanaPipeline.withWorkers('kibana-oss-tests', { kibanaPipeline.buildOss() }, [
'oss-firefoxSmoke': kibanaPipeline.getPostBuildWorker('firefoxSmoke', { runbld('./test/scripts/jenkins_firefox_smoke.sh', 'Execute kibana-firefoxSmoke') }),
'oss-ciGroup1': kibanaPipeline.getOssCiGroupWorker(1),
'oss-ciGroup2': kibanaPipeline.getOssCiGroupWorker(2),
'oss-ciGroup3': kibanaPipeline.getOssCiGroupWorker(3),
Expand All @@ -24,11 +25,11 @@ stage("Kibana Pipeline") { // This stage is just here to help the BlueOcean UI a
'oss-ciGroup10': kibanaPipeline.getOssCiGroupWorker(10),
'oss-ciGroup11': kibanaPipeline.getOssCiGroupWorker(11),
'oss-ciGroup12': kibanaPipeline.getOssCiGroupWorker(12),
'oss-firefoxSmoke': kibanaPipeline.getPostBuildWorker('firefoxSmoke', { runbld('./test/scripts/jenkins_firefox_smoke.sh', 'Execute kibana-firefoxSmoke') }),
'oss-accessibility': kibanaPipeline.getPostBuildWorker('accessibility', { runbld('./test/scripts/jenkins_accessibility.sh', 'Execute kibana-accessibility') }),
'oss-visualRegression': kibanaPipeline.getPostBuildWorker('visualRegression', { runbld('./test/scripts/jenkins_visual_regression.sh', 'Execute kibana-visualRegression') }),
// 'oss-visualRegression': kibanaPipeline.getPostBuildWorker('visualRegression', { runbld('./test/scripts/jenkins_visual_regression.sh', 'Execute kibana-visualRegression') }),
]),
'kibana-xpack-agent': kibanaPipeline.withWorkers('kibana-xpack-tests', { kibanaPipeline.buildXpack() }, [
'xpack-firefoxSmoke': kibanaPipeline.getPostBuildWorker('xpack-firefoxSmoke', { runbld('./test/scripts/jenkins_xpack_firefox_smoke.sh', 'Execute xpack-firefoxSmoke') }),
'xpack-ciGroup1': kibanaPipeline.getXpackCiGroupWorker(1),
'xpack-ciGroup2': kibanaPipeline.getXpackCiGroupWorker(2),
'xpack-ciGroup3': kibanaPipeline.getXpackCiGroupWorker(3),
Expand All @@ -39,9 +40,8 @@ stage("Kibana Pipeline") { // This stage is just here to help the BlueOcean UI a
'xpack-ciGroup8': kibanaPipeline.getXpackCiGroupWorker(8),
'xpack-ciGroup9': kibanaPipeline.getXpackCiGroupWorker(9),
'xpack-ciGroup10': kibanaPipeline.getXpackCiGroupWorker(10),
'xpack-firefoxSmoke': kibanaPipeline.getPostBuildWorker('xpack-firefoxSmoke', { runbld('./test/scripts/jenkins_xpack_firefox_smoke.sh', 'Execute xpack-firefoxSmoke') }),
'xpack-accessibility': kibanaPipeline.getPostBuildWorker('xpack-accessibility', { runbld('./test/scripts/jenkins_xpack_accessibility.sh', 'Execute xpack-accessibility') }),
'xpack-visualRegression': kibanaPipeline.getPostBuildWorker('xpack-visualRegression', { runbld('./test/scripts/jenkins_xpack_visual_regression.sh', 'Execute xpack-visualRegression') }),
// 'xpack-visualRegression': kibanaPipeline.getPostBuildWorker('xpack-visualRegression', { runbld('./test/scripts/jenkins_xpack_visual_regression.sh', 'Execute xpack-visualRegression') }),
]),
])
}
Expand Down
2 changes: 1 addition & 1 deletion config/kibana.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

# Optional settings that provide the paths to the PEM-format SSL certificate and key files.
# These files are used to verify the identity of Kibana to Elasticsearch and are required when
# xpack.ssl.verification_mode in Elasticsearch is set to either certificate or full.
# xpack.security.http.ssl.client_authentication in Elasticsearch is set to required.
#elasticsearch.ssl.certificate: /path/to/your/client.crt
#elasticsearch.ssl.key: /path/to/your/client.key

Expand Down
2 changes: 1 addition & 1 deletion docs/setup/docker.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ https://github.com/elastic/kibana-docker/tree/{branch}[GitHub].

These images are free to use under the Elastic license. They contain open source
and free commercial features and access to paid commercial features.
{xpack-ref}/license-management.html[Start a 30-day trial] to try out all of the
{stack-ov}/license-management.html[Start a 30-day trial] to try out all of the
paid commercial features. See the
https://www.elastic.co/subscriptions[Subscriptions] page for information about
Elastic license levels.
Expand Down
2 changes: 1 addition & 1 deletion docs/setup/install/deb.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Kibana on any Debian-based system such as Debian and Ubuntu.

This package is free to use under the Elastic license. It contains open source
and free commercial features and access to paid commercial features.
{xpack-ref}/license-management.html[Start a 30-day trial] to try out all of the
{stack-ov}/license-management.html[Start a 30-day trial] to try out all of the
paid commercial features. See the
https://www.elastic.co/subscriptions[Subscriptions] page for information about
Elastic license levels.
Expand Down
2 changes: 1 addition & 1 deletion docs/setup/install/rpm.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ such as SLES 11 and CentOS 5. Please see <<targz>> instead.

This package is free to use under the Elastic license. It contains open source
and free commercial features and access to paid commercial features.
{xpack-ref}/license-management.html[Start a 30-day trial] to try out all of the
{stack-ov}/license-management.html[Start a 30-day trial] to try out all of the
paid commercial features. See the
https://www.elastic.co/subscriptions[Subscriptions] page for information about
Elastic license levels.
Expand Down
2 changes: 1 addition & 1 deletion docs/setup/install/targz.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ are the easiest formats to use when trying out Kibana.

These packages are free to use under the Elastic license. They contain open
source and free commercial features and access to paid commercial features.
{xpack-ref}/license-management.html[Start a 30-day trial] to try out all of the
{stack-ov}/license-management.html[Start a 30-day trial] to try out all of the
paid commercial features. See the
https://www.elastic.co/subscriptions[Subscriptions] page for information about
Elastic license levels.
Expand Down
2 changes: 1 addition & 1 deletion docs/setup/install/windows.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Kibana can be installed on Windows using the `.zip` package.

This package is free to use under the Elastic license. It contains open source
and free commercial features and access to paid commercial features.
{xpack-ref}/license-management.html[Start a 30-day trial] to try out all of the
{stack-ov}/license-management.html[Start a 30-day trial] to try out all of the
paid commercial features. See the
https://www.elastic.co/subscriptions[Subscriptions] page for information about
Elastic license levels.
Expand Down
6 changes: 6 additions & 0 deletions docs/setup/settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,12 @@ running behind a proxy. Use the `server.rewriteBasePath` setting to tell Kibana
if it should remove the basePath from requests it receives, and to prevent a
deprecation warning at startup. This setting cannot end in a slash (`/`).

[[server-compression]]`server.compression.enabled:`:: *Default: `true`* Set to `false` to disable HTTP compression for all responses.

`server.compression.referrerWhitelist:`:: *Default: none* Specifies an array of trusted hostnames, such as the Kibana host, or a reverse
proxy sitting in front of it. This determines whether HTTP compression may be used for responses, based on the request's `Referer` header.
This setting may not be used when `server.compression.enabled` is set to `false`.

[[server-cors]]`server.cors:`:: *Default: `false`* Set to `true` to enable CORS support. This setting is required to configure `server.cors.origin`.

`server.cors.origin:`:: *Default: none* Specifies origins. "origin" must be an array. To use this setting, you must set `server.cors` to `true`. To accept all origins, use `server.cors.origin: ["*"]`.
Expand Down
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 6 additions & 3 deletions docs/user/monitoring/logstash-details.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,19 @@ If you are monitoring Logstash nodes, click **Overview** in the Logstash section
of the *Stack Monitoring* page in {kib}. You can view the overall health of the
Logstash nodes.

image::user/monitoring/images/monitoring-logstash-overview.jpg["Logstash Overview",link="images/monitoring-logstash-overview.jpg"]
[role="screenshot"]
image::user/monitoring/images/monitoring-logstash-overview.png["Logstash Overview",link="images/monitoring-logstash-overview.png"]

To view Logstash node metrics, click **Nodes**. The Nodes section shows the
status of each Logstash node.

image::user/monitoring/images/monitoring-logstash-nodes.jpg["Logstash Nodes",link="images/monitoring-logstash-nodes.jpg"]
[role="screenshot"]
image::user/monitoring/images/monitoring-logstash-nodes.png["Logstash Nodes",link="images/monitoring-logstash-nodes.png"]

Click the name of a node to view its statistics over time.

image::user/monitoring/images/monitoring-logstash-node.jpg["Logstash Node View",link="images/monitoring-logstash-node.jpg"]
[role="screenshot"]
image::user/monitoring/images/monitoring-logstash-node.png["Logstash Node View",link="images/monitoring-logstash-node.png"]

For more information, see
{logstash-ref}/monitoring-logstash.html[Monitoring Logstash].
43 changes: 38 additions & 5 deletions src/core/server/http/__snapshots__/http_config.test.ts.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ configService.atPath.mockReturnValue(
ssl: {
verificationMode: 'none',
},
compression: { enabled: true },
} as any)
);

Expand Down
56 changes: 49 additions & 7 deletions src/core/server/http/http_config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,26 @@ import { config, HttpConfig } from '.';
import { Env } from '../config';
import { getEnvOptions } from '../config/__mocks__/env';

const validHostnames = ['www.example.com', '8.8.8.8', '::1', 'localhost'];
const invalidHostname = 'asdf$%^';

test('has defaults for config', () => {
const httpSchema = config.schema;
const obj = {};
expect(httpSchema.validate(obj)).toMatchSnapshot();
});

test('accepts valid hostnames', () => {
const { host: host1 } = config.schema.validate({ host: 'www.example.com' });
const { host: host2 } = config.schema.validate({ host: '8.8.8.8' });
const { host: host3 } = config.schema.validate({ host: '::1' });
const { host: host4 } = config.schema.validate({ host: 'localhost' });

expect({ host1, host2, host3, host4 }).toMatchSnapshot('valid host names');
for (const val of validHostnames) {
const { host } = config.schema.validate({ host: val });
expect({ host }).toMatchSnapshot();
}
});

test('throws if invalid hostname', () => {
const httpSchema = config.schema;
const obj = {
host: 'asdf$%^',
host: invalidHostname,
};
expect(() => httpSchema.validate(obj)).toThrowErrorMatchingSnapshot();
});
Expand Down Expand Up @@ -296,3 +297,44 @@ describe('with TLS', () => {
expect(httpConfig.ssl.rejectUnauthorized).toBe(true);
});
});

describe('with compression', () => {
test('accepts valid referrer whitelist', () => {
const {
compression: { referrerWhitelist },
} = config.schema.validate({
compression: {
referrerWhitelist: validHostnames,
},
});

expect(referrerWhitelist).toMatchSnapshot();
});

test('throws if invalid referrer whitelist', () => {
const httpSchema = config.schema;
const invalidHostnames = {
compression: {
referrerWhitelist: [invalidHostname],
},
};
const emptyArray = {
compression: {
referrerWhitelist: [],
},
};
expect(() => httpSchema.validate(invalidHostnames)).toThrowErrorMatchingSnapshot();
expect(() => httpSchema.validate(emptyArray)).toThrowErrorMatchingSnapshot();
});

test('throws if referrer whitelist is specified and compression is disabled', () => {
const httpSchema = config.schema;
const obj = {
compression: {
enabled: false,
referrerWhitelist: validHostnames,
},
};
expect(() => httpSchema.validate(obj)).toThrowErrorMatchingSnapshot();
});
});
16 changes: 16 additions & 0 deletions src/core/server/http/http_config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,26 @@ export const config = {
socketTimeout: schema.number({
defaultValue: 120000,
}),
compression: schema.object({
enabled: schema.boolean({ defaultValue: true }),
referrerWhitelist: schema.maybe(
schema.arrayOf(
schema.string({
hostname: true,
}),
{ minSize: 1 }
)
),
}),
},
{
validate: rawConfig => {
if (!rawConfig.basePath && rawConfig.rewriteBasePath) {
return 'cannot use [rewriteBasePath] when [basePath] is not specified';
}
if (!rawConfig.compression.enabled && rawConfig.compression.referrerWhitelist) {
return 'cannot use [compression.referrerWhitelist] when [compression.enabled] is set to false';
}

if (
rawConfig.ssl.enabled &&
Expand Down Expand Up @@ -109,6 +123,7 @@ export class HttpConfig {
public publicDir: string;
public defaultRoute?: string;
public ssl: SslConfig;
public compression: { enabled: boolean; referrerWhitelist?: string[] };

/**
* @internal
Expand All @@ -126,5 +141,6 @@ export class HttpConfig {
this.publicDir = env.staticFilesDir;
this.ssl = new SslConfig(rawConfig.ssl || {});
this.defaultRoute = rawConfig.defaultRoute;
this.compression = rawConfig.compression;
}
}
Loading

0 comments on commit f66b237

Please sign in to comment.