Commit graph

3518 commits

Author SHA1 Message Date
Nathan Reese 7882e0c3a8
[Maps] Always show current zoom level (#62684)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-06 21:26:10 -06:00
The SpaceCake Project b65de27458
bc5 siem rules merge (#62679)
* bc5 rule merge

version changes
field changes to endpoint rules
removed max_signals from 7 rules

* Fixing monitoring i18n (#62715)

* Updates esarchiver test data with the latest rules (#62723)

* Remove CR, only CRLF for rules

* delete two files

for Garrett

* deletes

delete 2 files (for Garrett)

* Revert "deletes"

This reverts commit cc2ac1e05f.

* Revert "Fixing monitoring i18n (#62715)"

This reverts commit 028574037a.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Garrett Spong <spong@users.noreply.github.com>
Co-authored-by: Ross Wolf <31489089+rw-access@users.noreply.github.com>
2020-04-06 20:45:39 -06:00
spalger f1bd3bdacb Revert "[Monitoring] Cluster state watch to Kibana alerting (#61685)"
This reverts commit ab0cc8894a.
2020-04-06 17:05:09 -07:00
Ahmad Bamieh e16885c3ad
[Telemetry] update crypto packages (#62469)
* update crypto packages

* as type for return value

* get default export

* add if checks

* wrap errors in i18n

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-07 00:36:15 +03:00
Aaron Caldwell f80925af97
[Maps] Move layers to np maps (#61877)
* Move layers to new location

* Update layer path refs

* Update np kibana services to cover all required services

* Init np kibana services in legacy plugin. Port init functions to np

* Path updates, supporting file moves, general clean up

* More moves of related files and clean-up of legacy refs

* Path updates. Typescript warning fixes

* Update test paths

* Clean up unused kibana services usage in legacy

* Remove unused http ref

* Test fixes and clean up

* Remove unused snapshots

* Add np service init to embeddables too

* Move validate color picker to NP
2020-04-06 14:01:38 -06:00
Garrett Spong 0bdcda8f20
[SIEM] Fixes UX issues around prebuilt ML Rules (#62396)
## Summary

This PR fixes a number of UX issues around the new prebuilt `machine_learning` rules when the user does not have the necessary permissions to manage the backing ML Job. Along with https://github.com/elastic/kibana/pull/62383, this ensures there is adequate information for the user determine if a rule is not working because the backing job is not running (and helping to prevent this from occurring). This also includes some requested copy changes, including:

* Renames `Anomaly Detection`  dropdown to `ML job settings`
<p align="center">
  <img width="500" src="https://user-images.githubusercontent.com/2946766/78320279-57c5a880-7526-11ea-8350-647cbba263a4.png" />
</p>

* Updates copy in `ML job settings` dropdown
<p align="center">
  <img width="500" src="https://user-images.githubusercontent.com/2946766/78320473-cc98e280-7526-11ea-8871-e97661ff5f78.png" />
</p>

* Only shows `ML job settings` UI when on `/detections/` routes 
<p align="center">
  <img width="500" src="https://user-images.githubusercontent.com/2946766/78320401-922f4580-7526-11ea-9f97-0ec06526b273.png" />
</p>


### All Rules Changes

* Disables the `activate switch` if user does not have permission to enable/disable jobs
<p align="center">
  <img width="500" src="https://user-images.githubusercontent.com/2946766/78320892-d3742500-7527-11ea-90bb-91fd203480bd.png" />
</p>

* Adds warning toast when attempting to activate via bulk actions (if user does not have permission to enable/disable jobs)
<p align="center">
  <img width="300" src="https://user-images.githubusercontent.com/2946766/78321015-1a621a80-7528-11ea-8ab0-f9fef19240f7.png" />
</p>

### Rule Details Changes
* `Machine Learning job` link now links to ML App with table filtered to the relevant job

* Disables the `activate switch` if user does not have permission to enable/disable jobs
<p align="center">
  <img width="500" src="https://user-images.githubusercontent.com/2946766/78321277-c277e380-7528-11ea-99e9-034970a5054e.png" />
</p>

### Create/Edit Rule Changes

* If the job selected _is not running_, a warning will be displayed to remind the user to enable the job before running the rule. cc @benskelker @MikePaquette -- this okay copy here?
<p align="center">
  <img width="500" src="https://user-images.githubusercontent.com/2946766/78321498-63ff3500-7529-11ea-9b09-a87186cbe0ce.png" />
</p>

Resolves https://github.com/elastic/siem-team/issues/575
Resolves https://github.com/elastic/siem-team/issues/519

### Checklist

Delete any items that are not applicable to this PR.

- [X] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/master/packages/kbn-i18n/README.md)
- [ ] [Documentation](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#writing-documentation) was added for features that require explanation or tutorials 
  - Scheduled time with @benskelker to update docs
- [X] [Unit or functional tests](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility) were updated or added to match the most common scenarios
2020-04-06 13:44:46 -06:00
MadameSheema 813d6cb796
[SIEM] View signal in default timeline (#62616)
* adds test data

* adds 'View a signal in timeline' test

* implements test

* fixes implementation

* changes view signal for investigate signal
2020-04-06 21:42:43 +02:00
Chris Roberson ab0cc8894a
[Monitoring] Cluster state watch to Kibana alerting (#61685)
* WIP

* Add new alert with tests

* Fix type issues, and disable new alerting for tests

* Fix up the view all alerts view

* Turn off for merging

* Fix jest test

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-06 15:31:01 -04:00
patrykkopycinski 0ebfe76b3f
[SIEM][Detection Engine] Fix signals count in Rule notifications (#62311) 2020-04-06 19:26:40 +02:00
Christos Nasikas d67f2220b3
[SIEM][CASE] Configuration page tests (#61093)
* Test ClosureOptionsRadio component

* Test ClosureOptions component

* Test ConnectorsDropdown component

* Test Connectors

* Test FieldMappingRow

* Test FieldMapping

* Create utils functions and refactor to be able to test

* Test Mapping

* Improve tests

* Test ConfigureCases

* Refactor tests

* Fix flacky tests

* Remove snapshots

* Refactor tests

* Test button

* Test reducer

* Move test

* Better structure

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-06 20:22:46 +03:00
Corey Robertson 6da7c00b5d
Remove the action_value_click action in canvas (#62215)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-06 11:49:34 -04:00
Justin Kambic ba446f3900
[Uptime] Default uptime alert type and disable changing type (#62028)
* Default uptime alert type and disable changing type.

* Update functional test to handle new UI flow.

* Fix type error.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-06 11:11:25 -04:00
Alison Goryachev f86dac77da
Fix es_ui_shared imports (#62526) 2020-04-06 09:20:29 -04:00
Nathan Reese 102fa1b560
[Maps] clean up IDynamicStyleProperty (#62466)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-06 07:13:21 -06:00
Shahzad 6a32b457f0
[Uptime] Replace usage of date_histogram with aut_date_histogr… (#59577)
* remove usage of manual date_histogram

* update

* update

* remove unused

* update fixtures

* update snaps

* remove duplicate test

* type

* update test

* update fixtures

* update interface

* updated type

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-06 12:32:36 +02:00
Mikhail Shustov bdf628d29a
use union of strings instead of enum (#62493)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-06 12:31:36 +02:00
Dario Gieselaar ca1d77cc14
[APM] Prevent "For the last" expression from jumping (#62414)
Closes #61063.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-06 11:42:17 +02:00
Daniil Suleiman 104b49015e
[NP] Dashboard (#61895)
* Remove absoluteToParsedUrl reference in dashboard

* Remove KibanaParsedUrl from visualize

* Fix tests

* Add tests

* Fix saved dashboard

* Fix empty line after resolving conflicts

* Move dashboard to np

* Move migrations back to legacy

* Make it works

* Other fixes

* Move into application folder

* FIx translations

* Make share & home plugins otional

* FIx kbn url tracking, jest tests

* Import from dashboard_constants in FT

* Fix translations order

* Use getStartServices for start plugin deps

* Path fixes

* i18n fix

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-06 12:11:48 +03:00
Tim Sullivan f1f93d32a4
[Reporting] Use a shim for server config (#62086)
* config shim

* simplify route register calls

* switch to in-sync worker functions

* fix tests

* comment

* fix set up config with defaults

* reduce loc change

* remove test for removed file

* reportingconfigtype

* revert changing executeJobFactory to synchronous

* imports cleanup

* Clean up some awaits

* undo comment

* clean up async

* clean up imports

* add warning logs for config defaults

* Move around some config shim code

* Register routes params take ReportingCore

* usageCollection is an optional dependency
2020-04-03 21:37:54 -07:00
Tim Sullivan a5c3865594
[Reporting] Fix reporting for non-default spaces (#62226)
* [Reporting] Fix URLs in job params when basePath includes namespace suffix

* canvas fix

* cleanup

* update snapshots in tests

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-03 20:18:08 -07:00
Devin W. Hurley 7e11961869
[SIEM] [Detection Engine] Remove has manage api keys requireme… (#62446)
Alerting no longer requires the manage_api_keys privilege, so we are removing it from the detection engine code. Fixes #62387

* removes hasManageApiKeys since alerting is using the internal user api calls, manage_api_keys privilege is no longer necessary

* linting error

* fixes types and removes a test for manage api keys

* removes manage api key reducer and updates leftover tests

* moves userHasNoPermissions repeated code into a function in helpers, adds a few test cases, updated references to new function

* fix test title

* remove userHasNoPermissions function and remove tests, replace with just not canUserCRUD

* Revert "remove userHasNoPermissions function and remove tests, replace with just not canUserCRUD"

This reverts commit 93912e7e22.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-03 20:25:12 -04:00
Nathan Reese a5526c8730
[Maps] Safely handle empty string and invalid strings from EuiColorPicker (#62507)
* [Maps] Safely handle empty string and invalid strings from EuiColorPicker

* move RGBA_0000 to constants
2020-04-03 17:57:53 -06:00
Joel Griffith 9ed69ce9f2
Reporting/bug more blacklisted headers (#62389)
* Adding more blacklisted headers + a starts-with pattern export

* Fixing starts-with pattern export
2020-04-03 15:19:44 -07:00
Ryland Herrick b9ac2ac223
[SIEM] Prevent undefined behavior in our ML popover (#62498)
* Moves enableDataFeed outside of MLPopover

If we accept our dispatch functions, enableDatafeed can be abstracted as
a pure function. The version bound to popover's dispatch functions is
now named 'handleJobStateChange', as that is the callback it's used for.

* Remove unused component state

We no longer deal with jobs in our local state; that's the
responsibility of the useSiemJobs hook

* Prevent user from initiating multiple job installations

When attempting to run a job from the ML Popover, if the job needs to
first be installed, we set the rest of the jobs to be "loading" while
installation is performed.

Without this change, if users are fast enough they can potentially
trigger multiple rule installations, which is undefined behavior and
leads to failures and bad state in our component.

* Remove unused import
2020-04-03 16:52:12 -05:00
Devin W. Hurley 96ac8def87
[SIEM] [Detection Engine] remove all unknowns from all rules t… (#62327)
* remove all unknowns from all rules table props

* update sorting property type remove optional, also remove unnecessary properties we are not using in sorting, rename paginationMemo prop to pagination, remove null from rulesStatuses type as we are defaulting to empty array now

* fixes type mismatch for sorting and rulesStatuses

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-03 17:35:06 -04:00
Ryland Herrick 30afc9d597
Mark rule run as failure if there was an error (#62383)
While we still let the rule execute in the case of gap errors and
stopped ML jobs, we now mark that execution as a failure instead of a
success.
2020-04-03 15:22:38 -05:00
Frank Hassanabad 85c665acb0
[SIEM][Detection Engine] Fixes export of single rule and the icons
## Summary

Fixes export of single rule and the icons.
* https://github.com/elastic/kibana/issues/62378
* Single export of rules was using the `rule.id` instead of the `rule.rule_id` where now it flips it and works as expected.
* This adds data-test-subj for testing
* This adds jest unit tests to the menu component

Icons Before:
<img width="396" alt="Screen Shot 2020-04-02 at 5 12 43 PM" src="https://user-images.githubusercontent.com/1151048/78315482-5b533280-751a-11ea-8378-d5e106ebd36f.png">

Icons After:
<img width="407" alt="Screen Shot 2020-04-02 at 7 40 28 PM" src="https://user-images.githubusercontent.com/1151048/78315449-3fe82780-751a-11ea-9d16-2f8c2ea22a78.png">

### Checklist

- [x] [Unit or functional tests](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility) were updated or added to match the most common scenarios
2020-04-03 13:56:54 -06:00
MadameSheema 4cbf6d252b
fixes flakiness (#62406)
* fixes flakiness

* updates 'number of signals' selector

* changes the way we are asserting the text
2020-04-03 21:33:57 +02:00
Ryland Herrick 4b05ac2dee
Ensure rule message do not span multiple lines (#62391)
Because these messages are used for logging, we should ensure they do
not span multiple lines and confuse log parsers. Since the frontend does
not currently display these newlines, anyway, there is no impact to the
UI.
2020-04-03 11:29:02 -05:00
Angela Chuang f7bbf33667
fix persisting note (#62444) 2020-04-03 16:46:22 +01:00
Larry Gregory 37c826229b
Spaces - Migrate to NP Saved Objects Service (#58716)
* use NP saved objects service for type and wrapper registration

* simplifying

* additional testing

* revert snapshot changes

* removing dependency on legacy saved objects service

* consolidate mocks

* fixing imports

* addrress PR feedback

* remove unused docs

* adjust tests for updated corestart contract

* address test flakiness

* address flakiness, part 2

* address test flakiness

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-03 09:50:06 -04:00
Angela Chuang aab3dffefd
allow null for filterQuery (#62310) 2020-04-03 10:01:25 +01:00
Stacey Gammon bb747abdaf
Switch to embeddable factory interface with optional override (#61165)
* wip

* typescript map embeddable

* More updates

* Address code review comments and update some usages in SIEM and uptime to the new types

* More clean up - carry over some of the SIEM types to maps for render tool tip

* fixes

* fixes

* Address more review comments

* fixes

* fixes

* fix jest test

* Fix visualize embeddable

* fixes after master merge

* Fixes

* Prefix variable with name "custom" to make it more obvious

* Remove layerList from input state

* fixes

* Update src/plugins/dashboard/public/embeddable/dashboard_container_factory.tsx

Co-Authored-By: Vadim Dalecky <streamich@users.noreply.github.com>

* review updates

* fixes

* update maps readme

Co-authored-by: Vadim Dalecky <streamich@users.noreply.github.com>
2020-04-02 14:27:51 -04:00
Nathan Reese e202fe7aa3
[Maps] remove MapBounds type (#62332) 2020-04-02 11:04:06 -06:00
Shahzad 9a6c17d3da
[Uptime] Convert anomaly Jobs name to lowercase to comply with… (#62293)
* converted ml job name to lower case

* update type
2020-04-02 19:00:34 +02:00
Nathan Reese c8415b6519
[Maps] fix replaceLayerList to handle case where map is not intialized (#62202) 2020-04-02 09:06:57 -06:00
Court Ewing a729b3baef
Remove support for deprecated xpack.telemetry configurations (#51142)
* Remove support for deprecated xpack.telemetry configurations

In 7.5, we moved telemetry to OSS and dropped the xpack prefix for the
telemetry plugin configuration options. We deprecated the usage of the
xpack prefix so any existing usage would trigger a warning at startup.

In 8.0, we remove support for the deprecated xpack prefix configs for
telemetry.

* Move telemetry settings into its own document

* Use external reference instead of anchor

* Update docs/migration/migrate_8_0.asciidoc

Co-Authored-By: gchaps <33642766+gchaps@users.noreply.github.com>

* Update docs/migration/migrate_8_0.asciidoc

Co-Authored-By: gchaps <33642766+gchaps@users.noreply.github.com>

* Update docs/settings/telemetry-settings.asciidoc

Co-Authored-By: gchaps <33642766+gchaps@users.noreply.github.com>

* Update docs/settings/telemetry-settings.asciidoc

Co-Authored-By: gchaps <33642766+gchaps@users.noreply.github.com>

* Update docs/settings/telemetry-settings.asciidoc

Co-Authored-By: gchaps <33642766+gchaps@users.noreply.github.com>

* Update docs/settings/telemetry-settings.asciidoc

Co-Authored-By: gchaps <33642766+gchaps@users.noreply.github.com>

* Update docs/settings/telemetry-settings.asciidoc

Co-Authored-By: gchaps <33642766+gchaps@users.noreply.github.com>

* Update docs/settings/telemetry-settings.asciidoc

Co-Authored-By: gchaps <33642766+gchaps@users.noreply.github.com>

* Update docs/settings/telemetry-settings.asciidoc

Co-Authored-By: gchaps <33642766+gchaps@users.noreply.github.com>

* Update docs/settings/telemetry-settings.asciidoc

Co-Authored-By: gchaps <33642766+gchaps@users.noreply.github.com>

* Remove depecrated xpack.telemetry.* config from xpack_main/index.js

Co-authored-by: Alejandro Fernández Haro <alejandro.haro@elastic.co>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Alejandro Fernández Haro <afharo@gmail.com>
Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>
2020-04-02 15:27:57 +01:00
Andrew Cholakian 4a20567fb7
[Uptime] Remove static constant for index name completely (#62256)
Fixes #62255 . There were some remaining usages of a static defined
index name.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-02 09:06:15 -05:00
Victor Martinez 71ff45ad6a
[APM] E2E: install dependencies for vanilla workspaces (#62178) 2020-04-02 14:51:42 +01:00
Mike Côté 02dad02923
Rename some alert types (#61693)
* Rename some alert types

* Use sentence case for remaining changes + fix jest test

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-02 07:48:42 -04:00
Marta Bondyra ee3f5309f8
[Lens] fix error for minInterval>computedInterval for XYChart (#61931) 2020-04-02 09:26:23 +02:00
Shahzad df655c9a97
[Uptime] Optimize get latest monitor API (#61820)
* update monitor status API

* update fixture

* fix types

* fix tets

* fix tests
2020-04-02 08:31:32 +02:00
Nathan Reese 467f27b600
[Maps] Separate layer wizards for Clusters and heatmap (#60870)
* [Maps] source registry and register seperate clusters and heat map sources

* split into to registries

* add EMS file source

* add geojson upload layer

* register rest of sources

* i18n changes

* ts lint errors

* fix jest test

* fix pew-pew source

* review feedback

* import registires in plugin so they exist in embeddable

* remove order parameter and move all layer registies into single file

* fix functionalt est

* pass constructor to sourceREgistry instead of factory

* review feedback

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-01 20:21:18 -06:00
Devin W. Hurley cb914d408e
[SIEM] [Detection Engine] Fixes all rules sorting (#62039)
* fixes sorting to what it was in 7.6.1

* removes sortable=true from non-sortable columns, fixes naming of sortable column field from activate to enabled to match the field eui expects to sort on, fixes react render warning due to resetting tableRef's current field during a render
2020-04-01 16:45:16 -04:00
Xavier Mouligneau b1a39ce23c
[SIEM] CASES Bugs BC2 (#62170)
* fix persistence between filter

* Fix API filtering bug

* Show username if full name is empty

* fix user in avatar

* do not allow push to service now when connector is none

* fix types

* Show errors from actions

* update connector name in configure

Co-authored-by: Christos Nasikas <christos.nasikas@elastic.co>
2020-04-01 16:33:51 -04:00
Oliver Gupte 2cdb9d3113
Closes #60173 by turning off client caching for the main service map API call (#62111) 2020-04-01 11:29:58 -07:00
Andrew Goldstein 2cff8b43e4
[SIEM] Restores the _External alert count_ widget's subtitle (#62094)
## [SIEM] Restores the _External alert count_ widget's subtitle

Fixes an issue where the _External alert count_ widget's subtitle, (e.g. `Showing: 47,642,905 external alerts`), didn't render after data is loaded

### Before

![external-alerts-before](https://user-images.githubusercontent.com/4459398/78086038-f3fe7c80-7379-11ea-8291-2ef807349aea.png)

### After

![external-alerts-after](https://user-images.githubusercontent.com/4459398/78086045-fb258a80-7379-11ea-9bc6-338dc3aba482.png)
2020-04-01 11:47:59 -06:00
CJ Cenizal 82e0fd9b3f
Update ILM node attributes blacklist. (#62093)
- Remove 'testattr' because this doesn't seem to be used in production by ES.
- Add 'transform.node' (added via https://github.com/elastic/elasticsearch/pull/52712/files#diff-225cc2c1291b4c60a8c3412a619094e1R147).
2020-04-01 09:29:32 -07:00
Thomas Neirynck 42fbdc182f
[Maps] Highlight selected layer in TOC (#61510) 2020-04-01 09:29:48 -04:00
Frank Hassanabad 086bea5eb6
[SIEM][Detection Engine] Adds release notes link and updates one UI section
## Summary

Based on feed back from two users within our community slack channel of SIEM we are adding a release notes link to the product for when rules are updated.

Also, because new rules can show up we are changing the words of the "Reload X deleted Elastic prebuilt rule" to "Install X Elastic prebuilt rule" as it is misleading to imply the user has deleted rules when really they have either deleted rules or new rules are available to be installed.

The screen shot with the link of "release notes". Previously the link of "release notes" did not exist:

This new link right now goes to:
https://www.elastic.co/guide/en/siem/guide/master/prebuilt-rules.html

where in the link `master` is replaced with the version of the product that is deployed. I think we want to replace that link with a new one which will have release notes of rules for each new version of the rules.   

<img width="688" alt="Screen Shot 2020-03-20 at 2 29 47 PM" src="https://user-images.githubusercontent.com/1151048/77207801-ef0b1480-6abf-11ea-8ad7-771b0f3334d6.png">

Screen shot of the new text for Install Elastic Rules:
<img width="679" alt="Screen Shot 2020-03-20 at 3 20 44 PM" src="https://user-images.githubusercontent.com/1151048/77207875-1b269580-6ac0-11ea-908d-6ec1694df62f.png">

Screen shot of the existing Reload Elastic Rules the above screen shot is replacing:
<img width="817" alt="Screen Shot 2020-03-20 at 2 36 52 PM" src="https://user-images.githubusercontent.com/1151048/77207833-03e7a800-6ac0-11ea-92f8-7bb065775122.png">

### Checklist

Delete any items that are not applicable to this PR.

- [x] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/master/packages/kbn-i18n/README.md)
- [x] [Documentation](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#writing-documentation) was added for features that require explanation or tutorials
2020-04-01 06:32:41 -06:00
Dario Gieselaar d4fa5edafd
[APM] Ensure telemetry data matches SO/telemetry mapping (#61957)
* [APM] Ensure telemetry data matches SO/telemetry mapping

Closes #61802.

* Correct mapping for dotnet data
2020-04-01 12:39:24 +02:00
Cauê Marcondes 79757651a9
[APM] Filters are not prefilled when the custom link flyout is opened from a transaction page. (#61650)
* open flyout with filters prefilled

* addressing pr comments

* addressing pr comments

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-01 08:50:06 +02:00
Nathan L Smith 433d06fd16
Don't fetch service map data if no license (#62071)
Fixes #61994
2020-03-31 19:57:30 -05:00
Shahzad 92eab3e8d1
[Uptime] Added func test for obsv location map (#61518)
* add functional test

* update func test

* refactor more changed

* update test

* update test

* update type and test

* fix the fix of fix, which din't get fix

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-01 00:51:55 +02:00
Justin Kambic 93ad6d42e4
[Uptime] Fix action variables for monitor status alert (#61844)
* Add action variables for monitor status alert.

* Translate action variable descriptions.

* Add state variables to list. Update defaultActionMessage.

* Remove non-literal characters from test names, and update outdated snapshots.
2020-03-31 18:41:17 -04:00
Justin Kambic aa20442a3d
Close create alert popover after the create alert flyout has been selected. (#62036) 2020-03-31 16:56:34 -04:00
Corey Robertson f9fefdd467
[CANVAS] Gets ride of chrome/ui for advanced settings (#61865)
* Gets ride of chrome/ui for advanced settings

* Mock new platform for test

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-31 16:43:07 -04:00
MadameSheema 86a70ba963
slows down timeline creation (#62037) 2020-03-31 21:46:32 +02:00
Joel Griffith 12caa46e35
Always log non-200 responses in reportin (#61897)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-31 12:30:47 -07:00
MadameSheema c8b7b55a93
increases default command timeout (#62022) 2020-03-31 21:15:27 +02:00
Nathan L Smith 49e53dac7b
Hide APM alerting menu if alerting plugin is disabled (#61907)
* Hide APM alerting menu if alerting plugin is disabled

Checks for presence of plugin and does not display the link if the plugin is disabled.

Use `xpack.alerting.enabled: false` in config/kibana.dev.yml to try it.

Fixes #61048.
2020-03-31 13:22:36 -05:00
Mike Côté 7d97ead26e
Adding PagerDuty icon to connectors cards (#60805)
* adding PagerDuty icon to connectors cards

* Fix jest

* remove unnecessary global typings from canvas and sync global typings in xpack with oss

Co-authored-by: Andrea Del Rio <delrio.andre@gmail.com>
Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-31 13:41:00 -04:00
MadameSheema 477ce93d17
Fix drag and drop flakiness (#61993)
* increases the time between dragging and dropping an element

* fixes test
2020-03-31 19:11:41 +02:00
Kerry Gallagher 558dd120a1
Grok debugger migration (#60658)
* Migrates Grok Debugger to new platform
2020-03-31 17:54:34 +01:00
The SpaceCake Project 341c787f9c
[SIEM] version 7.7 rule import (#61903)
* rule import

* Update x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_credential_dumping_msbuild.json

Co-Authored-By: Garrett Spong <spong@users.noreply.github.com>

* Update add_prepackaged_rules_schema.ts

* Update rule.ts

* updates 'prebuilt_rules_loaded' data (#61940)

Co-authored-by: Garrett Spong <spong@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: MadameSheema <snootchie.boochies@gmail.com>
2020-03-31 10:24:59 -06:00
Matthias Wilhelm 0082ca7ad8
[Discover] Deangularize and euificate sidebar (#47559)
* Split angular templates into React components

* Add tooltip for field label

* Adapt SCSS

* Cleanup angular directives

* Extract helper functions

* Improve tests + docs

* Move css to _sidebar.scss

* Exclude _id field from displaying the Visualize button to prevent an ES error

* A11y improvements
2020-03-31 17:01:44 +02:00
Justin Kambic e8143918e6
Add an onBlur handler for the kuery bar. Only resubmit when input changes. (#61901) 2020-03-31 10:42:50 -04:00
Aaron Caldwell d73671e2b5
[Maps] Explicitly pass fetch function to ems-client (#61846)
* Add fetchFunction binding appropriate version of fetch for ems client

* Wrap standard window fetch prior to passing to ems-client

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-31 08:03:05 -06:00
Christos Nasikas 810cbd2820
[SIEM][CASE] Fix aria-labels and translations (#61670)
* Fix aria-labels and translations

* Fix conflicts and bugs
2020-03-31 16:20:37 +03:00
Dario Gieselaar 08c94bf58b
APM] Set ignore_above to 1024 for telemetry saved object (#61732)
Closes #61546.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-31 14:25:34 +02:00
patrykkopycinski 65e8f2b603
[SIEM][Detection Engine] Allow to edit actions for prepackaged rules (#61312) 2020-03-31 12:54:58 +02:00
Alexey Antonov 1696dd5607
Delete legacy embeddable_api plugin (#61767)
* Delete legacy `embeddable_api` plugin

Closes: #61545

* fix test:karma
2020-03-31 10:33:04 +03:00
Xavier Mouligneau 4083d6682f
[SIEM] Cases clean up Phase II (#61750)
* allow case to work without security

* disable configure button + add call out if license does not match and if kibana config does not allow if

* add skeleton for crud in case

* fix link to timeline + disable action on case on read only + allow read only access to our saved object in siem + manage no x-pack.security + show msg when read-only + fix reporters bug

* add actions required in plugins

* review I

* review II

* review III

* review IV

* fix types

* review V
2020-03-31 00:20:11 -04:00
Nathan Reese 1687e8ef5a
[Maps] convert redux store to TS phase 1 (#61704)
* [Maps] convert redux store to TS phase 1

* review feedback

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-30 21:56:43 -06:00
Patrick Mueller fcefe7d902
[Alerting] add complete alerting/action privs to apm feature (#61159)
Based on a [review comment of a related PR[1], the apm feature definition
has been changed to supply all the alerting/action privs for both read
and all apm privs.

[1] https://github.com/elastic/kibana/pull/61113#pullrequestreview-380544712
2020-03-30 23:27:44 -04:00
Nathan L Smith 5808f86f60
Use docLinks API for APM doc links (#61880)
* Use docLinks API for APM doc links

Remove `packageInfo` (from ui/metadata package from the legacy platform) and replace with `core.dockLinks` in the `ElasticDocsLink` component.

Fixes #56453
Fixes #60945
2020-03-30 18:34:23 -05:00
Ryland Herrick 8b31ce0a89
[SIEM] Check ML Job status on ML Rule execution (#61715)
* Move isMlRule helper to a more general location

And use it during rule execution as well.

* Add error message back to rule error status

This was unintentionally removed in a previous merge commit.

* Expose mlClient as part of ML's Setup contract

This allows dependent plugins to leverage the exposed services without
having to define their own ml paths, e.g. "ml.jobs"

* Move ML Job predicates to common folder

These are pure functions and used on both the client and server.

* WIP: Check ML Job status on ML Rule execution

This works, but unfortunately it pushes this executor function to a
complexity of 25. We're gonna refactor this next.

* Move isMlRule and RuleType to common

These are used on both the frontend and the backend, and can be shared.

* Refactor Signal Rule executor to use RuleStatusService

RuleStatusService holds the logic for updating the current status as
well as adding an error status. It leverages a simple
RuleStatusSavedObjectClient to handle the communication with
SavedObjects.

This removes the need for our specialized 'writeError', 'writeGap', and
'writeSuccess' functions, which duplicated much of the rule status
logic and code. It also fixes a bug with gap failures, with should have
been treated the same as other failures.

NB that an error does not necessarily prevent the rule from running, as
in the case of a gap or an ML Job not running.

This also adds a buildRuleMessage helper to reduce the noise of
generating logs/messages, and to make them more consistent.

* Remove unneeded 'async' keywords

We're not awaiting here, so we can just return the promise.

* Make buildRuleStatusAttributes synchronous

We weren't doing anything async here, and in fact the returning of a
promise was causing a bug when we tried to spread it into our attributes
object.

* Fix incorrectly-named RuleStatus attributes

This mapping could be done within the ruleStatusService, but it
lives outside it for now.

Also renames the object holding these values to the more general
'result,' as creationSuccess implies it always succeeds.

* Move our rule message helpers to a separate file

Adds some tests, as well.

* Refactor how rule status objects interact

Only ruleStatusSavedObjectsClient receives a savedObjectsClient, the
other functions receive the ruleStatusSavedObjectsClient

* pluralizes savedObjects in ruleStatusSavedObjectsClient
* Backfills tests

* Handle adding multiple errors during a single rule execution

We were storing state in our RuleStatusClient, and consequently could
get into a situation where that state did not reflect reality, and we
would incorrectly try to delete a SavedObject that had already been
deleted.

Rather than try to store the _correct_ state in the service, we remove
state entirely and just fetch our statuses on each action.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-30 16:35:38 -05:00
Ryland Herrick 9ff8be602d
[SIEM] 7.7. NP Cleanup (#61713)
* Remove unused legacy services

These were migrated to NP in a previous PR.

* Remove unused legacy request types

* Type our siem client as optional

If a plugin does not have siem enabled, they won't get our client.

While it seems unlikely to be in a situation where our routes are being
hit but our client is unavailable, we will return a 404 in that case,
similar to the unavailability of actions/alerting.

This also removes some redundant checks on action/alerting clients.

* Remove more redundant dependency checks

In general, we use optional chaining to ignore any intermediate null
values, and defer checks to our actual dependencies, e.g. alertsClient
or siemClient.
2020-03-30 15:12:45 -05:00
Steph Milovic 9831c12e1a
[SIEM] [Case] Design fixing (#61681) 2020-03-30 11:31:35 -06:00
Shahzad d1cf0acf3f
[Uptime] Update ML flyout to add cancel button (#61627)
* update button

* fix type

* update snaps

* update layout
2020-03-30 19:28:49 +02:00
Nathan Reese 0070bdcdd5
[Maps] clean-up unsaved state check (#61705)
* [Maps] clean-up unsaved state check (#61535)

* close layer panel in functional test

* skip vector styling test

* skip saved object management test

* skip all of group 7 tests

* turn back on group 7, skip full screen

* turn on all tests except full screen

* unskip all tests and resolve root problem

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-30 11:25:49 -06:00
Christos Nasikas d054fbc7dd
[SIEM][CASE] Add triggers_actions_ui plugin (#61810) 2020-03-30 19:10:47 +03:00
Cauê Marcondes 567f84056b
[APM] Storybook waterfall (#61617)
* creating storybook to test Waterfall

* creating storybook to test Waterfall

* addressing PR comments
2020-03-30 17:41:52 +02:00
Christos Nasikas c679ceb1ba
[SIEM][CASE] Configuration page design fixes (#61772)
* Add toaster

* Better message

* Design fixes
2020-03-30 18:38:15 +03:00
Angela Chuang c0c9d98538
[SIEM] Import timeline schema update (#61622)
* allow users importing data if they are authorized

* rename props

* rename types

* hide import timeline btn if unauthorized

* unit test for TimelinesPageComponent

* update schemas

* update schema

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-30 15:56:16 +01:00
Angela Chuang f21dea11c3
[SIEM] Fix layout issue for open timeline modal (#61786)
* show icon on open timeline modal

* add unit test

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-30 14:32:20 +01:00
Yara Tercero dd77dea216
[SIEM][Detections Engine] - Add rule markdown to timeline global notes (#61026)
[SIEM][Detections Engine] - Add rule markdown to timeline global notes

* added functionality of new global timeline note created on init timeline creation if signal.rule.note exists

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-30 07:58:01 -04:00
Joe Reuter b6101f042a
Graph: Migrate feature registration (#61419) 2020-03-30 11:11:00 +02:00
Daniil Suleiman 84d1bbd7b6
[NP] Remove absoluteToParsedUrl & KibanaParsedUrl ref in kibana app (#61105)
* Remove absoluteToParsedUrl reference in dashboard

* Remove KibanaParsedUrl from visualize

* Fix tests

* Add tests

* Fix saved dashboard

* Fix empty line after resolving conflicts

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-30 11:51:29 +03:00
Christos Nasikas 808dc855c6
[SIEM][CASE] Add missing AbortController to API calls (#61426) 2020-03-28 19:04:52 +02:00
Nathan Reese fdcbb19a3f
[Maps] fix tooltip overflow (#61564)
* [Maps] fix tooltip overflow

* update jest snapshots

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-27 17:20:53 -06:00
spalger 4c18199208 Revert "[Maps] clean-up unsaved state check (#61535)"
This reverts commit 30bdfeda6c.
2020-03-27 13:54:45 -07:00
Nathan L Smith a9a9776b39
Replace APM agent "Active" setting with "Recording" (#61538)
Also change "APM server" to "APM Server"

Fixes #61179.
2020-03-27 12:40:55 -05:00
Steph Milovic bec4e33651
[SIEM] [Cases] Fix comments and user (#61642) 2020-03-27 11:25:48 -06:00
Nathan Reese 30bdfeda6c
[Maps] clean-up unsaved state check (#61535) 2020-03-27 11:03:57 -06:00
Justin Kambic 1da53ed23b
[Uptime] Fix PingList pagination (#61481)
* Add pagination.

* Update test files.
2020-03-27 12:50:49 -04:00
Oliver Gupte 5afb573736
Closes #61291 by debouncing service map hover metric events tracking (#61561) 2020-03-27 09:30:16 -07:00
Mikhail Shustov ab39ceba8f
Serve static assets from NP (#60490)
* add hapi.inert plugin to NP

* update tests

* move serving static assets

* update tests

* add functional tests

* fix type errors. Hapi.Request doesn't support typings for payload

* update docs

* remove comment

* move assets to NP

* update all assets references

* address Spencer's comments

* move ui settings migration to migration examples

* document legacy plugin spec

* move platform assets test to integration_tests

* address Spencer's comment p.2

* try to fix type errors

* fix merge commit

* update tests
2020-03-27 14:24:28 +01:00
Peter Pisljar 7b0c66f7f1
move visualizations plugin to new platform (#60403) 2020-03-27 13:02:06 +01:00
Jean-Louis Leysens 3373bb8613
[Grokdebugger] Fix grokdebugger simulate call in non-default s… (#61423) 2020-03-27 11:35:22 +01:00
Christos Nasikas 5b8de94616
[SIEM][CASE] Improve connector flyout (#61450)
* Disable action types

* Disable autofill

* Warn user on edit flyout about empty secrets

* Change column name

* Disable field mapping
2020-03-27 11:03:59 +02:00
MadameSheema 55ed873f32
[SIEM] Adds 'Delete custom rules' tests (#61495)
* adds test data

* implements 'Deletes one rule' test

* adds new data

* fixes 'Deletes one rule' for the new data

* adds 'Deletes more than one rule' test
2020-03-27 09:34:14 +01:00
Xavier Mouligneau 327f5a099a
[SIEM] [CASES] bug/clean up phase I (#61354)
* clean up comments + add update_by/update_at  case when comment are added/updated + return all comments

* add refresh button + get a better interaction between user + fix bug with pushed data + fix three dot on detail page

* fix i18m

* review I

* review II
2020-03-26 20:09:58 -04:00
Nathan Reese 3431697a3a
[Maps] add functional test for category autocomplete (#61386)
* [Maps] add functional test for category autocomplete

* remove duplicated method
2020-03-26 16:26:26 -06:00
Stacey Gammon 65452bddf9
Typescript map embeddable (#61264)
* typescript map embeddable

* Address code review comments and update some usages in SIEM and uptime to the new types

* More clean up - carry over some of the SIEM types to maps for render tool tip

* Address more review comments
2020-03-26 16:14:23 -04:00
Angela Chuang 36a4944f0c
[SIEM] Allow Import timeline for authorised users (#61438)
* allow users importing data if they are authorized

* rename props

* rename types

* hide import timeline btn if unauthorized
2020-03-26 19:54:33 +00:00
Marta Bondyra 25221f7675
[Lens] Fix display single bar in XYChart Bar Vis (#61452) 2020-03-26 19:32:24 +01:00
Pierre Gayvallet 7ab38ff6de
Migrate savedObjectManagementActionRegistry to NP plugin (#60481)
* create empty plugin + move home feature registration to it

* move the so action_registry to new plugin

* adapt existing calls to the registry

* fix i18n namespace

* fix table unit tests

* update codeowners

* rename plugin to match other PRs

* remove registerLegacyAPI from spaces public plugin

* fix typo

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-26 17:25:27 +01:00
Christos Nasikas 933b6ee996
[SIEM][CASE] Track unsaved changes (#60925)
* Hide bottom bar when flyout is open

* Track unchanged saves

* Make function optional

* Show action bar when close flyout

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-26 14:17:55 +02:00
Cauê Marcondes a16d446492
[APM] Link preview breaks when editing a custom link (#61053)
* refactoring custom link server side

* refactoring custom link server side

* fixing pr comments

* fixing unit test

* fixing unit tests

* renaming server directory

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-26 11:49:41 +01:00
MadameSheema 01e3cc307e
[SIEM] Adds 'Deleting prebuilt rules' tests (#61328)
* implements 'Deleting prebuilt rules' tests

* refactors code

* extracts the number of prebuilt riles to a constant that can be used in any test
2020-03-26 11:34:28 +01:00
MadameSheema 4b4c5bca2d
increases timeouts (#61229)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-26 09:19:10 +01:00
Ryland Herrick 9243b6de28
Check auth status via security plugin on our privileges endpoint (#61334)
* Accounts for security being disabled, adds tests
* Updates other auth-aware endpoints (import timeline, graphql) to
account for security being disabled.
2020-03-25 19:08:29 -05:00
Nathan L Smith 43d95da464
Make global service map zoom toward center (#61340)
* Make global service map zoom toward center

Calculate the center of the graph when there's not a primary node.

Also update to latest version of types.

Fixes #61176.

* Fix types
2020-03-25 18:24:15 -05:00
Andrew Cholakian 5c5c98f0e7
[Uptime] Various Settings Fixes (#61007)
Fixes behavior in chrome where using the enter key to submit the settings form would reload the page. Fixes #61006

Fixes test failures in uptime settings tests by waiting until form data is loaded: https://kibana-ci.elastic.co/job/elastic+kibana+master/3882/https:/

Sample failure:

{ Error: expected { heartbeatIndices: '' } to sort of equal { heartbeatIndices: 'heartbeat-8*' }
    at Assertion.assert (/dev/shm/workspace/kibana/packages/kbn-expect/expect.js💯11)
    at Assertion.eql (/dev/shm/workspace/kibana/packages/kbn-expect/expect.js:244:8)
    at Context.it (test/functional/apps/uptime/settings.ts:31:25)
    at process._tickCallback (internal/process/next_tick.js:68:7)
  actual: '{\n  "heartbeatIndices": ""\n}',
  expected: '{\n  "heartbeatIndices": "heartbeat-8*"\n}',
  showDiff: true }

Re-enables location tests failure, which should have been fixed by https://github.com/elastic/kibana/pull/60573/files#diff-7198f3de6fe631f903e590f63bc88e21R20
2020-03-25 17:58:07 -05:00
Frank Hassanabad 33511b3879
[SIEM] Add developer optimization scripts for their environments
## Summary

This adds an optimization script very copied and slightly modified from:
* https://github.com/elastic/kibana/pull/49868

Usage:

Run this to do an dev tsconfig optimization:
```ts
node x-pack/legacy/plugins/siem/scripts/optimize_tsconfig
```

Run this to undo the optimization:
```ts
node x-pack/legacy/plugins/siem/scripts/unoptimize_tsconfig
```

Testing and what this does:

Run this:
```ts
node x-pack/legacy/plugins/siem/scripts/optimize_tsconfig
```

Then run your start-test-all or at least your linter, typescript check, and jest tests to make sure they all operate as expected. Restart your IDE and ensure everything works as expected.

Run `git status` and ensure it looks like no new files want to be checked in.

Open up your:
```ts
kibana/x-pack/tsconfig.json
```

And notice it is now changed when optimization has run to use a smaller set of includes.

Open up your:
```ts
kibana/tsconfig.json
```

And notice it is now changed when optimization is run to use a smaller set of includes.
2020-03-25 16:30:53 -06:00
Dario Gieselaar d87cb9489f
[APM] Explicit telemetry mappings (#61266)
Replaces generic object type mappings with explicitly defined properties. These were probably unmapped because the sample data for some agents does not have these fields.
2020-03-25 22:07:45 +01:00
Poff Poffenberger a16968dd3a
[Canvas] Fix map embeddables not showing up on PDF reports (#61149)
* Allow embeddables to track their own render complete for report generation in canvas

* Updating following consult with reporting team

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-25 14:54:32 -05:00
Nathan Reese 4c70ef54a7
descriptors to descriptor_types (#61290)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-25 13:42:50 -06:00
Tim Roes b8e3ccb356
Move lens saved object setup to Kibana platform (#61157) 2020-03-25 17:56:49 +01:00
Tim Schnell 46e495ff8a
Limit rows in debug element (#60804)
* limiting the number of rows displayed in debug element to 100

* updating function and typescripting

* adding debug tests
2020-03-25 11:27:03 -05:00
Joe Reuter d170b37b8f
Shim getFormat function correctly (#60032) 2020-03-25 16:16:11 +01:00
Aaron Caldwell f5da5bc6d6
Fix typo: autocompleteService -> autocomplete (#61186) 2020-03-25 07:23:25 -06:00
MadameSheema 5b706ee372
[SIEM] Adds 'Create ML rule' Cypress test (#61059)
* splits signal detection rules tests in different spec files

* implements 'creates and activates a new ml rule'

* refactors code

* updates 'select_rule_type' data-test-subj selectors

* Refactor JobStatusBadge

I'm adding a data-test-subj and it seems silly to define it in two
branches.

* Update ML Rule cypress tests

* Updates the test now that the Rule Details have changed
* Adds an additional assertion on the new JobStatusBadge

* keeps code consistency

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Ryland Herrick <ryalnd@gmail.com>
2020-03-25 11:11:03 +01:00
Katrin Freihofner 6c3fa6bd43
fix/uptime-alert-icon (#60750)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-25 08:24:46 +01:00
Søren Louv-Jansen 488b9e2648
[APM] Improve e2e runner (#61163) 2020-03-25 07:09:28 +01:00
Devin W. Hurley 411959fc47
fix type check failure on master (#61204) 2020-03-25 01:52:06 -04:00
Steph Milovic 1e3c5b1f87
[SIEM] [Cases] Final case features for 7.7 (#61161) 2020-03-24 23:39:46 -06:00
Devin W. Hurley 96852249e8
[SIEM] [Detection Engine] Rule activity monitoring (#60816)
* backend rule monitoring with gap desc, last look back date, and time duration of search after and bulk create operations

* adds new properties to mocked request_response status saved object

* first pass at UI table

* migrate rule monitoring backend to work with refactor of rule executor, fix some formatting stuff on the frontend, update the mapping for gap to be a string instead of a float

* trying to write a test for rules statuses hook

* fixed hooks tests

* fixes merge conflicts from rebase with master

* add columns for indexing and query time lapse

* i18n

* i18n for tabs

* don't change the mappings in ml es_archives

* remove accidental commit of interval change for shell script detection engine rule

* removes inline object from prop

* fix merge conflicts

* backend changes from pr comments

* updates ui changes from pr feedback

* fix tests and add formatting for dates

* remove null from rulesStatuses initial state and replace with empty array
2020-03-24 23:49:08 -04:00
Nathan Reese 29a3f55985
[Maps] clean up icon category UI (#61116)
* [Maps] clean up icon category UI

* fix jest tests

* add unit test for getFirstUnusedSymbol

* remove duplicate icon stop values

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-24 21:24:37 -06:00
Ryland Herrick 683bf3a72e
[SIEM] ML Rules Details (#61182)
* Add basic help text to ML Job dropdown on Rule form

* Use EUI's preferred layout for form fields

* Add a link to ML in the Job select help text

* Restrict timeline picker to EUI guidelines

Don't display the row as fullwidth, lest the help text wrap across the
entire page. It only looks okay now because it was a short sentence;
adding the ML Job select with its wrapped text caused some visual
weirdness, so this at least makes it consistent.

* Add placeholder option to ML Job dropdown

* Humanize rule type on Rule Description component

This is displayed both on the readonly form view, and the Rule Details
page.

* Add useMlCapabilities hook

This is a base hook that we can combine with our permissions helpers.

* Restrict ML Rule creation to ML Admins

If we're auto-activating jobs on their behalf, they'll need to be an
admin.

* Extract ML Job status helpers to separate file

* WIP: Enrich Rule Description with ML Job Data

This adds the auditMessage as well as a link to ML; actual status is
next

* Display job status as a badge on Rule Details

Also simplifies the layout of these job details.

* Port helper tests to new location

* Fix DescriptionStep tests now that they use useSiemJobs

UseSiemJobs uses uiSettings, so we need to use our kibana mocks here.

* Fix responsiveness of ML Rule Details

The long job names were causing the panel to overflow.
2020-03-24 21:39:07 -05:00
Angela Chuang 2ad68f0e98
[SIEM] Import timeline (#60880)
* add import timelines route

* update timeline

* sync with master

* wip

* wip

* update timeline

* overwrite pinned events

* clean up

* init server side unit test

* add server side unit test

* clean up unit test

* unit test

* add unit tests

* clean up

* clean up

* fix unit test

* fix types and unit tests

* rename constants

* fix validation schemas

* review

* fix schemas

* functional test

* skip a functinal test

* add unit tests

* code review

* review with angela

* fix tests

* update modal label

* rename folder to align component name

* fix types

* fix unit test

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Xavier Mouligneau <189600+XavierM@users.noreply.github.com>
2020-03-24 20:20:40 -04:00
Oliver Gupte f9ad60d490
Renames apm metric event 'service_map_object_hover' to 'service_map_node_or_edge_hover' for more clarity (#61178) 2020-03-24 16:55:05 -07:00
patrykkopycinski f9d37b392a
[SIEM] Add rule notifications (#59004)
## Summary

Allow defining notifications that will trigger whenever the rule created new signals.

Requires:
- https://github.com/elastic/kibana/pull/58395
- https://github.com/elastic/kibana/pull/58964
- https://github.com/elastic/kibana/pull/60832


![Screenshot 2020-03-02 at 10 19 18](https://user-images.githubusercontent.com/5188868/75662390-4fe8bf00-5c6f-11ea-943f-591367348b91.png)

![Screenshot 2020-03-02 at 10 13 00](https://user-images.githubusercontent.com/5188868/75662421-5e36db00-5c6f-11ea-9317-d158cddf4344.png)


### Checklist

Delete any items that are not applicable to this PR.

- [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/master/packages/kbn-i18n/README.md)
- [ ] [Documentation](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#writing-documentation) was added for features that require explanation or tutorials
- [ ] [Unit or functional tests](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility) were updated or added to match the most common scenarios
- [ ] This was checked for [keyboard-only and screenreader accessibility](https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Cross_browser_testing/Accessibility#Accessibility_testing_checklist)
- [ ] This renders correctly on smaller devices using a responsive layout. (You can test this [in your browser](https://www.browserstack.com/guide/responsive-testing-on-local-server)
- [ ] This was checked for cross-browser compatibility, [including a check against IE11](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility)

### For maintainers

- [ ] This was checked for breaking API changes and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)
2020-03-24 17:49:10 -06:00
Shahzad 2443827579
[Uptime] Feature/enhance telemetry Phase 1 (#61062)
* add telemetry

* update telemetry

* update telemetry

* update types

* fix issue when no data

* use dynamic settings in telemtry

* fix type

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-25 00:05:57 +01:00
Ryland Herrick 64a5734439
[SIEM] Add license checks for ML Rules on the backend (#61023)
* WIP: Check license on simple rule creation

We'll add this to the rest of the routes momentarily.

* Add license checks around all rule-modifying endpoints

This ensures that you cannot create nor update an ML Rule if your
license is not Platinum (or Trial).

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-24 16:49:35 -05:00
Nick Peihl 72afbbbd72
[Maps] Fix cross origin error for icon spritesheets when Kibana secured via OAuth proxy (#53896)
* Set crossOrigin to anonymous only on requests from external hosts

* Update x-pack/legacy/plugins/maps/public/connected_components/map/mb/utils.js

Co-Authored-By: Joe Portner <5295965+jportner@users.noreply.github.com>

* 🙇‍♂️ Lint

Co-authored-by: Joe Portner <5295965+jportner@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-24 14:30:44 -07:00
Oliver Gupte 36285d62b6
Closes #60754 by removing uiFilters from the API route for service map (#61012)
since it is unused.
2020-03-24 13:56:08 -07:00
Corey Robertson 17db8a66b3
[Canvas] Visualize embeddable (#60859)
* Enables Visualize Embeddable

* Fix i18n

* Fix tests

* Remove unused import
2020-03-24 16:04:43 -04:00
Oliver Gupte 693e74b1ca
[APM] Service map - add page load and interaction telemetry (#61009)
* Closes #60527 by adding called to shared observability usage tracking
function when service map page is loaded, and if the user interacts with
it

* trigger usage tracking on specific cytoscape events: node select, object hover
2020-03-24 12:53:31 -07:00
Wylie Conlon 2f1e689c91
[Lens] Create filters on click with bar, line, area charts (#57261) 2020-03-24 20:51:00 +01:00
Søren Louv-Jansen 0fc0440cdc
[APM] E2E: Zero config for running e2e locally (#59152) 2020-03-24 20:28:11 +01:00
Gidi Meir Morris 18793dbc6c
[Alerting] notifies user when security is enabled but TLS is not (#60270)
This PR:
1. Adds a callout on the Alerting UI when security is enabled but TLS is not
2. Cleans up displayed error message when creation fails due to TLS being switched off
2020-03-24 19:15:27 +00:00
Joel Griffith 427848c3be
Revert "[Reporting/New Platform Migration] Use a new config service on server-side (#55882)" (#61075)
This reverts commit 5755b2ac52.
2020-03-24 09:07:39 -07:00
Nathan Reese e55ee76b26
[Maps] convert layer utils to TS (#60791)
* [Maps] convert layer utils to TS

* clean up

* renovate changes

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-24 09:38:00 -06:00
Larry Gregory b82cc6ed4a
Support for sub-feature privileges (#60563)
* initial server-side support for sub-feature privileges (#57507)

* initial server-side support for sub-feature privileges

* start addressing PR feedback

* renaming interfaces

* move privilege id collision check to security plugin

* additional testing

* change featurePrivilegeIterator import location

* fix link assertions following rebase from master

* Initial UI support for sub-feature privileges (#59198)

* Initial UI support for sub-feature privileges

* Address PR feedback

* display deleted spaces correctly in the privilege summary

* additional testing

* update snapshot

* Enables sub-feature privileges for gold+ licenses (#59750)

* enables sub-feature privileges for gold+ licenses

* Address PR feedback

* address platform review feedback
2020-03-24 11:12:49 -04:00
Wylie Conlon 6d2aa8974d
[Lens] Fix bug in metric config panel (#60982)
* [Lens] Fix bug in metric config panel

* Fix test
2020-03-24 10:43:48 -04:00
patrykkopycinski 2106b69219
[SIEM][Detection Engine] Add rule's notification alert type (#60832) 2020-03-24 14:26:24 +01:00
Dario Gieselaar 6bd8755df4
[APM] Re-revert "Collect telemetry about data/API performance" (#61030)
* Revert "Revert "[APM] Collect telemetry about data/API performance (#51612)""

This reverts commit 6de7f2a62b.

* Update transaction mock data to reflect the type
2020-03-24 13:38:15 +01:00
Shahzad d31e5f524f
[Uptime] Ml detection of duration anomalies (#59785)
* add flyout

* add state

* update state

* ad job

* update

* updat

* add ml analyze button

* update api

* use differential colors for duration chart

* remove duration chart gql

* update type

* type fix

* fix tyoe

* update translation

* update test

* update conflicts

* update anomaly record

* chart

* added annotations

* update error handling

* update

* update types

* fixed types

* fix types

* update types

* update

* update

* remove unnecessary change

* remove unnecessary change

* fix type

* update

* save

* update pr

* update tets

* update job deletion

* update

* update tets

* upadte tests

* fix types

* update title text

* update types

* fixed tests

* update tests and types

* updated types

* fix PR feedback

* unit test

* update more types

* update test and manage  job

* resolve conflicts

* types

* remove unnecessary change

* revert ml code

* revert ml code

* fixed formatting issues pointed by pr feedback
2020-03-24 12:34:43 +01:00
Dario Gieselaar 85c0be357a
[APM] Threshold alerts (#59566)
* Add alerting/actions permissions for APM

* Export TIME_UNITS, getTimeUnitLabel from triggers actions UI plugin

* Add APM alert types and UI

* Review feedback

* Use Expression components for triggers

* Update alert name for transaction duration

* Change defaults for error rate trigger
2020-03-24 11:15:10 +01:00
Dario Gieselaar 8ef35c8f87
[APM] add service map config options to legacy plugin (#61002) 2020-03-24 09:28:29 +01:00
Uladzislau Lasitsa c26493d56c
[App Arch] migrate legacy CSS to new platform (core_plugins/kibana_react) (#59882)
* Migrate markdown styles to the new platform

* Removed unused import

* Update index.ts

* Removed not need layer

* Fixed paths

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-24 11:19:42 +03:00
Andrew Goldstein 462be16879
[SIEM] Overview: Recent cases widget (#60993)
## [SIEM] Overview: Recent cases widget

Implements the new `Recent cases` widget on the Overview page.

Recent cases shows the last 3 recently created cases, per the following animated gif:

![recent-cases](https://user-images.githubusercontent.com/4459398/77357982-ae550a80-6d0e-11ea-90d0-62fa5407eea5.gif)

### Markdown case descriptions

Markdown case descriptions are rendered, per the following animated gif:

![markdown-description](https://user-images.githubusercontent.com/4459398/77358163-f7a55a00-6d0e-11ea-8b85-dd4b3ff093ee.gif)

### My recently reported cases

My recently reported cases filters the widget to show only cases created by the logged-in user, per the following animated gif:

![my-recent-cases](https://user-images.githubusercontent.com/4459398/77358223-14419200-6d0f-11ea-8e4a-25cd55fdfc44.gif)

### No cases state

A message welcoming the user to create a case is displayed when no cases exist, per the following screenshot:

![no-cases-created](https://user-images.githubusercontent.com/4459398/77358338-4ce16b80-6d0f-11ea-98d3-5de1be19a935.png)

### Other changes

- [x] Case-related links were updated to ensure URL state parameters, e.g. global date selection, carry-over as the user navigates through case views
- [x] Recent timelines was updated to only show the last 3 recent timelines (down from 5)
- [x] All sidebar widgets have slightly more compact spacing

Tested in:
* Chrome `80.0.3987.149`
* Firefox `74.0`
* Safari `13.0.5`
2020-03-24 01:14:41 -06:00
Tudor Golubenco e6dbc3fc21
[SIEM] Updates process and TLS tables to use ECS 1.5 fields (#60854)
* Added new process filter
* Use new ECS TLS fields
2020-03-24 08:10:10 +01:00
spalger 6de7f2a62b Revert "[APM] Collect telemetry about data/API performance (#51612)"
This reverts commit 13baa51561.
2020-03-23 22:26:15 -07:00
Xavier Mouligneau 81b3723633
[SIEM] [CASES] Build lego blocks case details view (#60864)
* modify API to get the total comments in _find + Add user action to track what user are doing + create _pushed api to know when case have been pushed

* fix rebase

* add connector name in case configuration saved object

* fix total comment in all cases

* totalComment bug on the API

* integrate user action API with UI

* fix merged issue

* integration APi to push to services with UI

* Fix bugs

* wip to show pushed service in ui

* finish the full flow with pushing to service now

* review about client discrepency

* clean up + review

* merge issue

* update error msgs to info

* add aria label + fix but on add/remove tags

* fix i18n

Co-authored-by: Christos Nasikas <christos.nasikas@elastic.co>
2020-03-23 19:26:49 -04:00
Ryland Herrick e3431752f3
[SIEM] Move Timeline Template field to first step of rule creation (#60840)
* Move timeline template to Define step of Rule creation

This required a refactor/simplification of the step_define_rule logic to
make things work. In retrospect I think that the issue was we were not
handling incoming `defaultValues` props well, which was causing local
component state to be lost.

Now that we're doing a merge and removed a few unneeded local useStates,
things are a) working and b) cleaner

* Fix Rule details/edit view with updated data

We need to fix the other side of the equation to get these to work: the
timeline data was moved to a different step during creation, but when
viewing on the frontend we split the rule data back into the separate
"steps."

* Remove unused import

* Fix bug in formatDefineStepData

I neglected to pass through index in a previous commit.

* Update tests now that timeline has movied to a different step

* Fix more tests

* Update StepRuleDescription snapshots

* Fix cypress Rule Creation test

Timeline template moved, and so tests broke.

* Add unit tests for filterRuleFieldsForType
2020-03-23 18:09:30 -05:00
Tim Sullivan 5755b2ac52
[Reporting/New Platform Migration] Use a new config service on server-side (#55882)
* [Reporting/New Platform Migration] Use a new config service on server-side

* unit test for createConfig

* use promise.all and remove outdated comment

* design feedback to avoid handling the entire config getter

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-23 16:02:44 -07:00
Nathan Reese dc31736dd2
[Maps] Default ES document layer scaling type to clusters and show scaling UI in the create wizard (#60668)
* [Maps] show scaling panel in ES documents create wizard

* minor fix

* remove unused async state

* update create editor to use ScalingForm

* default geo field

* ts lint errors

* remove old dynamic filter behavior

* update jest tests

* eslint

* remove indexCount route

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-23 16:40:43 -06:00
Dario Gieselaar 13baa51561
[APM] Collect telemetry about data/API performance (#51612)
* [APM] Collect telemetry about data/API performance

Closes #50757.

* Ignore apm scripts package.json

* Config flag for enabling/disabling telemetry collection
2020-03-23 23:08:44 +01:00
Aleh Zasypkin fa69765e4b
Implement Kibana Login Selector (#53010) 2020-03-23 22:45:26 +01:00
Nathan L Smith a0a85dbb90
Simplify service map layout (#60949)
Clean up the cytoscape component and event handlers to simplify the layout logic.

Make all centering animations animated.

Add logging of cytoscape events when we're in debug mode.

Add Elasticsearch icon.
2020-03-23 16:13:56 -05:00
Dario Gieselaar d5c13c043b
[APM] use span.destination.service.resource (#60908)
* [APM] use span.destination.service.resource

Closes #60405.

* update snapshots

Co-authored-by: Nathan L Smith <smith@nlsmith.com>
2020-03-23 16:13:32 -05:00
Wylie Conlon f7a3049843
[Lens] Improve suggestions when dragging field for the second time (#60687)
* [Lens] Improve suggestions when dragging into an existing visualization

* Include 0 metrics case

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-23 17:11:09 -04:00
Wylie Conlon 3c924d9f87
[Lens] Use new charts APIs to simplify series naming (#60708)
* build: update @elastic/charts to v18.1.0

* tests: fix breaking-change on legendItem className

* fix: type changes and ml custom tooltip data

* tests: fix snapshot test

* [Lens] Use new charts APIs to simplify series naming

* Fix types

* Fix naming

* Remove accidental file

* Update snapshots

Co-authored-by: Marco Vettorello <vettorello.marco@gmail.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-23 16:44:57 -04:00
Thomas Neirynck 88d41fa352
[Maps] Remove client-side scaling of ordinal values (#58528)
This removes the rescaling of ordinal values to the [0,1] domain, and modifies the creation of the mapbox-style rules to use the actual RangeStyleMeta-data. This is an important prerequisite for Maps handling tile vector sources. For these sources, Maps does not have access to the raw underlying GeoJson and needs to use the stylemeta directly.
2020-03-23 16:09:09 -04:00
Nathan Reese d32c4c8390
[Maps] fix point to point source regression (#60930)
* [Maps] fix pew pew regression

* add functional test for pew pew source
2020-03-23 13:40:24 -06:00
Justin Kambic ef48205f15
[Uptime] Add configurable page size to monitor list (#60573)
* Add configurable page size to monitor list.

* Add functional tests for new feature.

* Update outdated snapshots.

* Extract UI concerns for size select component to dedicated function.

* Add missing props to resolve type check errors.

* Add unit test for new UI functionality.

* Refresh snapshots after additional changes.

* Introduce new parameter to API test function.

* Update flex behavior for new UI component.

* Clean up code in functional page object file.

* Refresh snapshots that were broken by previous feedback implementation.

* Fix async error introduced to test framework by other patch.
2020-03-23 15:18:11 -04:00
Søren Louv-Jansen 65359856a0
[APM] Remote Agent Config: Add additional (java) options (#59860) 2020-03-23 20:14:26 +01:00
Alejandro Fernández Haro 452193fdba
[Telemetry] Server-side Migration to NP (#60485)
* [Telemetry] Migration to NP

* Telemetry management advanced settings section + fix import paths + dropped support for injectVars

* Fix i18nrc paths for telemetry

* Move ui_metric mappings to NP registerType

* Fixed minor test tweaks

* Add README docs (#60443)

* Add missing translation

* Update the telemetryService config only when authenticated

* start method is not a promise anymore

* Fix mocha tests

* No need to JSON.stringify the API responses

* Catch handleOldSettings as we used to do

* Deal with the forbidden use case in the optIn API

* No need to provide the plugin name in the logger.get(). It is automatically scoped + one missing CallCluster vs. APICaller type replacement

* Add empty start method in README.md to show differences with the other approach

* Telemetry collection with X-Pack README

* Docs update

* Allow monitoring collector to send its own ES client

* All collections should provide their own ES client

* PR feedback

* i18n NITs from kibana-platform feedback

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-23 18:49:38 +00:00
MadameSheema 10afcf4be8
[SIEM] Adds 'Open one signal' Cypress test (#60484)
* adds data for having closed signals

* adds 'Open one signal when more than one closed signals are selected' test'

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-23 18:46:35 +01:00
Ryland Herrick 21e8cea183
[SIEM] Add license check to ML Rule form (#60691)
* Gate ML Rules behind a license check

If they don't have a Platinum or Trial license, then we disable the ML
Card and provide them a link to the subscriptions marketing page.

* Add aria-describedby for new ML input fields

* Add data-test-subj to new ML input fields

* Remove unused prop

This is already passed as isLoading

* Fix capitalization on translation id

* Declare defaulted props as optional

* Gray out entire ML card when ML Rules are disabled

If we're editing an existing rule, or if the user has an insufficient
license, we disable both the card and its selectability. This is more
visually striking, and a more obvious CTA.
2020-03-23 11:10:40 -05:00
Steph Milovic 969811eb20
[SIEM] [Cases] Update case icons (#60812) 2020-03-23 09:42:35 -06:00
Luke Elmers 3401ae42e0
Goodbye, legacy data plugin 👋 (#60449) 2020-03-23 09:17:27 -06:00
Cauê Marcondes 7eec879547
[APM]Create custom link from Trace summary (#59648)
* adding custom links to actions menu

* user should have at least gold license to be able to manage custom links

* replacing variable for the correspondent value

* refactoring license prompt to a shared place

* fixing query to return filters that were saved separated by comma

* refactoring license prompt to a shared place

* fixing query to return filters that were saved separated by comma

* adding unit test, splitting value by comma and removing empty ones

* adding custom links to actions menu

* UI fixes

* moving stuff to common

* changing flyout texts

* refactoring getSelectOption

* refactoring getSelectOption

* refactoring filter options name

* adding preview panel

* adding preview panel

* fixing test

* adding unit test for replace template variables

* fixing typo

* polishing preview panel

* fixing pr comments

* fixing pr comments

* adding links

* fixing unit test

* removing servicemap license prompt
2020-03-23 12:48:58 +01:00
Tudor Golubenco 7bafeb1d6f
[SIEM] Use ECS categorisation for Authentication widgets (#60734)
* Update the Authentication histogram to use categorization fields

* linting

* Use categorization fields for the Authentications table

* Use event.outcome for authentications KPIs

* Adjust mock to fix unit test

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-23 10:29:38 +01:00
Shahzad b909742a40
[Uptime]Update fetch effect failed action handling (#60742)
* update fetch effect

* added test

* update type
2020-03-22 18:17:03 +01:00
Andrew Cholakian c2e57af277
[Uptime] Add Settings Page (#53550)
Adds a settings page to the Uptime UI. The settings page values are per-space. The only current setting is heartbeatIndices.

To test this against alternate indices try changing setup.ilm.rollover_alias in heartbeat.yml to something like alt-prefix. See the ilm docs for more details.

This should be tested with read-only and write only roles. To test this in kibana try creating two users with two different roles in kibana. One roll should have read access to the Uptime space in kibana. The other should have all access. Both should have read permissions for the heartbeat-* index pattern.

This patch also splits API perms from just heartbeat to uptime-read and uptime-write.

This patch also refactors some of the header component functionality, using hooks for breadcrumbs, and making the top links optional.

Fixes elastic/uptime#43
2020-03-21 18:13:01 -05:00
Søren Louv-Jansen d3a9531270
[APM] service maps: avoid unnecesary useDeepObjectIdentity (#60836)
* [APM] service maps: avoid unnecesary `useDeepObjectIdentity`

* Remove unused dep
2020-03-21 21:41:54 +01:00
Ryland Herrick 9e911469a3
[SIEM] Fix patching of ML Rules (#60830)
* Allow ML Rules to be patched

* Test passing of params from our patch routes to our helpers

Since patchRules accepts a partial there's no way to verify this in
typescript, we need regression tests instead.

* Update lists when importing with overwrite

This was simply missed earlier.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-20 21:32:51 -05:00
Oliver Gupte 9de2d815fc
[APM] Service Map - Separate overlapping edges by rotating nodes (#60477)
* Adds rotation transform which does the top->bottom to left->right
transformation + an extra 5 degrees which results in taxi edges
separating when rendered.

* PR feedback to reduce edge width on hover, and assure that connected
edges are highlighted when node is selected/focused

* update disabled kuery bar placeholder text for service map
2020-03-20 18:56:08 -07:00
Frank Hassanabad 74ceceb324
[SIEM][Detection Engine] Adds test scripts for machine learning feature
## Summary

* Adds ad-hoc testing scripts for machine learning feature

## Testing

```ts
./post_rule.sh ./rules/queries/query_with_machine_learning.json
./update_rule.sh ./rules/updates/update_machine_learning.json
./patch_rule.sh ./rules/patches/update_machine_learning.json
```
2020-03-20 17:33:09 -06:00
Steph Milovic cf9b64eada
[SIEM] [Cases] Create case from timeline (#60711) 2020-03-20 15:14:09 -06:00
Wylie Conlon fc24febec9
[Lens] Resetting a layer generates new suggestions (#60674)
* [Lens] Resetting a layer generates new suggestions

* Include preview in tests
2020-03-20 17:03:59 -04:00
MadameSheema 5d93a0890c
increases loading timeout (#60788) 2020-03-20 21:52:26 +01:00
Catherine Liu ca55db53c1
[Canvas] Switch to using EUI SuperDatePicker in time filter el… (#59249)
* Replaced custom custom time filter component with EuiSuperDatePicker

* Added advanced settings dateFormat and timepicker:quickRanges to time filter

* Round up end date in time filter

* Updated snapshots

* Fixed timefilter function

* Fixed import

* reduce margin between datepicker and selection border (#59498)

* Added time_filter renderer stories

* Updated storyshots

* Updated timefilter element thumbnail

* Updated snapshots

* Used Filter type instead of any

* Renamed timefilter components folder

* Removed unused time range i18n strings

* Updated translations

* BROKEN

* Updated snapshots

* Revert "BROKEN"

This reverts commit e3b8bd7865.

* Fix time-filter element preview image

* Upated time filter preview image

* Fix time-filter renderer

* fixed storybook tests

* Fixed time filter renderer
2020-03-20 13:32:01 -07:00
Chandler Prall 0bf62cbf3e
Upgrade EUI to 21.0.1 (#60282)
* update to eui 21.0.1

* most changes needed for search bar ts changes

* Passing types

* snapshots

* jest tests

* Removed IQuery placeholder types

* Updated functional test to only look at table headers with content

* Moved 'filters' definition around in api docs

* Update types

* update snapshot

* typo

* Move DATA_FRAME_TASK_STATE enum to its own file to fix x-pack functional test config imports

* merge public api 'changes'

Co-authored-by: patrykkopycinski <patryk.kopycinski@elastic.co>
Co-authored-by: Patryk Kopycinski <contact@patrykkopycinski.com>
2020-03-20 14:07:04 -06:00
Tim Sullivan d896292b6f
[Reporting] revert skip telemetry step (#60450)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-20 12:37:22 -07:00
Wylie Conlon 6d1479fc08
[Lens] Fix bug when removing dimensions from non-XY chart (#60704) 2020-03-20 14:59:51 -04:00
Nathan L Smith b5f460fb6e
Remove all client-side map munging (#60701)
Remove the getCytoscapeElements function.

On the server:

* Replace `source` with `sourceData`, `destination` with `targetData`, `source.id` with `source`, and `destination.id` with `target`.
* Return a single array as an `elements` property instead of `nodes` and `connections`
* Map all of the items data to be inside of a `data` object
* Replace SERVICE_AGENT_NAME with AGENT_NAME
* Add some missing constants

On the client:

* Remove getCytoscapeElements
* Move all presentation-specific data transformation to use the original attributes in the place where they're needed
* Remove `href` since it wasn't being used
* Move BetaBadge to its own file
* Move cytoscapeDivStyle to cytoscapeOptions
* Fix storybook to work with new data formats
2020-03-20 13:14:39 -05:00
Chris Roberson 3a396027f6
[Monitoring] Migrate server to NP (#56675)
* First pass

* First pass

* Add new routes

* Getting closer

* Remove legacy server code, and other fixes

* Register the plugin with xpack

* Pass a legacy client to telemetry

* Suport callWithInternalUser

* Remove this

* More NP work

* Fix some tests

* Fix broken test

* Move over new telemetry changes, and fix other issues

* Fix TODO item

* Reuse the same schema as elasticsearch module

* Use a singular config definition here

* Disable this for now

* Use the right method

* Use custom config again

* Tweak the config to make this optional

* Remove these

* Remove these unnecessary files

* Fix jest test

* Fix some linting issues

* Fix type issue

* Fix localization issues

* Use the elasticsearch config

* Remove todos

* Fix this check

* Move kibana alerting over

* PR feedback

* Use new metrics core service

* Change config for xpack_api_polling_frequency_millis

* Make sure this is disabled for now

* Disable both

* Update this to the new function

* Tighten up legacy api needs

* Check for existence

* Fix jest tests

* Cleaning up the plugin definition

* Create custom type in our plugin

* Revert this change

* Fix CI issues

* Add these tests back

* Just use a different collector type

* Handle errors better

* Use custom type

* PR feedback

* Fix type issues

* PR feedback
2020-03-20 14:02:15 -04:00
Gidi Meir Morris 55814addac
[Alerting] Unifies the use of a single constant for Api urls in alerting & actions (#60430)
Unifies the use of a single constant for Api urls in alerting & actions
2020-03-20 17:39:07 +00:00
Nathan Reese 103f217964
[Maps] convert Vector style descriptor to typescript (#60526)
* vector style descriptor TS

* revert color_utils TS conversion

* clean up TS errors

* updated blended layer to use vector style descriptor type

* fix eslint error

* use FIELD_ORIGIN.SOURCE instead of SOURCE_DATA_ID_ORIGIN

* fix other incorrect uses of SOURCE_DATA_ID_ORIGIN

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-20 11:29:31 -06:00
Marco Vettorello 88612743a9
Update dependency @elastic/charts to v18.1.0 (#60578) 2020-03-20 17:37:11 +01:00
Daniil Suleiman 1a1e2e7b2e
[NP] Remove ui/agg_types dependencies and move paginated table to kibana_legacy (#60276)
* fix agg type shims and move paginated table to kibana_legacy

* fix types

* fix i18n ids

* fix unit tests

* Update imports

* Remove ui/agg_types imports

* Clean up vis_default_editor plugin

* Remove agg_types imports in vis_type_table

* Clean up x-pack

* Clean up vis_type_vislib

* Last cleanups

* Update docs

* Mock Schemas in vis_type_metric

* Use data plugin mocks

* Remove ui/directives/paginate reference

* Remove snapshot

* Remove shallow

Co-authored-by: Joe Reuter <johannes.reuter@elastic.co>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-20 18:39:44 +03:00
patrykkopycinski 87e07ef64f
[SIEM] Fix types in rules tests (#60736)
* [SIEM] Fix types in rules tests

* Update create_rules.test.ts

* Update create_rules.test.ts
2020-03-20 14:57:07 +00:00
Mike Côté 851b8a82a5
License checks for actions plugin (#59070)
* Define minimum license required for each action type (#58668)

* Add minimum required license

* Require at least gold license as a minimum license required on third party action types

* Use strings for license references

* Ensure license type is valid

* Fix some tests

* Add servicenow to gold

* Add tests

* Set license requirements on other built in action types

* Use jest.Mocked<ActionType> instead

* Change servicenow to platinum

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

* Make actions config mock and license state mock use factory pattern and jest mocks (#59370)

* Add license checks to action HTTP APIs (#59153)

* Initial work

* Handle errors in update action API

* Add unit tests for APIs

* Make action executor throw when action type isn't enabled

* Add test suite for basic license

* Fix ESLint errors

* Fix failing tests

* Attempt 1 to fix CI

* ESLint fixes

* Create sendResponse function on ActionTypeDisabledError

* Make disabled action types by config return 403

* Remove switch case

* Fix ESLint

* Add license checks within alerting / actions framework (#59699)

* Initial work

* Handle errors in update action API

* Add unit tests for APIs

* Verify action type before scheduling action task

* Make actions plugin.execute throw error if action type is disabled

* Bug fixes

* Make action executor throw when action type isn't enabled

* Add test suite for basic license

* Fix ESLint errors

* Stop action task from re-running when license check fails

* Fix failing tests

* Attempt 1 to fix CI

* ESLint fixes

* Create sendResponse function on ActionTypeDisabledError

* Make disabled action types by config return 403

* Remove switch case

* Fix ESLint

* Fix confusing assertion

* Add comment explaining double mock

* Log warning when alert action isn't scheduled

* Disable action types in UI when license doesn't support it (#59819)

* Initial work

* Handle errors in update action API

* Add unit tests for APIs

* Verify action type before scheduling action task

* Make actions plugin.execute throw error if action type is disabled

* Bug fixes

* Make action executor throw when action type isn't enabled

* Add test suite for basic license

* Fix ESLint errors

* Stop action task from re-running when license check fails

* Fix failing tests

* Attempt 1 to fix CI

* ESLint fixes

* Return enabledInConfig and enabledInLicense from actions get types API

* Disable cards that have invalid license in create connector flyout

* Create sendResponse function on ActionTypeDisabledError

* Make disabled action types by config return 403

* Remove switch case

* Fix ESLint

* Disable when creating alert action

* Return minimumLicenseRequired in /types API

* Disable row in connectors when action type is disabled

* Fix failing jest test

* Some refactoring

* Card in edit alert flyout

* Sort action types by name

* Add tooltips to create connector action type selector

* Add tooltips to alert flyout action type selector

* Add get more actions link in alert flyout

* Add callout when creating a connector

* Typos

* remove float right and use flexgroup

* replace pixels with eui variables

* turn on sass lint for triggers_actions_ui dir

* trying to add padding around cards

* Add callout in edit alert screen when some actions are disabled

* improve card selection for Add Connector flyout

* Fix cards for create connector

* Add tests

* ESLint issue

* Cleanup

* Cleanup pt2

* Fix type check errors

* moving to 3-columns cards for connector selection

* Change re-enable to enable terminology

* Revert "Change re-enable to enable terminology"

This reverts commit b497dfd6b6.

* Add re-enable comment

* Remove unecessary fragment

* Add type to actionTypeNodes

* Fix EuiLink to not have opacity of 0.7 when not hovered

* design cleanup in progress

* updating classNames

* using EuiIconTip

* Remove label on icon tip

* Fix failing jest test

Co-authored-by: Andrea Del Rio <delrio.andre@gmail.com>

* Add index to .index action type test

* PR feedback

* Add isErrorThatHandlesItsOwnResponse

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Andrea Del Rio <delrio.andre@gmail.com>
2020-03-20 10:49:37 -04:00
Aaron Caldwell 592ded89c0
[Maps] Update layer dependencies to NP (#59585)
* Layers dir up through sources migrated. Kibana services updated

* Create separate init method for plugin setup, leverage in embeddable factory

* Add NP timefilter, http, IndexPatternSelect

* Pull vis color utils into Maps

* Add NP dark mode and toast handling. Some fixes

* Init autocomplete and indexPattern via normal paths

* Test fixes and clean up

* Update index pattern and autocomplete refs. Make getters functions

* Fix remaining broken jest tests

* Update inspector start contract

* Clean up plugin and legacy files. Fix type issues

* Set inspector in plugin start method not external function

* Keep both injected var functions (legacy and NP). Move inspector init back to separate init function

* Add back ts-ignore on NP kibana services import
2020-03-20 08:17:05 -06:00
Angela Chuang ab44099739
[SIEM] Export timeline (#58368)
* update layout

* add utility bars

* add icon

* adding a route for exporting timeline

* organizing data

* fix types

* fix incorrect props for timeline table

* add export timeline to tables action

* fix types

* add client side unit test

* add server-side unit test

* fix title for delete timelines

* fix unit tests

* update snapshot

* fix dependency

* add table ref

* remove custom link

* remove custom links

* Update x-pack/legacy/plugins/siem/common/constants.ts

Co-Authored-By: Xavier Mouligneau <189600+XavierM@users.noreply.github.com>

* remove type ExportTimelineIds

* reduce props

* Get notes and pinned events by timeline id

* combine notes and pinned events data

* fix unit test

* fix type error

* fix type error

* fix unit tests

* fix for review

* clean up generic downloader

* review with angela

* review utils

* fix for code review

* fix for review

* fix tests

* review

* fix title of delete modal

* remove an extra bracket

Co-authored-by: Xavier Mouligneau <189600+XavierM@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-20 10:09:12 +00:00
patrykkopycinski 8f1e22f078
[SIEM] Add support for actions and throttle in Rules (#59641) 2020-03-20 10:54:51 +01:00
Spencer c3957d8554
[canvas/shareable_runtime] sync sass loaders with kbn/optimizer (#60653)
* [canvas/shareable_runtime] sync sass loaders with kbn/optimizer

* limit sass options to those relevant in this context

Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-19 17:41:28 -07:00
Ryland Herrick 182acdb666
[SIEM] Fixes Modification of ML Rules (#60662)
* Fix updating of ML rules

* Add a regression test for updating ML Rules

* Allow ML Rules to be patched

And adds a regression unit test.

* Allow ML rule params to be imported when overwriting

* Add a basic regression test for creating a rule with ML params

* Prevent users from changing an existing Rule's type
2020-03-19 19:33:36 -05:00
Steph Milovic 0163a71d24
[SIEM] [Case] Bulk status update, add comment avatar, id => title in breadcrumbs (#60410) 2020-03-19 17:08:53 -06:00
Tim Sullivan ce2e3fd621
[Reporting] Allow reports to be deleted in Management > Kibana > Reporting (#60077)
* [Reporting] Feature Delete Button in Job Listing

* refactor listing buttons

* multi-delete

* confirm modal

* remove unused

* fix test

* mock the id generator for snapshotting

* simplify

* add search bar above table

* fix types errors
2020-03-19 12:36:19 -07:00
Catherine Liu 3bd3364a55
[Canvas] Add Lens embeddables (#57499)
* Added lens embeddables to embed flyout

Fixed import

embedded panel styles (#58654)

Merging to WIP draft branch

* Added i18n strings for savedLens

* Added tests for lens embeddables

* Updated tests

* Updated tests

* Added style overrides for lens table

* DDisables triggers on lens emebeddable

* Updated test

* Sets embeddable view mode according to app state

* Fix embeddable component

* Removed embeddable view mode logic

* Removed unused import
2020-03-19 09:58:22 -07:00
Justin Kambic fcf439625b
[Uptime] Add Alerting UI (#57919)
* WIP trying things.

Add new alert type for Uptime.

Add defensive checks to alert executor.

Move status check code to dedicated adapter function.

Clean up code.

* Port adapter function to dedicated file.

* WIP.

* Working on parameter selection.

* Selector expressions working.

* Working on actions.

* Change anchor prop for popovers.

* Reference migrated alerting plugin.

* Clean up code for draft.

* Add button to expose flyout. Clean up some client code.

* Add test for requests function, add support for filters.

* Reorganize and clean up files.

* Add location and filter support to monitor status request function.

* Add tests for monitor status request function.

* Specify default action group id in alert registration.

* Extract repeated string value to a constant.

* Move test file to server in NP plugin.

* Update imports after NP migration.

* Fix UI bug that caused incorrect location selections in alert creation.

* Change alert expression language to clarify meaning.

* Add ability for user to select timerange units.

* Add code that fixes active item highlighting.

* Add better default value for active index selection.

* Introduce dedicated field number component.

* Add message to status check alert.

* Add tests for context message.

* Formalize alert action group definitions.

* Extract monitor id squashing from context message generator.

* Write test for monitor ID uniqueness function.

* Add alert state creator function and tests.

* Update action group id value.

* Add tests for alert factory and executor function.

* Rename alert context props to be more domain-specific.

* Clean up unnecessary type markup.

* Clean up alert ui controls file.

* Better organize new registration code.

* Simplify some logic code.

* Clean up bootstrap code.

* Add unit tests for alert type.

* Delete temporary test code from triggers_actions_ui.

* Rename a test file.

* Add some comments to annotate a file.

* Add io-ts type checking to alert create validation and alert executor.

* Add translation of plaintext content string.

* Further simplify monitor status alert validation.

* Add io-ts type checking to alert params.

* Update a comment.

* Prefer inline snapshots to more error-prone assertions.

* Clean up and comment request function.

* Rename a symbol.

* Fix broken types in reducer file and add a test.

* Fix a validation logic error and add tests.

* Delete unused import.

* Delete obsolete dependency.

* Fix function call to have correct parameters.

* Fixing some import weirdness.

* Reintroduce accidentally-deleted code.

* Delete unneeded require from legacy entry file.

* Remove unneeded connected component.

* Update flyout controls for new interface and delete connected components.

* Remove unneeded require from app index file.

* Introduce data-test-subj attributes to various components to assist with functional tests.

* Introduce functional test helpers for alert flyout.

* Add functional test arch and a test for alerting UI to ES SSL test suite.

* Add explicit exports to module index.

* Reorganize file to keep interfaces closer to their implementations.

* Move create alert button to better position.

* Clean up a file.

* Update a functional test attribute, clean up a file, rename a selector, add tests.

* Add a comment.

* Make better default alert message, translate messages, add/update tests.

* Fix broken type.

* Update obsolete snapshot.

* Introduce mock provider to tests and update snapshots.

* Reduce a strange type to `any`.

* Add alert flyout button connected component.

* Add alert flyout wrapper connected component.

* Create connected component for alert monitor status alert.

* Clean up index files.

* Update i18nrc file to cover translation in server plugin code.

* Fix broken imports.

* Update test snapshots.

* Prefer more descriptive type.

* Prefer more descriptive type.

* Prefer built-in React propType to custom.

* Prefer simpler validation.

* Add whitespace to clean up file.

* Extract function and write tests.

* Simplify validation function.

* Add navigate to alerting button.

* Move context item inside the items list.

* Clean up alert creation component.

* Update type check parsing and error messaging, and update snapshot/test assertions.

* Update broken snapshot.

* Update README for running functional tests.

* Update functional test service to reflect improved UX.

* Fix broken type that resulted from a mistake during a merge resolution.

* Add spacer between alert title and kuery bar.

* Update the id and name of our alert type because it was never changed from placeholder value.

* Rename alert keys.

* Fix broken unit tests.

* Add aria-labels to alert UI.

* Implement design feedback.

* Fix broken test snapshots.

* Add missing props to unit tests to staisfy updated types.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-19 12:50:05 -04:00
Steph Milovic d5ed93ee63
[SIEM] [Cases] Case closed and add user email (#60463) 2020-03-19 10:27:41 -06:00
MadameSheema b0a6b302ad
fixes drag and drop flakiness (#60625) 2020-03-19 16:32:19 +01:00
Jean-Louis Leysens 254cf99339
[Cross Cluster Replication] NP Shim (#60121)
* Public in WiP state, removed all 'ui/' imports

* First iteration of public shimmed and working

* A whole lotta WIP server side

* Server-side to using the NP router + client side changes

Updated the client code to properly encode requests to the
server. Did first E2E test.

Route tests are probably broken, need to fix them.

* Removed unused error wrapping code

* Update client Jest tests

* Add breadcrumbs service mock

* Fix server side Jest tests

* Add helper functions file for server side Jest tests

* Fix API integration tests

* Fixed boolean logic mistake in due to refactor in index mgmt ext.

Also migrated to the a more NP friendly version of index mgmt
extension.

* Remove unused import

* Clean up some cruft and refactor URL variable names

* Fix stringification of body and fix boolean server logic

* Fix mocha

Folder called __tests__ with Jest tests was breaking mocha.

* Refactor to Jest test

* Fix types issues in jest test

* Migrate to new config-schema API

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-19 15:42:25 +01:00
Christos Nasikas 6ed2918b6c
[SIEM][CASE] Configuration page action bar (#60608)
* Add bottom bar

* Add listeners
2020-03-19 15:06:33 +02:00
Mike Côté 4efeeac560
Sort by name when fetching alerts and connectors (#60506)
* Sort by name when fetching alerts and connectors

* Fix jest tests

* Add functional test

* Fix failing jest test
2020-03-19 08:06:51 -04:00
Dario Gieselaar 9cd0a36740
[APM] Optimize service map query (#60412)
* [APM] Optimize service map query

Closes #60411.

- Chunk trace lookup
- Remove pagination, move dedupe logic to server

* Fix imports

* Fix imports again

Co-authored-by: Nathan L Smith <smith@nlsmith.com>
2020-03-19 08:37:58 +01:00
Frank Hassanabad 01571b6739
[SIEM][Detection Engine] Adds lists feature flag and list values to the REST interfaces
## Summary

* https://github.com/elastic/kibana/issues/60022
* Adds the feature flag for simple list values
* Adds the boolean filters of "and", "and not" to further filter based on simple values
* Adds unit tests and e2e tests for the values.
* Most tests can include the simple list values but some have to be skipped until we move those to more functions or just enable simple list values as a permanent feature. 
* DOES NOT FILTER ON THE VALUES JUST YET (That will be a follow on PR)

## Testing:

To turn on/off the feature flag do this with an env variable (set this in your .bashrc/.zshrc):

```ts
export ELASTIC_XPACK_SIEM_LISTS_FEATURE=true
```

Expect to see this error in the console when the environment variable is set:

```ts
server    log   [11:41:16.245] [error][plugins][siem] You have activated the lists feature flag which is NOT currently supported for SIEM! You should turn this feature flag off immediately by un-setting the environment variable: ELASTIC_XPACK_SIEM_LISTS_FEATURE and restarting Kibana
```

Expect create and update to work when the environment variable is set and look like this:

```ts
./update_rule.sh ./rules/updates/update_list.json 
{
  "created_at": "2020-03-15T17:42:37.074Z",
  "updated_at": "2020-03-15T17:54:22.427Z",
  "created_by": "yo",
  "description": "Query with a list",
  "enabled": true,
  "false_positives": [],
  "from": "now-6m",
  "id": "c602e3f6-713b-4f43-9bdd-b60fbfead1c5",
  "immutable": false,
  "interval": "5m",
  "rule_id": "query-with-list",
  "language": "kuery",
  "output_index": ".siem-signals-hassanabad-frank-default",
  "max_signals": 100,
  "risk_score": 1,
  "name": "Query with a list",
  "query": "user.name: root or user.name: admin",
  "references": [],
  "severity": "high",
  "updated_by": "yo",
  "tags": [],
  "to": "now",
  "type": "query",
  "threat": [],
  "version": 6,
  "lists": [
    {
      "field": "source.ip",
      "boolean_operator": "and",
      "values": [
        {
          "name": "127.0.0.1",
          "type": "value"
        }
      ]
    },
    {
      "field": "host.name",
      "boolean_operator": "and not",
      "values": [
        {
          "name": "rock01",
          "type": "value"
        }
      ]
    }
  ],
  "status": "succeeded",
  "status_date": "2020-03-15T17:42:40.718Z",
  "last_success_at": "2020-03-15T17:42:40.718Z",
  "last_success_message": "succeeded"
}
```

```ts
./post_rule.sh ./rules/queries/query_with_list.json 
{
  "created_at": "2020-03-15T17:42:37.074Z",
  "updated_at": "2020-03-15T17:42:37.116Z",
  "created_by": "yo",
  "description": "Query with a list",
  "enabled": true,
  "false_positives": [],
  "from": "now-6m",
  "id": "c602e3f6-713b-4f43-9bdd-b60fbfead1c5",
  "immutable": false,
  "interval": "5m",
  "rule_id": "query-with-list",
  "language": "kuery",
  "output_index": ".siem-signals-hassanabad-frank-default",
  "max_signals": 100,
  "risk_score": 1,
  "name": "Query with a list",
  "query": "user.name: root or user.name: admin",
  "references": [],
  "severity": "high",
  "updated_by": "yo",
  "tags": [],
  "to": "now",
  "type": "query",
  "threat": [],
  "version": 1,
  "lists": [
    {
      "field": "source.ip",
      "boolean_operator": "and",
      "values": [
        {
          "name": "127.0.0.1",
          "type": "value"
        }
      ]
    },
    {
      "field": "host.name",
      "boolean_operator": "and not",
      "values": [
        {
          "name": "rock01",
          "type": "value"
        },
        {
          "name": "mothra",
          "type": "value"
        }
      ]
    }
  ]
}
```

```ts
./patch_rule.sh ./rules/patches/update_list.json   
{
  "created_at": "2020-03-15T18:02:52.434Z",
  "updated_at": "2020-03-15T18:02:57.675Z",
  "created_by": "yo",
  "description": "Query with a list",
  "enabled": true,
  "false_positives": [],
  "from": "now-6m",
  "id": "40b7c2fb-83b4-4820-bf7c-056f3a631126",
  "immutable": false,
  "interval": "5m",
  "rule_id": "query-with-list",
  "language": "kuery",
  "output_index": ".siem-signals-hassanabad-frank-default",
  "max_signals": 100,
  "risk_score": 1,
  "name": "Query with a list",
  "query": "user.name: root or user.name: admin",
  "references": [],
  "severity": "high",
  "updated_by": "yo",
  "tags": [],
  "to": "now",
  "type": "query",
  "threat": [],
  "version": 1,
  "lists": [
    {
      "field": "source.ip",
      "boolean_operator": "and",
      "values": [
        {
          "name": "127.0.0.1",
          "type": "value"
        }
      ]
    },
    {
      "field": "host.name",
      "boolean_operator": "and not",
      "values": [
        {
          "name": "rock01",
          "type": "value"
        },
        {
          "name": "mothra",
          "type": "value"
        }
      ]
    }
  ],
  "status": "succeeded",
  "status_date": "2020-03-15T18:02:56.426Z",
  "last_success_at": "2020-03-15T18:02:56.426Z",
  "last_success_message": "succeeded"
}
```

```ts
./get_rule_by_rule_id.sh query-with-list
{
  "created_at": "2020-03-15T18:10:07.657Z",
  "updated_at": "2020-03-15T18:10:08.479Z",
  "created_by": "yo",
  "description": "Query with a list",
  "enabled": true,
  "false_positives": [],
  "from": "now-6m",
  "id": "9854162b-003c-47be-af59-8c3c9545aafa",
  "immutable": false,
  "interval": "5m",
  "rule_id": "query-with-list",
  "language": "kuery",
  "output_index": ".siem-signals-hassanabad-frank-default",
  "max_signals": 100,
  "risk_score": 1,
  "name": "Query with a list",
  "query": "user.name: root or user.name: admin",
  "references": [],
  "severity": "high",
  "updated_by": "yo",
  "tags": [],
  "to": "now",
  "type": "query",
  "threat": [],
  "version": 1,
  "lists": [
    {
      "field": "source.ip",
      "boolean_operator": "and",
      "values": [
        {
          "name": "127.0.0.1",
          "type": "value"
        }
      ]
    },
    {
      "field": "host.name",
      "boolean_operator": "and not",
      "values": [
        {
          "name": "rock01",
          "type": "value"
        },
        {
          "name": "mothra",
          "type": "value"
        }
      ]
    }
  ],
  "status": "going to run",
  "status_date": "2020-03-15T18:10:10.738Z"
}
```

Expect these errors when the environment variable is not set:

```ts
./post_rule.sh ./rules/queries/query_with_list.json 
{
  "statusCode": 400,
  "error": "Bad Request",
  "message": "[request body]: child \"lists\" fails because [\"lists\" is not allowed]"
}
```

```ts
./update_rule.sh ./rules/queries/query_with_list.json
{
  "statusCode": 400,
  "error": "Bad Request",
  "message": "[request body]: child \"lists\" fails because [\"lists\" is not allowed]"
}
```

```ts
./patch_rule.sh ./rules/patches/update_list.json
{
  "statusCode": 400,
  "error": "Bad Request",
  "message": "[request body]: child \"lists\" fails because [\"lists\" is not allowed]"
}
```

Expect that this is _backwards_ compatible with the feature flag but not necessarily _forwards_ compatible. This means:

* You can have older data that never had lists and it will show up as an empty list when you query it. (backwards compatible)
* You _might_ have lists and remove the env. variable and get back items as if the list was not there for (forwards compatible) 

* You can export without lists, flip on the env flag and import with newer lists feature (backwards compatible)
* You can export lists and it will _not_ work with an older system (not forwards compatible)

### Checklist

Delete any items that are not applicable to this PR.

- [x] [Unit or functional tests](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility) were updated or added to match the most common scenarios
2020-03-18 23:57:36 -06:00
Maggie Ghamry cf08850489
Enhancement/update esdocs datasource (#59512)
* Initial Commit

Update to ESDocs datasource per team feedback

* Updates

Updates per Ryan's mockups

* Updates II

Updates per Poff's review

* Updates III

Update to some of the verbiage and card sizes - working on re-ordering and adding a link to the lucen query syntax

* design tweaks

* Adding lucene hyperlink

update to add hyperlink help for Lucene query syntax

* Consollidating datasources to sort

Consolidating the ESDocs datasource with the rest, so that we can order them

* updates for i18n

updates for i18n

* Updates

Updates from Gail for verbiage and integrating Ryan's change for style

* Update ui.ts

Updates for i18n

* Updates for datasource order

moving the esdocs datasource to live with the rest of the UI datasources, and sorting them accordingly.

* Update datasource_component.js

removing console log, whoops

* Update ui.ts

Update to fix i18n essql issue

* Update ui.ts

Updates to fix i18n references for the esdocs datasource move

* Update to Timelion URL

I noticed that the Timelion datasource showed "Lucene query syntax" which wasn't relevant, so I updated it to "Timelion", along with a tutorial, as the link for current Timelion docs does not provide any syntax tutorial.

* Update ui.ts

update for i18n

* Update ui.ts

update for i18n

* Update ui.ts

Update to removed unused value - the i18n check gave me latent errors, sorry for the repost

* i18n updates

Updating nomenclature to get past i18n errors

* Updates

Code review updates to remove extraneous code

* Update timelion.js

update to remove extraneous comment per code review

* More i18n updates

translation updates to accommodate the esdocs datasource move

* Update datasource_component.js

Update to toggle datasource icon in selected element mode

* Update ui.ts

hopefully last i18n fix

Co-authored-by: Ryan Keairns <contactryank@gmail.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-18 21:36:21 -04:00
Ryland Herrick a05a61286f
[SIEM] Create ML Rules (#58053)
* Remove unnecessary linter exceptions

Not sure what was causing issues here, but it's gone now.

* WIP: Simple form to test creation of ML rules

This will be integrated into the regular rule creation workflow, but for
now this simple form should allow us to exercise the full ML rule
workflow.

* WIP: Adds POST to backend, and type/payload changes necessary to make that work

* Simplify logic with Math.min

* WIP: Failed spike of making an http call

* WIP: Hacking together an ML client

The rest of this is going to be easier if I have actual data. For now
this is mostly copy/pasted and simplified ML code. I've hardcoded time
ranges to a period I know has data for a particular job.

* Threading through our new ML Rule params

It's a bummer that we normalize our rule alert params across all rule
types currently, but that's the deal.

* Retrieve our anomalies during rule execution

Next step: generate signals

* WIP: Generate ECS-compatible ML Signals

This uses as much of the existing signal-creation code as possible. I
skipped the search_after stuff for now because it would require us
recreating the anomalies query which we really shouldn't own. For now,
here's how it works:

* Adds a separate branch of the rule executor for machine_learning rules
* In that branch, we call our new bulkCreateMlSignal function
  * This function first transforms the anomaly document into ECS fields
  * We then pass the transformed documents to singleBulkCreate, which
  does the rest
* After both branches, we update the rule's status appropriately.

We need to do some more work on the anomaly transformation, but this
works!

* Extract setting of rule failure to helper function

We were doing this identically in three places.

* Remove unused import

* Define a field for our Rule Type selection

This adds most of the markup and logic to allow an ML rule type to be
selected. We still need to add things like license-checking and
showing/hiding of fields based on type.

* Hide Query Fields when ML is selected

These are still getting set on the form. We'll need to filter these
fields before we send off the data, and not show them on the readonly
display either.

ALso, edit is majorly broken.

* Add input field for anomaly threshold

* Display numberic values in the readonly view of a step

TIL that isEmpty returns false for numbers and other non-iterable
values. I don't think it's exactly what we want here, but until I figure
out the intention this gets our anomalyThreshold showing up without a
separate logic branch here. Removes the unnecessary branch that was
redundant with the 'else' clause.

* Add field for selecting an ML job

This is not the same as the mockups and lacks some functionality, but
it'll allow us to select a job for now.

* Format our new ML Fields when sending them to the server

So that we don't get rejected due to snake case vs camelcase.

* Put back code that respects a rule's schedule

It was previously hardcoded to a time period I knew had anomalies.

* ML fields are optional in our creation step

In that we don't initialize them like we do the query (default) fields.

* Only send along type-specific Rule fields from form

This makes any query- or ML-specific fields optional on a Rule, and
performs some logic on the frontend to group and include these fieldsets
conditionally based on the user's selection. The one place we don't
handle this well is on the readonly view of a completed step in the
rules creation, but we'll address that.

* Rename anomalies query

It's no longer tabular data. If we need that, we can use the ML client.

* Remove spike page with simple form

* Remove unneeded ES option

This response isn't going to HTTP, which is where this option would
matter.

* Fix bulk create logic

I made a happy accident and flipped the logic here, which meant we
weren't capping the signals we created.

* Rename argument

Value is a little more ambiguous than data, here: this is our step data.

* Create Rule form stores all values, but filters by type for use

When sending off to the backend, or displaying on the readonly view, we
inspect which rule type we've currently selected, and filter our form
values appropriately.

* Fix editing of ML fields on Rule Create

We need to inherit the field value from our form on initial render, and
everything works as expected.

* Clear form errors when switching between rule types

Validation errors prevent us from moving to the next step, so it was
previously possible to get an error for Query fields, switch to an ML
rule, and be unable to continue because the form had Query errors.

This also adds a helper for checking whether a ruleType is ML, to
prevent having to change all these references if the type string
changes.

* Validate the selection of an ML Job

* Fix type errors on frontend

According to the types, this is essentially the opposite of formatRule,
so we need to reinflate all potential form values from the rule.

* Don't set defaults for query-specific rules

For ML rules these types should not be included.

* Return ML Fields in Rule responses

This adds these fields to our rule serialization, and then adds
conditional validation around those fields if the rule type is ML.
Conversely, we moved the 'language' and 'query' fields to be
conditionally validated if the rule is a query/saved_query rule.

* Fix editing of ML rules by changing who controls the field values

The source of truth for their state is the parent form object; these
inputs should not have local state.

* Fix type errors related to new ML fields

In adding the new ML fields, some other fields (e.g. `query` and
`index`) that were previously required but implicitly part of Query
Rules are now marked as optional.

Consequently, any downstream code that actually required these fields
started to complain. In general, the fix was to verify that those fields
exist, and throw an error otherwise as to appease the linter.

Runtime-wise, the new ML rules/signals follow a separate code path and
both branches should be unaffected by these changes; the issue is simply
that our conditional types don't work well with Typescript.

* Fix failing route tests

Error message changed.

* Fix integration tests

We were not sending required properties when creating a rule(index and
language).

* Fix non-ML Rule creation

I was accidentally dropping this parameter for our POST payload. Whoops.

* More informative logging during ML signal generation

The messaging diverged from the normal path here because we don't have
index patterns to display. However, we have the rest of the rule
context, and should report it appropriately.

* Prefer keyof for string union types

* Tidy up our new form components

* Type them as React.FCs
* Remove unnecessary use of styled-components

* Prefer destructuring to lodash's omit

* Fix mock params for helper functions

These were updated to take simpler parameters.

* Remove any type

This could have been a boolean all along, whoops

* Fix mock types

* Update outdated tests

These were added on master, but behavior has been changed on my branch.

* Add some tests around our helper function

I need to refactor it, so this is as good a time as any to pin down the
behavior.

* Remove uses of any in favor of actual types

Mainly leverages ML typings instead of our placeholder types. This
required handling a null case in our formatting of anomalies.

* Annotate our anomalies with @timestamp field

We were notably lacking this ECS field in our post-conversion anomalies,
and typescript was rightly complaining about it.

* ml_job_id -> machine_learning_job_id

* PR Feedback

* Stricter threshold type
* More robust date parsing
* More informative log/error messages
* Remove redundant runtime checks

* Cleaning up our new ML types

* Fix types on our Rest types
* Use less ambiguous machineLearningJobId over mlJobId
* Declare our ML params as required keys, and ensure we pass them around
everywhere we might need them (creating, importing, updating rules).

* Use implicit type to avoid the need for a ts-ignore

FormSchema has a very generic index signature such that our
filterRuleFieldsForType helper cannot infer that it has our necessary
rule fields (when in fact it does). By removing the FormSchema hint we
get the actual keys of our schema, and things work as expected.

All other uses of schema continue to work because they're expecting
FormSchema, which is effectively { [key: string]: any }.

* New ML params are not nullable

Rather than setting a null and then never using it, let's just make it
truly optional in terms of default values.

* Query and language are conditional based on rule type

For ML Rules, we don't use them.

* Remove defaulted parameter in API test

We don't need to specify this, and we should continue not to for
backwards compatibility.

* Use explicit types over implicit ones

The concern is that not typing our schemae as FormSchema could break our
form if there are upstream changes. For now, we simply use the
intersection of FormSchema and our generic parameter to satisfy our use
within the function.

* Add integration test for creation of ML Rule

* Add ML fields to route schemae

* threshold and job id are conditional on type
* makes query and language mutually exclusive with above

* Fix router test for creating an ML rule

We were sending invalid parameters.

* Remove null check against index for query rules

We support not having an index here, as getInputIndex will return the
current UI setting if none is specified.

* Add regression test for API compatibility

We were previously able to create a rule without an input index; we
should continue to support that, as verified by this test!

* Respect the index pattern determined at runtime when performing search_after

If a rule does not specify an input index pattern on creation, we use
the current UI default when the rule is evaluated. This ensures that any
subsequent searches use that same index.

We're not currently persisting that runtime index to the generated
signal, but we should.

* Fix type errors in our bulk create tests

We added a new argument, but didn't update the tests.
2020-03-18 19:26:42 -05:00
Thomas Neirynck a35267afd5
[Maps] Mark instance state as readonly (#60557) 2020-03-18 17:18:03 -04:00
CJ Cenizal 9aad8986e1
Move ui/indices into es_ui_shared plugin. (#60186)
* Convert js files to ts.
* Add indices namespace.
2020-03-18 13:07:41 -07:00
Nathan Reese 7e085eabf5
[Maps] Blended layer that switches between documents and clusters (#57879)
* [Maps] Blended layer that switches between documents and clusters

* change layer type when scalingType changes

* getSource

* use cluster source when count exceeds value

* ensure doc source stays in editor

* start creating cluster style

* pass all parts of style descriptor

* get toggling between sources working

* derive cluster style from document style

* remove references to METRIC_TYPE

* fix import

* start typescripting blended_vector_layer

* more typescript work

* last of the TS errors

* add migration to convert useTopTerm to scalingType

* clean up

* remove MapSavedObject work since its in a seperate PR now

* fix EsSearchSource update editor jest test

* fix map_selector jest test

* move mutable state out of BlendedVectorLayer

* one more change for removing mutable BlendedVectorLayer state

* integrate newly merged MapSavedObjectAttributes type

* review feedback

* use data request for fetching feature count

* add functional test

* fix functional test

* review feedback

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-18 12:06:54 -06:00
Steph Milovic 4fc89aeb0d
[SIEM] [Cases] Shell scripts and unit tests (#60183) 2020-03-18 11:42:08 -06:00
Frank Hassanabad 3e10276b20
[SIEM][Detection Engine] Fixes bug with timeline templates not working
### Summary

Fixes a bug with the timeline templates not working when specifying filters.

* Creates a type safe mechanism for getting StringArrays or regular strings
* AddsType Script function returns to functions in the helpers file
* Adds unit tests for the effected areas of code and corner cases

Before this fix you would get these toaster errors if you tried to use a template name such as `host.name` in the timeline filters:

<img width="677" alt="Screen Shot 2020-03-18 at 12 58 01 AM" src="https://user-images.githubusercontent.com/1151048/76934058-0bd2fc80-68b4-11ea-8dad-7c257bb81a1d.png">

After this fix it will work for you.

Testing:

1) Create a timeline template that has a host.name as both a query and a filter such as this. You can give the value of the host.name any value such as placeholder.

<img width="1125" alt="Screen Shot 2020-03-18 at 12 56 04 AM" src="https://user-images.githubusercontent.com/1151048/76934108-20af9000-68b4-11ea-8a11-4ba9c935506f.png">

2) Create a signal that uses it and produces a lot of signals off of something such as all host names
<img width="1054" alt="Screen Shot 2020-03-18 at 12 50 47 AM" src="https://user-images.githubusercontent.com/1151048/76934198-4f2d6b00-68b4-11ea-8ae3-6de76154cbb7.png">

3) Ensure you select your **Timeline template** you saved by using the drop down
<img width="1071" alt="Screen Shot 2020-03-18 at 12 51 21 AM" src="https://user-images.githubusercontent.com/1151048/76934281-73894780-68b4-11ea-9a2a-a0a9176f28ce.png">

4) Once your signals have run, go to the signals page and send one of the signals for your newly crated rule which has a host name to the timeline from "View in timeline"
<img width="568" alt="Screen Shot 2020-03-18 at 12 52 10 AM" src="https://user-images.githubusercontent.com/1151048/76934365-a4697c80-68b4-11ea-91a5-e0dea7e3e18f.png">

You should notice that your timeline has both the query and the filter set correctly such as this
<img width="1114" alt="Screen Shot 2020-03-18 at 12 56 23 AM" src="https://user-images.githubusercontent.com/1151048/76934432-c105b480-68b4-11ea-9a82-3e8a2da19376.png">


### Other notes

All the different fields you can choose from for templates are:
```
  'host.name',
  'host.hostname',
  'host.domain',
  'host.id',
  'host.ip',
  'client.ip',
  'destination.ip',
  'server.ip',
  'source.ip',
  'network.community_id',
  'user.name',
  'process.name',
```

And it should not work with anything outside of those. You should be able to mix and match them into different filters and queries to have a multiples of them.

### Checklist

- [x] [Unit or functional tests](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility) were updated or added to match the most common scenarios
2020-03-18 11:00:44 -06:00
Oliver Gupte 6abb9d7d18
Closes #60265. Adds Beta badge to service map (#60482) 2020-03-18 08:19:50 -07:00
Nathan L Smith c8b2b05897
Fixes to service map single node banner (#60072)
* Fixes to service map single node banner

* Make the banner 95% width so it takes up the full width
* Check the actual count of cytoscape nodes to determine whether or not to show the banner
* Make the Cytoscape component able to take a function as children so we can access the cytoscape instance directly
* Update the .NET icon

* rework

* Update x-pack/legacy/plugins/apm/public/components/app/ServiceMap/EmptyBanner.tsx

Co-Authored-By: Oliver Gupte <ogupte@users.noreply.github.com>

Co-authored-by: Oliver Gupte <ogupte@users.noreply.github.com>
2020-03-18 09:23:03 -05:00
Shahzad 95a42ed2c9
[Uptime] replace fetch with kibana http (#59881)
* use kibana http

* unused import

* fix type

* update type

* refactor

* fix types

* fix type

* fix type
2020-03-18 14:43:30 +01:00
Sébastien Loix 2a8a7d7970
[License Management] NP migration (#60250) 2020-03-18 13:36:20 +01:00
Mike Côté a97ecaae69
Fix create alert button from not showing in alerts list (#60444) 2020-03-18 08:31:03 -04:00
Christos Nasikas 70c1b69eb0
[SIEM][Case] Update connector through flyout (#60307)
* Move add flyout to parent

* Disable mapping

* Show edit flyout

* Do not update connectors throught cases API

* Fix uncontrolled input error

* Disable edit button

* Add comments

* Change undefined to null

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-18 14:04:25 +02:00
Lisa Cawley c1435db29f
Edits UI text for ML nodes and job button (#60184)
* Edits UI text for ML nodes and job button

* Update x-pack/plugins/ml/public/application/explorer/components/explorer_no_jobs_found/explorer_no_jobs_found.js

Co-Authored-By: Brandon Morelli <bmorelli25@gmail.com>

* Update x-pack/plugins/ml/public/application/explorer/components/explorer_no_jobs_found/explorer_no_jobs_found.js

Co-Authored-By: Brandon Morelli <bmorelli25@gmail.com>

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Brandon Morelli <bmorelli25@gmail.com>
2020-03-17 18:15:58 -07:00
Nick Peihl 928454afa4
Update the ems-client dependency to 7.7.0 (#59936)
* Update the ems-client dependency

This PR adds the `appName` and `appVersion` parameters used by ems-client. The `appVersion` parameter replaces the now deprecated `kbnVersion` parameter in ems-client.

* Review feedback

* Fix borked merge

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-17 11:51:17 -07:00
Joel Griffith 6b7731bb74
[Reporting] Wholesale moves client to newest-platform (#58945)
* Move over to new plugin space, working implementation

* Fixing tests for report_listing snapshots

* WIP: Fixing react-component tests

* Fixing report_info_button tests

* Fixing download linksies

* WIP: Final working implementation

* Fixing attachAction API + API URLs

* Let the past die. Kill it if you have to. That’s the only way to become what you were meant to be.

* Fixing stream-client for new platform APIs

* Fixing types and tests

* Fix broken mock

* Adds back in warnings to report info button

* kibana.json line-breaks on required plugins

* Fixing broked snapshots

* Fix license checks in client-side components

* Adding back in warnings to report_listing component

* Fix danglig unused import

* Adds license checks for basic to our csv panel action

* Fixes issues from prior fork

* Move relative pathing to absolute

* Fix POST URL copying as we've moved from static methods

* Fix layoutId props

* Fixes types for layoutId

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-17 10:41:06 -07:00
MadameSheema 79b04547db
[SIEM] Adds 'Closes one signal when more than one opened signals are selected' test again (#60380)
* Revert "Revert "adds new test (#60064)""

This reverts commit 4a8fd0afee.

* waits for having 25 signals displayed
2020-03-17 18:14:02 +01:00
Yara Tercero cea277e7c2
[SIEM][Detections Engine] - Add rule markdown field to rule create, detail, and edit flows (#60108)
* add rule note markdown field to rule creation, rule details, and rule edit flows

Co-authored-by: Gloria Hornero <snootchie.boochies@gmail.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-17 13:06:12 -04:00
Larry Gregory 9318862f19
Allow kbn-config-schema to ignore unknown keys (#59560)
* allow kbn-config-schema to ignore unknown keys

* Consolidate unknown key configuration

* updates following merge

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-17 12:30:17 -04:00
Xavier Mouligneau 0f9f81c30a
[SIEM] Fix link on overview page (#60348)
* Fix link on overview page

* no needs of useMemo

* clean up

* review I

* review II

* review III
2020-03-17 10:46:54 -04:00
spalger b9cc3e940c skip flaky test (#60369) 2020-03-17 07:39:04 -07:00
Wylie Conlon caed9ba5ac
[Lens] Simplify state management from visualization (#58279)
* [Lens] Declarative right panel

* Fix memoized operations

* Add error checking

* Fix dimension panel tests

* More updates

* Fix all editor frame tests

* Fix jest tests

* Fix bug with removing dimension

* Update tests

* Fix frame tests

* Fix all tests I could find

* Remove debugger

* Style config panels

* Update i18n

* Fix dashboard test

* Fix bug when switching index patterns
2020-03-17 09:57:52 -04:00
Daniil Suleiman eddbdc896b
[NP] Get rid of usage redirectWhenMissing service (#59777)
* Move redirect_when_missing to kibana utils

* Replace redirectWhenMissing in dashboard

* Replace redirectWhenMissing in discover

* Remove redirect in monitoring

* Remove extra import

* Move invalid vistype check into editor.js

* Mock the history folder

* Fix redirect when missing index or saved object

* Move history to discover services

* Use redirect to listing page

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-17 14:02:03 +03:00
patrykkopycinski 55003b61dd
[SIEM] Fix Timeline footer styling (#59587) 2020-03-17 11:50:34 +01:00
Oliver Gupte 59551e7e81
Closes 59786 by removing the update toast (#60172)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-16 18:46:38 -07:00
spalger 4a8fd0afee Revert "adds new test (#60064)"
This reverts commit a946adbf10.
2020-03-16 15:58:53 -07:00
Nathan Reese ef3261132a
[Maps] move MapSavedObject type out of telemetry (#60127)
* [Maps] move MapSavedObject type out of telemetry

* move SavedObject from server to core/types

* review feedback

* results from check_published_api_changes
2020-03-16 15:40:52 -06:00
Tim Sullivan 537fa8c1eb
[Reporting] Fix error handling for job handler in route (#60161)
* fix bogus rison error

* add generate route test

* update test name
2020-03-16 14:26:47 -07:00
Aaron Caldwell c898e799a5
Migrate dual validated range (#59689)
* Move validated range files to new NP location

* Update refs in code

* Clean up old validated range files

* Change relative paths to 'kibana-react'. Some clean up

* Change to relative paths

* Fix i18n errors

* i18n clean up. Export module explicitly

* Change files over to TS to prevent build issue where validated range was missing

* Clean up TS conversion

* More clean up. Extend EuiRangeProps

* Remove unneeded ts-ignore

* Review feedback and test fixes

* Change double to single quotes

* min and max aren't always passed, make optional

* Type updates

* Review feedback. Set state to empty on init and add ignore comment

* Review feedback

* Add back in last 2 ts-ignores. Build fails without focusable attribute on EuiDualRange & No good alternatives for spread syntax in TS components

* Rollback change to state init. Initializing state to null actually triggers a react browser warning and complicates using 'prevState' in getDerivedStateFromProps

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-16 14:33:56 -06:00
Stacey Gammon dccfa593dc
Embeddable API cleanup (#60207)
* wip

* Remove test in legacy functional plugin
2020-03-16 15:37:42 -04:00
Nathan Reese 6cbfa274cf
[Maps] add draw control to create distance filter (#58163)
* [Maps] add distance filter to draw controls

* create distance filter

* update jest snapshot

* remove duplicated code

* reset circle draw when user hits escape

* i18n cleanup

* ts MultiIndexGeoFieldSelect

* ts DistanceFilterForm

* remove unused prop

* make interface a type

* move geo_field_with_index to components folder

* convert draw_circle to TS

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-16 13:33:40 -06:00
Frank Hassanabad dfff4fd6fa
[SIEM][Detection Engine] Refactors signal rule alert type into smaller code by creating functions
Refactors signal rule alert type into a smaller executor

## Summary

* Breaks out the schema into its own file and function
* Breaks out the action group into its own file and function
* Moves misc types being added to this into the `./types` file
* Breaks out all the writing of errors and success into their own functions
* Uses destructuring to pull data out of some of the data types
* Tweaks the gap detection to accept a date instead of moment to ease "ergonomics"   
* Updates unit tests for the gap detection

### Checklist

Delete any items that are not applicable to this PR.

- [x] [Unit or functional tests](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility) were updated or added to match the most common scenarios
2020-03-16 12:18:27 -06:00
Mikhail Shustov dd7531deb4
Add UiSettings validation & Kibana default route redirection (#59694)
* add schema to ui settings params

* add validation for defaults and overrides

* validate in ui settings client

* ui settings routes validation

* clean up tests

* use schema for defaultRoutes

* move URL redirection to NP

* fix spaces test

* update docs

* update kbn pm

* fix karma test

* fix tests

* address comments

* get rid of getDEfaultRoute

* regen docs

* fix tests

* fix enter-spaces test

* validate on relative url format

* update i18n

* fix enter-spoace test

* move relative url validation to utils

* add CoreApp containing application logic

* extract public uiSettings params in a separate type

* make schema required

* update docs
2020-03-16 14:30:20 +01:00
Christos Nasikas 271c9597be
[SIEM][CASE] Change configuration button (#60229)
* Change button

* Make URLs constants
2020-03-16 14:33:03 +02:00
MadameSheema a946adbf10
adds new test (#60064) 2020-03-16 13:01:48 +01:00
Shahzad 168239ca07
[Uptime] Index Status API to Rest (#59657)
* gql to rest

* update snap

* fix api

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-16 12:39:27 +01:00