Skip to content

Commit

Permalink
Merge branch 'master' into update-file-data-visualizer-permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine authored Jun 29, 2021
2 parents db90076 + 1dce600 commit 34518bf
Show file tree
Hide file tree
Showing 3,345 changed files with 134,125 additions and 44,304 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 0 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ snapshots.js

# package overrides
/packages/elastic-eslint-config-kibana
/packages/kbn-interpreter/src/common/lib/grammar.js
/packages/kbn-tinymath/src/grammar.js
/packages/kbn-plugin-generator/template
/packages/kbn-pm/dist
/packages/kbn-test/src/functional_test_runner/__tests__/fixtures/
Expand Down
24 changes: 22 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -857,6 +857,18 @@ module.exports = {
'react-hooks/exhaustive-deps': ['error', { additionalHooks: '^useFetcher$' }],
},
},
{
files: ['x-pack/plugins/apm/**/*.stories.*', 'x-pack/plugins/observability/**/*.stories.*'],
rules: {
'react/function-component-definition': [
'off',
{
namedComponents: 'function-declaration',
unnamedComponents: 'arrow-function',
},
],
},
},

/**
* Fleet overrides
Expand Down Expand Up @@ -893,6 +905,8 @@ module.exports = {
files: [
'x-pack/plugins/security_solution/public/**/*.{js,mjs,ts,tsx}',
'x-pack/plugins/security_solution/common/**/*.{js,mjs,ts,tsx}',
'x-pack/plugins/timelines/public/**/*.{js,mjs,ts,tsx}',
'x-pack/plugins/timelines/common/**/*.{js,mjs,ts,tsx}',
],
rules: {
'import/no-nodejs-modules': 'error',
Expand All @@ -907,7 +921,10 @@ module.exports = {
},
{
// typescript only for front and back end
files: ['x-pack/plugins/security_solution/**/*.{ts,tsx}'],
files: [
'x-pack/plugins/security_solution/**/*.{ts,tsx}',
'x-pack/plugins/timelines/**/*.{ts,tsx}',
],
rules: {
'@typescript-eslint/no-this-alias': 'error',
'@typescript-eslint/no-explicit-any': 'error',
Expand All @@ -917,7 +934,10 @@ module.exports = {
},
{
// typescript and javascript for front and back end
files: ['x-pack/plugins/security_solution/**/*.{js,mjs,ts,tsx}'],
files: [
'x-pack/plugins/security_solution/**/*.{js,mjs,ts,tsx}',
'x-pack/plugins/timelines/**/*.{js,mjs,ts,tsx}',
],
plugins: ['eslint-plugin-node', 'react'],
env: {
jest: true,
Expand Down
22 changes: 13 additions & 9 deletions NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -149,17 +149,17 @@ SOFTWARE.

---
Detection Rules
Copyright 2020 Elasticsearch B.V.
Copyright 2021 Elasticsearch B.V.

---
This product bundles rules based on https://github.com/BlueTeamLabs/sentinel-attack
which is available under a "MIT" license. The files based on this license are:
which is available under a "MIT" license. The rules based on this license are:

- defense_evasion_via_filter_manager
- discovery_process_discovery_via_tasklist_command
- persistence_priv_escalation_via_accessibility_features
- persistence_via_application_shimming
- defense_evasion_execution_via_trusted_developer_utilities
- "Potential Evasion via Filter Manager" (06dceabf-adca-48af-ac79-ffdf4c3b1e9a)
- "Process Discovery via Tasklist" (cc16f774-59f9-462d-8b98-d27ccd4519ec)
- "Potential Modification of Accessibility Binaries" (7405ddf1-6c8e-41ce-818f-48bea6bcaed8)
- "Potential Application Shimming via Sdbinst" (fd4a992d-6130-4802-9ff8-829b89ae801f)
- "Trusted Developer Application Usage" (9d110cb3-5f4b-4c9a-b9f5-53f0a1707ae1)

MIT License

Expand All @@ -185,9 +185,9 @@ SOFTWARE.

---
This product bundles rules based on https://github.com/FSecureLABS/leonidas
which is available under a "MIT" license. The files based on this license are:
which is available under a "MIT" license. The rules based on this license are:

- credential_access_secretsmanager_getsecretvalue.toml
- "AWS Access Secret in Secrets Manager" (a00681e3-9ed6-447c-ab2c-be648821c622)

MIT License

Expand Down Expand Up @@ -235,6 +235,10 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

---
Portions of this code are licensed under the following license:
For license information please see https://edge.fullstory.com/s/fs.js.LICENSE.txt

---
This product bundles [email protected] which is available under a
"MIT" license.
Expand Down
89 changes: 89 additions & 0 deletions dev_docs/tutorials/setting_up_a_development_env.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
---
id: kibDevTutorialSetupDevEnv
slug: /kibana-dev-docs/tutorial/setup-dev-env
title: Setting up a Development Environment
summary: Learn how to setup a development environemnt for contributing to the Kibana repository
date: 2021-04-26
tags: ['kibana', 'onboarding', 'dev', 'architecture', 'setup']
---

Setting up a development environment is pretty easy.

<DocCallOut title="A note about Windows">
In order to support Windows development we currently require you to use one of the following:

- [Git Bash](https://git-scm.com/download/win)
- [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/about)


Before running the steps below, please make sure you have installed [Visual C++ Redistributable for Visual Studio 2015](https://www.microsoft.com/en-us/download/details.aspx?id=48145) and that you are running all commands in either Git Bash or WSL.
</DocCallOut>

## Get the code

Start by forking [the Kibana repository](https://github.com/elastic/kibana) on Github so that you have a place to stage pull requests and create branches for development.

Then clone the repository to your machine:

```sh
git clone https://github.com/[YOUR_USERNAME]/kibana.git kibana
cd kibana
```

## Install dependencies

Install the version of Node.js listed in the `.node-version` file. This can be automated with tools such as [nvm](https://github.com/creationix/nvm) or [nvm-windows](https://github.com/coreybutler/nvm-windows). As we also include a `.nvmrc` file you can switch to the correct version when using nvm by running:

```sh
nvm use
```

Then, install the latest version of yarn using:

```sh
npm install -g yarn
```

Finally, boostrap Kibana and install all of the remaining dependencies:

```sh
yarn kbn bootstrap
```

Node.js native modules could be in use and node-gyp is the tool used to build them. There are tools you need to install per platform and python versions you need to be using. Please follow the [node-gyp installation steps](https://github.com/nodejs/node-gyp#installation) for your platform.

## Run Elasticsearch

In order to start Kibana you need to run a local version of Elasticsearch. You can startup and initialize the latest Elasticsearch snapshot of the correct version for Kibana by running the following in a new terminal tab/window:

```sh
yarn es snapshot
```

You can pass `--license trial` to start Elasticsearch with a trial license, or use the Kibana UI to switch the local version to a trial version which includes all features.

Read about more options for [Running Elasticsearch during development](https://www.elastic.co/guide/en/kibana/current/running-elasticsearch.html), like connecting to a remote host, running from source, preserving data inbetween runs, running remote cluster, etc.

## Run Kibana

In another terminal tab/window you can start Kibana.

```sh
yarn start
```

If you include the `--run-examples` flag then all of the [developer examples](https://github.com/elastic/kibana/tree/{branch}/examples). Read more about the advanced options for [Running Kibana](https://www.elastic.co/guide/en/kibana/current/running-kibana-advanced.html).

## Code away!

You are now ready to start developing. Changes to the source files should be picked up automatically and either cause the server to restart, or be served to the browser on the next page refresh.

## Install pre-commit hook (optional)

In case you want to run a couple of checks like linting or check the file casing of the files to commit, we provide a way to install a pre-commit hook. To configure it you just need to run the following:

```sh
node scripts/register_git_hook
```

After the script completes the pre-commit hook will be created within the file `.git/hooks/pre-commit`. If you choose to not install it, don’t worry, we still run a quick CI check to provide feedback earliest as we can about the same checks.
4 changes: 4 additions & 0 deletions docs/api/alerting/legacy/list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ The API returns the following:
},
"producer":"stackAlerts",
"minimumLicenseRequired":"basic",
"isExportable":true,
"enabledInLicense":true,
"authorizedConsumers":{
"alerts":{
Expand Down Expand Up @@ -113,6 +114,9 @@ Each alert type contains the following properties:
| `minimumLicenseRequired`
| The license required to use the alert type.

| `isExportable`
| Whether the rule type is exportable through the Saved Objects Management UI.

| `enabledInLicense`
| Whether the alert type is enabled or disabled based on the license.

Expand Down
4 changes: 4 additions & 0 deletions docs/api/alerting/list_rule_types.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ The API returns the following:
},
"producer":"stackAlerts",
"minimum_license_required":"basic",
"is_exportable":true,
"enabled_in_license":true,
"authorized_consumers":{
"alerts":{
Expand Down Expand Up @@ -115,6 +116,9 @@ Each rule type contains the following properties:
| `minimum_license_required`
| The license required to use the rule type.

| `is_exportable`
| Whether the rule type is exportable through the Saved Objects Management UI.

| `enabled_in_license`
| Whether the rule type is enabled or disabled based on the license.

Expand Down
5 changes: 5 additions & 0 deletions docs/api/saved-objects/bulk_create.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ experimental[] Create multiple {kib} saved objects.
(Optional, string array) Identifiers for the <<xpack-spaces,spaces>> in which this object is created. If this is provided, the
object is created only in the explicitly defined spaces. If this is not provided, the object is created in the current space
(default behavior).
* For shareable object types (registered with `namespaceType: 'multiple'`): this option can be used to specify one or more spaces, including
the "All spaces" identifier (`'*'`).
* For isolated object types (registered with `namespaceType: 'single'` or `namespaceType: 'multiple-isolated'`): this option can only be
used to specify a single space, and the "All spaces" identifier (`'*'`) is not allowed.
* For global object types (registered with `namespaceType: 'agnostic'`): this option cannot be used.

`version`::
(Optional, number) Specifies the version.
Expand Down
5 changes: 5 additions & 0 deletions docs/api/saved-objects/create.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ any data that you send to the API is properly formed.
(Optional, string array) Identifiers for the <<xpack-spaces,spaces>> in which this object is created. If this is provided, the
object is created only in the explicitly defined spaces. If this is not provided, the object is created in the current space
(default behavior).
* For shareable object types (registered with `namespaceType: 'multiple'`): this option can be used to specify one or more spaces, including
the "All spaces" identifier (`'*'`).
* For isolated object types (registered with `namespaceType: 'single'` or `namespaceType: 'multiple-isolated'`): this option can only be
used to specify a single space, and the "All spaces" identifier (`'*'`) is not allowed.
* For global object types (registered with `namespaceType: 'agnostic'): this option cannot be used.

[[saved-objects-api-create-request-codes]]
==== Response code
Expand Down
11 changes: 7 additions & 4 deletions docs/api/task-manager/health.asciidoc
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
[[task-manager-api-health]]
=== Get Task Manager health API
== Task Manager health API
++++
<titleabbrev>Get Task Manager health</titleabbrev>
++++

Retrieve the health status of the {kib} Task Manager.

[float]
[[task-manager-api-health-request]]
==== Request
=== Request

`GET <kibana host>:<port>/api/task_manager/_health`

[float]
[[task-manager-api-health-codes]]
==== Response code
=== Response code

`200`::
Indicates a successful call.

[float]
[[task-manager-api-health-example]]
==== Example
=== Example

Retrieve the health status of the {kib} Task Manager:

Expand Down
18 changes: 10 additions & 8 deletions docs/developer/best-practices/navigation.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -47,24 +47,26 @@ console.log(discoverUrl); // http://localhost:5601/bpr/s/space/app/discover
const discoverUrlWithSomeState = core.http.basePath.prepend(`/discover#/?_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:'2020-09-10T11:39:50.203Z',to:'2020-09-10T11:40:20.249Z'))&_a=(columns:!(_source),filters:!(),index:'90943e30-9a47-11e8-b64d-95841ca0b247',interval:auto,query:(language:kuery,query:''),sort:!())`);
----

Instead, each app should expose {kib-repo}tree/{branch}/src/plugins/share/public/url_generators/README.md[a URL generator].
Other apps should use those URL generators for creating URLs.
Instead, each app should expose {kib-repo}tree/{branch}/src/plugins/share/common/url_service/locators/README.md[a locator].
Other apps should use those locators for navigation or URL creation.

[source,typescript jsx]
----
// Properly generated URL to *Discover* app. Generator code is owned by *Discover* app and available on *Discover*'s plugin contract.
const discoverUrl = discoverUrlGenerator.createUrl({filters, timeRange});
// Properly generated URL to *Discover* app. Locator code is owned by *Discover* app and available on *Discover*'s plugin contract.
const discoverUrl = await plugins.discover.locator.getUrl({filters, timeRange});
// or directly execute navigation
await plugins.discover.locator.navigate({filters, timeRange});
----

To get a better idea, take a look at *Discover* URL generator {kib-repo}tree/{branch}/src/plugins/discover/public/url_generator.ts[implementation].
To get a better idea, take a look at *Discover* locator {kib-repo}tree/{branch}/src/plugins/discover/public/locator.ts[implementation].
It allows specifying various **Discover** app state pieces like: index pattern, filters, query, time range and more.

There are two ways to access other's app URL generator in your code:
There are two ways to access locators of other apps:

1. From a plugin contract of a destination app *(preferred)*.
2. Using URL generator service instance on `share` plugin contract (in case an explicit plugin dependency is not possible).
2. Using locator client in `share` plugin (case an explicit plugin dependency is not possible).

In case you want other apps to link to your app, then you should create a URL generator and expose it on your plugin's contract.
In case you want other apps to link to your app, then you should create a locator and expose it on your plugin's contract.


[[navigating-between-kibana-apps]]
Expand Down
6 changes: 6 additions & 0 deletions docs/developer/getting-started/monorepo-packages.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ yarn kbn watch-bazel
- @kbn/apm-utils
- @kbn/babel-code-parser
- @kbn/babel-preset
- @kbn/cli-dev-mode
- @kbn/config
- @kbn/config-schema
- @kbn/crypto
Expand All @@ -80,11 +81,14 @@ yarn kbn watch-bazel
- @kbn/eslint-plugin-eslint
- @kbn/expect
- @kbn/i18n
- @kbn/interpreter
- @kbn/io-ts-utils
- @kbn/legacy-logging
- @kbn/logging
- @kbn/mapbox-gl
- @kbn/monaco
- @kbn/optimizer
- @kbn/plugin-helpers
- @kbn/rule-data-utils
- @kbn/securitysolution-es-utils
- @kbn/securitysolution-hook-utils
Expand All @@ -99,10 +103,12 @@ yarn kbn watch-bazel
- @kbn/securitysolution-utils
- @kbn/server-http-tools
- @kbn/server-route-repository
- @kbn/spec-to-console
- @kbn/std
- @kbn/storybook
- @kbn/telemetry-utils
- @kbn/tinymath
- @kbn/ui-framework
- @kbn/ui-shared-deps
- @kbn/utility-types
- @kbn/utils
3 changes: 2 additions & 1 deletion docs/developer/plugin-list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,8 @@ so they can properly protect the data within their clusters.
|{kib-repo}blob/{branch}/src/plugins/share/README.md[share]
|Replaces the legacy ui/share module for registering share context menus.
|The share plugin contains various utilities for displaying sharing context menu,
generating deep links to other apps, and creating short URLs.
|{kib-repo}blob/{branch}/src/plugins/spaces_oss/README.md[spacesOss]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

```typescript
readonly links: {
readonly settings: string;
readonly canvas: {
readonly guide: string;
};
Expand Down Expand Up @@ -106,6 +107,7 @@ readonly links: {
};
readonly search: {
readonly sessions: string;
readonly sessionLimits: string;
};
readonly indexPatterns: {
readonly introduction: string;
Expand All @@ -116,6 +118,7 @@ readonly links: {
readonly addData: string;
readonly kibana: string;
readonly upgradeAssistant: string;
readonly rollupJobs: string;
readonly elasticsearch: Record<string, string>;
readonly siem: {
readonly guide: string;
Expand Down
Loading

0 comments on commit 34518bf

Please sign in to comment.