Commit graph

45591 commits

Author SHA1 Message Date
Ece Özalp 448ada669c
[CTI] add hover to threat summary items on alert summary flyout (#108996) 2021-08-17 19:04:49 -04:00
Patryk Kopyciński 754b79f08a
[Cases] Add Lens markdown plugin (#96703) 2021-08-17 15:49:44 -07:00
Jonathan Budzenski e9136e2ce9
[build/x-pack] Exclude scss, test files and fixtures (#108986) 2021-08-17 18:17:29 -04:00
Lukas Olson 0f0a33c737
Fix search warnings with sample data (#108825)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-08-17 15:15:47 -07:00
Oliver Gupte 5815c4d3f4
[APM] Replaces the transaction events fallback callout with an info badge (#108925)
* [APM] Replaces the transaction events fallback callout with an info badge (#108830)

* PR feedback and test fix
2021-08-17 18:10:05 -04:00
Caroline Horn 59ec89bfbe
[NoDataPage] Updating the default messages (#108799)
* [NoDataPage] Updating the default messages and reusing `title` as default `button` label
  * Update default description for agent
* Overview page i18n and snaps
2021-08-17 17:59:15 -04:00
Marshall Main edfb98104c
[RAC][Rule Registry] Fix bug where namespaces with dashes could cause conflicts (#107991)
* Fix bug where namespaces with dashes could cause conflicts

* Missing word in comment

* Apply logic changes to consolidated RuleData implementation
2021-08-17 17:57:03 -04:00
Tiago Costa 5d404fff6b
chore(NA): moving @kbn/legacy-logging to babel transpiler (#108703) 2021-08-17 22:24:48 +01:00
Xavier Mouligneau 3013e10eda
[SECURITY SOLUTION] [RAC] Event rendered view (#108644)
* wip

* match design for selecting grid view

* wip to integrate event rendered view

* wip

* integration of the event rendered

* fix perPage action on Euibasic table

* Add bulding block background color to EventRenderedView

* styling

* remove header

* fix types

* fix unit tests

* use memo for listProps

* fix styling + add feature flag

* review I

* fix merge

* change the gutter size

Co-authored-by: Pablo Neves Machado <pablo.nevesmachado@elastic.co>
Co-authored-by: Angela Chuang <yi-chun.chuang@elastic.co>
2021-08-17 17:04:35 -04:00
Quynh Nguyen 09e8cfd305
[ML] Replace APM error rate table with failed transactions correlations (#108441)
* [ML] Refactor with new table

* [ML] Fix types, rename var

* [ML] Remove duplicate action columns

* [ML] Finish renaming for consistency

* [ML] Add failure correlations help popover

* [ML] Add failure correlations help popover

* [ML] Extend correlation help

* Update message

* [ML] Delete old legacy correlations pages

* [ML] Address comments, rename

* [ML] Revert deletion of latency_correlations.tsx

* [ML] Add unit test for getFailedTransactionsCorrelationImpactLabel

* [ML] Rename & fix types

* [ML] Fix logic to note include 0.02 threshold

* [ML] Refactor to use state handler

* [ML] Fix hardcoded index, columns, popover

* [ML] Replace failed transaction tab

* [ML] Fix unused translations

* [ML] Delete empty files

* [ML] Move beta badge to be inside tab content

Co-authored-by: lcawl <lcawley@elastic.co>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-08-17 15:47:31 -05:00
Alejandro Fernández Haro 335393e875
Add debounce to the status observers to reduce unnecessary CPU loops (#108952) 2021-08-17 16:46:54 -04:00
Aaron Caldwell d838d7671f
[Maps] Add telemetry usage tracking for feature edit tools (#108802)
* Telemetry usage collection added to maps. Tracking added for feature edit tools

* Swap absolute vs. relative imports

* Review feedback. Pass react component through renderApp function

Co-authored-by: Alejandro Fernández Haro <alejandro.haro@elastic.co>
2021-08-17 16:29:43 -04:00
Sergi Massaneda b607f42fcf
[RAC][Observability] Add status update actions in row menu (#108698)
* use rac alerts bulk_update

* cleanup

* adds replace ALERT_STATUS with ALERT_WORKFLOW_STATUS and updates tests and adds logic for switching between signal.status and workflow status when updating alerts in .siem-signals

* allow object and string types in query param, fixed single update api to use WORKFLOW_STATUS instead of ALERT_STATUS

* adds additional integration test for when query is a DSL object in addtion to KQL string

* optionally use fields api in requests if _source does not contain authz properties

* integrate bulk update to all hook calls

* adds fields support, fixes bug where we were writing to 'signals.status' and not { signals: {status }} in alerts client

* clean up and fixes

* fix a bug where we were not waiting for updates to complete when using ids param in alerts bulk update. Adds integration tests for detection engine testing update alerts with new alerts as data client routes

* take index name from ecsData props

* pr suggestions

* some more type fixes

* refactor and type fixes

* snapshot updated

* add status update actions to row context menu

* refactor to use dispatch function in o11y actions

* comment removed

* bring alertConsumer back

* bring indexNames back

* check capabilities to show status update items

Co-authored-by: Devin Hurley <devin.hurley@elastic.co>
2021-08-17 16:03:35 -04:00
Frank Hassanabad 3e7423a0e9
[Security Solutions][Detection Engine] Migrates exception lists to saved object references (Part 2) (#108291)
## Summary

This is part 2 to addressing the issue seen here: #101975 (Part 1 #107064)

This adds the alerting migration scripts and unit tests for exception list containers on Kibana startup for `7.15.0`

We only migrate if we find these conditions and cases:
  - `exceptionLists` are an `array` and not `null`, `undefined`, or malformed data.
  - The exceptionList item is an `object` and its `id` is a `string` and not `null`, `undefined`, or malformed data
  - The existing references do not already have an exceptionItem reference already found within it.

We migrate on the common use case
  - The saved object references do not exist but we have exceptionList items with the id's to create the saved object references, 👍 so we migrate.
  - The alert contains no exception list items, in which case we have nothing to migrate 

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 list items 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 `exceptionLists` contains invalid data shape or not enough information to migrate, we filter it out and ignore it
  - If the saved object references already exists and contains a different or foreign value, we will retain the foreign reference(s) and still migrate.  
 

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

Create a few alerts through the `security_solution` application with exception lists
<img width="1775" alt="Screen Shot 2021-08-11 at 5 42 31 PM" src="https://user-images.githubusercontent.com/1151048/129117377-61b17fcf-ad01-4405-bbfe-42d97a6f7654.png">

Use the dev tools to de-migrate as well as to test end to end like so:

```json
# First get an "_id" with an exceptions list like below.  Mine I found was: "alert:38482620-ef1b-11eb-ad71-7de7959be71c":
GET .kibana/_search
{
  "query": {
    "terms": {
      "alert.alertTypeId": [
        "siem.signals"
      ]
    }
  },
  "size": 10000
}
``` 

With Kibana running downgrade and remove the references as a test:

```json
# Set saved object array references as empty arrays and set our migration version to be 7.14.0 
POST .kibana/_update/alert:38482620-ef1b-11eb-ad71-7de7959be71c
{
  "script" : {
    "source": """
    ctx._source.migrationVersion.alert = "7.14.0";
    ctx._source.references = []
    """,
    "lang": "painless"
  }
}

# Double check the references is empty and the version is 7.14.0
GET .kibana/_doc/alert:38482620-ef1b-11eb-ad71-7de7959be71c
```

Reload the alert in the `security_solution` and notice you get these errors until you restart Kibana to cause a migration moving forward

```sh
server    log   [17:35:16.914] [error][plugins][securitySolution] The saved object references were not found for our exception list when we were expecting to find it. Kibana migrations might not have run correctly or someone might have removed the saved object references manually. Returning the last known good exception list id which might not work. exceptionItem with its id being returned is: {"list_id":"endpoint_list","namespace_type":"agnostic","id":"endpoint_list","type":"endpoint"}
server    log   [17:35:16.914] [error][plugins][securitySolution] Cannot get a saved object reference using an index which is larger than the saved object references. Index is:1 which is larger than the savedObjectReferences:[]
server    log   [17:35:16.915] [error][plugins][securitySolution] The saved object references were not found for our exception list when we were expecting to find it. Kibana migrations might not have run correctly or someone might have removed the saved object references manually. Returning the last known good exception list id which might not work. exceptionItem with its id being returned is: {"list_id":"cd152d0d-3590-4a45-a478-eed04da7936b","namespace_type":"single","id":"50e3bd70-ef1b-11eb-ad71-7de7959be71c","type":"detection"}
server    log   [17:35:16.940] [error][plugins][securitySolution] The saved object references were not found for our exception list when we were expecting to find it. Kibana migrations might not have run correctly or someone might have removed the saved object references manually. Returning the last known good exception list id which might not work. exceptionItem with its id being returned is: {"list_id":"endpoint_list","namespace_type":"agnostic","id":"endpoint_list","type":"endpoint"}
server    log   [17:35:16.940] [error][plugins][securitySolution] Cannot get a saved object reference using an index which is larger than the saved object references. Index is:1 which is larger than the savedObjectReferences:[]
server    log   [17:35:16.940] [error][plugins][securitySolution] The saved object references were not found for our exception list when we were expecting to find it. Kibana migrations might not have run correctly or someone might have removed the saved object references manually. Returning the last known good exception list id which might not work. exceptionItem with its id being returned is: {"list_id":"cd152d0d-3590-4a45-a478-eed04da7936b","namespace_type":"single","id":"50e3bd70-ef1b-11eb-ad71-7de7959be71c","type":"detection"}
```

Restart Kibana and you should no longer have errors in the Kibana console.

If you do this query in dev tools

```json
# Check that the `migrationVersion` is `7.15.0` and that we have a `references` array filled out with the correct structure
GET .kibana/_doc/alert:38482620-ef1b-11eb-ad71-7de7959be71c
```

You should notice that you now have a `references` array filled out:
```json
"references" : 
[
  {
    "name" : "param:exceptionsList_0",
    "id" : "endpoint_list",
    "type" : "exception-list-agnostic"
  },
  {
    "name" : "param:exceptionsList_1",
    "id" : "50e3bd70-ef1b-11eb-ad71-7de7959be71c",
    "type" : "exception-list"
  }
],
  "migrationVersion" : {
    "alert" : "7.15.0"
  }
```

For testing [idempotentence](https://en.wikipedia.org/wiki/Idempotence) 

Run just this to downgrade and restart Kibana and you should notice on a GET that we do not have anything extra in the references array:

```json
# Set our migration version to be 7.14.0 only
POST .kibana/_update/alert:38482620-ef1b-11eb-ad71-7de7959be71c
{
  "script" : {
    "source": """
    ctx._source.migrationVersion.alert = "7.14.0";
    """,
    "lang": "painless"
  }
}

# Double check the `references` is still there, and we do not get errors or changes to `references` after we restart Kibana
GET .kibana/_doc/alert:38482620-ef1b-11eb-ad71-7de7959be71c
```

For testing foreign keys:

```json
# Set saved object array references to foreign keys and set our migration version to be 7.14.0 
POST .kibana/_update/alert:38482620-ef1b-11eb-ad71-7de7959be71c
{
  "script" : {
    "source": """
    ctx._source.migrationVersion.alert = "7.14.0";
    ctx._source.references = [["name" : "foreign", "id" : "123", "type" : "some-type"]];
    """,
    "lang": "painless"
  }
}
```

Restart, ensure no errors in Kibana console and do a get call to ensure we have the foreign mixed with valid values:

```json
GET .kibana/_doc/alert:38482620-ef1b-11eb-ad71-7de7959be71c
```

Should return this data:

```json
"type" : "alert",
"references" : 
[
  {
    "name" : "foreign",
    "id" : "123",
    "type" : "some-type"
  },
  {
    "name" : "param:exceptionsList_0",
    "id" : "endpoint_list",
    "type" : "exception-list-agnostic"
  },
  {
    "name" : "param:exceptionsList_1",
    "id" : "50e3bd70-ef1b-11eb-ad71-7de7959be71c",
    "type" : "exception-list"
  }
]
```

### 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-08-17 13:59:25 -06:00
Josh Dover 66a06f97df
Update onboarding interstitial to handle default Fleet assets (#108193) 2021-08-17 15:47:03 -04:00
Tim Sullivan 468daebe76
[Reporting] Restore legacy compatibility shim for PDF job creation (#108271)
* restore legacy shim

Restore the legacy shim for PDF job creation from the 7.x branch.

* strip relativeUrls from pdf payload

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-08-17 15:45:35 -04:00
Nathan L Smith ab6e77b416
Backend polish (#108789)
- Add a `fixedHeight` prop so tables in panels keep pagination at the bottom but others do not

### Backends inventory

- Remove title from dependency table
- Remove service map link
- Add spacer between the header controls (date picker etc.) and the table for more spacing

### Service dependencies overview

- Don't show dependencies link on table
- Increase spacer size between chart and table from `m` to `l`

### Service page

- Hide dependencies tab for RUM and iOS agents (fixes #108510)

### Backends detail page

- Remove service map link from from dependencies table
- Increase spacer size between charts and table from `m` to `l`

Fixes #108495.
2021-08-17 14:20:08 -05:00
Jonathan Budzenski fe11fe0c58
[build] Exclude __fixtures__ (#108946) 2021-08-17 14:42:09 -04:00
Katrin Freihofner cac84d7cce
styling updates to alerts table and alignment of elements (#108507)
Co-authored-by: Kerry Gallagher <471693+Kerry350@users.noreply.github.com>
2021-08-17 14:35:21 -04:00
James Gowdy 61097e70c0
[ML] Adding reset anomaly detection jobs link to jobs list (#108039)
* [ML] Adding reset jobs link to jobs list

* fixing types

* updating types

* improving react code

* adding closed job warning callout

* small code changes after review

* updating comment for api docs

* adding canResetJob to security's emptyMlCapabilities

* updating apidoc

* adding blocked to job summary

* udating test

* adding delayed refresh back in

* updating tests

* adding better reverting controls and labels

* fixing bug in delete modal

* updating job task polling for all blocking tasks

* fixing types after es client update

* one other type correction

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-08-17 19:34:08 +01:00
Ryland Herrick c60530f4a6
Updates beats field metadata from released 7.14.0 fields (#108771) 2021-08-17 13:26:09 -05:00
Ryland Herrick d50988443e
[Security Solution] ECS 1.11 Signal Mappings (#108764)
* Update signals mappings to include ECS 1.11

* Ensures no constant_keyword mappings
* Bumps index version by 1, since it was already bumped by 10 for 7.15
  in #106049

* Remove threat.indicator mappings from signals indices

Until the old, 7.14 enrichment mappings (which define threat.indicator
as nested) are in our rearview, we cannot add the official, non-nested
threat.indicator mappings as they'll conflict.
2021-08-17 13:22:21 -05:00
Scotty Bollinger e80c093c94
[Workplace Search] Replaces success Flash Messages with Toasts (#108937) 2021-08-17 13:07:27 -05:00
Stacey Gammon 43256bfe11
Point to new developer guide in CONTRIBUTING.md (#108953)
* Point to new developer guide

* Update CONTRIBUTING.md
2021-08-17 14:04:12 -04:00
Matthew Kime 5b5e152e2f
[index pattern management] Restore cross cluster search functionality (#108756)
* restore cross cluster search functionality
2021-08-17 12:52:07 -05:00
Kevin Qualters 87c93abf1d
[RAC] [Observability] [Security Solution] Use correct url to management app for observability cases, use normalized ids (#108775)
* Use correct url to management app for observability cases, use normalized ids in timelines

* Update failing test

* Load alert details data to render flyout in case detail view
2021-08-17 13:49:59 -04:00
Pablo Machado ab637303e7
Remove 'missing fields' from alerts trend graph and count table (#108843) 2021-08-17 13:48:59 -04:00
Yuliia Naumenko 348f040591
[Actions][Docs] Updated ServiceNow docs with information about the user permissions for making CRUD operations. (#108642)
* [Actions][Docs] Updated ServiceNow CRUD operations required user permissions.

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

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

* added sys_choice link

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>
2021-08-17 10:48:34 -07:00
Christiane (Tina) Heiligers 3a74287268
Improves not found response handling in the saved objects repository (#108749) 2021-08-17 13:47:05 -04:00
Alexey Antonov 5b30b3d316
[TSVB] Markdown variables should be clickable (#108844)
* [TSVB] Markdown variables should be clickable

* fix test
2021-08-17 19:21:17 +03:00
Pablo Machado 6a5a2150ea
[Security solution] [Timeline] Improve timeline title and move description to notes tab (#106544)
* Improve timeline title and move description to the notes tab

Truncate the title only in the UI
When the user hover the title we display the full title
Truncate the title if it appears in a table
2021-08-17 12:18:00 -04:00
Dominique Clarke 15494cd25f
uptime - index default severity of warning for tls and monitor status alerts (#108731)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-08-17 12:10:00 -04:00
Byron Hulcher 720a609266
[App Search] Migrate duplicate document handling UX for Crawler domains (#108623) 2021-08-17 11:59:51 -04:00
Walter Rafelsberger d07f7a5d5e
[ML] Move APM Latency Correlations from flyout to transactions page. (#107266)
- Moves APM Latency Correlations from flyout to transactions page.
- Introduces a tab based navigation for `Trace samples` / `Latency correlations` / `Failed transactions correlations`
- For trace samples, the previous low detailed histogram chart gets replaced with the new log log based histogram chart. Users can drag select a range of lantency to filter trace samples.
- Removes code related to the previous distribution chart. Renames `useTransactionDistributionFetcher` to `useTransactionTraceSamplesFetcher`. Instead of a histogram with top hits, this will now just return a sample of traces for the given filters.
2021-08-17 11:15:44 -04:00
Matthew Kime d62ff559b8
[index pattern management] load index pattern list without loading field lists (#108823)
* don't load field list for index pattern list
2021-08-17 10:03:54 -05:00
Tim Roes 6f4a615860
Make indexPattern only read only in Discover permission (#108376)
* Make indexPattern only read only in Discover permission

* Fix test failures

* Address review comments

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-08-17 16:47:43 +02:00
Dima Arnautov f243b0540d
[ML] Check for error messages in the Anomaly Detection jobs health rule type (#108701)
* [ML] retrieve job errors

* [ML] account for previous execution time

* [ML] update default message

* [ML] update description

* [ML] update unit tests

* [ML] update unit tests

* [ML] update action name

* [ML] update errorMessages name

* [ML] update a default message to avoid line breaks

* [ML] update rule helper text

* [ML] refactor getJobsErrors

* [ML] perform errors check starting from the second execution
2021-08-17 16:21:44 +02:00
Stacey Gammon 9258ba5147
Adding owners to kibana plugins (#108407)
* Adding owners to kibana plugins

* Fix ui actions enhanced owner

* Account for virtual RAC team owning a plugin

* Fix empty githubTeam for ui actions
2021-08-17 10:21:06 -04:00
Stratoula Kalafateli 0640a11feb
Import EuiCodeEditor from kibana (#108846) 2021-08-17 16:54:36 +03:00
Dominique Clarke 8bfd5e2f95
[Uptime][Synthetics Integration] Add browser monitors configuration options (#102928)
* update types

* add browser context

* update validation

* add browser fields to custom fields

* add browser simple fields and source field

* add browser context to create and edit wrappers

* update content

* add formatters for formatting javascript values to integration policy yaml

* fix policy name bug

* adjust tests

* adjust types

* add normalizers for converting yaml to javascript

* update default values

* add params field to browser monitors

* adjust types, formatters and normalizers to account for browser advanced fields

* add browser advanced fields context and components

* adjust http and tcp providers

* adjust use_update_policy and wrappers

* update types

* update content

* adjust timeout content

* adjust zip url content

* adjust content

* remove unused content

* hide monitor options that do not have corresponding data streams from the integration package

* Update x-pack/plugins/uptime/public/components/fleet_package/browser/simple_fields.tsx

Co-authored-by: Justin Kambic <justin.kambic@elastic.co>

* Update x-pack/plugins/uptime/public/components/fleet_package/browser/source_field.tsx

Co-authored-by: Justin Kambic <justin.kambic@elastic.co>

* Update x-pack/plugins/uptime/public/components/fleet_package/custom_fields.test.tsx

Co-authored-by: Justin Kambic <justin.kambic@elastic.co>

* Update x-pack/plugins/uptime/public/components/fleet_package/http/simple_fields.tsx

Co-authored-by: Justin Kambic <justin.kambic@elastic.co>

* adjust content

* adjust validation

* adjust tests

* adjust normalizers and formatters and add tests

* resolves validation error with inline scripts

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Justin Kambic <justin.kambic@elastic.co>
2021-08-17 09:48:04 -04:00
Mikhail Shustov 94f35087b0
fix another conflict in test file (#108905) 2021-08-17 15:29:02 +02:00
Mikhail Shustov 609bd90785
mute incorrect types in es-query (#108898)
* mute incorrect types in es-query

* fix another conflict
2021-08-17 15:21:14 +02:00
Angela Chuang 04a8a3c199
[RAC] integrating rbac search strategy with alert flyout (#108748)
* add alert consumers for useTimelineEventDetails

* set entityType to events

* rename to AlertConsumers

* set entityType to alerts

* send entity type to search strategy

* fix import

* fix import

* fix import

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-08-17 14:20:17 +01:00
DeFazio 848085a8c3
Remove styling from euiPanel around Alerts tables (#108603)
* Add styling to euiPanel

* remove styling on Observability side in favor of separate PR

* Fix merge conflicts

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-08-17 09:18:36 -04:00
Jonathan Budzenski e2ad384d12
[build] Remove jest.config.js (#108822) 2021-08-17 08:13:04 -05:00
Jonathan Budzenski 304bbf054f
[build] Remove scss files (#108821) 2021-08-17 08:12:32 -05:00
Stratoula Kalafateli 8939ee6c24
[Lens] Supports long legend values (#107894)
* [Lens] Supports multilines legend

* Add a truncate legends switch

* Add more unit tests

* Add tooltip condition

* Adress PR comments

* Apply PR comments

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-08-17 16:10:18 +03:00
Dzmitry Lemechko 02817055c0
bumping chromedriver dep up to 92.0.1 (#108849) 2021-08-17 15:05:57 +02:00
Michael Dokolin 3c95c43c57
[Reporting] Add support of chunked export (#108485)
* Decouple job error fetching from the content stream
* Encapsulate content encoding and decoding in the content stream
* Move report size calculation from task runners
* Remove configuration check from the reporting diagnostics
* Add support of chunked export
2021-08-17 15:05:15 +02:00
Alexey Antonov 87ac80ec90
[Lens] Make lens_time_scale function to pick timezone from the context (#108366)
Part of: #97134

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-08-17 15:53:25 +03:00