Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into lens/splitted-tim…
Browse files Browse the repository at this point in the history
…e-offset
  • Loading branch information
flash1293 committed May 28, 2021
2 parents 8e9f724 + fcaded7 commit ab828a3
Show file tree
Hide file tree
Showing 183 changed files with 8,506 additions and 2,336 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:changeme@192.168.50.1: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
8 changes: 5 additions & 3 deletions docs/developer/getting-started/monorepo-packages.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,12 @@ yarn kbn watch-bazel
- @kbn/i18n
- @kbn/legacy-logging
- @kbn/logging
- @kbn/mapbox-gl
- @kbn/monaco
- @kbn/securitysolution-es-utils
- kbn/securitysolution-io-ts-alerting-types
- kbn/securitysolution-io-ts-list-types
- kbn/securitysolution-io-ts-types
- @kbn/securitysolution-io-ts-alerting-types
- @kbn/securitysolution-io-ts-list-types
- @kbn/securitysolution-io-ts-types
- @kbn/securitysolution-io-ts-utils
- @kbn/securitysolution-list-api
- @kbn/securitysolution-list-constants
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
"@kbn/io-ts-utils": "link:packages/kbn-io-ts-utils",
"@kbn/legacy-logging": "link:bazel-bin/packages/kbn-legacy-logging/npm_module",
"@kbn/logging": "link:bazel-bin/packages/kbn-logging/npm_module",
"@kbn/monaco": "link:packages/kbn-monaco",
"@kbn/monaco": "link:bazel-bin/packages/kbn-monaco/npm_module",
"@kbn/securitysolution-list-constants": "link:bazel-bin/packages/kbn-securitysolution-list-constants/npm_module",
"@kbn/securitysolution-es-utils": "link:bazel-bin/packages/kbn-securitysolution-es-utils/npm_module",
"@kbn/securitysolution-io-ts-types": "link:bazel-bin/packages/kbn-securitysolution-io-ts-types/npm_module",
Expand Down
1 change: 1 addition & 0 deletions packages/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ filegroup(
"//packages/kbn-legacy-logging:build",
"//packages/kbn-logging:build",
"//packages/kbn-mapbox-gl:build",
"//packages/kbn-monaco:build",
"//packages/kbn-plugin-generator:build",
"//packages/kbn-securitysolution-list-constants:build",
"//packages/kbn-securitysolution-io-ts-types:build",
Expand Down
1 change: 1 addition & 0 deletions packages/kbn-babel-preset/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ DEPS = [
"@npm//@babel/preset-typescript",
"@npm//babel-plugin-add-module-exports",
"@npm//babel-plugin-styled-components",
"@npm//babel-plugin-transform-react-remove-prop-types",
]

js_library(
Expand Down
108 changes: 108 additions & 0 deletions packages/kbn-monaco/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
load("@npm//@bazel/typescript:index.bzl", "ts_config", "ts_project")
load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm")
load("@npm//webpack-cli:index.bzl", webpack = "webpack_cli")

PKG_BASE_NAME = "kbn-monaco"
PKG_REQUIRE_NAME = "@kbn/monaco"

SOURCE_FILES = glob(
[
"src/**/*",
],
exclude = [
"**/*.test.*",
"**/README.md",
],
)

SRCS = SOURCE_FILES

filegroup(
name = "srcs",
srcs = SRCS,
)

NPM_MODULE_EXTRA_FILES = [
"package.json",
"README.md"
]

SRC_DEPS = [
"//packages/kbn-babel-preset",
"//packages/kbn-i18n",
"@npm//antlr4ts",
"@npm//babel-loader",
"@npm//monaco-editor",
"@npm//raw-loader",
"@npm//regenerator-runtime",
]

TYPES_DEPS = [
"@npm//@types/jest",
"@npm//@types/node",
]

DEPS = SRC_DEPS + TYPES_DEPS

webpack(
name = "target_web",
data = DEPS + [
":src",
":webpack.config.js",
],
output_dir = True,
args = [
"--config",
"$(location webpack.config.js)",
"--output-path",
"$(@D)",
"--env.prod",
"--display=minimal"
],
)

ts_config(
name = "tsconfig",
src = "tsconfig.json",
deps = [
"//:tsconfig.base.json",
],
)

ts_project(
name = "tsc",
args = ['--pretty'],
srcs = SRCS,
deps = DEPS,
declaration = True,
declaration_dir = "target_types",
declaration_map = True,
incremental = True,
out_dir = "target_node",
source_map = True,
root_dir = ".",
tsconfig = ":tsconfig",
)

js_library(
name = PKG_BASE_NAME,
srcs = NPM_MODULE_EXTRA_FILES,
deps = DEPS + [":target_web", ":tsc"],
package_name = PKG_REQUIRE_NAME,
visibility = ["//visibility:public"],
)

pkg_npm(
name = "npm_module",
deps = [
":%s" % PKG_BASE_NAME,
]
)

filegroup(
name = "build",
srcs = [
":npm_module",
],
visibility = ["//visibility:public"],
)
Loading

0 comments on commit ab828a3

Please sign in to comment.