Commit graph

46243 commits

Author SHA1 Message Date
Søren Louv-Jansen 61e533f253
[APM] Clean up readme (#110973)
* [APM] Clean up readme

* Update linting.md

* Update testing.md

* Update testing.md

* Update testing.md

* Update plugin-list.asciidoc

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-09-05 07:14:06 +02:00
ymao1 9132b43128
[Alerting][Docs] Add de-duplication example to ES query docs + update email docs wording (#111026)
* Change to allowlist

* Adding example to es query rule

* Apply suggestions from code review

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>
2021-09-03 18:48:45 -04:00
Tiago Costa 7c4e4f507b
chore(NA): replace babel config files by inline presets by default in the jsts_transpiler rule (#110620)
* chore(NA): replace babel config files by inline presets by default in the js_ts_transpiler rule

* chore(NA): update @kbn/ace build to exclude worker file

* chore(NA): remove config file support

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-09-03 21:17:46 +01:00
Dmitry Shevchenko c6aa4f625c
Fix exceptions page table pagination (#111000) 2021-09-03 21:38:45 +02:00
Justin Kambic 9b20c80867
Fix ML alert not allowed in Uptime app. (#111180) 2021-09-03 15:17:06 -04:00
Alejandro Fernández Haro a9d73311e0
[Docs] Logging settings: add explanation of appenders, loggers and root (#111013) 2021-09-03 15:06:36 -04:00
Quynh Nguyen 167b876a8a
[ML] Fix issue with AD data points not showing up because missing indices (#110899)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-09-03 13:12:48 -04:00
Tim Roes df22a8e197
Change Graph ownership (#111157) 2021-09-03 19:12:42 +02:00
Michael Dokolin df43d253c8
[Expressions] Align renderMode with the embeddable viewMode (#110199)
* Add preview view mode to the embeddable
* Rename display render mode to view
* Extract no interactivity render mode to a separate flag
2021-09-03 19:10:29 +02:00
Tyler Smalley cb27ba01c1
Update sync workflow to only run on elastic/kibana (#111183)
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2021-09-03 12:58:31 -04:00
Tyler Smalley c9440bb5ff
Revert "Update sync workflow to only run on elastic/kibana (#111171)" (#111181)
This reverts commit d840ea6da9.
2021-09-03 09:32:33 -07:00
Tyler Smalley d840ea6da9
Update sync workflow to only run on elastic/kibana (#111171)
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2021-09-03 09:31:00 -07:00
Jonathan Buttner a2c848e1d2
[Cases] Fix connector information disappearing (#110914)
* Move intialization to use effect

* Fixing fields can't get test working

* Fix tests

Co-authored-by: Christos Nasikas <christos.nasikas@elastic.co>
2021-09-03 12:00:51 -04:00
Tim Roes b6ab15e9f4
Remove kibana.defaultAppId setting (#109798)
* Remove kibana.defaultAppId setting

* Fix typings

* Remove plugin dependency

* Use proper navigation method to get to home

* Default route for home

* Address discover new routing code

* Make non existing /kibana URLs working

* Fix space awareness

* Remove documentation

* Remove the setting from docker file

* Make defaultRoute forward work properly

* Add forward_url tests

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-09-03 17:59:59 +02:00
Nick Partridge 634ce7f83b
[ML] fix heatmap label colors (#110515) (#111140) 2021-09-03 11:57:36 -04:00
Pete Harverson 7f6c6e44ea
[ML] Add API integration tests for start and stop datafeeds (#110961)
* [ML] Add API integration tests for start and stop datafeeds

* [ML] Edits to setup and clean-up steps following review
2021-09-03 16:32:10 +01:00
Jean-Louis Leysens 1f06cafa19
[Reporting/Visualization] Migrate Visualize to V2 reporting (#110206)
* added initial version of locator

* removed unused params and added jest test

* updated functional test to expect PDF reports to be available when vis is new

* fix TS: remove unkown field

* added some docs and removed unused code

* AggsConfigOption -> AggsConfigSerialized

* moved locator to common

* fixed building of "create" path and updated test snapshots

* updated import

* update encoding behaviour

* added time range from timefilter to locator params request

* add index pattern and search id to URL params

* reading index pattern from search source if it is there for the locator

* remove "type" from locator params, update comments and test

* removed duplicate identifier

* remove unused type

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-09-03 17:08:56 +02:00
Marta Bondyra d4c03eb9b4
[Lens] Switch to SavedObjectClient.resolve (#110059)
* Step 2: Update client code to use resolve() method instead of get()

Following sharing Saved Objects developer guide: Step 2
This step demonstrates the changes to update client code to use the new
SavedObjectsClient `resolve()` method instead of `get()`.

* Step 3 Lens
2021-09-03 16:44:12 +02:00
Frank Hassanabad 9a459806ad
[Security Solutions][Detection Engine] Adds ability to ignore fields during alert indexing and a workaround for an EQL bug (#110927)
## Summary

Adds a workaround for EQL bug: https://github.com/elastic/elasticsearch/issues/77152
Adds the safety feature mentioned here: https://github.com/elastic/kibana/issues/110802

Adds the ability to ignore particular [fields](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-fields.html#search-fields-param) when the field is merged with [_source](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-fields.html#source-filtering). Also fixes an EQL bug where EQL is introducing the meta field of `_ignored` within the fields and causing documents to not be indexable when we merge with the fields from EQL. 

Alerting document creation uses the fields API to get [runtime field](https://www.elastic.co/guide/en/elasticsearch/reference/current/runtime.html),  [constant keyword](https://www.elastic.co/guide/en/elasticsearch/reference/master/keyword.html#constant-keyword-field-type), etc... that are only available within the [fields API](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-fields.html#search-fields-param) and then merges the field values not found within the `_source` document with the `_source` document and then finally indexes this merged document as an alert document.

This fix/ability is a "safety feature" in that if a problematic [runtime field](https://www.elastic.co/guide/en/elasticsearch/reference/current/runtime.html), [constant keyword](https://www.elastic.co/guide/en/elasticsearch/reference/master/keyword.html#constant-keyword-field-type) is discovered or another bug along the stack we can set a `kibana.yml` key/value pair to ignore the problematic field.

This _WILL NOT_ remove problematic fields from the `_source` document. This will only ignore problematic constant keyword, runtime fields, aliases, or anything else found in the fields API that is causing merge issues.

This PR:
  * Adds a `alertIgnoreFields` `kibana.yml` array key with a default of an empty array if not specified. 
  * Plumbs the `alertIgnoreFields` through the stack and into the fields/_source merge strategies of `missingFields` and `allFields`
  * Adds a temporary `isEqlBug77152` where it hard codes an ignore of `_ignored` until the EQL problem is fixed and then we will remove the workaround
  * Adds unit tests
  * Adds e2e tests which covers the described use cases above.

The `alertIgnoreFields` key/value within `kibana.yml` if set should be an array of strings of each field you want to ignore. This can also contain regular expressions as long as they are of the form, `"/regex/"` in the array.

Example if you want to ignore fields that are problematic called "host.name" and then one in which you want to ignore all fields that start with "user." using a regular expression:

```yml
xpack.securitySolution.alertIgnoreFields: ['host.name', '/user\..*/']
``` 

Although there are e2e tests which exercise the use cases...

If you want to manual test the EQL bug fix you would add these documents in dev tools:

```json
# Delete and add a mapping with a small ignore_above.
DELETE eql-issue-ignore-fields-delme
PUT eql-issue-ignore-fields-delme
{
  "mappings" : {
    "dynamic": "strict",
    "properties" : {
      "@timestamp": {
        "type": "date"
      },
      "some_keyword" : {
        "ignore_above": 5, 
        "type" : "keyword"
      },
      "other_keyword" : {
        "ignore_above": 10, 
        "type" : "keyword"
      }
    }
  }
}

# Add a single document with one field that will be truncated and a second that will not.
PUT eql-issue-ignore-fields-delme/_doc/1
{
  "@timestamp": "2021-09-02T04:13:05.626Z",
  "some_keyword": "longer than normal",
  "other_keyword": "normal"
}
```

Then create an alert which queries everything from it:
<img width="1155" alt="Screen Shot 2021-09-01 at 10 15 06 PM" src="https://user-images.githubusercontent.com/1151048/131781042-faa424cf-65a5-4ebb-b801-3f188940c81d.png">

and ensure signals are created:
<img width="2214" alt="Screen Shot 2021-09-01 at 10 30 18 PM" src="https://user-images.githubusercontent.com/1151048/131782069-b9ab959c-f22d-44d5-baf0-561fe349c037.png">

To test the manual exclusions of any other problematic fields, create any index which has runtime fields or `constant keywords` but does not have anything within the `_source` document using dev tools. For example you can use `constant keyword` like so

```json
PUT constant-keywords-deleme
{
  "mappings": {
    "dynamic": "strict",
    "properties": {
      "@timestamp": {
        "type": "date"
      },
      "testing_ignored": {
        "properties": {
          "constant": {
            "type": "constant_keyword",
            "value": "constant_value"
          }
        }
      },
      "testing_regex": {
        "type": "constant_keyword",
        "value": "constant_value"
      },
      "normal_constant": {
        "type": "constant_keyword",
        "value": "constant_value"
      },
      "small_field": {
        "type": "keyword",
        "ignore_above": 10
      }
    }
  }
}

PUT constant-keywords-deleme/_doc/1
{
  "@timestamp": "2021-09-02T04:20:01.760Z"
}
```

Set in your `kibana.yml` the key/value of:

```yml
xpack.securitySolution.alertIgnoreFields: ['testing_ignored.constant', '/.*_regex/']
```

Setup a rule to run:
<img width="1083" alt="Screen Shot 2021-09-01 at 10 23 23 PM" src="https://user-images.githubusercontent.com/1151048/131781696-fea0d421-836f-465c-9be6-5289fbb622a4.png">

Once it runs you should notice that the constant values for testing are not on the signals table since it only typically exists in the fields API:
<img width="1166" alt="Screen Shot 2021-09-01 at 10 26 16 PM" src="https://user-images.githubusercontent.com/1151048/131781782-1684fb1d-bed9-4cf0-be9a-0abe1f0f34d1.png">

But the normal one still exists:
<img width="1136" alt="Screen Shot 2021-09-01 at 10 26 31 PM" src="https://user-images.githubusercontent.com/1151048/131781827-5450c693-de9e-4285-b082-9f7a2cbd5d07.png">

If you change the `xpack.securitySolution.alertIgnoreFields` by removing it and re-generate the signals you will see these values added back.

### Checklist

Delete any items that are not applicable to this PR.

- [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios
- [x] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/master/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
2021-09-03 08:41:28 -06:00
Dmitry Shevchenko 19260d5f02
Fix "Expression produces a union type that is too complex to represent" TS error (#111111) 2021-09-03 10:38:58 -04:00
James Gowdy 98014d0cb9
[ML] Datafeed preview based job validation check (#109080)
* [ML] Datafeed preview based job validation check

* updating warning text

* fix tests

* adding jest test

* updating tests

* fixing translation ids

* fixing more tests

* changes based on review

* disabled validation step next button when validation fails

* disabling nano job test

* adding test skip comment

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-09-03 15:36:45 +01:00
James Gowdy a18cc31924
[ML] Datafeed preview based job validation check (#109080)
* [ML] Datafeed preview based job validation check

* updating warning text

* fix tests

* adding jest test

* updating tests

* fixing translation ids

* fixing more tests

* changes based on review

* disabled validation step next button when validation fails

* disabling nano job test

* adding test skip comment

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-09-03 15:36:03 +01:00
Christiane (Tina) Heiligers 66cb058fa7
Removes support for legacy exports (#110738)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-09-03 07:22:14 -07:00
Josh Dover ed18699e38
Handle bulkGet errors on package retrieval from ES storage (#111114) 2021-09-03 16:01:28 +02:00
Marco Liberati 21b4752dba
[Lens] Fix transition to custom palette inconsistency when in number mode (#110852)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-09-03 15:57:57 +02:00
ymao1 9ba00ee594
[Actions] Allowing service specification in email connector config (#110458)
* Initial commit of serverType in email connector config

* Fleshing in route to get well known email service configs from nodemailer

* Adding elastic cloud to well known server type

* Cleaning up email constants and allowing for empty selection

* Showing error if user doesn't select server type

* Adding hook for setting email config based on server type

* Adding tests and making sure settings are not overwritten on edit

* Fixing functional test

* Adding migration

* Adding functional test for migration

* Repurposing service instead of adding serverType

* Cleanup

* Disabling host/port/secure form fields when settings retrieved from API

* Updating docs for service

* Filtering options based on whether cloud is enabled

* Initialize as disabled

* Fixing types

* Update docs/management/connectors/action-types/email.asciidoc

Co-authored-by: David Kilfoyle <41695641+kilfoyle@users.noreply.github.com>

Co-authored-by: David Kilfoyle <41695641+kilfoyle@users.noreply.github.com>
2021-09-03 09:49:00 -04:00
Ester Martí Vilaseca 75486ecd12
[Stack Monitoring] Add setup mode to react app (#110670)
* Show setup mode button and setup bottom bar

* Adapt setup mode in react components to work without angular

* Add setup mode data update to react app

* Add missing functions from setup mode

* Revert setup mode changes from react components

* remove some empty lines

* Add setup button to  monitoring toolbar

* Fix types

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-09-03 15:15:53 +02:00
Christos Nasikas 6f357e0433
[Cases] Do not show status dropdown on modal cases selector (#111101) 2021-09-03 16:10:29 +03:00
James Gowdy 71571c5b60
[ML] Job import and export functional tests (#110578)
* [ML] Job import export functional tests

* adding title check

* adding dfa tests

* removing export file

* adds bad data test

* commented code

* adding export job tests

* adds version to file names

* improving tests

* removing comment

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-09-03 14:05:53 +01:00
Dominique Clarke d83c8244a2
[Uptime] [Synthetics Integration] fix content typo (#110088)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-09-03 08:47:26 -04:00
mgiota e2ee2637e2
Update alert documents when the write index changes (#110788)
* first draft(work in progress)

* add back missing await

* disable require_alias flag only when we update

* cleanup
2021-09-03 13:39:52 +01:00
Pierre Gayvallet b4f5877ff8
catch errors from providers (#111093) 2021-09-03 14:38:19 +02:00
Ashokaditya 5b4d265571
[Security Solution][Endpoint] Use super date picker instead of date range picker (#108722)
* Use super date picker instead of date range picker

fixes elastic/security-team/issues/1571

* fix test target

Super date picker's `data-test-subj` prop gets garbled and doesn't show up in rendered DOM. In other words, the component is entirely void of a data-test-subj attribute.

* make auto refresh work!!

fixes https://github.com/elastic/security-team/issues/1571

* set max width as per mock

fixes elastic/security-team/issues/1571

* show a callout to inform users to select different date ranges

fixes elastic/security-team/issues/1571

* persist recently used date ranges on the component only

fixes elastic/security-team/issues/1571

* use commonly used ranges from default common security solution ranges

fixes elastic/security-team/issues/1571

* Better align date picker

* full width panel for date picker so content flows below it

review comments

* mock time picker settings for tests

* use eui token for bg color

review comment

* persist recently used dates

fixes elastic/security-team/issues/1571

* persist date range selection over new endpoint selection

review comments

* remove obsolete local state since update button is not visible.

review comments

* fix bg color for dark mode and relative path

* update relative path

review comments

* cleanup - the action doesn't allow for undefined start and end dates anyway

refs 28a859ab3a

* fix types after sync

* update test title

* add a test for callout when empty data

* fix lint

* show update button when dates are changed

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-09-03 13:47:36 +02:00
ymao1 df8ed81195
Adding experimental to event log mentions in the docs (#110876) 2021-09-03 07:35:17 -04:00
Alejandro Fernández Haro dfea0fee21
[GET /api/status] Default to v8format and allow v7format=true (#110830) 2021-09-03 07:32:59 -04:00
Alejandro Fernández Gómez 4e9e7a8671
[RAC] Add loading and empty states to the alerts table - Take II (#110504)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-09-03 06:59:56 -04:00
Mikhail Shustov 641cef7ca6
Functional tests for execution context (#110299)
* remove unnecessary ts-ignore

* add context propagation to x-opaque-id header tests

* run tests on CI

* simplify logging. the action purpose follows from the context name

* extend tests with the assertion against execution_context from the Kibana logs

* split JSON log records only

* apply suggestions proposed by Spencer
2021-09-03 05:48:32 -04:00
Aleh Zasypkin c42391ed3a
Resurrect deprecated and removed authentication settings. (#110835) 2021-09-03 11:42:12 +02:00
Jean-Louis Leysens 23fa1b4c07
[Reporting] Updated telemetry types for V2 export types (#110622)
* updated telemetry types

* update tests

* telemtery JSON file

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-09-03 11:30:51 +02:00
Jean-Louis Leysens 0b5f1c0d9c
[Reporting] Unskip ILM migration tests (#110813)
* added allow restricted indices to privileges check

* updated comment -> TODO

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-09-03 11:22:26 +02:00
Stratoula Kalafateli 33c124b9d8
Move to vis_types folder part 2 (#110574)
* Move to vis_types folder part 2

* fix jest tests

* do some tests

* revert

* Test Tiago's fix

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-09-03 11:19:44 +03:00
Pierre Gayvallet 9d216cd312
[SOR] use initialNamespaces when checking for conflict for create and bulkCreate (#111023)
* use initialNamespaces when checking for conflict

* nits
2021-09-03 08:27:18 +02:00
Matthias Wilhelm 8f728977f2
[Discover] Remove export* syntax (#110934) 2021-09-03 07:48:32 +02:00
Yuliia Naumenko d421c4dda7
[Event log][7.x] Updated event log client to search across legacy IDs (#109365)
* [Event log][7.x] Updated event log client to search across legacy IDs

* fixed tests

* extended kibana null version check

* added logic to alerting plugin

* fixed typechecks

* fixed typechecks

* Revert "fixed typechecks"

This reverts commit 6f6770fa4b.

* removed legacyId for routes

* fixed typechecks

* fixed position

* fixed query

* fixed query

* fixed tests

* fixed types place

* fixed due to comments

* fixed due to comments

* fixed eslint

* fixed due to comments

* splitted test data

* fixed test data

* increased the delay time to await the search

* removed version for 7.9 docs

* Update x-pack/plugins/event_log/server/es/cluster_client_adapter.ts

Co-authored-by: Mike Côté <mikecote@users.noreply.github.com>

* fixed unit test

* fixed test data

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Mike Côté <mikecote@users.noreply.github.com>
2021-09-03 01:18:48 -04:00
Davis Plumlee 9c165a1bc4
[Security Solution][Detection Rules] Changes 'activated' text on rule details page (#111044) 2021-09-02 23:45:15 -04:00
Zacqary Adam Xeper a99360fa32
[Metrics UI] Filter out APM nodes from the inventory view (#110300)
* [Metrics UI] Filter out APM nodes from the inventory view

* Update jest snapshots

* Add tests for fs for filtering out APM nodes
2021-09-03 09:28:11 +09:00
Jonathan Budzenski 95423242ac
[package testing] Update logging and pid configuration (#111059)
With the merge of #98213, pid and log file settings were moved from
command line options to kibana.yml.  Package tests use a non-default
kibana.yml and these settings were not applied.  This updates our
configuration to include these settings.
2021-09-02 20:11:45 -04:00
Devon Thomson e704a52f6e
[Dashboard] Read App State from URL on Soft Refresh (#109354)
Subscribe to app changes from URL to allow dashboard URL to be used as an API. On URL change, update filters, timerange, and query
2021-09-02 17:50:02 -04:00
Poff Poffenberger c692ad3724
Add correct roles to test user for functional tests in dashboard (#110880)
* Add animals role to test user for functional tests in dashboard

* Fix two more dashboard tests by applying proper roles

* Restore test user defaults

* Fix one last dashboard test

* forgot security service

* Cleanup
2021-09-02 16:35:12 -05:00
Kaarina Tungseth d92010575c
[DOCS] Adds Lens Inspector and minor edits (#109736)
* [DOCS] Adds Lens Inspector and minor edits

* Update docs/user/dashboard/lens.asciidoc

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* Removes outdated menus and adds new visual component content

* Updates with review comments

* Last review comment

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>
2021-09-02 15:49:47 -05:00