Commit graph

6614 commits

Author SHA1 Message Date
patrykkopycinski 14be0ee8f4
Bump to stable styled-components@5 (#54698) 2020-01-14 18:53:20 +01:00
Jean-Louis Leysens e4c73ffbbb
[Console][Chore] Update spec (#54564)
* Update spec conversion to exclude deprecated completions

* Update OSS spec

* Remove console.log

* Add skip deprecated endpoints option to script

* Actually, remove skip deprecated flag for now. Just do not include deprecated. See this issue: https://github.com/elastic/kibana/issues/48375

* x-pack: Delete data from transform completions

* Update to existing x-pack autocomplete extensions

* Added ml explain with overrides

* Added put trained model with doc override

* Added SLM get_status, start and stop with URL param overrides where needed

* Add data completion for clear scroll

* Remove include_type_name flag from indices and delete create.json override

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-14 18:47:13 +01:00
Joe Reuter 97d460e051
Fix safari layout issue in Visualize, Graph and Lens (#54694) 2020-01-14 18:40:12 +01:00
Chris Davies 79054afb5a [Lens] Add support for scripted fields and aliases to the existence API (#54064)
* Add support for scripted fields and
default index pattern

* Add scripted fields and aliases to existence API

* Fix TypeScript errors.

* Fix mappings parsing

* Default to the index pattern timeFieldName

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-14 12:39:50 -05:00
Chris Davies 8c0440f29d [Lens] Add clear layer feature (#53627)
* [Lens] Add clear layer feature

* Move clear / remove layer out of the context menu

* Address code review comments

* Remove xpack.lens.xyChart.deleteLayer translation

* Get rid of unused Lens translations

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-14 12:06:51 -05:00
Joe Reuter 8c878bcaa8
add graph sample data (#54558) 2020-01-14 18:02:49 +01:00
Tim Schnell b298dd4c20
fixing color and toggle accessibility (#54661)
* fixing color and toggle accessibility

* updating snapshots

* fixing more snapshots

* fixing toggle console warning
2020-01-14 10:53:27 -06:00
Garrett Spong 569b1f6606
[SIEM] Use import/export API instead of client implementation (#54680)
## Summary

This PR switches the Rule Import / Export functionality away from the client-side implementation (that was leveraging the create/read Rule API) to the new explicit `/rules/_import` & `/rules/_export` API introduced in https://github.com/elastic/kibana/pull/54332.

Note: This PR also disables the ability to export `immutable` rules.

![image](https://user-images.githubusercontent.com/2946766/72311962-c0963680-3643-11ea-812f-237bc51be7dc.png)


Sample error message:

<img width="800" alt="Screen Shot 2020-01-13 at 20 22 45" src="https://user-images.githubusercontent.com/2946766/72311909-8cbb1100-3643-11ea-94ab-023a5ff56e20.png">


### Checklist

Use ~~strikethroughs~~ to remove checklist items you don't feel are applicable to this PR.

- [X] This was checked for cross-browser compatibility, [including a check against IE11](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility)
- [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~
- [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
- [ ] ~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)~

### 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)~
- [ ] ~This includes a feature addition or change that requires a release note and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~
2020-01-14 09:25:07 -07:00
Nathan Reese 643912e4f5
[Maps] add labels to sample data maps (#54671)
* [Maps] add count labels to sample data maps

* [Maps] add labels to sample data maps

* review feedback

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-14 11:12:53 -05:00
Dmitry Lemeshko 040aee9fed
Functional tests: refactor dashboard_page (#54588)
* [test/functional] cleanup & tsfy dashboard_page

* fix & improvement

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-14 16:56:38 +01:00
James Gowdy c2abc12c7e
[ML] Adding categorization job wizard icon (#54721) 2020-01-14 15:56:08 +00:00
patrykkopycinski e20fbd8e8f
[SIEM] Detection Engine UI improvements (#54712) 2020-01-14 16:36:15 +01:00
Robert Oskamp 6a45241b79
[ML] Functional tests - basic tests for single metric viewer and anomaly explorer (#54699)
This PR adds basic functional UI tests for the single metric viewer and the anomaly explorer.
2020-01-14 16:29:43 +01:00
Felix Stürmer c1cf970fe1
[Logs UI] Move beta badges from tabs to headings (#54572)
This moves the beta badges for the Ml integration tabs from the tabbed navigation bar into the primary headings of the respective setup and result pages.
2020-01-14 16:28:27 +01:00
Ahmad Bamieh 1a34375fa0
[i18n] integrate translation files ja and zh (#54722) 2020-01-14 17:03:58 +02:00
Phillip Burch 2927373f8b
Add aria labels to fields (#54510)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-14 08:46:49 -06:00
Shahzad 038c2b1ce3
[Uptime] Fix Jest test with absolute time (#54684)
* fix test

* update more skipped tests

* update test
2020-01-14 15:18:07 +01:00
Melissa Alvarez 69730cef73
[ML] DataFrame Analytics use field caps api to set column type (#54543)
* wip: initialize newJobCaps service in parent element

* wip: use jobCaps service to create columns

* add render and types to talble columns

* add keyword suffix when constructing query. ensure pagination works

* Ensure search query and sorting works

* wip: update regression table to use jobCaps api

* move shared resources to central location

* ensure 0 and false values show up in table

* add error handling to jobCaps initialization

* ensure outlier detection table can toggle columns

* check for undefined before using moment to create date

* add tests for fix for getNestedProperty
2020-01-14 08:58:36 -05:00
Katrin Freihofner 45f8ca90a3
changes alignment of location column in monitor details view (#54709) 2020-01-14 14:52:52 +01:00
Gidi Meir Morris 5216b382f4
fix broken configuration in Task manager (#54695)
Fixes an issue that prevents custom configuration in Task Manager
2020-01-14 13:49:43 +00:00
Devin W. Hurley c976094f54
[SIEM][Detection Engine] Rule Status Monitoring (#54452)
* Working status updates in executor. Need to update read rules api endpoint to only respond with 'status' and not status info. Will create another endpoint to get status details for a rule which will include last five errors (if there are any). Still need tests

* adds new route for getting statuses for a list of given alert ids, adds try-catch and more logic in executor for logging errors, adds scripts and rules for testing, updates find_rules endpoint to display statuses too. Would like to look into using the alerts executor state to better manage logic for statuses, and need to update some types. Also needs unit tests still.

* updated types for routes, updated how merging of alert-to-rule and rule status happens when formatting REST response.

* typecast test server as ServerFacade type

* fix bug where we were not awaiting the accumulated result in the reducer

* update rule status saved object interfaces to play nicely with interfaces provided by saved objects module. Update tests to pass - Need to write new unit tests in an upcoming commit. Next commit will be cleanup from comments then new unit tests.

* fix missed conflicts after rebase

* replace id param with rule.id when searching in statuses, adds sort fields to the saved objects find queries.

* fixes bug where 'executing' statuses were being written into failing historical status list

* camelCase to snake_case in new statuses route, also fix merge conflict

* add deletion of rule statuses to delete_rules_bulk_route. Statuses are created inside of executor so we will not be needing to create statuses directly inside of the create rules bulk route, so I removed that extraneous code.

* pr feedback I forgot to fix earlier

* remove unused import. fixes type check error generated in previous commit

* removes status information from rule when saved to signals index and updates tests to represent this change. Also removes extraneous quotes inserted around alertId field when creating a new historical status.

* adds new bash script to delete all rule statuses, updates error messages in rule statuses to just store actual message, moved querying of rules statuses under a null check, initialize everything to null when first creating rule status, update number of results returned when querying saved objects based on usage, updates saved objects mapping types to use date for dates and keyword for alertId.

* use lodash snake case and update total number of saved objects to return for find rules, delete rules, and read rules.

* updates how statuses are transformed inside of read_rules_route, only update updated_at in rule on update of rule, removes unlabeled todo comment, updates scripts descriptions, removes interval from query_with_rule_id.json sample query, removes debug statement, removes verbose from curl script.

* display rule status on update
2020-01-14 07:59:57 -05:00
Felix Stürmer cd9ead87c5
[Logs UI] Reduce panel paddings in ML integration result tabs (#54574)
This reduces the panel paddings on the log rate and categorization result tabs from `l` to `m` as per elastic/logs#7 and brings a title padding in line with the rest.
2020-01-14 12:00:36 +01:00
Dario Gieselaar 3f46e2bec6
[APM] Support error.{log,exception}.stacktrace.classname (#54577)
In elastic/apm-server/pull/3096, an alternative to stacktrace.filename was introduced: stacktrace.classname. This change makes sure classname is properly represented in the UI and in our types.
2020-01-14 09:37:22 +01:00
Dima Arnautov 9a871d2a7a
[ML] MML calculator enhancements for multi-metric job wizard (#54573)
* [ML] fix fieldNames provided to calculateModelMemoryLimit

* [ML] calculateModelMemoryLimit when the influencers are changed
2020-01-14 08:58:43 +01:00
patrykkopycinski 7c4a531ae7
[SIEM] Fix Inspect query 'request timestamp' value changes when curso… (#54223) 2020-01-14 08:50:49 +01:00
Andrew Cholakian 72dd68e3b4 [Uptime] Temporarily skip flakey tests (#54675)
* [Uptime] Temporarily skip flakey tests

* Fix further flakey tests due to hardcoding times + using snapshots
2020-01-13 22:05:07 -05:00
Brian Seeders e5c17fb0cd
Skip failing uptime tests 2020-01-13 21:53:35 -05:00
Yuliia Naumenko 8259445350
Create UI for alerting and actions plugin (#48959)
* Refactored reducers type definitions

* Fixed dependancy objects

* Fixed action add

* Fixed logging app icon

* Added action types params fields

* Added fields for check and re-notify alert

* Add tags to alert list

* Adjusted threshold expression with validation, added visualization

* Move delete button to the left and hide when no selection

* Rename action list title column to name

* fixed request

* Removed watcher labels

* Design cleanup

* Added expression default values

* Added visualization for index threshold alert

* Rename Actions tab to Connectors

* Rename "create action" to "create connector"

* Remove actions column name

* Add count per action type

* Hide checkboxes when user can't delete

* Add title to home, rename Alerting UI breadcrumb (remove UI part)

* Added correct binding for interval and throttle

* Added tags support for create Alert UI

* Added server error display in UI on save alert

* Added connectors for action forms

* Update button styles

* Switch inputs to compressed forms

* Fixed some fields for add alert form

* Fixed updating action by index

* Fixed filter for index/fields api requests

* Remove the test alert type that was in the init function

* Fixed action type icon on add connector form and did small refactoring on action forms; added action validation

* Rename alerting UI plugin to triggers and actions UI (or something else) #50305

* Implemented action connector edit UI

* Add bulk actions to alerts list

* Update home title spacing

* Fixed editing secrets action property

* Changing behaviour of bulk actions and disable buttons during request

* Refactored plugin definition with appdependency interface

* Moved add dependencies to the separate file

* Enable visualization if only hasExpressionErrors passed

* Fixed add action twice on click card

* Fix actions column in alert list

* Fixed action canSave capability

* Renamed Actions to ActionConnectors in appropriate UI files

* Renamed alertTypeParams to params in UI code

* Add filter for tags

* Cleanup previous commit

* Fix alert type filter

* Refactored edit form to use ActionTableItem

* Renamed ActionTableItem to ActionConnectorTableItem

* Fixed missing button key error for alerts list filter

* Renamed translation labels for connectors

* Enable UI plugin by default

* Rename buildin to builtin

* Fix some type checks

* Add API tests

* Split API file into smaller files

* Rename plugin id

* Remove dependency on actions plugin (should be optional dep in NP)

* Fix some translation ids

* Revert "Rename plugin id"

This reverts commit f6daeb3d5e.

* Rename method for loading connectors

* Added functional tests base

* Fix functional test type filter

* Add test alert type for now

* Initial connectors functional tests

* Rename description to name

* Use unique connector names to allow re-running tests

* Assert on more things

* Update alert/action menu items. Flyout width. Add index.scss file

* Added action connector list unit tests

* Add bulk delete functional test

* Move tests to SSL functional environment

* Fix tests

* Added unit tests for actionTypeRegistry and alertTypeRegistry

* Fixed update connector with only properties

* Added some functional tests for alerts with TODOs

* connectors list page cleanup

* empty state cleanup

* Added connector edit flyout unit test

* Fix functional tests

* text cleanup

* zindex fix for index threshold trigger

* Expand the functional tests, add assertions

* Fixed edit connector from the Name column, and removed pencil button

* Remove tags filter, use search bar instead

* Finalize functional tests

* Support filtering alerts by action type

* Rename plugin name for translations

* Rename default breadcrumb title to alerts and actions

* Added unit tests for connectors empty prompt, fixed api tests

* Added unit test for select action type menu for create connector; Fixed update selected connector for edit form

* Added unit test for edit connector flyout

* Added alerts list unit tests

* Added connector form unit tests

* Added connector reducer unit tests

* Fixed some failing unit tests

* Fixed alerts list unit tests

* Set alert tab default if it is available

* Added doc_title and get_time_units unit tests

* Added some test fixes

* Fixed index threshold expression to display only index and fields

* Added email building action unit tests

* Added unit tests for builtin action types

* Remove test alert type

* Move create alert UI behind feature flag 'createAlertUiEnabled'

* Fix functional tests

* Update codeowners

* Update codeowners for tests

* Revert watcher changes

* Fix type check failure

* Fix unit test failures

* Fixed typecheck failures

* Fixed language check errors

* Did some text/type fixes

* Fixed typecheck

* Fixed unit tests warning

* Fix failing functional tests

* Fix registry tests to have cleaner diff when it fails

* Make DEFAULT_SECTION a Section type

* Remove unused constructor

* Make app dependency error string same line

* Remove unused error pages

* Set interface to alerts context

* Fix action_connector_form.tsx label

* Fix label in connector_add_flyout.tsx

* Fix label in alert_add.tsx

* Move alert_types to builtin_alert_types

* Move some threshold constants into threshold folder

* Move api.ts within threshold folder

* Removed duplication logic from action type and alert type registry list

* Fixed email action type test and adjusted validation to support arrays ony

* Added missing connector fields for email action type

* Fixed building action types issues due to comments

* Refactored with more new platform structure; fixed some comments from review

* Capitalize Actions in 'Alerts and Actions' labels

* Skip flaky tests

* Fix failing functional test

* Fixed failing unit tests, added new deps

* Fixed type checks

* Fixed language check failing

* Fix broken functional tests

* Refactored actionConnectors and alerting context

* Removed doc title service

* added get time options type definitions

* removed obsolete code

* Made generic registry type for actionTypes and alert types

* Fixed some enum types

* fixed type check CI

* Convert EuiSearchBar to normal text field

* Fix typo

* Fix conditional rendering

* Fix bug where selection doesn't reset

* Fix broken functional test, wait for ENTER key to search alerts

* Make app section hide from menu when user doesn't have access

* Fixed connector name validation (error due to renaming from description)

* Removed obsolete useEffect

* Removed unused ShareRouter

* Fixed key validation error

* Mobed wrongly wrapped objects

* Removed useEffect from connectors form

* Replaced error forms with eui controls props

* Added delete confirmation dialog for connectors list

* Fixed build errors

* Fixed failing test

* Skip flaky tests

* Added null check for app context - render components tree only if it isn't null

* Fixed type check eror

* Did changes on the UX and text/labels commnets

* Fixed failing tests

* Fixed error handling

* Refactored Webhook form http headers due to the mockup

* Fixed build

* Fix labels issue

* Fix spacing and form row alignment

* Fixed failing type check

* put ownfocus on popover in actions list

* fix spacing and flex

* fix color on conectors list

* clean up webhook headers form

* fix logic check for headers

* Made changes due to review comments

* Fixed delete connector test

* Fixed all flaky test for delete connectors 53956

* Fixed type check due to NP changes

* Disable plugin by default

* Added configuration props for functional tests to enable triggers and actions ui

* removed timeout from test

* added enable triggers and actions to functional/config.js

* fix the build

* Changed ci group and disabled plugin

* changed config setting to root

* Changed disable approach

* Experiment with index managment

* Set back configuration settings for triggers and actions

* Enable plugins

* Set index management to disabled to see the failing issue

* Revert experimental back for index_managment

* Fixed type check

Co-authored-by: Mike Côté <mikecote@users.noreply.github.com>
Co-authored-by: dave.snider@gmail.com <dave.snider@gmail.com>
Co-authored-by: DeFazio <michael.defazio@elastic.co>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Peter Schretlen <peter.schretlen@gmail.com>
2020-01-13 16:16:20 -08:00
Garrett Spong 6f54c06695
[SIEM] Use bulk actions API when updating or deleting rules (#54521)
## Summary

This PR updates the `All Rules Table` actions to use the new bulk API introduced in https://github.com/elastic/kibana/pull/53543. More robust error reporting has also been added to let the user know exactly which operation has failed. Note that individual `update`/`delete` requests now also go through the bulk API as this simplifies the implementation and error handling.

Additional features:
* Adds toast error when failing to activate, deactivate or delete a rule (related https://github.com/elastic/kibana/issues/54515)
* Extracted commonly used toast utility for better re-use
* Removes ability to delete `immutable` rules


##### Activate/Deactivate Before:
![bulk_activate_before](https://user-images.githubusercontent.com/2946766/72196245-0ea50300-33d4-11ea-8d49-5ebdb63db1a1.gif)
(Ignore failed requests from test env -- request count is important here)


##### Activate/Deactivate After:
![bulk_activate_after](https://user-images.githubusercontent.com/2946766/72196361-c0443400-33d4-11ea-9a42-11f66c64e925.gif)



##### Delete Before:
![bulk_delete_before](https://user-images.githubusercontent.com/2946766/72196249-149ae400-33d4-11ea-80fc-b2f7fb83245f.gif)
(Ignore failed requests from test env -- request count is important here)

##### Delete After:
![bulk_delete_after](https://user-images.githubusercontent.com/2946766/72196366-c803d880-33d4-11ea-90d8-f1917b18035f.gif)

### Checklist

Use ~~strikethroughs~~ to remove checklist items you don't feel are applicable to this PR.

- [x] This was checked for cross-browser compatibility, [including a check against IE11](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility)
- [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~
- [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
- [ ] ~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)~

### 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)~
- [ ] ~This includes a feature addition or change that requires a release note and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~
2020-01-13 15:25:24 -07:00
Nathan Reese e9e44ec851
[Maps] add text halo color and width style properties (#53827)
* [Maps] add text halo color and width style properties

* fix jest test

* update for new editor UI

* add removed styling

* get halo size from label size

* fix label border size with dynamic label size

* clean up

* fix jest test

* fix jest test

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-13 16:34:56 -05:00
Oliver Gupte b65710d33d
Service Map Data API at Runtime (#54027)
* [APM] Runtime service maps

* Make nodes interactive

* Don't use smaller range query on initial request

* Address feedback from Ron

* Get all services separately

* Get single service as well

* Query both transactions/spans for initial request

* Optimize 'top' query for service maps

* Use agent.name from scripted metric

* adds basic loading overlay

* filter out service map node self reference edges from being rendered

* Make service map initial load time range configurable with
`xpack.apm.serviceMapInitialTimeRange` default to last 1 hour in
milliseconds

* ensure destination.address is not missing in the composite agg when
fetching sample trace ids

* wip: added incremental data fetch & progress bar

* implement progressive loading design while blocking service map interaction during loading

* adds filter that destination.address exists before fetching sample trace ids

* reduce pairs of connections to 1 bi-directional connection with arrows on both ends of the edge

* Optimize query; add update button

* Allow user interaction after 5s, auto update in that time, otherwise
show toast for user to update the map with button

* Correctly reduce nodes/connections

* - remove non-interactive state while loading
- use cytoscape element definition types

* - readability improvements to the ServiceMap component
- only show the update map button toast after last request loads

* addresses feedback for changes to the Cytoscape component

* Add span.type/span.subtype do external nodes

* PR feedback

Co-authored-by: Dario Gieselaar <d.gieselaar@gmail.com>
2020-01-13 13:25:14 -08:00
patrykkopycinski e9319360e2
[SIEM] Detection Engine Create Rule Design Review #1 (#54442) 2020-01-13 21:59:45 +01:00
Brian Seeders 51d96e52ec
Skip flaky test 2020-01-13 15:54:58 -05:00
Corey Robertson 24b3ecbae0
[Canvas] Enable Embeddable maps (#53971)
* Enables Embeddable maps in Canvas. Updates expressions as maps are interacted with

* Fix type check errors

* Update imports. Remove filters from initial embed expressions

* Adds hide layer functionality to canvas map embeds

* Fix typecheck error

* Fix Type check

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-13 15:40:05 -05:00
Frank Hassanabad 054bbbbc46
[SIEM][Detection Engine] Increases the number or rules you can view on a single page (#54628)
* Increased the number or rules you can view on a single page

* messed up one line
2020-01-13 13:36:51 -07:00
Matthew Kime 2178ee38c0
uiSettings - use validation field for image field maxSize (#54522)
* uiSettings - use validation field for image field maxSize
2020-01-13 13:58:59 -06:00
robbruce 62e7edbe26 Fixes #45896 (#50229)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-13 14:50:33 -05:00
Shahzad e90ca93687
[Uptime] Most recent checks info on details page (#54340)
* update API

* update query

* hide layer control and added loc tags

* update test

* remove unused comment

* update API

* remove capitalization

* style fix

* update types

* added location status number on details page

* useref instead of createRef

* update interface

* update import

* removed redundant file

* fix header for empty data

* refactor for most recent check

* remove redundant code

* remone unused translation

* update status bar

* update styling

* update snaps

* added API tests

* fix types

* fixing integration tests and a typo

* remove unused translations

* update tests

* fixed PR feedback

* update feedback

* update messaging

* update snap

* added timestamp in front of tags

* update snaps

* improve readability

* PR feedbacka and snaps

* PR feedbacka and snaps

* update txt

* snaps

* fix timestamp issue in tests

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-13 20:31:28 +01:00
Shahzad 6f3ff99968
[Uptime] Monitor SSL Certificate Color version for warning (#54040)
* update monitor list columns

* update columns

* update snaps

* enhance ui

* update SSL Cert to badge warning

* fix i18n errors

* removed unnecessary margin

* update snaps

* update ssl

* update snaps

* added test for warning state

* added test for warning state

* update test name

* update test name

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-13 20:30:11 +01:00
Brian Seeders 70cedb08f9
Update alerting task_runner test snapshots (#54627) 2020-01-13 14:29:08 -05:00
Felix Stürmer 5ef4aa10e7
[Logs UI] Add categories table to the categorization tab (#53004)
This renders the log entry categories after the ML jobs have been set up previously.

closes #42776
closes #42065
2020-01-13 20:15:15 +01:00
Gidi Meir Morris ea9a7b8a16
migrate TaskManager Plugin to the Kibana Platform (#53869)
Migrates the existing TaskManager plugin from Legacy to Kibana Platform.
We retain the Legacy API to prevent a breaking change, but under the hood, the legacy plugin is now using the Kibana Platform plugin.

Another reason we retain the Legacy plugin to support several features that the Platform team has yet to migrate to Kibana Platform (mapping, SO schema and migrations).
2020-01-13 19:09:57 +00:00
Jimmy Kuang 79ee978fc4 [SR] Support capitalized date formats in snapshot names (#53751)
Snapshot names that contain date math may require capital letters, e.g. "<snapshot-{now/d{yyyy.MM.dd|+09:00}}>". This change fixes a bug which complained that capital letters are not allowed in snapshot names, by scoping this validation to only the name part of this pattern, ignoring the date math part.
2020-01-13 09:58:20 -08:00
Catherine Liu 70aa7b3c5c
Migrates ES Fields Route to NP (#54398)
* Migrated es fields route to NP and added tests

* Removed extraneous import

* Removed check for index query

* Fixed broken test
2020-01-13 10:50:00 -07:00
Maja Grubic 7543b0c7b2
[Lens][Dashboard] Adding Lens to Dashboard (#53110)
* First version of adding Lens to dashboard

* Fix failing unit test

* Replacing explicit Lens query param with a more generic one

* Fixing failing unit test

* Adding a unit test for redirect

* Do not show Save New if adding from Dashboard

* Adding functional test

* Adding functional test

* Fixing type issues

* Renaming query params

* Fixing failing unit test

* Removing unused constants

* Fixing erroneous imports

* Fixing erroneous import

* Fixing import

* Fix failing typecheck

* Removing timefilter from Dashboard URL

* Fixing type error

* Replacing time parsing with rison

* Replacing URL regex parsing with legacy URLs

* Fixing failing test

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-13 17:38:47 +00:00
Gidi Meir Morris e8b2b28aef
[alerting] gracefully handle error in initialization of Alert TaskRunner (#54335)
Prevents an edge cases where Alerts can end up in a zombie state.

1. Decrypting attributes throws an error
2. Fetching an Api Key throws an error
3. Getting Services with user permissions throws an error
2020-01-13 17:16:25 +00:00
Poff Poffenberger 71dfdea7ae
[Canvas] Fix expression updating bug (#54297)
* Fix expression updating bug

* Add functional test for expression editor

* Add page object helper to open expression editor

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-13 17:16:12 +00:00
Gidi Meir Morris e54a7175da
pass previousStartedAt as Date into Alert executor (#54576)
Corrects how we pass previousStartedAt into Alert executor
2020-01-13 17:15:08 +00:00
Walter Rafelsberger 6826ece3b0
[ML] Fix appState/globalState (#52987)
Replaces appState/globalState with a custom hook useUrlState().
2020-01-13 18:14:36 +01:00
Corey Robertson 3ce2025c75
[CANVAS] Relax workpad schema to allow existing templates to work (#54019)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-13 11:53:47 -05:00
Brandon Kobel ea4a1ac12c
Fixing the spaces header aria-controls a11y issue (#54512)
* Fixing the spaces header aria-controls a11y issue

* Updating snapshots

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-13 07:21:24 -08:00
Frank Hassanabad 641c67091f
[SEIM][Detection Engine] Time gap detection and logging
## Summary

This adds utilities and logging of time gap detection. Gaps happen whenever rules begin to fall behind their interval. This isn't a perfect works for all inputs and if it detects unexpected input that is not of an interval format (but could be valid date time math) it will just return null and ignore it.

This also fixes a bug with interval where we were using the object instead of the primitive since alerting team changed their structure.

For testing, fire up any rule and shutdown Kibana for more than 6 minutes and then when restarting you should see the warning message. 



### Checklist

Use ~~strikethroughs~~ to remove checklist items you don't feel are applicable to this PR.

~~- [ ] This was checked for cross-browser compatibility, [including a check against IE11](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility)~~

~~- [ ] 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~~

- [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

~~- [ ] 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)~~

### 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)~~

- [x] This includes a feature addition or change that requires a release note and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)
2020-01-13 08:09:55 -07:00
cachedout 05c48cf153
Display APM server memory in bytes (#54275)
* Display APM server memory in bytes

* Add tests for helpers
2020-01-13 13:42:33 +00:00
Nathan Reese 14df4c096c
[Maps] refactor isPointsOnly, isLinesOnly, and isPolygonsOnly to make synchronous (#54067)
* [Maps] refactor isPointsOnly, isLinesOnly, and isPolygonsOnly to make synchronous

* fix jest test

* review feedback

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-13 07:28:39 -05:00
Joe Reuter 204155b4e2
[Graph] Fix various a11y issues (#54097) 2020-01-13 10:26:57 +01:00
Pierre Gayvallet aeebedfa4d
Add ApplicationService app status management (#50223)
* add unimplemented registerAppStatusUpdater & remove observers for apps and legacyApps

* adapt NavLinksService to use new application observables

* merge availableApps$ and availableLegacyApps$

* updating core docs

* adapt the navLink updating methods

* filters the inaccessible apps from availableApps$

* restrict access to navigateToApp depending on app status

* fixes due to merge

* add statusUpdater$ to AppBase

* export new types

* disable navlink depending on app status

* update generated doc

* update snapshots for disabled prop

* Address josh review

* Address review comments

* fix merge conflicts

* adapt changes due to merge

* update generated doc

* add comment and fix navlink url for custom url apps

* add AppNavLinkStatus type to split app/navlink states

* fix typo

* review comments and improvements

* add functional tests

* update generated docs and migration guide

* fix wrong type cast on AppsMenuProvider.readLinks

* properly type return of navigateToApp
2020-01-12 22:37:42 +01:00
MadameSheema 794bb02249
logs in one time (#54447) 2020-01-12 12:25:19 +01:00
Larry Gregory e6e1373db2
Security - Role Mappings UI (#53620)
* Initial role mappings UI

* apply design edits

* address PR feedback

* fix type cast for number field

* Update x-pack/legacy/plugins/security/public/views/management/role_mappings/edit_role_mapping/components/mapping_info_panel/mapping_info_panel.tsx

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

* Cleanup FTR configuration, and handle role mapping 404 errors properly

* align naming of role mappings feature check

* Apply suggestions from code review

Co-Authored-By: Brandon Kobel <brandon.kobel@gmail.com>

* add missing test assertions

* inlining feature check logic

* switch to using snapshot

* use href instead of onClick

* adding delete unit test

* consolidate href building

* unify page load error handling

* simplify initial loading state

* documenting unconditional catch blocks

* use nodes.info instead of transport.request

* Apply suggestions from code review

Co-Authored-By: Brandon Kobel <brandon.kobel@gmail.com>

* move model out of LP into NP

* convert except_field_rule to except_any_rule

* docs, take 1

* update gif

Co-authored-by: Joe Portner <5295965+jportner@users.noreply.github.com>
Co-authored-by: Brandon Kobel <brandon.kobel@gmail.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-11 13:26:31 -05:00
Xavier Mouligneau b057f18d16
[SIEM] [Detection engine] Permission II (#54292)
* allow read only user with no CRUD

* use ../../lib/kibana

* fix timeline-template

* add re-routing on page

* bug

* cleanup

* review I

* review II

* a pretty shameful bug I will live thanks Frank

* bug select rule

* only activate deactivate if user has the manage permission

* add permissions rule with manage api key

* bug on batch action for rules

* add permissions to write status on signal
2020-01-11 08:19:01 -05:00
John Dorlus 10733b5415
Allow User to Cleanup Repository from UI (#53047)
* Added repository cleanup button. Added logic for spinner while loading, added new repository request, type and telemetry metric.

* Added additional bindings for server side to hit the cleanup endpoint.

* fix cleanup request

* Added data test subject to the code editors to differentiate them and fixed a broken inport of RepositoryCleanup.

* Added files for a component integration test. The tests are failing right now so we need to get those green. Added a functional test. Need to set up kbn-es to be able to set up a file repository before being able to run the functional tests.

* Added change to the way data-test-subjects were created for the repository list table so that columns can be individually identified. Added functional test to allow checking the details of repositories.

* Removed the jest tests for repository details until we get jest fixed.

* Fixed jest test to reflect updated test subjects.

* Made changes per feedback in PR comments.

* Fixed i10n issues using <FormattedMessage>. Removed reference to blueBird and used Promise.all(). Fixed all nits in PR comments.

* Added i10n fixes for header.

* Added i10n fixes for header.

* Added name parameter for i18n strings.

* Removed i18n string from JSON.stringify call since it's already a string.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Alison Goryachev <alisonmllr20@gmail.com>
2020-01-11 02:51:35 -05:00
Xavier Mouligneau 51e51ca434
[Detection engine] Some UX for rule creation (#54471)
* wip

* update timelien select to design

* Rename label to design
Timeline Select match design with favorite
Now, you are able to add mutiple items for url and false positive
Add tm for Mitre Att&ck (tnaks Frank)
And match mitre selection to design

* cleanup with michael

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-10 17:37:38 -05:00
Spencer 357be5970d
share specific instances of some ui packages (#54079)
* share specific instances of some ui packages

* remove unnecessary eslint changes, every package will define deps anyway

* remove mentions of moment webpackShims in eslint resolver

* remove use of lodash

* list angular as dep for x-pack

* add operations as codeowner of shared-deps pkg
2020-01-10 15:22:18 -07:00
Dima Arnautov 51c1a8f805
[ML] APM modules configs for RUM Javascript and NodeJS (#53792)
* [ML] apm modules

* [ML] apm modules

* [ML] update mocha test

* [ML] fix config

* [ML] single line JSON formatting for queries

* [ML] remove an empty path component with a trailing slash

* [ML] change detector descriptions, remove scroll size

* [ML] remove chunking_config from datafeeds

* [ML] fix configs

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-10 23:19:26 +01:00
Dario Gieselaar c87ba85141
[APM] Delay rendering invalid license notification (#53924)
* [APM] Delay rendering invalid license notification

Don't render an invalid license notification if the license information has not been loaded. (Don't render any UI either).

* Show UI if license has not loaded
2020-01-10 22:07:55 +01:00
Joe Reuter d459270be2
[Graph] Improve error message on graph requests (#54230) 2020-01-10 22:00:49 +01:00
Jimmy Kuang 63d0bf84c8 [ILM] Kibana should allow a min_age setting of 0ms in ILM policy phases (#53719) 2020-01-10 15:22:13 -05:00
Tim Schnell c9e4304770
Unit Tests for common/lib (#53736)
* converting mocha tests to jest

* adding a few lib tests

* adding more lib tests

* moving test files and adding autocomplete tests

* updating test definition

* fixing import and test definitions
2020-01-10 14:02:11 -06:00
Joe Reuter 51e07f27f2
[Graph] Only show explorable fields (#54101) 2020-01-10 20:34:15 +01:00
Chris Roberson bf7c25332e
[Monitoring] Fetch shard data more efficiently (#54028)
* For the nodes listing page, do not fetch shard data for indices

* Optimize our shard queries for the index and node listing pages

* This change isn't necessary

* Rename file and function

* Use optimized query for ml jobs and es overview

* Apply to node/index detail page, and more renaming

* Unnecessary change

* Fix tests

* Add basic tests

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-10 14:06:54 -05:00
Corey Robertson 934d6b3eeb
[Maps] Add hiddenLayers option to embeddable map input (#54355)
* Add hiddenLayers option to embeddable map input

* Move hiddenLayers logic to actions and reducers. Adds Documentation

* Address code review suggestions
2020-01-10 12:58:37 -05:00
CJ Cenizal 2e3ce5c0f8
Pass termOrder and hasTermsAgg properties to serializeThresholdWatch function (#54391)
* Fix Watcher regression in which a threshold watch's termOrder and hasTermsAgg properties weren't being passed to the serializeThresholdWatch function.
* Remove unused upstreamJson getter method from server models.
2020-01-10 09:53:06 -08:00
James Gowdy 1a3aef0d21
[ML] Job validation loading spinner (#54450)
* [ML] Job validation loading spinner

* adding to modal version

* updating snapshots
2020-01-10 16:26:23 +00:00
Justin Kambic aa9126ec04
[Uptime] Add tags dropdown to Overview filters group (#50837)
* Finish implementing snapshot count redux code.

* Replace GQL-powered Snapshot export with Redux/Rest-powered version.

* Add tests for Snapshot API call.

* Rename new test file from tsx to ts, it has no JSX.

* Rename outdated snapshot file.

* Update filter groups to use redux and add tags dropdown.

* Delete obsolete graphql filter bar query.

* Add fetch effect factory.

* Use generic fetch effect factory to avoid code redundancy.

* Infer isDisabled status from data for filter group buttons and disable when there are no items.

* Fix removal of overview filter from previous rebase.

* Rename generator-related functions from *saga to *effect.

* WIP trying to make filters filterable.

* WIP cleaning up.

* Delete obsolete API test.

* Add API test for filters endpoint.

* Remove obsolete fields from overview filters.

* Add functional testing attributes and delete a comment for filter popover.

* Update obsolete unit test snapshots and test props for filter popover.

* Fix broken types and delete obsolete test snapshots for filters api call.

* Modify filters endpoint to adhere to np routing contracts.

* Add functional test and associated helper functions for filters API.

* Remove obsolete resolver function for filter bar.

* Remove obsolete FilterBar type from graphql schema.

* Delete static types generated for obsolete GQL schema types.

* Delete obsolete fields from default filters state.

* Delete obsolete method from graphql schema.

* Add default values to unit test that requires complete app state mock.

* Extract helper logic to dedicated module.

* Finish working on adapter/helper tests.

* Add state field for overview page search query.

* Apply search kuery to filters.

* Simplify creation of overview filter fetch actions and API call.

* Add tests for overview filter action creators.

* Simplify api query parameterizaton.

* Improve a variable name.

* Update formatting of file.

* Improve a variable name.

* Improve a variable name.

* Simplify API endpoint typing.

* Clean up helper code and rename some functions/vars.

* Clean up parameterization of filter values.

* Move function from dedicated file back to calling file.

* Clean up naming in a function.

* Move function from dedicated file to caller's file.

* Modify interface of function return value.

* Have function throw error when it receives invalid input instead of returning empty object.

* Extract constant value to dedicated function value and remove parameter from function.

* Clean up object declarations.

* Rename a property.

* Fix issue where function was not handling empty input.

* Delete unnecessary snapshots.

* Add message to internal server error response.

* Fix broken type.

* Delete type that was added as a result of a merge error.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-10 11:15:20 -05:00
nnamdifrankie 1d4c2f6ca1
EMT-65:always return accurate endpoint count (#54423)
EMT-65:always return accurate endpoint count, independent of paging properties
2020-01-10 11:08:11 -05:00
Jimmy Kuang 919126160f [Watcher] Support scheme field when creating a Threshold alert with a Webhook action (#53757) 2020-01-10 09:42:02 -05:00
Shaunak Kashyap 402322c7a9
Enable functionbeat telemetry (#54267)
* Adding placeholder for functionbeat telemetry in test fixture

* Adding placeholder for functionbeat telemetry expectation

* Adding placeholder for aggregating functionbeat telemetry per cluster

* Update test + fixture

* Updating code
2020-01-10 06:16:47 -08:00
Anton Dosov a7a557babe
[State Management] State syncing utilities (#53582)
Today, apps rely on AppState and GlobalState in the ui/state_management module to deal with internal (app) and shared (global) state. These classes give apps an ability to read/write state, when is then synced to the URL as well as sessionStorage. They also react to changes in the URL and automatically update state & emit events when changes occur.

This PR introduces new state synching utilities, which together with state containers src/plugins/kibana_utils/public/state_containers will be a replacement for AppState and GlobalState in New Platform.
2020-01-10 17:14:33 +03:00
Pete Harverson 0bafcb9e50
[ML] Display anomaly actual in chart tooltip when model plot enabled (#54364)
* [ML] Display anomaly actual in chart tooltip when model plot enabled

* [ML] Fixes translations for chart tooltip fixes

* [ML] Edits to chart tooltip div following review
2020-01-10 14:12:07 +00:00
James Gowdy cda91cf0cb
[ML] Auto selecting categorization field (#54365)
* [ML] Auto selecting categorization field

* updating translations

* reverting unrelated translation changes
2020-01-10 13:07:28 +00:00
MadameSheema 9ee9f3d038
[SIEM] Improves navigation Cypress tests time execution (#54273)
* extracts before

* fixes the type check failure
2020-01-10 13:48:10 +01:00
MadameSheema 07d56f73f7
[SIEM] Improves event viewer Cypress tests time execution (#54117)
* groups tests in context

* makes tests fully order-independent

* updates Readme file

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-10 13:46:54 +01:00
MadameSheema cc09f61d3b
[SIEM] Improves fields browser Cypress tests time execution (#54236)
* groups fields browser tests by context

* saves cookies between tests

* fix types

* renames 'cleansFieldsBrowser' to 'clearFieldsBrowser'

* adds 'SID cookie to whitelist'

* fixes type check

Co-authored-by: patrykkopycinski <contact@patrykkopycinski.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-10 13:07:29 +01:00
Pierre Gayvallet c0d6b932f1
Allow the mounted application to prompt a confirm message before leaving (#54221)
* add onAppLeave to AppMountParameters

* adapt legacy shims of app mount

* update generated doc

* returns properly typed AppLeaveAction from leave handler instead of raw strings

* add openConfirm to modal service and use it instead of window.confirm

* fix unit test

* update querystringinput snapshots

* add integration tests

* nits and review comments

* add functional tests
2020-01-10 12:17:21 +01:00
Casper Hübertz 4d659477ad
[APM] Update annotation icon for service.version (#54428)
Updating the service version annotation icon in the chart and legend
2020-01-10 11:39:43 +01:00
Jean-Louis Leysens 753eb53448
[SearchProfiler] Remove sources of recursion over potentially deeply nested objects (#54015)
* Added max tree depth guard
Removed recursive normalizeTimes functions (one fewer iteration through the entire data structure)
Optimizied appliation of tree mutations by taking `if` out of tight loop
Cleaned up types

* Tidy up data being passed into store (and through immer)

* Fix max tree depth logic

* Remove immer from non-test code.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-10 10:56:28 +01:00
Garrett Spong 482faae799
[SIEM] Adds Signals Histogram (#53742)
## Summary

Detection Engine Meta Issue: #50405

This PR adds the `Signals Histogram` component for use on the main `Detection Engine` page, `Rule Details` page, and the newly designed `Overview` page.

Out of the box configuration includes an `EuiSelect` for stacking by the following:
* Risk Scores
* Severities
* Event Actions
* Event Categories
* Host Names
* Rule Types
* Rules
* Users
* Destination IPs
* Source IPs

Additional configuration properties are available to configure the component as needed depending on where it will be displayed (e.g. no `Stack By` option on `Overview`, filter to specific `rule_id` on `Rule Details`, etc):

``` ts
interface SignalsHistogramPanelProps {
  defaultStackByOption?: SignalsHistogramOption;
  filters?: esFilters.Filter[];
  from: number;
  query?: Query;
  legendPosition?: 'left' | 'right' | 'bottom' | 'top';
  loadingInitial?: boolean;
  showLinkToSignals?: boolean;
  showTotalSignalsCount?: boolean;
  stackByOptions?: SignalsHistogramOption[];
  title?: string;
  to: number;
  updateDateRange: (min: number, max: number) => void;
}
```
##### Light Theme:
![de_hist_light](https://user-images.githubusercontent.com/2946766/71299977-41685800-234e-11ea-93bd-05a0c4cb6ee1.gif)

##### Dark Theme:
![de_histogram_dark](https://user-images.githubusercontent.com/2946766/71299980-45947580-234e-11ea-9d26-380bae5c4aa6.gif)


##### Overview:

Example props for overview impl:

``` jsx
<SignalsHistogramPanel
  filters={filters}
  from={from}
  loadingInitial={loading}
  query={query}
  showTotalSignalsCount={true}
  showLinkToSignals={true}
  defaultStackByOption={{
    text: 'Signals count by MITRE ATT&CK category',
    value: 'signal.rule.threats',
  }}
  legendPosition={'right'}
  to={to}
  title="Signals count by MITRE ATT&CK category"
  updateDateRange={updateDateRangeCallback}
/>
```
![image](https://user-images.githubusercontent.com/2946766/72030438-2fd7e900-3246-11ea-8404-40905ca5f85c.png)


Note @andrew-goldstein @angorayc @MichaelMarcialis -- looks like the MITRE ATT&CK Tactics are stored as a nested object in `signal.rule.threat`, so we may have to do some finangling to get it to show on the histogram. 

e.g. format:

``` json
{
  "framework": "MITRE ATT&CK",
  "tactic": {
    "id": "TA0010",
    "reference": "https://attack.mitre.org/tactics/TA0010",
    "name": "Exfiltration"
  },
  "techniques": [
    {
      "id": "T1002",
      "name": "Data Compressed",
      "reference": "https://attack.mitre.org/techniques/T1002"
    }
  ]
}
```




### Checklist

Use ~~strikethroughs~~ to remove checklist items you don't feel are applicable to this PR.

- [ ] This was checked for cross-browser compatibility, [including a check against IE11](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility)
- [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
  * Will work with @benskelker on any specific documentation
- [ ] [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)~

### 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)~
- [ ] ~This includes a feature addition or change that requires a release note and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~
2020-01-09 17:52:57 -07:00
Frank Hassanabad 68883c6333
[SIEM][Detection Engine] pre-packaged rule changes and addition of one new rule
## Summary

pre-packaged rule changes and addition of one new rule

### Checklist

Use ~~strikethroughs~~ to remove checklist items you don't feel are applicable to this PR.

~~- [ ] This was checked for cross-browser compatibility, [including a check against IE11](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility)~~

~~- [ ] 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)~~

### 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)~~

~~- [ ] This includes a feature addition or change that requires a release note and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~~
2020-01-09 17:17:34 -07:00
Frank Hassanabad 7eb88c4d13
[SIEM][Detection Engine] Import/Export REST endpoints (#54332)
## Summary

* Adds Import and Export REST endpoints
* Fixes minor misc issues with types
* Changes camel case from bulk api to become snake_case

For the API and testing it is very similar to the saved objects API

For import:

```ts
POST /api/detection_engine/rules/_import
```

With a ndjson body of:

```ts
{"created_at":"2020-01-09T01:38:00.740Z","updated_at":"2020-01-09T01:38:00.740Z","created_by":"elastic_kibana","description":"Query with a rule_id that acts like an external id","enabled":true,"false_positives":[],"from":"now-6m","id":"6688f367-1aa2-4895-a5a8-b3701eecf57d","immutable":false,"interval":"5m","rule_id":"query-rule-id-1","language":"kuery","output_index":".siem-signals-frank-hassanabad-default","max_signals":100,"risk_score":1,"name":"Query with a rule id Number 1","query":"user.name: root or user.name: admin","references":[],"severity":"high","updated_by":"elastic_kibana","tags":[],"to":"now","type":"query","threats":[],"version":1}
{"created_at":"2020-01-09T01:38:00.745Z","updated_at":"2020-01-09T01:38:00.745Z","created_by":"elastic_kibana","description":"Query with a rule_id that acts like an external id","enabled":true,"false_positives":[],"from":"now-6m","id":"7a912444-6cfa-4c8f-83f4-2b26fb2a2ed9","immutable":false,"interval":"5m","rule_id":"query-rule-id-2","language":"kuery","output_index":".siem-signals-frank-hassanabad-default","max_signals":100,"risk_score":2,"name":"Query with a rule id Number 2","query":"user.name: root or user.name: admin","references":[],"severity":"low","updated_by":"elastic_kibana","tags":[],"to":"now","type":"query","threats":[],"version":1}
{"exported_count":2,"missing_rules":[],"missing_rules_count":0}
```

If you want to overwrite existing objects you can use the overwrite query parameter like so:

```ts
POST /api/detection_engine/rules/_import?overwrite=true
```

See and run the scripts of:
```ts
import_rules.sh
import_rules_no_overwrite.sh
```

For exporting everything:

```ts
POST /api/detection_engine/rules/_export
```

For exporting just a handful of things you would send a body like so:

```ts
POST /api/detection_engine/rules/_export
{
  "objects": [
    {
      "rule_id": "query-rule-id-1"
    },
    {
      "rule_id": "query-rule-id-2"
    }
  ]
}
```

To change either the filename of the file that gets downloaded or to remove the extra appended export details you can do the following:

```ts
POST /api/detection_engine/rules/_export?exclude_export_details=true&file_name=my_file.ndjson"
```

See the scripts of:
```ts
export_rules.sh
export_rules_by_rule_id.sh
export_rules_by_rule_id_to_file.sh
export_rules_to_file.sh
```

### Checklist

Use ~~strikethroughs~~ to remove checklist items you don't feel are applicable to this PR.

~~- [ ] This was checked for cross-browser compatibility, [including a check against IE11](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility)~~

~~- [ ] 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~~

- [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

~~- [ ] 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)~~

### 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)~~

- [x] This includes a feature addition or change that requires a release note and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)
2020-01-09 17:16:45 -07:00
Patrick Mueller 5853360d75
pass more alert info into alert executor (#54035)
resolves https://github.com/elastic/kibana/issues/50522

The alert executor function is now passed these additional alert-specific
properties as parameters:

- spaceId
- namespace
- name
- tags
- createdBy
- updatedBy
2020-01-09 18:14:53 -05:00
Phillip Burch 32e61592ec
Remove graphql types (#54176)
* Fix server types

* Remove graphql types from the frontend

* More type cleanup

* Replace more types. Delete unused files

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-09 17:09:57 -06:00
Justin Kambic 6826368842
Add separate describe blocks for different functional test data sources. (#54395) 2020-01-09 16:26:35 -05:00
Chris Roberson dfac5d894e
[Monitoring] Ensure setup mode work in a ccs environment (#54361)
* Ensure setup mode work in a ccs environment

* Missed this file
2020-01-09 13:14:05 -05:00
Joe Portner 719ff259fc
Add support for certificates in PKCS#12 (P12) key stores (#53810)
Kibana now supports the usage of PKCS#12 (P12) key stores and trust stores for certificates and keys.
2020-01-09 13:03:16 -05:00
Chris Cowan a6605f21cc
[Metrics UI & Logs UI] Deprecate the override fields in settings (#54206) 2020-01-09 10:59:16 -07:00
Shahzad 31a0bfd540
[Uptime] Monitor details page left side title (#53529)
* update API

* update query

* hide layer control and added loc tags

* update test

* remove unused comment

* update API

* remove capitalization

* style fix

* update types

* added location status number on details page

* useref instead of createRef

* update interface

* update import

* removed redundant file

* fix header for empty data

* refactor for most recent check

* remove redundant code

* remone unused translation

* update status bar

* update styling

* update snaps

* added API tests

* fix types

* fixing integration tests and a typo

* remove unused translations

* update tests

* fixed PR feedback

* update feedback

* update messaging

* update snap

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-09 18:23:44 +01:00
Tim Sullivan c2362d4807
[Reporting] Update some runtime validations (#53975)
* [Reporting] Update some runtime validations

* fix unit test

* i18n

* make warning logging of encryptionKey possible

* update snapshot

* revert unrelated config change
2020-01-09 10:13:22 -07:00
Pedro Luiz Cabral Salomon Prado 599a470f54 Added space char (#49997)
added space to improve readability

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-09 10:10:55 -06:00
cachedout 459cad534c
[Monitoring] h1 elements for accessibility (#52276)
* Add header element to indices page for WCAG

* Add h1 element for WCAG to node page

* Add h1 element for WCAG to stack monitoring overview page

* Add h1 to advanced nodes page in stack monitoring

* Add h1 to nodes page in stack monitoring

* Add h1 header for index advanced page in stack monitoring

* Standarize more on ide for h1 tag

* Give heading element to beats overview

* Update Beats listing page for H1 compat with WAVE

* Modified beat page to comply with heading rules from WCAG

* Kibana instance listing page updated for header WCAG

* Add WCAG header fix to logstash listing page

* Added headings for WCAG to logstash overview page

* Update pipeline listing page for WCAG A headings

* Fix WCAG heading problems in pipeline viewer

* Fix screen reader heading for APM overview page

* Update APM instances page for screen reader headings

* Update APM instance page for screen reader heading

* Update ccr page for screen reader headings

* More a11y fixes for headings in stack monitoring

* Fixup

* Consistant captalization per review

* Removed help text per review comment

* Include Elasticsearch node into screen reader message, per review feedback

* Update snapshots

* Linting

* Implement review suggestion for i8n compat

* Revert back to just plain string

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-09 15:30:58 +00:00
James Gowdy 36abed3496
[ML] Categorization wizard (#53009)
* [ML] Categorization wizard

* fixing js prettier issues

* adding basic category field validation

* adding rare or count selection

* fixing types

* category examples changes

* improving results search

* adding analyzer editing

* improving callout

* updating callout text

* fixing import path

* resetting cat analyser json on flyout open

* disabling model plot by default

* minor refactoring

* fixing types

* hide estimate bucket span

* setting default bucket span

* removing ml_classic workaround

* changing style of detector selection

* fixing convert to advanced issue

* removing sparse data checkbox

* changes based on review

* use default mml

* fixing job cloning

* changes based on review

* removing categorization_analyzer from job if it is same as default

* fixing translations

* disabling model plot for rare jobs

* removing console.error in useResolver
2020-01-09 15:21:40 +00:00
Nathan L Smith 9befff1236
[APM] Fix service map license check and controls (#54286)
* Check for a trial license as well as platinum when loading the map
* Increase the z-index of the controls so clicking on them works
* Rename the styled component to `ControlsContainer` from `Container` to make a less ambiguous class name on the element
2020-01-09 09:03:50 -06:00
Andrew Cholakian 2d15b8c82b
[Uptime] Improve query performance with Heartbeat 7.6+ data. (#52433)
This PR optimizes both the snapshot component and the monitor list on the overview page by using the new monitor.timespan field from elastic/beats#14778. Note that the functionality here will work with heartbeats lacking that patch, but the performance improvements will be absent.

This PR adapts the snapshot tests to use synthetically generated data which should be easier to maintain. As a result some of that code is refactored as well.

See #52433 parent issue as well.
2020-01-09 08:36:31 -06:00
DeFazio 4466059327
[ML] Updates Anomaly Detection job wizard button styles, page panel and titles (#53340)
* Update button styles, page panel and page title

* Add getJobCreatorTitle function for human readable job type name

* Add formatMessage to Create job title

* Fix translation test

* Update tests
2020-01-09 08:46:46 -05:00
Ahmad Bamieh a27c4c4a4e
[Telemetry] [Monitoring] Only retry fetching usage once monito… (#54309)
* fix interval and add tests

* Update x-pack/legacy/plugins/monitoring/server/kibana_monitoring/bulk_uploader.js

Co-Authored-By: Christiane (Tina) Heiligers <christiane.heiligers@elastic.co>

Co-authored-by: Christiane (Tina) Heiligers <christiane.heiligers@elastic.co>
2020-01-09 02:55:17 +02:00
Xavier Mouligneau 1e2cbb3710
[SIEM] Detection engine timeline (#53783)
* change create to only have only one form to be open at the same time

* add tick to risk score

* remove compressed

* fix select in schedule

* fix bug to not  allow more than one step panel to be open at a time

* Add a color/health indicator to severity selector

* Move and reword tags placeholder to bottom helper text

* fix ux on the index patterns field

* Reorganize MITRE ATT&CK threat

* add url validation + some cleaning to prerp work for UT

* add feature to get back timeline + be able to disable action on timeline modal

* Add option to import the query from a saved timeline.

* wip

* Add timeline template selector

* fix few bugs from last commit

* review I

* fix unit test for timeline_title

* ui review

* fix truncation on timeline selectable
2020-01-08 19:32:10 -05:00
Matthew Kime 9282f19bf5
Management - New platform api (#52579)
* implement management new platform api
2020-01-08 17:43:10 -06:00
Phillip Burch e1e1d964c6
Reset region and Account when switching inventory (#54287) 2020-01-08 16:37:37 -06:00
Steph Milovic 303e4842ea
[SIEM] [Case] Case workflow api schema (#51535) 2020-01-08 14:28:29 -07:00
Dmitry Lemeshko 26ce6104a9
Code coverage setup on CI (#49003)
* running code coverage in CI

* apply review feedback

* add custom function to upload merged coverage reports

* fix artifacts upload without coverage

* add file extension to fix validation

* Check code_coverage is set

* run oss tests via grunt task

* review fixes

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-08 21:08:48 +01:00
Melissa Alvarez e93c6b8d1a
[ML] DF Analytics Results: adds link to docs (#54189)
* add doc links to evaluate panel for analytics jobs

* fix confusion matrix dataGrid label

* internationalize link text
2020-01-08 15:07:14 -05:00
Joe Portner bbe700d797
Update schemas boolean, byteSize, and duration to coerce strings (#54177)
* Update Duration to coerce number strings to numbers (in millis)

* Coerce in a way that's consistent with kbn-config-schema

* Update ByteSizeValue to coerce strings to numbers

* Update Boolean to coerce strings to boolean values

* Fix Jest test

* Address PR review feedback

* Whoops

* Whoops 2

* Whoops 3
2020-01-08 14:48:00 -05:00
Zacqary Adam Xeper 8edb53ddbc
[Metrics UI] Pass relevant shouldAllowEdit capabilities into SettingsPage (#49781)
* [Metrics UI] Pass relevant shouldAllowEdit capabilities into SettingsPage

* Split settings pages in two; add loading screen to settings page

* Restore timestamp field to metrics screen

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-08 13:46:01 -06:00
Corey Robertson 89e4daf5bd
[Canvas] Fixes bugs with autoplay and refresh (#53149)
* Fixes bugs with autoplay and refresh

* Fix typecheck

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-08 14:16:31 -05:00
Melissa Alvarez fc948a0c8e
[ML] DF Analytics Classification: ensure confusion matrix can be fetched (#53629)
* check depVar field type before adding keyword suffix for evaluate endpoint

* update indexPattern type and use FIELD types

* add keyword suffix if field type is keyword

* keyword suffix added if depVar is of type keyword AND text
2020-01-08 13:38:34 -05:00
patrykkopycinski 8e0e4948d5
[SIEM] Fix columns in timeline do not resize (#51816) 2020-01-08 16:33:51 +01:00
Aleh Zasypkin 63ac99b3aa
Re-enable OIDC API integration test. (#54111) 2020-01-08 15:59:06 +01:00
Justin Kambic a93c23cd56 Reorganize structure of component render to avoid errors. (#54251) 2020-01-08 15:53:49 +01:00
Aaron Caldwell 683c138798
Add file upload to telemetry integration tests (#53539)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-08 07:26:54 -07:00
Xavier Mouligneau 6abfbd1382
filters are back (#54218) 2020-01-08 08:58:44 -05:00
Tim Schnell 3b5a90b51c
fix ecommerce percentages in sample data (#54200) 2020-01-08 07:41:52 -06:00
Ahmad Bamieh 392e62a4de
[Telemetry] Fix license page crashing on telemetry.enabled: fa… (#54174) 2020-01-08 13:31:07 +02:00
Alexey Antonov 71ff2de7e1
[ui/public/utils] Copy rarely used items to where they are consumed (#53819)
* [ui/public/utils] Copy rarely used items to where they are consumed

Closes: #52841

* sort_prefix_first 👉x-pack/legacy/plugins/kuery_autocomplete

* numeric 👉src/legacy/core_plugins/kibana/public/management

* diff_object + tests 👉ui/state_management

* function + tests 👉ui/state_management (function.js was removed!)

* key_map 👉ui/directives

* leastCommonMultiple 👉ui/vis

* string_utils 👉ui/saved_objects

* collection

* parse_interval

* it -> test

* fix CI

* fix PR comments

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-08 13:15:54 +03:00
Mikhail Shustov 56041f03ad
Don't expose Elasticsearch client as Observable (#53824)
* expose ES clients without observables

* expose observable-less api to plugins

* update core api and mocks

* update plugins

* NP SO & legacy use updated API

* update SO tests

* update TSDocs

* update types

* update docs

* document createCluster analog in np

* typo
2020-01-08 12:01:47 +03:00
patrykkopycinski 8eb000d629
[SIEM] Cleanup unnecessary use of enzyme-to-json (#53980) 2020-01-08 09:28:38 +01:00
Ryan Keairns 0d11ec7729
change markdown element title (#54194) 2020-01-07 17:26:36 -06:00
Zacqary Adam Xeper f5448bd9f4
[Logs UI] Refactor log position to hooks (#53540)
* Move URL state to hook

* Fix log filter URL state infinite loop

* Initial refactor of log position to hooks

* Simplify and reimplement controlsShouldDisplayTargetPosition

* Fix live streaming

* Flatten logposition destructuring

* Revert "Move URL state to hook"

This reverts commit 4e04aa061d.

# Conflicts:
#	x-pack/legacy/plugins/infra/public/containers/logs/log_filter/use_log_filter_url_state.tsx
#	x-pack/legacy/plugins/infra/public/pages/logs/stream/page_providers.tsx

* Fix unused imports

* Fix link-to test

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-07 16:38:25 -06:00
Ryland Herrick b7a534b1b1
[SIEM] Implement NP Plugin Setup (#54030)
* Set up our react app in the NP way

* Defines the setup() method for our UI plugin
* Renders the app in the NP way within our setup() method
* Defines a legacy file that invokes the plugin manually

Things seem to be mostly working; the app mounts with no immediate
errors, at least.

* Move files into NP structure

Our plugin function and class are both direct children of siem/public.
The app folder contains both our React app and the function to render
it.

* Register SIEM in the feature catalogue via NP format

Unfortunately, this can't live in the plugin for now because it doesn't
get invoked when we need it. For now, it's going to live in the same
spot, and once we're a real NP plugin we can move it.

* Eliminate usage of timezoneBrowser UI setting

This seems to be redundant with dateFormat:tz except that it always
returns a real timezone, not just a preference. By wrapping that logic
in our own hook, useTimeZone, we can remove this weird usage and stick
to the standard dateFormat and dateFormat:tz.

* Clean up tests for FormattedDate components

Mocks our simpler wrapping hooks rather than the entire UI Settings
module.

* Remove remaining uses of UI Settings mocks

These remaining tests can mock settings directly, or otherwise were
misusing the settings mocks to retrieve assertion values.

* Remove unnecessary intermediate `describe` blocks

They were not adding any information to the tests.

* Remove use of kibana version in client requests

We were previously passing this version all over the place for the sake
of our framework-specific request header. The sole advantage of supplying
such a header is that the client will receive an informative error modal
in the case of a version mismatch between the client and server.

We can successfully perform these requests with the `kbn-xsrf` header
instead. Long-term, we can use core.http.fetch to perform the requests
and auto-populate the version header, but it would be nicer to abstract
those requests to the framework level rather than threading the HTTP
client throughout the application.

* Remove newly added uses of kbnVersion

These happened on master in the meantime.

* Use helper to generate test assertion

Allows us to change the implementation of the empty string without
breaking the test.

* Remove guard from date formatting component

We're always going to get back usable values from these hooks; while the
user can unset the dateFormat in their settings, we'll still get an
empty string which is effectively the same as no formatting (as
evidenced in the tests).

* Remove default from byte formatting component

If the user has deleted this default, they presumably meant to do so and
we shouldn't supersede it.

* Refactor bytes formatting to allow use in our charts

We need a formatting function to use with our charts, so this splits out
a hook from the original react component, allowing our charts to be
formatted as specified in the user's UI settings.

* Refer to our constant for APP_ID

* Explicit return values for some UI Settings hooks

This forces accidental changes to the return value to be explicit.

* Remove use of ui/chrome in request header

This is an unnecessary use: kibana works the same no matter what
contents the `kbn-xsrf` header contains (as long as it's there).

* Mock UI Settings values in our TestProvider

When using our TestProvider components, we were previously relying on
platform's UISettings mocks instead of our own, more comprehensive ones.
This worked for the most part, and when we needed real settings we would
mock the UI Settings client manually.

When we removed some app code that defaulted UI Settings values when the
client did not return a value, tests that used TestProviders but also
relied on those defaults broke. This adds that behavior back,
and obviates the need for manual calls to jest.mock except when we're a)
not using TestProviders but b) overriding the platform mocks.

Also removes some of those unneeded uses.

* Remove unused import

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-07 13:20:57 -08:00
Lisa Cawley ae1fac4fe5
[DOCS] Updates ML links (#53613) 2020-01-07 13:07:24 -08:00
Larry Gregory 03ec7af044
Spaces - fix flakey api tests (#54154)
* adding terms query

* run x-pack-ciGroup8 44 times

* Revert "run x-pack-ciGroup8 44 times"

This reverts commit 7d10217c2b.
2020-01-07 14:50:02 -05:00
Justin Kambic 7b33fd318c
Remove dependency that was causing effect to re-execute infinitely. (#54160) 2020-01-07 14:20:02 -05:00
patrykkopycinski 0308c9d8ca
[SIEM] Cleanup React imports (#53981) 2020-01-07 19:30:37 +01:00
renovate[bot] 49d6a45788 Update eslint related packages (#54107) 2020-01-07 19:08:36 +01:00
Shahzad 334dff37d4
[Uptime] Added date range filter into expanded list query (#52609)
* added filters into expanded list query

* update filters

* update query

* update snap

* update tests

* update filters

* update test

* remove side effect

* ignore typcehck

* update to remove location filter from query

* update filter groups

* remove code

* update test
2020-01-07 18:47:00 +01:00
patrykkopycinski 23a0513469
[SIEM] Add react/display-name eslint rule (#53107) 2020-01-07 18:05:04 +01:00
patrykkopycinski 677670b929
[SIEM] Enable eslint prefer-template rule (#53983)
* [SIEM] Enable eslint prefer-template rule

* cleanup

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-07 18:02:32 +01:00
patrykkopycinski 6e1328b9f0
[SIEM] Enable eslint react/no-children-prop (#53985) 2020-01-07 17:46:56 +01:00
Chris Roberson 28b6efa260
Fix linting issues (#54068)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-07 11:31:15 -05:00
Joe Reuter c02531a494
NP Migration: Move doc views registry and existing doc views into discover plugin (#53465) 2020-01-07 16:53:16 +01:00
Melissa Alvarez 865462a259
[ML] DF Analytics job creation: Add 'excludes' input field to form (#53856)
* Add exclude fields input to df analytics creation form

* rename explain api endpoint to general explainDataFrameAnalytics

* wip: use explain api for exclude fields

* show error message if classification depVar has cardinality of > 2

* update types

* updates after conflict resolution

* prevent creation if more than 2 distinct classes for class job. create form field validation file
2020-01-07 10:46:32 -05:00
nnamdifrankie 6a2fb61ae5
EMT-issue-65: add endpoint list api (#53861)
add endpoint list api
2020-01-07 09:59:11 -05:00
patrykkopycinski f46e8e2f0b
[SIEM] Fix doubled drag handles in Timeline (#52679) 2020-01-07 15:56:13 +01:00
Dmitry Lemeshko a1176b0e4a
Functional tests: refactor visualize_page (#53845)
* add new POs and services

* split visualize_page

* refactor PO and tests

* lost changes

* more fixes

* fix tslint error

* refactor POs

* add vega_chart_page, refactor

* review fix

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-07 15:42:20 +01:00
Dima Arnautov 8ac233f303
[ML] Support search for partitions on Single Metric Viewer (#53879)
* [ML] agg for partition field values

* [ML] change api

* [ML] load entity values

* [ML] check for partition field names

* [ML] wip

* [ML] refactor api

* [ML] debounce input

* [ML] remove Record, improve types, fix typo

* [ML] jobId as dedicated param, jsdoc comments

* [ML] result_type term based on model plot config

* [ML] remove redundant criteria for job id

* [ML] refactor getPartitionFieldsValues to TS

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-07 06:14:32 -08:00
Dima Arnautov 54b2f148e3
[ML] persist the brush when expanded to full width (#54020) 2020-01-07 04:55:44 -08:00
Alejandro Fernández 3953c9020e
Skip failing test (#54100)
ES behaves differently in master and in 7.x, causing the test to fail in
the latter.
2020-01-07 13:29:35 +01:00
Cauê Marcondes 58cb24a7e6
[APM] Show errors on the timeline instead of under the transaction (#53756)
* creating error marker and refactoring some stuff

* styling popover

* adding agent marks and errors to waterfall items

* adding agent marks and errors to waterfall items

* adding agent marks and errors to waterfall items

* fixing tests and typescript checking

* refactoring helper

* changing transaction error badge style

* adding unit test

* fixing agent marker position

* fixing offset when error is registered before its parent

* refactoring error marker

* refactoring error marker

* refactoring error marker

* refactoring error marker

* refactoring error marker

* refactoring waterfall helper

* refactoring waterfall helper

* refactoring waterfall helper api

* refactoring waterfall helper

* removing unused code

* refactoring waterfall helper

* changing unit test

* removing comment

* refactoring marker component and waterfall helper

* removing servicecolor from waterfall item and adding it to errormark

* fixing trace order
2020-01-07 11:56:23 +00:00
MadameSheema 7607c162fe
removes logout (#54098) 2020-01-07 12:53:58 +01:00
Jean-Louis Leysens e687fc63df
[Console] Telemetry (part 1) (#52893)
* Saving anonymised data to SO

* Add new files

* Hook up usage collector

* Added app start up ui metric tracking

* Only use client side track metrics functionality

* Added comment regarding use of `patterns`, renamed trackMetric -> trackUiMetric

* Fix jest tests

* Slight refactor and fix for functional tests. More defensive tracking logic

* Fix types in test

* Minor refactor to get endpoint description - removed SenseEditor from autocomplete.
Fix bug where cursor at end of line does not get endpoint informaiton

* Send request to es: do not mutate args
Always move cursor to end of line when getting endpoint description

* Create an interface a simple interface to the metrics tracker
Use the new createUiStatsReporter function to create the tracker

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-07 11:01:21 +01:00
Cauê Marcondes 6398e22b4f
adding message to transaction and span metadata (#54017) 2020-01-07 08:33:49 +00:00
Melissa Alvarez 9aa23410d5
convert modelMemoryLimit nums to strings before validation check (#54011) 2020-01-06 19:50:55 -05:00
Tim Sullivan fef8485f36
[Reporting/Legacy] Remove reporting legacy job params compatibility shim (#52539)
* [Reporting/Tests] consolidate functional test configs

* remove console.log

* trash

* Update

* add more to the comment

* restore historic archive for wip ui functional tests

* [Reporting/Legacy] Remove reporting legacy job params compatibility shimmy shim shim

* objectType: objectType

* fix jest test and get_urls logging

* simplify change

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-06 16:20:45 -07:00
Justin Kambic 9481cbf36e
[Uptime] Prefer Kibana core http services (#53726)
* Prefer Kibana core http service to other fetch functions, refactor helper functions to hooks.

* Reintroduce newline deleted in previous commit.

* Clean up obsolete import.

* Clean up effect code in new hook.

* Clean up enum usage in new hook.

* Implement PR feedback on new hook.

* Fix eslint error.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-06 18:00:49 -05:00
Tim Sullivan fa8da7c349
[Reporting/PDF] Refactor screenshot pipeline for multi-url by default (#48588)
* Multi-url pass to screenshotsObservable

* Restore "first" operator

* max attempt = 1 for testing

* cleanup debug

* restore more concatMap

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-06 14:34:27 -07:00
Tim Sullivan c9c80845d0
Check license to typescript (#52955)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-06 13:29:13 -07:00
Aaron Caldwell 368a894bd2
[Maps] Fix regression preventing maps telemetry from populating & remove task manager logic (#52834)
* Remove task logic. Remove server refs and revise for np. Migrate a few files to ts

* Remove unused reference

* Update mappings

* Test usage collector register

* Update api integration tests to include maps now that telemetry is 'normal' (not using task mgr state)

* Update integration test to use stack stats

* Update integration test to look for 'maps-telemetry' instead of 'maps'

* Update jest test to reflect calls to register

* Follow the same pattern as other int tests and test reliable nested attribute

* Back out np-related changes for separate PR

* timeCaptured hasn't changed but for some reason stopped working. Getting iso string fixes issue

* Back out file shuffling for separate PR

* Remove mappings updates (handled in separate PR)

* Review feedback. Move telemetry type constant to constants file

* Consolidate imports

* Linting fix

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-06 13:05:07 -07:00
Chris Davies f08fc201c8
Add support for scripted fields and (#53948)
default index pattern

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-06 14:55:51 -05:00
Nathan Reese dbe0bfdf79
[Maps] Allow editing EMS basemap selection (#53631)
* [Maps] Allow editing EMS basemap selection

* resync source data when map changes

* remove old sources and layers

* update ownsMbLayerId and ownsMbSourceId so they return true for previous sources when source changes

* review feedback

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-06 14:55:12 -05:00
Chris Davies ae8925c123
Select Records when count operation is chosen (#53911) 2020-01-06 14:54:49 -05:00
Larry Gregory 194c97f4f6
Reorganizing spaces client-side plugin (#53644)
* reorganizing spaces client-side plugin

* additional testing and cleanup

* address PR feedback

* additional cleanup

* rename scss file

* one more index
2020-01-06 14:12:07 -05:00
Chris Cowan eb5460fe66
[Metrics UI] Add AWS Cloudwatch dimensions to groups filter in Metrics Explorer (#53624)
* [Metrics UI] Adding aws.cloudwatch.* fields to group by for aws.metrics in Metrics Explorer

* Ensuring the correct module is used for the field.

* Adding a unique around the fields to prevent potential extra work

* Adding missing file

* Fixing possible missing event.dataset

* clean up for review
2020-01-06 10:31:29 -07:00
Nathan Reese 1e5135ec53
[Maps] Vector style UI redesign (#53946)
* [Maps] style editor update

* update label editor

* update size editor

* update orienation editor

* i18n cleanup

* deconstruct props

* review feedback

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-06 11:42:01 -05:00
Shahzad e4ccf19f75
[Uptime] Fix/location map hide layer view control (#53568)
* hide layer control and added loc tags

* update test

* remove unused comment

* remove capitalization

* style fix

* update types

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-06 16:54:37 +01:00
Gidi Meir Morris 785b916917
allows Alerts to recover gracefully from Executor errors (#53688)
Prevents errors in Alert Executors from forcing their underlying tasks into a zombie state.
2020-01-06 14:52:06 +00:00
Jean-Louis Leysens 6ce2818f88
[Console] Fix OSS build (#53885)
* Move fp-ts and immer to "." package.json

* Revert "Move fp-ts and immer to "." package.json"

This reverts commit b876df0d54.

* Second attempt, fp-ts and immer -> root

* fp-ts -> 2.3.1

* Revert x-pack/package.json

* Update fp-ts in x-pack/package.json

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-06 15:21:44 +01:00
Gidi Meir Morris 8992a43c6e
adds strict types to Alerting Client (#53821)
The AlertsClient API currently returns mixed inferred types instead of a clear strict type, making it harder to work with the client's type signatures.
The root causes for this difficulty is that we have to support the SavedObjects API which allows partial updates of types, and the implementation of code that converts the SavedObject from a RawAlert to an Alert in a non type-strict manner.

To address this we've added concrete types on the AlertsClient APIs, using Partial on update due to the SavedObjects API, and a strict Alert on the other APIs.
2020-01-06 11:11:18 +00:00
Maja Grubic 5b2a188c43
[Dashboard] Empty screen redesign (#53681)
* Edit screen redesign

* Edit screen redesign

* Redesign view screen

* Redesign view screen

* Fixing type failure, and functional test

* Updating failing functional tests

* update dashboard empty styles

* i18n fix

* Updating failing snapshot

Co-authored-by: Ryan Keairns <rkeairns@chef.io>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-06 10:55:15 +00:00
Aleh Zasypkin aa38fb68a7
Migrate config deprecations and ShieldUser functionality to the New Platform (#53768) 2020-01-06 11:43:15 +01:00
Mikhail Shustov d64c4cb5fe
increase delay to make sure license refetched (#53882)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-06 12:24:25 +03:00
Thomas Neirynck c19151d474
[Maps] show custom color ramps in legend (#53780) 2020-01-05 20:05:47 -05:00
Maja Grubic 58da936968
[Lens] Expression type on document can be null (#53883)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-05 09:16:07 +00:00
Xavier Mouligneau a73ad23a64
[SIEM] [Detection engine] Add user permission to detection engine (#53778)
* add logic to see if we can show signals or create signal index for user

* fix unit test

* fix spelling set up

* Update msg from review

* review II

* fix type

* review III

* fix bug found by Garrett

* fix snapshot
2020-01-04 20:20:41 -05:00
Marco Vettorello 9d5603a298
Update dependency @elastic/charts to v16.0.2 (#52619) 2020-01-04 13:38:11 +01:00
Zacqary Adam Xeper a03f395b52
[Logs UI] Refactor query bar state to hooks (#52656)
* [Logs UI] Refactor query bar state to hooks

* Update typedef

* Typecheck fix

* Typecheck fix

* Simplify log filter state

* Remove WithLogFilter HOC and simplify hook further

* Rename js to ts

* Fix redirect imports

* Fix link-to test accuracy

* Fix link-to test

* Simplify destructuring signature

* Stylistic fixes

* Move URL state to hook

* Fix log filter URL state infinite loop

* Revert "Fix log filter URL state infinite loop"

This reverts commit 43302b354a.

* Revert "Move URL state to hook"

This reverts commit c61f5b190b.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-03 15:45:11 -06:00
Nathan Reese ace50d8d2b
[Maps] pass getFieldFormatter to DynamicTextProperty (#53937)
* [Maps] pass getFieldFormatter to DynamicTextProperty

* remove files from another PR
2020-01-03 14:19:19 -05:00
Mike Côté 8cc778a64a
Invalidate alert API Key when generating a new one (#53732)
* Initial work to auto cleanup old API keys

* Fix ESLint error

* Rename confusing variables

* Add test to ensure thrown errors are swallowed

* Add more tests

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-03 13:40:20 -05:00
Alejandro Fernández 47830c75d9
[Logs UI] HTTP API for log entries (#53798)
* Scaffold `log_entries/entries` route

* Scaffold a log entry response

* Add `after` pagination

* Add `before` pagination

* Process `query` parameter

* Use pre-existing structure for the columns

* Change type of date ranges

We will move the responsibility to parse the dates to the client. The
API will only take timestamps

* Add `center` parameter

Allows consumers of the API to get log items around a certain cursor

* Change default page size

* Test the defaults of the API

* Add optional `size` parameter

This makes easier to test the pagination. By default it returns a 200
size page.

* Test the pagination

* Test centering around a point

* Handle `0` sizes

Co-Authored-By: Zacqary Adam Xeper <Zacqary@users.noreply.github.com>

* Add highlights endpoint

* Refactor `processCursor`

* Tweak cursor handling in the routes

* Refine `LogEntry` type

* Add tests for highlights endpoint

* Tweak the types for the LogEntry

Co-authored-by: Zacqary Adam Xeper <Zacqary@users.noreply.github.com>
2020-01-03 18:12:47 +01:00
Spencer 7b4278dc49
[kbn/pm] add caching to bootstrap (#53622)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-03 09:35:38 -07:00
Gidi Meir Morris d4b1966d4f
adds createdAt and updatedAt fields to alerting (#53793)
When users are writing UI's they need to see when an alert was created and when it was last updated, to this end we've added these two fields on the alert type.
2020-01-03 16:34:17 +00:00
Alison Goryachev 45e227b2b5
[SR] Enable component integration tests (#53893) 2020-01-03 10:26:17 -05:00
Alexey Antonov 6942d0bbe6
Move index patterns: src/legacy/core_plugins/data 👉 src/plugins/data (#53794)
* Move index patterns: src/legacy/core_plugins/data 👉 src/plugins/data

Closes: #43444

Make sure that all index pattern related imports use NP (and delete index_pattern folder from shim)

* fix JEST tests

* fix CI

* fix PR comments

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-03 15:57:46 +03:00
Gidi Meir Morris b09653ac74
moved Task Manager server code under "server" directory (#53777)
Changes Task Manager folder structure to include a "server" folder as required by our linting rules as part of the migration to the Kibana Platform
2020-01-03 12:07:17 +00:00
Aleh Zasypkin 6cf7ece9df
Rename /api/security/oidc to /api/security/oidc/callback. (#53886) 2020-01-03 10:01:50 +01:00
Tim Sullivan 08e6ee2b22
[Reporting/Tests] consolidate functional test configs (#52671)
* [Reporting/Tests] consolidate functional test configs

* remove console.log

* trash

* Update

* add more to the comment

* restore historic archive for wip ui functional tests
2020-01-02 15:31:16 -07:00
Tim Sullivan 01dd08ea9a
[Reporting] Correct the docvalue_fields params in the search query Download CSV from Dashboard Panel (#52833)
* fix the bug and add a test

* fix query bug of empty array

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-02 15:30:41 -07:00
Patrick Mueller 592bc43600
cleanup server-log action (#53326)
- make the level param optional, defaults to info
- change the actions logger "tag" from "alerting" to "actions"
- remove control characters from message
2020-01-02 17:12:41 -05:00
Justin Kambic bd2be32876
[Uptime] Delete uptime eslint rule skip (#50912)
* Delete uptime eslint rules.

* Update hooks usage to adhere to new eslint rules.

* Delete code accidentally added during rebase.

* WIP trying things.

* Clean up types and hook usage to comply with kibana eslint rules.

* Clean up code.

* Update new useEffect hooks that are missing dependencies.

* Fix edits that broke a page.
2020-01-02 16:36:07 -05:00
Kevin Logan fa6a801ebd
[Endpoint] add react router to endpoint app (#53808)
* add react router to endpoint app

* linting

* linting

* linting

* correct tests

* change history from hash to browser, add new test util

* remove default values in helper functions

* fix type check, use FunctionComponent as oppsed to FC

* use BrowserRouter component

* use BrowserRouter component lin

* add comments to test framework, change function name to include browserHistory

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-02 15:58:45 -05:00
Ryland Herrick d9554ff66c
[SIEM][Detection Engine] Silence 409 errors on signal creation (#53859)
* Remove punctuation from translation

We already had a colon on both uses of this key, resulting in '::' on
the page.

* Ignore 409 errors from our signal creation

In my experience these are always due to a rule being run multiple times
on the same document, generating a duplicate signal with a (correctly)
duplicate id. Only if we encounter non-409 errors do we log a message to
the user.

* Hide 409 errors during signal creation

These are expected and potentially confusing to the user. Instead, we
only show unexpected errors.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-02 13:34:57 -06:00
Nathan Reese 47e5342c27
[Maps] get max_result_window and max_inner_result_window from index settings (#53500)
* [Maps] pull ES_SIZE_LIMIT and top hits limit from index settings

* get fetch working

* get min values from indicies response

* use indexSettings.maxResultWindow in documents request size

* use max_inner_result_window to define top hits max

* update jest test

* update docs

* more docs changes for top hits

* fix line spacing

* Update docs/maps/maps-aggregations.asciidoc

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

* Update docs/maps/vector-layer.asciidoc

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

* add api integration test for indexSettings route

* eslint fixes

* review feedback

* display toast on first index settings fetch failure

* clean up

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-02 12:25:28 -07:00
Melissa Alvarez 9372100516
[ML] New Platform server shim: update analytics routes to use new platform router (#53521)
* update dfAnalytics routes to use np router

* add route schemas and only show error message

* convert route file to ts and set handlers inline

* update df analytics param type

* update mlClient type and assert mlClient is not null

* handle errors correctly

* ensure error status gets passed correctly to wrapper
2020-01-02 11:38:19 -07:00
Ben Skelker 7f39fd8f34
fixes typo on engine detection page (#53877) 2020-01-02 20:36:58 +02:00
Nathan Reese b7c53502c5
[Maps] push mapbox value extraction from VectorStyle and into DynamicStyleProperty (#53806) 2020-01-02 07:53:55 -07:00
Anton Dosov dcb8cca63c
Clean up generic hooks, use react-use instead (#53822)
As we recently added react-use as a dependency, makes sense to clean up those generic hooks from Kibana repo.

Removed custom hooks from kibana_react and other places:
useObservable
useUnmount
useShallowCompareEffect

react-use should be used instead:
import useObservable from 'react-use/lib/useObservable'
2020-01-02 14:04:31 +03:00
Mike Côté 98ac7a64ad
Add tests to ensure AAD isn't broken after performing a change on an alert / action (#53333) 2019-12-31 13:36:39 -05:00
Poff Poffenberger b8046c7964
[Canvas] Refactor Canvas to no longer use componentWillReceiveProps (#52129)
* Removing componentWillReceiveProps from time filter

* Changing expression form to componentDidUpdate

* Updating expression to be key-driven updates and arg_types to use compomentDidUpdate

* temporary

* Revert "temporary"

This reverts commit 255525d65f.

* typo fix

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2019-12-30 09:19:51 -06:00
Poff Poffenberger 6765def84d
[Canvas] Migrate usage collector to NP plugin (#53303)
* Move canvas usage collector to NP plugin

* Removing old usage collector fom legacy Canvas plugin

* Adding types placeholder

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2019-12-30 09:16:36 -06:00
Eli Perelman 054ec7036d
Add server rendering service to enable standalone route rendering (#52161)
* Add server rendering service to enable standalone route rendering

* Update renovate config

* Move legacy rendering functionality to legacy service

* Use config for exposed variable in new platform

* Lint changes from rebase

* Rebase artifact

* Remove RenderingProvider, add tests for legacy vars implementation, review notes

* Add UI app functionality to legacy service

* Update rendering snapshots

* Update docs

* Fix up functional tests

* Clean up legacy types

* Revise types from reverting injected metadata changes

* Update translations and broken tests

* Mock legacy internals in legacy tests

* Add missing doc types

* Rename InternalRenderOptions to LegacyRenderOptions

* Remove extraneous legacy exports, review nits

* Functional tests fixes

* Rebase, attempt CI test fixes

* Only allow specified appIds in testbed rendering integration test

* Update snapshot names

* Review nits
2019-12-29 02:10:55 -06:00
Aaron Caldwell 6669111f86
Update maps telemetry mappings to account for recent updates (#53803) 2019-12-26 14:02:06 -07:00
Thomas Neirynck 4b00bada23
[Maps] Only show legend when layer is visible (#53781) 2019-12-26 11:15:16 -05:00
Søren Louv-Jansen 53513f6b7b
[APM] Add log statements for flaky test (#53775)
* [APM] Add log statements for flaky test

* Improve logging

* Improve logging

* Log full index on error
2019-12-24 12:39:08 +01:00
Cauê Marcondes 3b0cce0035
[APM] Transaction page throws unhandled exception if transactions doesn't have http.request (#53760)
* Making http.request optional

* changing unit test
2019-12-24 10:33:20 +01:00