Commit graph

46739 commits

Author SHA1 Message Date
Brian Seeders 083eb24876
[buildkite] Speed up OSS misc tests by removing TS refs and bumping instance (#113855) 2021-10-04 21:08:01 -04:00
Brian Seeders 5216442d6c
[ci] Add branch to failed test reporter github comments (#113860) 2021-10-04 21:07:49 -04:00
Brian Seeders 7ad30eda15
Revert "[App Search] Detail Page for Automated Curations (#113550)"
This reverts commit 4d2a9c59a4.
2021-10-04 21:02:49 -04:00
Brian Seeders fc89528c40
[buildkite] Fix off-by-one problem for test failure annotations (#113852) 2021-10-05 00:29:43 +01:00
Brandon Morelli 55bd942a1f
Update schema_overview.tsx (#113848) 2021-10-04 18:47:10 -04:00
Yuliia Naumenko 73f232f5b3
[Alerting][Docs] Elasticsearch setting search.allow_expensive_queries should be set as true. (#113062)
* [Alerting][Docs] Elasticsearch setting search.allow_expensive_queries should be set to true.

* fixed text

* fixed text

* fixed due to comments

* Update alerting-setup.asciidoc
2021-10-04 15:20:11 -07:00
Byron Hulcher 4d2a9c59a4
[App Search] Detail Page for Automated Curations (#113550) 2021-10-04 17:57:18 -04:00
Clint Andrew Hall 5ca923772d
[fleet] Add component story smoke test (#113634)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-10-04 14:49:44 -07:00
Kellen 6f665004cb
correct relativity in images (#113834) 2021-10-04 14:19:30 -07:00
Pete Hampton a565fa02f3
Fix issue with incorrect policy response attachment. (#113430)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-10-04 17:00:21 -04:00
Nicolas Chaulet 3efad94646
[Fleet] Fix integration category redirect after loading categories (#113812) 2021-10-04 16:34:05 -04:00
Lee Drengenberg d038f1e214
don't wait for nav:not(.ng-hide) on status page (#113674)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-10-04 21:07:04 +01:00
Tre 240716d2ee
[QA][SO INFO SVC] Drop in-test jq filtering (#113655) 2021-10-04 21:02:51 +01:00
Cauê Marcondes 432a8492c8
[APM] Fleet: Update "switch to datastreams" wording for apm migration (#113574)
* removing data stream in favor of Elastic agent

* fixing i18n

* addressing pr changes

* capitalization

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-10-04 15:41:03 -04:00
Sandra G 6f2757dfea
[Stack Monitoring] Node Advanced View (#113628)
* add template navigation

* implement advanced node view

* fix I18N titles
2021-10-04 15:28:17 -04:00
Caroline Horn 2fad6e92c6
[Getting Started] Added “Add data” button to Global Nav Drawer (#113648)
* Adding EUI as code-owners to KibanaPageTemplate
2021-10-04 15:25:24 -04:00
Jason Stoltzfus 2dac93cb4c
[App Search] Wired up Suggestion detail data (#113796) 2021-10-04 15:15:49 -04:00
CJ Cenizal 257e33a50e
Partial forward-port of dacf0c2a6c. (#113672)
- Add Authorization type to ES UI shared.
- Add convertPrivilegesToArray, patch to also accept privileges that might contain dots in its name, and add tests.

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-10-04 12:11:05 -07:00
Shahzad abffa79ba2
[Uptime] Refactor snapshots into RTL (#113727) 2021-10-04 20:57:25 +02:00
Mikhail Shustov 1f60a1662f
[@kbn/securitysolution-es-utils] remove transport API in favour of typed public API (#113717)
* remove transport API in favour of typed public API

* put elasticsearch_client back

* fix create index call

* fix setpolicy

* fix unit tests in SecuritySolution
2021-10-04 20:42:07 +02:00
Thomas Watson d8b4f4bdcb
[Reporting] Improve _read code in ContentStream (#113237) 2021-10-04 11:29:18 -07:00
Joe Portner 006e3713a6
Fix bulkResolve for duplicate requests (#113798) 2021-10-04 14:20:39 -04:00
Sergi Massaneda 02129d9911
prevent undefined filterQuery error (#113522)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-10-04 13:55:05 -04:00
Kellen 500fb00271
updates DevPrinciples URL (#113785) 2021-10-04 13:48:22 -04:00
Stacey Gammon eddbc8db6f
Update doc slugs to improve analytic tracking, move to appropriate folders (#113630)
* Update the slugs to improve google analytics drilldown tracking

* more slug updates

* Fix some formatting issues in building blocks

* update paths

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-10-04 13:36:45 -04:00
Nicolas Chaulet a4eab441c0
[Fleet] Use elastic_agent package to build monitoring permissions for agent (#112730) 2021-10-04 13:36:12 -04:00
Thom Heymann 693727663e
Better message for unanticipated authorisation errors (#113460)
* Custom message for unanticipated 401 errors

* Refactor logout reasons

* Fix types

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-10-04 18:18:45 +01:00
Diana Derevyankina 51df1e58a3
[TSVB] Rename Index pattern to Data view (#110253)
* [TSVB] Rename Index pattern to Data view

* Update some labels

* Make asterisk bold to indicate it's text input

* Remove redundant translation

* Remove "now" from TSVB callout notification title

* Update variable name to match the text

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-10-04 20:15:57 +03:00
Marco Liberati 6b9ef32ffe
🐛 Fix color fallback for different type of layers (#113642)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-10-04 19:10:14 +02:00
Matthew Kime bbb2e96dd5
[data views] Move data views api from data plugin and into its own (#113497)
* initial pass at moving data views into own plugin

* require expressions plugin, fix META_FIELDS reference

* bundle limits and localization

* fix integration test

* update plugin list and jest config

* type fixes

* search fixes

* fix localization

* fix mocks

* fix mocks

* fix stub

* type fixes

* fix import on test file

* path fixes

* remove shorted dotted from data plugin

* more todo removal

* eslint fixes

* eslint fix

* simplify data views server plugin

* simplify data views server plugin

* simplify data views server plugin

* fix imports on api routes

* fix imports on api routes

* update plugin list

* ts fixes

* ts fixes

* add deprecation notice

* fix circular dependency and api integration test

* fix circular dependency and api integration test

* rename types for better clarity

* path fixes

* jest.config and tsconfig cleanup

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-10-04 12:05:22 -05:00
Dzmitry Lemechko 28702ff1c6
[test/page_objects] validate selected dates for timepicker (#113597)
* [test/page_objects] validate selected dates for timepicker

* unskip flaky test

* fix types check failure

* update tests

* update message

* unskip more tests
2021-10-04 19:00:41 +02:00
Frank Hassanabad ba7bea456a
[Security Solution] Migrates siem.notifications ruleAlertId to saved object references array (#113205)
## Summary

Fixes https://github.com/elastic/kibana/issues/113276

* Migrates the legacy `siem.notifications` "ruleAlertId" to be within the references array
* Adds code to serialize and de-serialize "ruleAlertId" from the saved object references array
* Adds migration code to `kibana-alerting` to migrate on startup
* Adds `legacy_saved_object_references/README.md` which describes how to test and what those files are for.
* Updates earlier similar `signals/saved_object_references/README.md` after reviewing it during my work
* Names these files the format of `legacy_foo` since this is all considered legacy work and will be removed once the legacy notification system is removed after customers have migrated. 
* Adds unit tests
* Adds 2e2 tests

We only migrate if we find these conditions and cases:
* "ruleAlertId" is not `null`, `undefined` or malformed data
* The"ruleAlertId" references do not already have an exceptionItem reference already found within it.

We migrate on the common use case:
* "ruleAlertId" exists and is a string

We do these additional (mis-use) cases and steps as well. These should NOT be common things that happen but we safe guard for them here:
* If the migration is run twice we are idempotent and do NOT add duplicates or remove items.
* If the migration was partially successful but re-run a second time, we only add what is missing. Again no duplicates or removed items should occur.
* If the saved object references already exists and contains a different or foreign value, we will retain the foreign reference(s) and still migrate.

Before migration you should see data structures like this if you query:

```json
# Get the alert type of "siem-notifications" which is part of the legacy system.
GET .kibana/_search
{
  "query": {
    "term": {
      "alert.alertTypeId": "siem.notifications"
    }
  }
}
```

```json
"data..omitted": "data..omitted",
"params" : {
  "ruleAlertId" : "933ca720-1be1-11ec-a722-83da1c22a481" <-- Pre-migration we had this Saved Object ID which is not part of references array below
},
"actions" : [
  {
    "group" : "default",
    "params" : {
      "message" : "Hourly\nRule {{context.rule.name}} generated {{state.signals_count}} alerts"
    },
    "actionTypeId" : ".slack",
    "actionRef" : "action_0" <-- Pre-migration this is correct as this work is already done within the alerting plugin
  },
  "references" : [
    {
      "id" : "879e8ff0-1be1-11ec-a722-83da1c22a481",
      "name" : "action_0", <-- Pre-migration this is correct as this work is already done within the alerting plugin
      "type" : "action"
    }
  ]
],
"data..omitted": "data..omitted",
```

After migration you should see data structures like this:
```json
"data..omitted": "data..omitted",
"params" : {
  "ruleAlertId" : "933ca720-1be1-11ec-a722-83da1c22a481" <-- Post-migration this is not used but rather the serialized version references is used instead.
},
"actions" : [
  {
    "group" : "default",
    "params" : {
      "message" : "Hourly\nRule {{context.rule.name}} generated {{state.signals_count}} alerts"
    },
    "actionTypeId" : ".slack",
    "actionRef" : "action_0"
  },
  "references" : [
    {
      "id" : "879e8ff0-1be1-11ec-a722-83da1c22a481",
      "name" : "action_0",
      "type" : "action"
    },
    {
      "id" : "933ca720-1be1-11ec-a722-83da1c22a481", <-- Our id here is preferred and used during serialization.
      "name" : "param:alert_0", <-- We add the name of our reference which is param:alert_0 similar to action_0 but with "param"
      "type" : "alert" <-- We add the type which is type of alert to the references
    }
  ]
],
"data..omitted": "data..omitted",
```

## Manual testing 
There are e2e and unit tests but for any manual testing or verification you can do the following:

If you have a 7.14.0 system and can migrate it forward that is the most straight forward way to ensure this does migrate correctly and forward. You should see that the legacy notification system still operates as expected.

If you are a developer off of master and want to test different scenarios then this section is for below as it is more involved and harder to do but goes into more depth:

* Create a rule and activate it normally within security_solution
* Do not add actions to the rule at this point as we are exercising the older legacy system. However, you want at least one action configured such as a slack notification.
* Within dev tools do a query for all your actions and grab one of the `_id` of them without their prefix:

```json
# See all your actions
GET .kibana/_search
{
  "query": {
    "term": {
      "type": "action"
    }
  }
}
```

Mine was `"_id" : "action:879e8ff0-1be1-11ec-a722-83da1c22a481"`, so I will be copying the ID of `879e8ff0-1be1-11ec-a722-83da1c22a481`

Go to the file `detection_engine/scripts/legacy_notifications/one_action.json` and add this id to the file. Something like this:

```json
{
  "name": "Legacy notification with one action",
  "interval": "1m",  <--- You can use whatever you want. Real values are "1h", "1d", "1w". I use "1m" for testing purposes.
  "actions": [
    {
      "id": "879e8ff0-1be1-11ec-a722-83da1c22a481", <--- My action id
      "group": "default",
      "params": {
        "message": "Hourly\nRule {{context.rule.name}} generated {{state.signals_count}} alerts"
      },
      "actionTypeId": ".slack" <--- I am a slack action id type.
    }
  ]
}
```

Query for an alert you want to add manually add back a legacy notification to it. Such as:

```json
# See all your siem.signals alert types and choose one
GET .kibana/_search
{
  "query": {
    "term": {
      "alert.alertTypeId": "siem.signals"
    }
  }
}
```

Grab the `_id` without the alert prefix. For mine this was `933ca720-1be1-11ec-a722-83da1c22a481`

Within the directory of detection_engine/scripts execute the script:

```json
./post_legacy_notification.sh 933ca720-1be1-11ec-a722-83da1c22a481
{
  "ok": "acknowledged"
}
```

which is going to do a few things. See the file `detection_engine/routes/rules/legacy_create_legacy_notification.ts` for the definition of the route and what it does in full, but we should notice that we have now:

Created a legacy side car action object of type `siem-detection-engine-rule-actions` you can see in dev tools:

```json
# See the actions "side car" which are part of the legacy notification system.
GET .kibana/_search
{
  "query": {
    "term": {
      "type": {
        "value": "siem-detection-engine-rule-actions"
      }
    }
  }
}
```

But more importantly what the saved object references are which should be this:

```json
# Get the alert type of "siem-notifications" which is part of the legacy system.
GET .kibana/_search
{
  "query": {
    "term": {
      "alert.alertTypeId": "siem.notifications"
    }
  }
}
```

If you need to ad-hoc test what happens when the migration runs you can get the id of an alert and downgrade it, then
restart Kibana. The `ctx._source.references.remove(1)` removes the last element of the references array which is assumed
to have a rule. But it might not, so ensure you check your data structure and adjust accordingly.
```json
POST .kibana/_update/alert:933ca720-1be1-11ec-a722-83da1c22a481
{
  "script" : {
    "source": """
    ctx._source.migrationVersion.alert = "7.15.0";
    ctx._source.references.remove(1);
    """,
    "lang": "painless"
  }
}
```

If you just want to remove your your "param:alert_0" and it is the second array element to test the errors within the console
then you would use
```json
POST .kibana/_update/alert:933ca720-1be1-11ec-a722-83da1c22a481
{
  "script" : {
    "source": """
    ctx._source.references.remove(1);
    """,
    "lang": "painless"
  }
}
```

Check your log files and should see errors about the saved object references missing until you restart Kibana. Once you restart then it will migrate forward and you will no longer see errors.

### Checklist

- [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
2021-10-04 10:31:47 -06:00
Michael Dokolin 0d9825d03c
[Expressions] Remove the any type usages (#113477)
* Update ESLint config to disallow usage of the any type
* Remove the any type usages from the expressions plugin
* Update plugins using expressions according to the updated public API
2021-10-04 18:30:10 +02:00
Shahzad fed0dc6563
[Uptime] Supress fetch errors on no data screen (#113458)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-10-04 18:10:27 +02:00
spalger 2b401d06df Revert "Lint git index content on commit (#113300)"
This reverts commit 92fe7f8ab3.
2021-10-04 15:59:36 +00:00
spalger 9df5051817 Revert "Revert "chore: add modifications to staging automatically after eslint fix (#113443)""
This reverts commit cc73577f84.
2021-10-04 15:59:36 +00:00
Justin Kambic a9c100768e
Increase timeout for long-running unit test assertions. (#113122)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-10-04 11:56:00 -04:00
Sergi Massaneda 59b15df115
fix priority reset bug (#113626)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-10-04 17:49:14 +02:00
Sandra G 3d0da7f0f6
[Stack Monitoring] Migrate Index Views to React (#113660)
* index views

* fix type

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-10-04 11:37:19 -04:00
Sébastien Loix 4693c3812e
[console] Deprecate "proxyFilter" and "proxyConfig" on 8.x (#113555) 2021-10-04 16:19:03 +01:00
Cauê Marcondes 10ca6f42d6
[APM] Show APM Server stand-alone mode in Kibana Upgrade Assistant (cloud-only) (#113567)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-10-04 11:11:08 -04:00
Domenico Andreoli 3d7e04b799
[Security] Add EQL rule test in CCS config (#112852) 2021-10-04 17:04:24 +02:00
Brian Seeders 252278a433
[buildkite] Fix packer cache issues (#113769) 2021-10-04 10:57:32 -04:00
Stratoula Kalafateli c558f26dd1
[TSVB] Update the series and metrics Ids that are numbers to strings (#113619)
* [TSVB] Update the series and metrics Ids that are numbers to strings

* Minor changes

* Adds a unit test to TSVB plugin to test this case

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-10-04 17:55:49 +03:00
Nicolas Chaulet ab91bb0075
[Fleet] Fix how we get the default output in the Fleet UI (#113620) 2021-10-04 10:52:05 -04:00
Joey F. Poon 69bee186c2
[Security Solution] create task for auto restarting failed OLM transforms (#113686) 2021-10-04 09:48:01 -05:00
ymao1 8c89daedba
Adding range filter to ownerId aggregation (#113557)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-10-04 10:06:07 -04:00
Dominique Clarke 1ff02e1da6
[Observability] [Exploratory View] Add exploratory view multi series (#113464)
* Revert "[Observability][Exploratory View] revert exploratory view multi-series (#107647)"

This reverts commit 1649661ffd.

* Revert "[Observability][Exploratory View] revert exploratory view multi-series (#107647)"

This reverts commit 1649661ffd.

* [Observability] [Exploratory View] Create multi series feature branch (#108079)

* Revert "[Observability][Exploratory View] revert exploratory view multi-series (#107647)"

This reverts commit 1649661ffd.

* Revert "[Observability][Exploratory View] revert exploratory view multi-series (#107647)"

This reverts commit 1649661ffd.

* update types

* update tests

* [Observability] exploratory view design issues (#111028)

* remove custom y axis labels for better clarity

* move add series button to the bottom

* disable auto apply

* fix missing test

* When series count changes, collapse other series. (#110894)

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

* Feature/observability exploratory view multi series panels (#111555)

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

* [Exploratory View] Fix date range picker on secondary series (#111700)

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

* [Exploratory View] Collapse series only on add, not delete (#111790)

* [Exploratory view] Remove preview panel (#111884)

* [Exploratory view] implement popovers for data type and metric type (#112370)

* implement popovers for data type and metric type

* adjust types

* add IncompleteBadge

* make report metric dismissable

* show date-picker even if metric is undefined

* adjust styles of expanded series row

* add truncation to series name

* move incomplete badge and add edit pencil

* add tooltip to data type badge

* adjust content

* lint

* delete extra file

* move filters row

* adjust name editing behavior

* adjust filter styles

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

* move cases button to top

* fix types

* more types :(

Co-authored-by: Justin Kambic <justin.kambic@elastic.co>
Co-authored-by: shahzad31 <shahzad31comp@gmail.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Shahzad <shahzad.muhammad@elastic.co>
2021-10-04 10:05:01 -04:00
Matthias Wilhelm c868cd5c81
[Discover] Extract fetch observable initialization to separate function (#108831)
* Don't trigger autorefresh when there's no time picker
- because there's no UI for that

* Refactor and add test

* Add doc and test

* Refactor

* Remove index pattern without timefield filtering

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-10-04 16:00:08 +02:00
Kevin Lacabane 163133827b
[Stack Monitoring] React migration kibana overview (#113604)
* Create react Kibana template

* React Kibana overview

* Add breadcrumb to kibana overview

* fix linting errors

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-10-04 15:57:47 +02:00