Commit graph

10797 commits

Author SHA1 Message Date
Joe Portner
c31acce649
Fix more broken usages of bulkCreate (#76005) 2020-08-27 13:54:09 -04:00
Brent Kimmel
ebfba81ba5
[Security Solution][Resolver] break/wrap for process detail (#76095)
* [Security Solution][Resolver]break/wrap for process detail

* add an enzyme test to check for the breakers
2020-08-27 13:25:01 -04:00
Nathan Reese
12f4f6d74a
[Maps] fix read only badge is no longer shown in nav for users with read-only permission (#76091) 2020-08-27 10:53:16 -06:00
Bhavya RM
d556c79481
Test user assignment to maps tests - 2 (#75890)
and removing unused data from fullscreen maps.js
2020-08-27 12:03:53 -04:00
Tim Sullivan
69a8d06129
[Reporting/Download CSV] Get the file name from savedSearch data (#76031)
* [Reporting/Download CSV] provide title even if panel \titles are hidden in the dashboard

* add functional test

* Update embeddable_panel.tsx

* Update download_csv.ts
2020-08-27 08:40:56 -07:00
Brandon Kobel
bf25e16a8b
Skip creating SpacesClient when not needed in auth interceptor (#75706)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-08-27 08:23:07 -07:00
Zacqary Adam Xeper
b98e2e4f3d
[Metrics UI] Replace uses of any introduced by Lodash 4 (#75507)
Co-authored-by: Felix Stürmer <weltenwort@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-08-27 10:06:55 -05:00
Nathan Reese
b2939618f4
do not advance beneathMbLayerId if bottomMbLayer could not be found for a layer (#76007)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-08-27 08:15:37 -06:00
Larry Gregory
54bbd6a910
Adds authenticaton_type as expected property on ES authentication response (#75808)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-08-27 10:09:20 -04:00
Justin Kambic
d457d53001
[Uptime] Translate bare strings (#75918)
* Translate a bare string.

* Remove unneeded translation.
2020-08-27 09:02:32 -04:00
Jason Stoltzfus
f065191a75
[Enterprise Search] Added an App Search route for listing Credentials (#75487)
In addition to a route for listing Credentials, this also adds a
utility function which helps create API routes which simply proxy
the App Search API.

The reasoning for this is as follows;
1. Creating new routes takes less effort and cognitive load if we
can simply just create proxy routes that use the APIs as is.
2. It keeps the App Search API as the source of truth. All logic is
implemented in the underlying API.
3. It makes unit testing routes much simpler. We do not need to verify
any connectivity to the underlying App Search API, because that is
already tested as part of the utility.
2020-08-27 08:44:41 -04:00
Yulia Čech
b802af8002
[ILM] Fix json in request flyout (#75971)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-08-27 14:15:59 +02:00
Sébastien Loix
ec1516064c
[Form lib] Correctly add field to form on component mount (#75796)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-08-27 14:02:03 +02:00
Mikhail Shustov
37ec1e1053
Update to TS v4 (#73924)
* bump ts to v4

* MOAR RAM

* fix type errors for OSS

* first pass on x-pack errors

* second pass on x-pack type errors

* 3rd pass on x-pack type-errors

* mute errors if complex cases

* don't delete if spread suffices

* mute other complex cases

* make User fields optional

* fix optional types

* fix tests

* fix typings for time_range

* fix type errors in x-pack/tests

* rebuild kbn-pm

* remove leftovers from master update

* fix alert tests

* [Telemetry Checker] TS4 Fixes

* bump to 4.0.1-rc

* fix new errors in master

* bump typescript-eslint to version supporting TS v4 syntax

* fix merge commit errors

* update to the stable TS version 4.0.2

* bump ts-eslint to version supporting ts v4

* fix typo

* fix type errors after merge

* update ts in another new package.json

* TEMP: remove me

* Revert "TEMP: remove me"

This reverts commit dc0fc3bae6.

* [Telemetry] Update snapshot for new TS4 SyntaxKind

* bump prettier to support TS v4 syntax

* fix prettier rules

* last style change

* fix new type errors

Co-authored-by: Alejandro Fernández Haro <alejandro.haro@elastic.co>
2020-08-27 10:28:02 +02:00
Dima Arnautov
e488c087fc
[ML] fix tooltip content for scheduled events (#75973)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-08-27 09:03:36 +02:00
Shahzad
a358c5768e
[Uptime] One click simple monitor down alert (#73835)
* WIP

* added anomaly alert

* update types

* update types

* update

* types

* types

* update ML part

* update ML part

* update ML part

* unnecessary change

* icon for disable

* update test

* update api

* update labels

* resolve conflicts

* fix types

* fix editing alert

* fix types

* added actions column

* added code to add alert

* update anomaly message

* added anomaly alert test

* update

* update type

* fix ml legacy scoped client

* update

* WIP

* fix conflict

* added aria label

* Added deleteion loading

* fix type

* update

* update tests

* update

* update type

* fix types

* WIP

* added enabled alerts section

* add data

* update

* update tests

* fix test

* update i18n

* update i18n

* update i18n

* fix

* update message

* update

* update

* update

* revert

* update types

* added component

* update test

* incorporate PR feedback

* fix focus

* update drawer

* handle edge case

* improve btn text

* improve btn text

* use switch instead of icons

* update snapshot

* use compressed form

* fix type

* update snapshot

* update snapshot

* update test

* update test

* PR feedback

* fix test and type

* remove delete action

* remove unnecessary function

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-08-27 07:02:28 +02:00
Brent Kimmel
42942327e5
[Security Solution][Resolver] Word-break long titles in related event… (#75926)
* [Security Solution][Resolver] Word-break long titles in related event description lists

* word-break long titles at non-word boundaries

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-08-26 21:06:38 -04:00
Rashmi Kulkarni
c08bf7f3ca
using test_user with minimum privileges for canvas functional ui tests (#75917)
* incorporating test_user wth specific roles for the canvas functional ui tests

* additional checks - removed comments

* changes to incorporate code comments

* lint check

* incorporate code reviews

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-08-26 17:21:16 -07:00
spalger
4289f9d8b1 skip all tests that rely on es authentication type 2020-08-26 16:15:09 -07:00
Yara Tercero
043382d686
[Security Solution][Exceptions] - Improve UX for missing exception list associated with rule (#76012)
## Summary

**Current behavior:**
  - **Scenario 1:** User is in the exceptions viewer flow, they select to edit an exception item, but the list the item is associated with has since been deleted (let's say by another user) - a user is able to open modal to edit exception item and on save, an error toaster shows but no information is given to the user to indicate the issue.
  - **Scenario 2:** User exports rules from space 'X' and imports into space 'Y'. The exception lists associated with their newly imported rules do not exist in space 'Y' - a user goes to add an exception item and gets a modal with an error, unable to add any exceptions. 
  - **Workaround:** current workaround exists only via API - user would need to remove the exception list from their rule via API

**New behavior:**
  - **Scenario 1:** User is still able to oped edit modal, but on save they see an error explaining that the associated exception list does not exist and prompts them to remove the exception list --> now they're able to add exceptions to their rule
  - **Scenario 2:** User navigates to exceptions after importing their rule, tries to add  exception, modal pops up with error informing them that they need to remove association to missing exception list, button prompts them to do so --> now can continue adding exceptions to rule
2020-08-26 18:46:15 -04:00
Wylie Conlon
8364d8d67a
[Lens] Decouple visualizations from specific operations (#75703)
* [Lens] Decouple visualizations from specific operations

* Remove unused mock
2020-08-26 18:27:40 -04:00
Devin W. Hurley
979d1dbca8
[Security Solution] [Detections] Updates rules routes to validate "from" param on rules (#76000)
* updates validation on 'from' param to prevent malformed datemath strings from being accepted

* fix imports

* copy paste is not my friend

* missed type check somehow

* forgot to mock common utils

* updates bodies for request validation tests
2020-08-26 18:18:39 -04:00
Scotty Bollinger
35b8d50ccd
[Enterprise Search] Adds app logic file to Workplace Search (#76009)
* Add new Workplace Search initial data properties

* Add app logic

* Refactor index to match App Search

Adds the easier-to-read ComponentConfigured and ComponentUnconfigured FCs with a ternary in the root compoenent

* Remove ‘Logic’ from interface names

* Extract initial data from WS into interface

This allows for breaking apart the app-specific data and also having an interface to extend in the app_logic file

* Destructuring FTW
2020-08-26 16:21:11 -05:00
Devon Thomson
fd39f094cc
Duplicate title warning wording (#75908)
Changed wording on duplicate title warning.
2020-08-26 17:19:30 -04:00
Davis Plumlee
deb71ecbb7
[Security Solution][Exceptions Modal] Switches modal header (#76016) 2020-08-26 17:13:38 -04:00
Joe Portner
6627d7d9af
Sharing saved-objects phase 1.5 (#75444)
Added UI for sharing saved objects, and updated UI for importing and copying too
2020-08-26 16:52:29 -04:00
Paul Tavares
9873df8ee0
[SECURITY_SOLUTION][ENDPOINT] Trusted Apps List API (#75476)
* Trusted Apps initial setup for route registration

* Added types for TrustedApp entries

* trusted apps list API returns results

* use methods and const from latest PR merge to lists

* a quick generator for trusted apps entries

* support cli options for trusted app data loader

* Add mocked `createTrustedAppsList()` method to `ExceptionListClientMock`

* tests fro trusted apps route handlers

* tests for trusted apps schema

* Correct name of mock method

* Fix service to ensure return value of `getExceptionList` service throws if service not available

* Fix types

* Refactor TrustedApp type + code review feedback
2020-08-26 16:02:37 -04:00
Catherine Liu
532f2d70e8
[Home] Elastic home page redesign (#70571)
Co-authored-by: Catherine Liu <catherine.liu@elastic.co>
Co-authored-by: Ryan Keairns <contactryank@gmail.com>
Co-authored-by: Catherine Liu <catherineqliu@outlook.com>
Co-authored-by: Michael Marcialis <michael.marcialis@elastic.co>
2020-08-26 13:00:00 -07:00
Garrett Spong
638df5820c
[Security Solution][Detections] Fixes Alerts Table 'Select all [x] alerts' action (#75945)
## Summary

Resolves https://github.com/elastic/kibana/issues/75194

Fixes issue where the `Select all [x] alerts` feature would not select the checkboxes within the Alerts Table. Also resolves issue where bulk actions wouldn't work with Building Block Alerts.


##### Select All Before
<p align="center">
  <img width="700" src="https://user-images.githubusercontent.com/2946766/91266588-d2d66800-e72e-11ea-8c57-c91bd80a8f0e.gif" />
</p>




##### Select All After
<p align="center">
  <img width="700" src="https://user-images.githubusercontent.com/2946766/91266573-cc47f080-e72e-11ea-9812-67e7182f90f3.gif" />
</p>



##### Building Block Query Before
<p align="center">
  <img width="700" src="https://user-images.githubusercontent.com/2946766/91266516-af132200-e72e-11ea-9088-63de64d2774e.gif" />
</p>

##### Building Block Query After
<p align="center">
  <img width="700" src="https://user-images.githubusercontent.com/2946766/91266531-bb977a80-e72e-11ea-8071-904b355856f7.gif" />
</p>
2020-08-26 13:56:18 -06:00
Nicolas Chaulet
2946e68581
[Ingest Manager] Remove useless saved object update in agent checkin (#75586) 2020-08-26 15:51:47 -04:00
Pierre Gayvallet
eee139295d
Migrate data folder creation from legacy to KP (#75527)
* rename uuid service to environment service

* adapt resolve_uuid to directly use the configurations

* move data folder creation to core

* update generated doc

* fix types

* fix monitoring tests

* move instanceUuid to plugin initializer context

* update generated doc
2020-08-26 21:40:03 +02:00
James Gowdy
61550b7ce0
[ML] Adding authorization header to DFA job update request (#75899) 2020-08-26 20:08:39 +01:00
Jen Huang
5447565f0b
[Ingest Manager] Return ID when default output is found (#75930)
* Return ID when default output is found

* Fix typing
2020-08-26 10:55:27 -07:00
Tyler Smalley
e773f221a3 Revert "[Security Solution][Exceptions] - Improve UX for missing exception list associated with rule (#75898)"
This reverts commit b9c8201202.
2020-08-26 08:41:09 -07:00
Frank Hassanabad
d6c45a2e70
Fixes runtime error with meta when it is missing (#75844)
## Summary

Found in 7.9.0, if you post a rule with an action that has a missing "meta" then you are going to get errors in your UI that look something like:

```ts
An error occurred during rule execution: message: "Cannot read property 'kibana_siem_app_url' of null"
name: "Unusual Windows Remote User" id: "1cc27e7e-d7c7-4f6a-b918-8c272fc6b1a3"
rule id: "1781d055-5c66-4adf-9e93-fc0fa69550c9" signals index: ".siem-signals-default"
```

This fixes the accidental referencing of the null/undefined property and adds both integration and unit tests in that area of code.

If you have an action id handy you can manually test this by editing the json file of:

```ts
test_cases/queries/action_without_meta.json
```

to have your action id and then posting it like so:

```ts
./post_rule.sh ./rules/test_cases/queries/action_without_meta.json
```

### 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
2020-08-26 09:01:32 -06:00
Yara Tercero
b9c8201202
[Security Solution][Exceptions] - Improve UX for missing exception list associated with rule (#75898)
## Summary

**Current behavior:**
  - **Scenario 1:** User is in the exceptions viewer flow, they select to edit an exception item, but the list the item is associated with has since been deleted (let's say by another user) - a user is able to open modal to edit exception item and on save, an error toaster shows but no information is given to the user to indicate the issue.
  - **Scenario 2:** User exports rules from space 'X' and imports into space 'Y'. The exception lists associated with their newly imported rules do not exist in space 'Y' - a user goes to add an exception item and gets a modal with an error, unable to add any exceptions. 
  - **Workaround:** current workaround exists only via API - user would need to remove the exception list from their rule via API

**New behavior:**
  - **Scenario 1:** User is still able to oped edit modal, but on save they see an error explaining that the associated exception list does not exist and prompts them to remove the exception list --> now they're able to add exceptions to their rule
  - **Scenario 2:** User navigates to exceptions after importing their rule, tries to add  exception, modal pops up with error informing them that they need to remove association to missing exception list, button prompts them to do so --> now can continue adding exceptions to rule
2020-08-26 10:16:17 -04:00
Bhavya RM
4e1b1b5d9e
adding test user to auto fit to bounds test (#75914) 2020-08-26 10:02:10 -04:00
Bhavya RM
4f2d4f8b01
adding test user to pew pew maps test + adding a role for connections index pattern (#75920) 2020-08-26 09:59:41 -04:00
Jonathan Buttner
4042f82035
[Security Solution][Resolver] Support kuery filter (#74695)
* Adding kql filter

* Adding filter support for the backend and tests

* Moving the filter to the body

* switching events and alerts api to post

* Removing unused import

* Adding tests for events api results being in descending order

* Switching frontend to use post for related events
2020-08-26 09:25:45 -04:00
Nicolas Chaulet
63265b6f57
Compute AAD to encrypty/decrypt SO only if needed (#75818) 2020-08-26 08:50:52 -04:00
Dario Gieselaar
789b67fb5f
[APM] Improvements for breakdown data gaps (#75534)
Closes #69704, #73387, #43780.
2020-08-26 10:59:44 +02:00
Alejandro Fernández Gómez
686cde88af
[Logs UI] View log details for anomaly log examples (#75425)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-08-26 10:38:54 +02:00
Joe Reuter
ddf99b64db
[Lens] Fix rollup related bugs (#75314)
Co-authored-by: Marta Bondyra <marta.bondyra@elastic.co>
2020-08-26 09:09:40 +02:00
Justin Ibarra
eecf4aa71f
[Detection Rules] Add 7.9.1 rules (#75939)
* increase lookback (`from`) and bump versions
2020-08-25 23:25:07 -05:00
Frank Hassanabad
ba9a607384
Optimizes the index queries to not block the NodeJS event loop (#75716)
## Summary

Before this PR you can see event loop block times of:

```ts
formatIndexFields: 7986.884ms
```

After this PR you will see event loop block times of:

```ts
formatIndexFields: 85.012ms
```

within the file:

```ts
x-pack/plugins/security_solution/server/lib/index_fields/elasticsearch_adapter.ts
```

For the GraphQL query of `SourceQuery`/`IndexFields`

This also fixes the issue of `unknown` being returned to the front end by removing code that is no longer functioning as it was intended. Ensure during testing of this PR that blank/default and non exist indexes within `securitySolution:defaultIndex` still work as expected.

Before, notice the `unknown` instead of the `filebeat-*`:
<img width="733" alt="Screen Shot 2020-08-20 at 4 55 52 PM" src="https://user-images.githubusercontent.com/1151048/90949129-f5047900-e402-11ea-9278-b4c7bf5cd16d.png">

After:
<img width="830" alt="Screen Shot 2020-08-20 at 4 56 03 PM" src="https://user-images.githubusercontent.com/1151048/90949133-02b9fe80-e403-11ea-8504-f5bbe043048a.png">

An explanation of how to see the block times for before and after
---

For perf testing you first add timed testing to the file:
```ts
x-pack/plugins/security_solution/server/lib/index_fields/elasticsearch_adapter.ts
```

Before this PR, around lines 42:
```ts
console.time('formatIndexFields'); // <--- start timer
const fields = formatIndexFields(
  responsesIndexFields,
  Object.keys(indexesAliasIndices) as IndexAlias[]
);
console.timeEnd('formatIndexFields'); // <--- outputs the end timer
return fields;
```

After this PR, around lines 42:

```ts
console.time('formatIndexFields'); // <--- start timer
const fields = await formatIndexFields(responsesIndexFields, indices);
console.timeEnd('formatIndexFields');  // <--- outputs the end timer
return fields;
```

And then reload the security solutions application web page here:
```
http://localhost:5601/app/security/timelines/default
```

Be sure to load it _twice_ for testing as NodeJS will sometimes report better numbers the second time as it does optimizations after the first time it encounters some code paths.

You will begin to see numbers similar to this before this PR:

```ts
formatIndexFields: 2553.279ms
```

This indicates that it is blocking the event loop for ~2.5 seconds befofe this fix. If you add additional indexes to your `securitySolution:defaultIndex` indexes that have additional fields then this amount will increase exponentially. For developers using our test servers I created two other indexes called delme-1 and delme-2 with additional mappings you can add like below

```ts
apm-*-transaction*, auditbeat-*, endgame-*, filebeat-*, logs-*, packetbeat-*, winlogbeat-*, delme-1, delme-2
```

<img width="980" alt="Screen Shot 2020-08-21 at 8 21 50 PM" src="https://user-images.githubusercontent.com/1151048/90949142-211ffa00-e403-11ea-8ab2-f66de977dce3.png">

Then you are going to see times approaching 8 seconds of blocking the event loop like so:

```ts
formatIndexFields: 7986.884ms
```

After this fix on the first pass unoptimized it will report

```ts
formatIndexFields: 373.082ms
```

Then after it optimizes the code paths on a second page load it will report

```ts
formatIndexFields: 84.304ms
```

### 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
2020-08-25 19:48:18 -06:00
Davis Plumlee
5f89e0003b
[Security Solution][Detections] Disables add exception for ML and threshold rules (#75802) 2020-08-25 18:13:41 -04:00
Marta Bondyra
1fee8f16ef
[Lens] fix dimension popover design on mobile (#75866) 2020-08-26 00:00:24 +02:00
Scotty Bollinger
fef89334b5
[Enterprise Search] Move views into separate folder from components (#75906)
* Move views into separate folder from components

* Fix paths in tests

* More error_state to views
2020-08-25 16:43:28 -05:00
Nathan Reese
947a93900d
[Maps] fix IVectorLayer.getStyle typing (#75829)
* [Maps] fix IVectorLayer.getStyle typing

* update typing in VectorLayer type definition

* fix unit tests

* review feedback
2020-08-25 15:02:38 -06:00
Nathan Reese
c3e226cf31
[Maps] Originating App Breadcrumb (#75692)
* [Maps] Originating App Breadcrumb

* pass getHasUnsavedChanges instead of passing boolean

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-08-25 14:24:14 -06:00