Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into fix/kibana-100800…
Browse files Browse the repository at this point in the history
…-generator-changes
  • Loading branch information
paul-tavares committed May 28, 2021
2 parents 58fa724 + a4f6d43 commit 83b8f03
Show file tree
Hide file tree
Showing 188 changed files with 11,092 additions and 4,418 deletions.
29 changes: 29 additions & 0 deletions .ci/package-testing/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/groovy
library 'kibana-pipeline-library'
kibanaLibrary.load()
kibanaPipeline(timeoutMinutes: 300) {
slackNotifications.onFailure {
ciStats.trackBuild {
workers.ci(ramDisk: false, name: "package-build", size: 'l', runErrorReporter: false) {
withGcpServiceAccount.fromVaultSecret('secret/kibana-issues/dev/ci-artifacts-key', 'value') {
kibanaPipeline.bash("test/scripts/jenkins_xpack_package_build.sh", "Package builds")
}
}
def packageTypes = ['deb', 'docker', 'rpm']
def workers = [:]
packageTypes.each { type ->
workers["package-${type}"] = {
testPackage(type)
}
}
parallel(workers)
}
}
}
def testPackage(packageType) {
workers.ci(ramDisk: false, name: "package-${packageType}", size: 's', runErrorReporter: false) {
withGcpServiceAccount.fromVaultSecret('secret/kibana-issues/dev/ci-artifacts-key', 'value') {
kibanaPipeline.bash("test/scripts/jenkins_xpack_package_${packageType}.sh", "Execute package testing for ${packageType}")
}
}
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ npm-debug.log*
.ci/runbld
.ci/bash_standard_lib.sh
.gradle
.vagrant

## @cypress/snapshot from apm plugin
snapshots.js
Expand Down
64 changes: 64 additions & 0 deletions docs/developer/contributing/development-package-tests.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
[[development-package-tests]]
== Package Testing

Packaging tests use Vagrant virtual machines as hosts and Ansible for
provisioning and assertions. Kibana distributions are copied from the
target folder into each VM and installed, along with required
dependencies.

=== Setup

* https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html[Ansible]
+
```
# Ubuntu
sudo apt-get install python3-pip libarchive-tools
pip3 install --user ansible

# Darwin
brew install python3
pip3 install --user ansible
```
* https://www.vagrantup.com/downloads[Vagrant]
* https://www.virtualbox.org/wiki/Downloads[Virtualbox]

=== Machines

[cols=",,",options="header",]
|===
|Hostname |IP |Description
|deb |192.168.50.5 |Installation of Kibana’s deb package
|rpm |192.168.50.6 |Installation of Kibana’s rpm package
|docker |192.168.50.7 |Installation of Kibana’s docker image
|===

=== Running

```
# Build distributions
node scripts/build --all-platforms --debug --no-oss

cd test/package

# Setup virtual machine and networking
vagrant up <hostname> --no-provision

# Install Kibana and run OS level tests
# This step can be repeated when adding new tests, it ensures machine state - installations won't run twice
vagrant provision <hostname>

# Running functional tests
node scripts/es snapshot \
-E network.bind_host=127.0.0.1,192.168.50.1 \
-E discovery.type=single-node \
--license=trial
TEST_KIBANA_URL=http://elastic:changeme@<ip>:5601 \
TEST_ES_URL=http://elastic:[email protected]:9200 \
node scripts/functional_test_runner.js --include-tag=smoke
```

=== Cleanup

....
vagrant destroy <hostname>
....
3 changes: 3 additions & 0 deletions docs/developer/contributing/development-tests.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,16 @@ to learn more about using the node scripts we provide for building
* <<development-functional-tests>>
* <<development-unit-tests>>
* <<development-accessibility-tests>>
* <<development-package-tests>>

include::development-functional-tests.asciidoc[leveloffset=+1]

include::development-unit-tests.asciidoc[leveloffset=+1]

include::development-accessibility-tests.asciidoc[leveloffset=+1]

include::development-package-tests.asciidoc[leveloffset=+1]

[discrete]
=== Cross-browser compatibility

Expand Down
46 changes: 36 additions & 10 deletions docs/settings/alert-action-settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ You can configure the following settings in the `kibana.yml` file.
[cols="2*<"]
|===
| `xpack.actions.enabled`
| Feature toggle that enables Actions in {kib}. Defaults to `true`.
| Feature toggle that enables Actions in {kib}. Default: `true`.

| `xpack.actions.allowedHosts` {ess-icon}
| A list of hostnames that {kib} is allowed to connect to when built-in actions are triggered. It defaults to `[*]`, allowing any host, but keep in mind the potential for SSRF attacks when hosts are not explicitly added to the allowed hosts. An empty list `[]` can be used to block built-in actions from making any external connections. +
Expand All @@ -50,7 +50,7 @@ You can configure the following settings in the `kibana.yml` file.

| `xpack.actions.customHostSettings` {ess-icon}
| A list of custom host settings to override existing global settings.
Defaults to an empty list. +
Default: an empty list. +
+
Each entry in the list must have a `url` property, to associate a connection
type (mail or https), hostname and port with the remaining options in the
Expand All @@ -70,6 +70,7 @@ You can configure the following settings in the `kibana.yml` file.
xpack.actions.customHostSettings:
- url: smtp://mail.example.com:465
tls:
verificationMode: 'full'
certificateAuthoritiesFiles: [ 'one.crt' ]
certificateAuthoritiesData: |
-----BEGIN CERTIFICATE-----
Expand All @@ -79,7 +80,9 @@ xpack.actions.customHostSettings:
requireTLS: true
- url: https://webhook.example.com
tls:
// legacy
rejectUnauthorized: false
verificationMode: 'none'
--

[cols="2*<"]
Expand Down Expand Up @@ -115,10 +118,16 @@ xpack.actions.customHostSettings:

| `xpack.actions.customHostSettings[n]`
`.tls.rejectUnauthorized` {ess-icon}
| A boolean value indicating whether to bypass server certificate validation.
| Deprecated. Use <<action-config-custom-host-verification-mode,`xpack.actions.customHostSettings.tls.verificationMode`>> instead. A boolean value indicating whether to bypass server certificate validation.
Overrides the general `xpack.actions.rejectUnauthorized` configuration
for requests made for this hostname/port.

|[[action-config-custom-host-verification-mode]] `xpack.actions.customHostSettings[n]`
`.tls.verificationMode`
| Controls the verification of the server certificate that {hosted-ems} receives when making an outbound SSL/TLS connection to the host server. Valid values are `full`, `certificate`, and `none`.
Use `full` to perform hostname verification, `certificate` to skip hostname verification, and `none` to skip verification. Default: `full`. <<elasticsearch-ssl-verificationMode,Equivalent {kib} setting>>. Overrides the general `xpack.actions.tls.verificationMode` configuration
for requests made for this hostname/port.

| `xpack.actions.customHostSettings[n]`
`.tls.certificateAuthoritiesFiles`
| A file name or list of file names of PEM-encoded certificate files to use
Expand All @@ -137,10 +146,10 @@ xpack.actions.customHostSettings:

| `xpack.actions`
`.preconfiguredAlertHistoryEsIndex` {ess-icon}
| Enables a preconfigured alert history {es} <<index-action-type, Index>> connector. Defaults to `false`.
| Enables a preconfigured alert history {es} <<index-action-type, Index>> connector. Default: `false`.

| `xpack.actions.preconfigured`
| Specifies preconfigured connector IDs and configs. Defaults to {}.
| Specifies preconfigured connector IDs and configs. Default: {}.

| `xpack.actions.proxyUrl` {ess-icon}
| Specifies the proxy URL to use, if using a proxy for actions. By default, no proxy is used.
Expand All @@ -152,27 +161,44 @@ xpack.actions.customHostSettings:
| Specifies hostnames which should only use the proxy, if using a proxy for actions. The value is an array of hostnames as strings. By default, no hosts will use the proxy, but if an action's hostname is in this list, the proxy will be used. The settings `xpack.actions.proxyBypassHosts` and `xpack.actions.proxyOnlyHosts` cannot be used at the same time.

| `xpack.actions.proxyHeaders` {ess-icon}
| Specifies HTTP headers for the proxy, if using a proxy for actions. Defaults to {}.
| Specifies HTTP headers for the proxy, if using a proxy for actions. Default: {}.

a|`xpack.actions.`
`proxyRejectUnauthorizedCertificates` {ess-icon}
| Set to `false` to bypass certificate validation for the proxy, if using a proxy for actions. Defaults to `true`.
| Deprecated. Use <<action-config-proxy-verification-mode,`xpack.actions.tls.proxyVerificationMode`>> instead. Set to `false` to bypass certificate validation for the proxy, if using a proxy for actions. Default: `true`.

|[[action-config-proxy-verification-mode]]
`xpack.actions[n]`
`.tls.proxyVerificationMode` {ess-icon}
| Controls the verification for the proxy server certificate that {hosted-ems} receives when making an outbound SSL/TLS connection to the proxy server. Valid values are `full`, `certificate`, and `none`.
Use `full` to perform hostname verification, `certificate` to skip hostname verification, and `none` to skip verification. Default: `full`. <<elasticsearch-ssl-verificationMode,Equivalent {kib} setting>>.

| `xpack.actions.rejectUnauthorized` {ess-icon}
| Set to `false` to bypass certificate validation for actions. Defaults to `true`. +
| Deprecated. Use <<action-config-verification-mode,`xpack.actions.tls.verificationMode`>> instead. Set to `false` to bypass certificate validation for actions. Default: `true`. +
+
As an alternative to setting `xpack.actions.rejectUnauthorized`, you can use the setting
`xpack.actions.customHostSettings` to set TLS options for specific servers.

|[[action-config-verification-mode]]
`xpack.actions[n]`
`.tls.verificationMode` {ess-icon}
| Controls the verification for the server certificate that {hosted-ems} receives when making an outbound SSL/TLS connection for actions. Valid values are `full`, `certificate`, and `none`.
Use `full` to perform hostname verification, `certificate` to skip hostname verification, and `none` to skip verification. Default: `full`. <<elasticsearch-ssl-verificationMode,Equivalent {kib} setting>>. +
+
As an alternative to setting `xpack.actions.tls.verificationMode`, you can use the setting
`xpack.actions.customHostSettings` to set TLS options for specific servers.



| `xpack.actions.maxResponseContentLength` {ess-icon}
| Specifies the max number of bytes of the http response for requests to external resources. Defaults to 1000000 (1MB).
| Specifies the max number of bytes of the http response for requests to external resources. Default: 1000000 (1MB).

| `xpack.actions.responseTimeout` {ess-icon}
| Specifies the time allowed for requests to external resources. Requests that take longer are aborted. The time is formatted as: +
+
`<count>[ms,s,m,h,d,w,M,Y]` +
+
For example, `20m`, `24h`, `7d`, `1w`. Defaults to `60s`.
For example, `20m`, `24h`, `7d`, `1w`. Default: `60s`.


|===
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@
"@mapbox/mapbox-gl-draw": "1.3.0",
"@mapbox/mapbox-gl-rtl-text": "0.2.3",
"@mapbox/vector-tile": "1.3.1",
"@reduxjs/toolkit": "^1.5.1",
"@scant/router": "^0.1.1",
"@slack/webhook": "^5.0.4",
"@turf/along": "6.0.1",
Expand All @@ -173,6 +174,7 @@
"@turf/distance": "6.0.1",
"@turf/helpers": "6.0.1",
"@turf/length": "^6.0.2",
"@types/redux-logger": "^3.0.8",
"JSONStream": "1.3.5",
"abort-controller": "^3.0.0",
"abortcontroller-polyfill": "^1.4.0",
Expand Down Expand Up @@ -365,6 +367,7 @@
"redux": "^4.0.5",
"redux-actions": "^2.6.5",
"redux-devtools-extension": "^2.13.8",
"redux-logger": "^3.0.6",
"redux-observable": "^1.2.0",
"redux-saga": "^1.1.3",
"redux-thunk": "^2.3.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ kibana_vars=(
xpack.actions.rejectUnauthorized
xpack.actions.maxResponseContentLength
xpack.actions.responseTimeout
xpack.actions.tls.verificationMode
xpack.actions.tls.proxyVerificationMode
xpack.alerts.healthCheck.interval
xpack.alerts.invalidateApiKeysTask.interval
xpack.alerts.invalidateApiKeysTask.removalDelay
Expand Down
1 change: 1 addition & 0 deletions src/dev/precommit_hook/casing_check_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export const IGNORE_FILE_GLOBS = [
'vars/*',
'.ci/pipeline-library/**/*',
'packages/kbn-test/jest-preset.js',
'test/package/Vagrantfile',

// filename must match language code which requires capital letters
'**/translations/*.json',
Expand Down
4 changes: 2 additions & 2 deletions test/functional/page_objects/time_picker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ export function TimePickerProvider({ getService, getPageObjects }: FtrProviderCo
const testSubjects = getService('testSubjects');
const { header } = getPageObjects(['header']);
const kibanaServer = getService('kibanaServer');
const MenuToggle = getService('MenuToggle');
const menuToggle = getService('menuToggle');

const quickSelectTimeMenuToggle = new MenuToggle({
const quickSelectTimeMenuToggle = menuToggle.create({
name: 'QuickSelectTime Menu',
menuTestSubject: 'superDatePickerQuickMenu',
toggleButtonTestSubject: 'superDatePickerToggleQuickMenuButton',
Expand Down
30 changes: 13 additions & 17 deletions test/functional/services/embedding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,20 @@
* Side Public License, v 1.
*/

import { FtrProviderContext } from '../ftr_provider_context';
import { FtrService } from '../ftr_provider_context';

export function EmbeddingProvider({ getService, getPageObjects }: FtrProviderContext) {
const browser = getService('browser');
const log = getService('log');
const PageObjects = getPageObjects(['header']);
export class EmbeddingService extends FtrService {
private readonly browser = this.ctx.getService('browser');
private readonly log = this.ctx.getService('log');
private readonly PageObjects = this.ctx.getPageObjects(['header']);

class Embedding {
/**
* Opens current page in embeded mode
*/
public async openInEmbeddedMode(): Promise<void> {
const currentUrl = await browser.getCurrentUrl();
log.debug(`Opening in embedded mode: ${currentUrl}`);
await browser.get(`${currentUrl}&embed=true`);
await PageObjects.header.waitUntilLoadingHasFinished();
}
/**
* Opens current page in embeded mode
*/
public async openInEmbeddedMode(): Promise<void> {
const currentUrl = await this.browser.getCurrentUrl();
this.log.debug(`Opening in embedded mode: ${currentUrl}`);
await this.browser.get(`${currentUrl}&embed=true`);
await this.PageObjects.header.waitUntilLoadingHasFinished();
}

return new Embedding();
}
20 changes: 10 additions & 10 deletions test/functional/services/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@ import {
DashboardVisualizationsService,
} from './dashboard';
import { DocTableService } from './doc_table';
import { EmbeddingProvider } from './embedding';
import { EmbeddingService } from './embedding';
import { FilterBarService } from './filter_bar';
import { FlyoutService } from './flyout';
import { GlobalNavService } from './global_nav';
import { InspectorService } from './inspector';
import { FieldEditorService } from './field_editor';
import { ManagementMenuService } from './management';
import { QueryBarProvider } from './query_bar';
import { QueryBarService } from './query_bar';
import { RemoteProvider } from './remote';
import { RenderableProvider } from './renderable';
import { RenderableService } from './renderable';
import { ToastsService } from './toasts';
import { DataGridService } from './data_grid';
import {
Expand All @@ -44,17 +44,17 @@ import {
VegaDebugInspectorViewService,
} from './visualizations';
import { ListingTableService } from './listing_table';
import { SavedQueryManagementComponentProvider } from './saved_query_management_component';
import { SavedQueryManagementComponentService } from './saved_query_management_component';
import { KibanaSupertestProvider } from './supertest';
import { MenuToggleProvider } from './menu_toggle';
import { MenuToggleService } from './menu_toggle';
import { MonacoEditorProvider } from './monaco_editor';

export const services = {
...commonServiceProviders,

__webdriver__: RemoteProvider,
filterBar: FilterBarService,
queryBar: QueryBarProvider,
queryBar: QueryBarService,
find: FindProvider,
testSubjects: TestSubjects,
docTable: DocTableService,
Expand All @@ -70,8 +70,8 @@ export const services = {
flyout: FlyoutService,
comboBox: ComboBoxService,
dataGrid: DataGridService,
embedding: EmbeddingProvider,
renderable: RenderableProvider,
embedding: EmbeddingService,
renderable: RenderableService,
browser: BrowserProvider,
pieChart: PieChartService,
inspector: InspectorService,
Expand All @@ -80,10 +80,10 @@ export const services = {
appsMenu: AppsMenuService,
globalNav: GlobalNavService,
toasts: ToastsService,
savedQueryManagementComponent: SavedQueryManagementComponentProvider,
savedQueryManagementComponent: SavedQueryManagementComponentService,
elasticChart: ElasticChartService,
supertest: KibanaSupertestProvider,
managementMenu: ManagementMenuService,
monacoEditor: MonacoEditorProvider,
MenuToggle: MenuToggleProvider,
menuToggle: MenuToggleService,
};
Loading

0 comments on commit 83b8f03

Please sign in to comment.