Commit graph

35910 commits

Author SHA1 Message Date
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
Tyler Smalley
595dfdb023
Disables Chromedriver version detection (#75984)
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2020-08-26 14:37:55 -07:00
Pierre Gayvallet
d2d7b0decf
Legacy ES plugin pre-removal cleanup (#75779)
* delete integration tests

* remove legacy version healthcheck / waitUntilReady

* remove handleESError

* remove createCluster

* no longer depends on kibana plugin

* fix kbn_server

* remove deprecated comment and dead code

* revert code removal, apparently was used (?)

* Revert "revert code removal, apparently was used (?)"

This reverts commit 69481850
2020-08-26 23:33:15 +02: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
spalger
1ca7651493 Revert "Downloads Chrome 84 and adds to PATH"
This reverts commit 5a9d227eee.
2020-08-26 09:28:22 -07:00
Tyler Smalley
5a9d227eee Downloads Chrome 84 and adds to PATH
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2020-08-26 08:56:51 -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
Nathan L Smith
3541edbb5d
Minor developer guide doc changes (#75763) 2020-08-26 08:30:47 -05: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
Alejandro Fernández Haro
86d7050822
[Telemetry] Add Application Usage Schema (#75283)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-08-26 12:51:22 +01:00
Dario Gieselaar
789b67fb5f
[APM] Improvements for breakdown data gaps (#75534)
Closes #69704, #73387, #43780.
2020-08-26 10:59:44 +02:00
Daniil Suleiman
4efaba3298
Reset chrome fields while switching an app (#73064)
* Reset chrome help extension while switching an app

* Reset other chrome fields

* Set docTitle in saved objects app

* Add unit tests

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-08-26 11:48:27 +03: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
Spencer
9511285bbd
[src/dev/build] report file count of archives when building (#75900)
Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-08-25 13:27:27 -07: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
Nathan Reese
f2fef70282
Migrate legacy map UI settings (#75887)
* Migrate legacy map UI settings

* i18n fixes
2020-08-25 14:21:35 -06:00
Nathan Reese
e236bdf4af
[Maps] add message to empty add tooltip card (#75809)
* [Maps] add message to empty add tooltip card

* use suggested text
2020-08-25 12:13:57 -06:00
Robert Austin
e9446b2060
[Resolver] restore function to the resolverTest plugin. (#75799)
Restore the resolverTest plugin. This will allow us to run the test plugin and try out Resolver using our mock data access layers. Eventually this could be expanded to support multiple different data access layers. It could even be expanded to allow us to control the data access layer via the browser. Another option: we could export the APIs from the server and use those in this test plugin.

We eventually expect other plugins to use Resolver. This test plugin could allow us to test Resolver via the FTR (separately of the Security Solution.)

This would also be useful for writing tests than use the FTR but which are essentially unit tests. For example: taking screenshots, using the mouse to zoom/pan.

Start using: `yarn start --plugin-path x-pack/test/plugin_functional/plugins/resolver_test/`
2020-08-25 13:34:29 -04:00
Yulia Čech
c634208e4f
[ILM] TS conversion of Edit policy page (#75148)
* [ILM] TS conversion of Edit policy page

* [ILM] Deleted some constants

* [ILM] Fixed imports

* [ILM] Fixed imports

* [ILM] Clean up

* [ILM] Clean up

* [ILM] Fixed ui_metric jest test

* [ILM] Fixed ui_metric jest test

* [ILM] Fix review suggestions

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-08-25 18:59:47 +02:00
Spencer
9cafade2b9
[remove] production deps which are only used in public code (#75838)
Co-authored-by: spalger <spalger@users.noreply.github.com>
2020-08-25 08:27:15 -07:00
Frank Hassanabad
8f85593910
[Security Solution] Fixes assert unreachable to be within the common section and the type to never (#75798)
## Summary

Assert unreachable was created through advice given by both the Typescript community and through the techniques that TyepScript is trying to achieve type safety with switch statements.

This fixes recent bugs by:
* Re-adding the never type
* Reduces the two different types by putting the helper within the common section so there's not duplication
* Fixes on type that looks like it was a regular string rather than a one of the enum types

The reasoning for exhaustive checks within switch statements and techniques can be seen in numerous areas such as here:
https://stackoverflow.com/questions/39419170/how-do-i-check-that-a-switch-block-is-exhaustive-in-typescript

You can do it either way with TypeScript as long as you ensure you have a explicit return type and you do early return statements you can actually avoid having to call into the assertUnreachable.

If introduced and used correctly it is there to help out like this error it is telling us that this string type is not exhaustive:
<img width="921" alt="Screen Shot 2020-08-24 at 10 39 42 AM" src="https://user-images.githubusercontent.com/1151048/91075618-9b1ad380-e5fb-11ea-9200-1c355faf5dca.png">

You can notice that for this pull request I actually remove the assertion like so if someone accidentally removes one of the switch statements:
<img width="1014" alt="Screen Shot 2020-08-24 at 10 42 08 AM" src="https://user-images.githubusercontent.com/1151048/91075662-a968ef80-e5fb-11ea-8d74-a92eedd63892.png">

And since the function has an explicit return type it is not needed. You will see that TypeScript improved its never types behind the scenes where it actually will tell you that it will never reach the `assertUnreachable` and want to remove it as an auto-refactor. That is ok as long as we have explicit return types and what I did with one line of code here.

<img width="536" alt="Screen Shot 2020-08-24 at 11 21 05 AM" src="https://user-images.githubusercontent.com/1151048/91075861-efbe4e80-e5fb-11ea-9991-dda111a04f1d.png">

Without this fix, and having the never type become an unknown it introduces less safety where any code that is utilizing the assertUnknown without explicit return types will be prone to having run time errors being thrown when something new is added to their switch enum types.
2020-08-25 09:22:13 -06:00
Spencer
1dc48b3fdd
[src/dev/build] stop including public source in distributable (#75841)
Co-authored-by: spalger <spalger@users.noreply.github.com>
2020-08-25 08:07:10 -07:00
Cauê Marcondes
75232a74f3
[APM] Implement nest level expand/collapse toggle for each span row (#75259)
* returning an waterfallTransaction

* fixing style

* fixing unit test

* fixing style

* addressing PR comment

* addressing PR comment

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-08-25 16:39:57 +02:00
James Rodewig
c3b6745e3d
Correct punctuation for ingest processors help text (#75695) 2020-08-25 10:29:57 -04:00