Commit graph

35893 commits

Author SHA1 Message Date
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
Cauê Marcondes
1e8c05f87a
[APM] UI filters: Change transaction type selector from dropdown to radio buttons (#75625)
* changing transaction type filter to radio group

* fixing unit test

* changing transaction type filter to radio group

* adding onclick to the badge component

* adding onclick to the badge component

* adding i18n to aria

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-08-25 16:15:36 +02:00
Yuliia Naumenko
59c4cd4a69
Reduced the number of targets for a proxy server, only actions executions should be affected (#75839)
* Reduced the number of targets for a proxy server, only actions executions should be affected

* fixed typecheck
2020-08-25 06:33:04 -07:00
Patrick Mueller
90f0a294af
[Actions] change routing key refereence in Pager Duty action message to include integration key (#75516)
resolves https://github.com/elastic/kibana/issues/68209

Since routing key figures fairly prominently throughout PagerDuty APIs,
and ours, it seems like it make sense to include it in the single validation
message we have for it, as well as using the term we use for it in the product:
"integration key".

See the referenced issue for more background.
2020-08-25 09:29:55 -04:00
Matthew Kime
7fa23a4ec1
IndexPattern class - no longer use getConfig or uiSettingsValues (#75717)
* remove getConfig and uiSettingsValues from IndexPattern class
2020-08-25 08:20:17 -05:00
Marta Bondyra
446c5237d5
[Visualize] fix performance degradation after lodash@4 upgrade 2020-08-25 13:47:04 +02:00
Shahzad
fec0d515b3
[RUM Dashboard] Rum design improvement (#74946)
* craete new path for client side monitoring

* update

* update app

* fix i18n

* remove space

* added feature on server

* use lazy load

* update test

* update

* remove csm serve file

* update test

* added design improvements

* imrpove design

* fix types

* rervet conflict screw up

* revert

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-08-25 12:39:52 +02:00
Shahzad
1257aad5b2
[Uptime]fix wrapping issue in certificate list column (#74749)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-08-25 12:35:29 +02:00
Kerry Gallagher
43cac5af45
[Logs UI] Log alerts chart previews (#75296)
* Add chart previews for log threshold alerts
2020-08-25 11:23:57 +01:00
Liza Katz
6718f5494d
Don't overwrite sync strategy in xpack (#75556)
* Don't override sync strategy in XPACK

* search name

* docs

* mock

* Use enhancement pattern

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-08-25 12:36:30 +03:00
Peter Pisljar
40d8edc2a0
cleaning up embeddable types (#75560) 2020-08-25 09:31:03 +02:00
Cauê Marcondes
b82e4d8a84
[APM] User can't navigate back home using browser nav when clicking link (#75755)
* replaces the route when parmeter is missing

* fixing unit test
2020-08-25 09:03:22 +02:00
Yuliia Naumenko
e31a0c27e6
Fixed alerting_api_integration/security_and_spaces tests failing if actions proxy set on for parallel process running using commands 'scripts/functional_tests_server' and 'scripts/functional_test_runner' (#75232)
* Fixed alerting_api_integration/security_and_spaces tests failing if actions proxy set on for parallel process running using commands 'scripts/functional_tests_server' and 'scripts/functional_test_runner'

* -

* Fixed get port from range for Slack and webhook simulators, removed some test warnings

* Added check for listening proxy server

* changed logger to debug removed not useful error

* -

* changed proxy to dynamic target in a single place

* test retry

* -

* -

* -

* -

* test with no cleanup

* -

* -

* -

* -

* Added environment variable ALERTING_PROXY_PORT

* fixed type checks

* fixed clean up proxy server port
2020-08-24 16:43:44 -07:00
Yuliia Naumenko
f28a9e6e2d
Rename Whitelist to AllowList in Actions and Alerting (#75099)
* Rename Whitelist to AllowList in Actions and Alerting

* revert not related change

* Fixed due to comments and tests failing

* Fixed failing tests

* Fixed due to comments
2020-08-24 16:25:05 -07:00
Tyler Smalley
6b9092609a
[build] Produce Docker target consistent with stack (#75621)
The release manager is currently expecting a Docker asset image with
the format of `kibana-8.0.0-SNAPSHOT-docker-image.tar.gz`. If this
target is not found, it will re-export the image. Making this change to
produce the expected filename will remove that duplicated effort.
Additionally, the release manager plans to remove this fallback in the
future anyways.

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-08-24 16:11:45 -07:00
Catherine Liu
7c2eb85a7d
[Canvas][Docs] Adds var and var_set to expression function reference (#74291) 2020-08-24 15:55:53 -07:00
Rashmi Kulkarni
eddd39a1c1
Adding sorting test to scripted fields in discover (#75520)
...sorting functional UI tests added.
2020-08-24 15:28:36 -07:00
Constance
90bd654d7e
[Enterprise Search] Create HttpLogic Kea store, add http interceptors, and manage error connecting at top app-level (#75790)
* [Setup] Change error connecting status code to 502

- For clearer error handling

* Set up new HttpProvider/Logic Kea store & listeners

- This allows us to:
  - connect() directly to HttpLogic in other Kea logic files that need to make http calls, instead of passing in http manually via args
  - Set http interceptors & remove them interceptors on unmount within Kea
  - Share state derived from http (e.g. errorConnecting, readOnlyMode) between both AS & WS (but allow each app to handle that state differently if needed)

+ Refactors necessary for these changes:
  - Kea types - add events key, clarify that mount returns an unmount function, fix reducer state type
  - ReactDOM unmount - remove resetContext({}), was preventing logic from unmounting properly

* Update AS & WS to show error connecting component at app level

* [WS] Remove errorConnecting logic & http arg from Overview

- Since main app is now handling errorConnecting
- http can now be connected directly from HttpLogic Kea store, so no need to pass it
+ minor cleanup in logic_overview.test.ts - remove unneeded unmount(), act(), switch to HttpLogic mock

* [AS] Add top-level ErrorConnecting component & remove error logic from EngineOverview

* [AS] Clean up/move EngineOverview child components into subfolder

- delete old ErrorState component
- move LoadingState, EmptyState, and EngineOverviewHeader into subfolders in engine_overview

* PR feedback: Update test assertions 404 copy
2020-08-24 15:07:00 -07:00