Commit graph

3518 commits

Author SHA1 Message Date
Shahzad 7c7fbc70cd
[Uptime] Refactor folder structure (#63442)
* update structure

* update connected structure

* update connected structure

* update code structure

* update types

* update imports

* update folder

* update trans

* fixed snapshot

* updated code

* refacto monitor list container

* update types

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-20 11:12:17 +02:00
Shahzad c59320c7dd
[Uptime] Refresh index and also show more info to user regardi… (#62606)
* Refresh index and also show more info to user

* updated type

* updated type

* updated test

* updated formatting

* update text

* updated types

* updated translation

* update

* fixed types

* updated code

* fixed types

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-18 13:41:11 +02:00
Justin Kambic 4242fe5400
[Uptime] Add cert API request and runtime type checking (#63062)
* Add cert API request and runtime type checking.

* Collapse on sha256 field instead of common_name.

* Add basic wildcard search capabilities.

* Support searching.

* Update fields and queries, remove server response validation.

* Update API to utilize x509 fields.

* Add new fields to certs API request, provide defaults.

* Add api test for cert api.

* Add unload command to certs test.

* Extract API params interface to io-ts type.

* Rename a functional test.

* Fix broken type.
2020-04-17 17:58:27 -04:00
Wylie Conlon 561c0f9fed
[Lens] Allow table to scroll horizontally (#63805)
* [Lens] Allow table to scroll horizontally

* Fixing scrolling pt. 2

Co-authored-by: cchaos <caroline.horn@elastic.co>
2020-04-17 17:03:33 -04:00
Aaron Caldwell f179ec4069
Migrate legacy maps licensing (x-pack/tilemap) to NP (#63539)
* Move logic to NP and add basic plugin structure

* Remove unused server-side licensing logic and old index

* Set license in maps_legacy via new plugin

* Change add to set for service settings queryParams function

* Fix accidentally changed emsClient method call

* Require at least a basic license

* Type updates

* Remove unneeded legacy license test

* Remove unused headers in test
2020-04-17 13:56:20 -06:00
Ryland Herrick 40f82229f0
[SIEM] Server cutover to New Platform (#63430)
* Move server code into NP folder

* NP config is not yet used
* Relative imports are somewhat broken

* Move common folder into NP

* Move cypress folder into NP

* Move scripts folder into NP

* Move misc. config into NP folder

A few of these were moved into the cypress folder as they're
cypress-specific.

I tried to update all the relative paths but some are likely broken. I'm
not going to know until other stuff is fixed, though.

* Move value for siem index pattern into common/constants

The other default values live in there, this is no different.

* Update paths following file move

If this was referencing the full project, it now references both paths
(legacy for UI, and NP for server).

* Fix typescript errors related to module resolution

These are mostly updating imports to the common/ folder on the UI side
(since things changed relative to those files).

* Replace Legacy Config with NP Config

* Updates plugin to use NP config
  * defines new config previously coming from savedObjects config
* cleans up legacy types

 Conflicts:
	x-pack/plugins/siem/server/lib/detection_engine/routes/rules/export_rules_route.ts
	x-pack/plugins/siem/server/lib/detection_engine/routes/rules/import_rules_route.ts
	x-pack/plugins/siem/server/lib/detection_engine/rules/types.ts
	x-pack/plugins/siem/server/plugin.ts
	x-pack/plugins/siem/server/routes/index.ts
	x-pack/plugins/siem/server/types.ts

* Remove local SIEM tsconfig

This was originally added to address an issue with tsserver, but that
issue is no longer relevant. The presence of this file confuses
typescript into thinking that siem is a separate TS project.

* Update kibana.json to declare our dependencies

These are not necessarily correct in terms of what's required/optional,
but this is what's declared in our types.

* Remove legacy plugin instantiation

* Removes legacy instantiation of server plugin, which is now handled by
NP
* Loosens legacy config spec so we no longer have to duplicate config
types

* Update tests with NP config

These were written against the old Hapi config function; now, we just
have a POJO.

* Update es_archiver helpers' paths

I'm not quite sure if these are working yet, but they're no longer
throwing errors.

* Ignore restricted path on script

This was cribbed from infra, who has made a similar change.

* Ignore restricted path on temporary savedObject mappings import

This will be changed subsequently when we switch to the NP form of
savedObject type registration.

* Add symlink to lockfile

* Fix paths on circular deps script

* Add separate config for Rule and Timeline saved objects

We had previously used the savedObjects' config, but those are not
currently exposed to us on New Platform. For now, we're going to split
this into two sets of values for the SOs we deal with
importing/exporting within the SIEM app, with the same defaults as
savedObjects.

* Fixing relative paths within cypress

These are strings that wouldn't be caught by typescript.
2020-04-17 12:31:54 -05:00
Cauê Marcondes 675c5898ca
[APM] Reparenting spans to support inferred spans (#63695)
* reparening spans

* adding unit test

* adding unit test
2020-04-17 18:19:19 +02:00
Joe Reuter 550d6af2cb
Migrate rollup client side code (#63227) 2020-04-17 18:07:27 +02:00
Justin Kambic 7efe7e88d3
[Uptime] Remove monitor states graphql (#62853)
* WIP replacing GQL with redux/rest.

* Finish implementing migration.

* Introduce new connected component for ping list.

* Replace GraphQL type with io-ts.

* Update some broken tests.

* Add test for new helper function.

* Write test snapshots.

* Migrate api tests from graphql to rest.

* Update fixtures that rely on pings.

* Move ping types to runtime_types folder with rest of io-ts files.

* Update Ping type location and imports, type checking.

* Remove reliance on fixtures for ping functional API tests.

* Fix broken unit tests.

* Fix broken types.

* Remove local state storage from parent components.

* Add functional test to cover Ping List functionality.

* Fix monitor page functional test that was broken by merge conflicts.

* Fix broken tests.

* Fix broken API test.

* Replace a test with a describe block that will pre-navigate all tests.

* Delete unused reducer keys.

* Re-introduce loading to ping list reducer.

* Inroduce code that will cause PingList to re-fetch when refresh button is pressed.

* Update expanded rows to support multiple concurrent expanded rows.

* Modify pingList reducer to have singular optional error field.

* Delete unnecessary helper code.

* Delete unused interface.

* Add runtime_type to parse getPings params, fix pagination index.

* Add dedicated monitor type to runtime_types.

* Fix broken tests.

* Fix broken tests.

* Rename '@timestamp' property to 'timestamp' on Ping type.

* Fix broken type and key pings list table on document ID instead of timestamp.

* Fix broken unit tests.

* Fix broken tests and types.

* Fix broken functional test.

* Add REST endpoint for monitor states.

* Add REST route to constants file.

* Introduce io-ts typing for monitor states.

* Remove remaining GraphQL types.

* Update monitor states types to use io-ts types.

* Add state management for monitor states.

* Introduce connected monitor list component.

* Fixup runtime types for monitor states.

* Remove all remaining references to apollo graphql.

* Update URL generator function tests to use inline snapshots instead of snapshot files.

* Fix missing imports and small type issues.

* Prefer inline snapshot to object literal comparison.

* Add type check and console log to API response.

* Update README to remove graphql references.

* Fix type error.

* Make monitor list refresh when global refresh button is pressed.

* Fix broken types.

* Rename `@timestamp` field to `timestamp`.

* Change spelling of var.

* Add timestamp map for `@timestamp` field in monitor states fetcher.

* Remove need for `monito_states` fixture.

* Write test code that allows for deletion of the `monitor_states_id_filtered` fixture.

* Rewrite pagination tests to no longer rely on monitor states page fixtures.

* Skip test that is causing other functional tests to fail.

* Remove unused translations.

* Fix broken test snapshots.

* Fix stale error reporting errors.

* Remove runtime validation from REST handler.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-17 11:50:20 -04:00
CJ Cenizal 7e7884e01f
Add body validation to update follower index API endpoint. (#63653) 2020-04-17 07:37:50 -07:00
Yara Tercero 954dda1662
[SIEM][Detections] - Update KQL/Lucene search to include lists exceptions (#63264)
[SIEM][Detections] - Update KQL/Lucene search to include lists exceptions (#63264)

### Summary 

This PR adds logic to include the lists values in search so we can now filter off of lists.

- does work with KQL search
- does work with Lucene search
- does NOT yet filter off of large lists (will be separate PR)
- does NOT yet work on ML search (will be separate PR)
2020-04-17 10:04:48 -04:00
Andrew Goldstein c2293cb11d
[SIEM] Threat hunting enhancements: Filter for/out value, Show top field, Copy to Clipboard, Draggable chart legends (#61207)
## [SIEM] Threat hunting enhancements: Filter for/out value, Show top field, Copy to Clipboard, Draggable chart legends

Enhancements to the threat hunting experience

![show-top-field](https://user-images.githubusercontent.com/4459398/79180753-f9bb7f80-7dc7-11ea-9ae2-d4e4fc79208c.gif)

### New draggable context menu

A new context menu with the following items has been added to all draggables:

- Filter for value
- Filter out value
- Show top _field name_
- Copy to Clipboard

as shown in the following animated gif:

![new-context-menu](https://user-images.githubusercontent.com/4459398/79173935-4dbd6880-7db6-11ea-9253-7746481e1b17.gif)

### Filter for value

The _Filter for value_ context menu action adds the draggable to the global filter bar, which is applicable to all pages in the SIEM app, per the following animated gif:

![filter-in-value](https://user-images.githubusercontent.com/4459398/79176624-f91deb80-7dbd-11ea-9b01-799145d776c8.gif)

### Filter out value

The _Filter out value_ context menu action adds the draggable to the global filter bar as a _negated_ (`NOT`) filter, per the following animated gif:

![filter-out-value](https://user-images.githubusercontent.com/4459398/79178474-9f6bf000-7dc2-11ea-9423-512ad7f89a18.gif)

### Show top _field_

The _Show top field_ context menu action displays an interactive Top 10 histogram, per the following animated gif: 

![show-top-field](https://user-images.githubusercontent.com/4459398/79180753-f9bb7f80-7dc7-11ea-9ae2-d4e4fc79208c.gif)

- The contents of the histogram are filtered by the global KQL bar / filters and current date range
- Brushing over the bars in the histogram updates the global date range / picker
- Select _Events_ or _Signals_
- The _Show top field_ action is also available in the Fields Browser, per the following animated gif:

![in-fields-browser](https://user-images.githubusercontent.com/4459398/79179548-1a360a80-7dc5-11ea-9ad7-cdd7fef0cc64.gif)

### Copy to Clipboard

The _Copy to clipboard_ context menu action copies the draggable field and value to the clipboard in KQL format (e.g. `process.name: "nice"`).

Per the following animated gifs, it's now possible to copy _any_ draggable to the clipboard, and paste it in KQL format, which addresses [this feature request from a user](https://github.com/elastic/kibana/issues/59472):

![copy-to-clipboard](https://user-images.githubusercontent.com/4459398/79178893-a7785f80-7dc3-11ea-868a-5d7bc2824912.gif)

![pasted-value](https://user-images.githubusercontent.com/4459398/79179126-2c637900-7dc4-11ea-92a7-86c7d6377688.gif)

### Draggable chart legends

You may now pivot from chart legends by dragging and dropping them to a timeline, or by selecting the Filter for / out context menu action, per the following animated gif:

![draggable-legend](https://user-images.githubusercontent.com/4459398/79179769-9deff700-7dc5-11ea-9153-b472914f2dfe.gif)

#### Desk testing

Desk tested in:

- Chrome `81.0.4044.92`
- Firefox `75.0`
- Safari `13.1`
2020-04-16 22:17:28 -06:00
Nathan Reese 420ccffcd6
[Maps] fix term join agg key collision (#63324)
* [Maps] fix term join agg key collision

* fix tslint and jest errors

* fix join functional test

* revert LayerDescriptor union and cast to VectorLayerDescriptor instead

* move getJoinKey out of constants and into its own file

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-16 19:22:02 -06:00
Nick Partridge 4e8ff57355
update elastic charts to 18.3.0 (#63732) 2020-04-16 17:00:36 -05:00
Dario Gieselaar 5413cee294
[APM] Encode spaces when creating ML job (#63683)
Closes #62370. Per 95a7eed9aa/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/utils/MlStrings.java (L20-L26), spaces are not supported in job and group ids.
2020-04-16 22:50:16 +02:00
Thomas Neirynck ad41eea211
[Maps] Add 3rd party vector tile support (#62084)
Adds support for adding an external vector tile service to Maps. This is experimental functionality. To enable, add `xpack.maps.enableVectorTiles: true` to the `kibana.yml`configuration file.
2020-04-16 16:26:13 -04:00
Shahzad a9399c3d91
[Uptime] Certificate expiration threshold settings (#63682)
* update settings

* added cert form

* update settings

* update types

* update test

* updated tests

* updated snapshots
2020-04-16 21:13:35 +02:00
Alexey Antonov 871f7209f9
[Timeseries] remove unused configuration properties (#62543)
* [Timeseries] remove unused configuration properties

* Fix PR comments

* update id of vis_type_timeseries plugin

* metrics -> vis_type_timeseries

* fix wrong plugin id

* update requiredPliugins for infra/kibana.json

* change id

* update plugin id in infra folder

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-16 19:28:04 +03:00
Devin W. Hurley ebcb50227a
[SIEM] [Detection Engine] Changes find_statuses route HTTP met… (#63508)
* changes http method for find_statuses route from GET to POST

* fix test string formatting

* update sample shell script for find statuses route

* adds e2e test for find statuses
2020-04-16 10:52:43 -04:00
Frank Hassanabad 721e4fae1b
[SIEM][Detection Engine] Adds an error aggregator by error reason and a way to filter them
## Summary

Changes the error handling for when responses are returning with errors from the backend. We were aggregating on error status codes, but this will aggregate on the error reason per rule run and report those instead.

* Adds a utility function
* Adds unit tests for the utility function
* Adds TypeScript Types for the utility function
* Adds sample helpers for the mocks for testing 

### Checklist

- [x] [Unit or functional tests](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility) were updated or added to match the most common scenarios
2020-04-16 08:04:23 -06:00
Aaron Caldwell 11b6f7fc7d
[Maps] Update remaining client dependencies to NP (#63297)
* Routes dependencies updated (except for routes itself)

* Replace all chrome deps except map controller

* Replace npSetup and npStart with normal plugin init logic. Some clean up

* Bind kibana services in map controller

* Use kibana services in map controller

* Convert remaining deps that aren't critical to legacy operation

* Remove last angular bindings to gis map saved object loader

* Consolidate kibana services in NP

* Some fixes. Remove console logs

* Fix type errors

* Fix jest test path refs

* Accomodate legacy 'hacks' and init services for vis type alias

* Review feedback. Remove/update unused declarations

* getFileUpload actually just needed Component tacked on the end

* Handle visibility of toolbars for full screen mode using new core chrome. Should fix test

* Import source types in getInitialLayers to ensure registry
2020-04-16 05:49:53 -06:00
Shahzad a3f4acfc27
[Uptime] Update duration chart query filters (#63620)
* updated duration query

* updated snapshot

* update fixtures

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-16 13:48:34 +02:00
Angela Chuang 7b74aa9d69
[SIEM] move away from Joi for importing/exporting timeline (#62125)
* move away from joi

* update schema for filterQuery

* fix types

* update schemas

* remove boom

* remove redundant params

* reuse utils from case

* update schemas for query params and body

* fix types

* update validation schema

* fix unit test

* update description for test cases

* remove import from case

* lifting common libs

* fix dependency

* lifting validation builder function

* add unit test

* fix for code review

* reve comments

* rename common utils

* fix types
2020-04-16 10:17:15 +01:00
Gidi Meir Morris bb9f8845ae
[alerting] Adds an alertServices mock and uses it in siem, monitoring and uptime (#63489)
Work on #61313 has revealed that we don't have amock for AlertServices, which creates coupling between us and any solution depending on us, which makes it harder to make changes in our own code.

This PR adds mocks and uses them in SIEM, Monitoring and Uptime, so that we can make future changes without having to change outside solutions.
2020-04-16 08:45:38 +01:00
Oliver Gupte 3ade2d358d
Closes #63109 for Service Map by resetting edges styles for the selected node (#63655) 2020-04-16 00:42:25 -07:00
Steph Milovic 31ed266d73
[SIEM] [Cases] Insert timeline and reporters/tags in table bug fixes (#63642) 2020-04-16 00:53:22 -06:00
Tim Sullivan 3d41ca6d27
[Reporting] Make usable default element positions (#63191)
* [Reporting] Make usable default element posistions

* revert unrelated changes

* fix ts

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-15 17:00:56 -07:00
Tim Sullivan f4c81b440d
[Reporting] Switch Serverside Config Wrapper to NP (#62500)
* New config

* fix translations json

* add csv.useByteOrderMarkEncoding to schema

* imports cleanup

* restore "get default chromium sandbox disabled" functionality

* integrate getDefaultChromiumSandboxDisabled

* fix tests

* --wip-- [skip ci]

* add more schema tests

* diff prettiness

* trash legacy files that moved to NP

* create_config tests

* Hoist create_config

* better disableSandbox tests

* fix ts

* fix export

* fix bad code

* make comments better

* fix i18n

* comment

* automatically setting... logs

* replace log_configuration

* fix lint

* This is f2

* improve startup log about sandbox info

* update docs with log reference

* revert log removal

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-15 14:52:32 -07:00
Tim Sullivan 23e3f1aab5
[Reporting] Add "warning" status as an alternate type of completed job (#63498)
* [Reporting] Add "warning" as a status

* test

* fix warning status handling

* Simplify logic

* fix syntax

* more different statuses

* fix warning

* feedbacks
2020-04-15 14:05:19 -07:00
Tim Roes 99332b8a6e
Fix CODEOWNERS and sass lint paths (#63552) 2020-04-15 17:52:21 +02:00
Corey Robertson 3a91e713aa
Fixes Keyboard Shortcuts help extension (#63583) 2020-04-15 11:13:28 -04:00
Oliver Gupte d1d0a44d5d
Closes #63113 by limiting service maps to only draw certain shapes in IE 11 without icons (#63558) 2020-04-15 06:59:47 -07:00
patrykkopycinski 5deb74e6c4
[SIEM][Detection Engine] Increase UI unit tests coverage (#62230) 2020-04-15 14:34:29 +02:00
Tim Roes ebbc062689
Move Lens frontend to Kibana Platform (#62965)
* Move Lens frontend to Kibana platform

* Fix line breaks

* Fix jest tests

* Fix remaining test

* Remove old Lens plugin entry

* Fix i18n prefix

* Add config schema

* Address review
2020-04-15 12:22:37 +02:00
Wylie Conlon 7cd746bc2f
[Lens] Fix missing formatting bug in "break down by" (#63288)
* [Lens] Fix missing formatting bug in "break down by"

* Stop showing UUIDs, make logic more explicit

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-14 17:20:18 -04:00
Steph Milovic f9e8c1bfff
[SIEM] [Cases] Removed double pasted line (#63507) 2020-04-14 14:11:50 -06:00
Steph Milovic d275d7f4df
[SIEM] [Cases] Case container unit tests (#63376) 2020-04-14 12:25:54 -06:00
Mikhail Shustov d015c24509
[NP] Migrate logstash server side code to NP (#63135)
* convert api_integration test into TS

* create logstash NP plugin and move models

* move common/constants to NP

* type fetch all from scroll

* move route declaration to NP

* add licence checker wrapper

* register logstash route handlers in NP

* track logstash NP i18n

* address shaunak comment

* fix validation

* udpdate security tests since for new mock defaults

* address Pierres comments

* rename upgrade file route
2020-04-14 17:45:40 +02:00
Wylie Conlon 48d528ff2e
[Lens] Fix bug where suggestions didn't use filters (#63293)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-14 10:59:01 -04:00
Justin Kambic e6095fcd03
[Uptime] Remove pings graphql (#59392)
* WIP replacing GQL with redux/rest.

* Finish implementing migration.

* Introduce new connected component for ping list.

* Replace GraphQL type with io-ts.

* Update some broken tests.

* Add test for new helper function.

* Write test snapshots.

* Migrate api tests from graphql to rest.

* Update fixtures that rely on pings.

* Move ping types to runtime_types folder with rest of io-ts files.

* Update Ping type location and imports, type checking.

* Remove reliance on fixtures for ping functional API tests.

* Fix broken unit tests.

* Fix broken types.

* Remove local state storage from parent components.

* Add functional test to cover Ping List functionality.

* Fix monitor page functional test that was broken by merge conflicts.

* Fix broken tests.

* Fix broken API test.

* Replace a test with a describe block that will pre-navigate all tests.

* Delete unused reducer keys.

* Re-introduce loading to ping list reducer.

* Inroduce code that will cause PingList to re-fetch when refresh button is pressed.

* Update expanded rows to support multiple concurrent expanded rows.

* Modify pingList reducer to have singular optional error field.

* Delete unnecessary helper code.

* Delete unused interface.

* Add runtime_type to parse getPings params, fix pagination index.

* Add dedicated monitor type to runtime_types.

* Fix broken tests.

* Fix broken tests.

* Rename '@timestamp' property to 'timestamp' on Ping type.

* Fix broken type and key pings list table on document ID instead of timestamp.

* Fix broken unit tests.

* Fix broken tests and types.

* Fix broken functional test.
2020-04-14 08:35:31 -04:00
Gil Raphaelli 5bc539c6db
update in-app links to metricbeat configuration docs (#63295) 2020-04-13 22:06:09 -04:00
The SpaceCake Project b54388746d
investigation notes field (documentation / metadata) (#63386)
* notes field

added text to the "investigation notes" field in md which the field supports.

* Revert "notes field"

This reverts commit dae6ffc683.

* Revert "Revert "notes field""

This reverts commit f9de4bfc92.

* Update linux_anomalous_network_activity.json

* text change

change to "Signals from this rule indicate"
2020-04-13 18:42:10 -04:00
Nathan Reese 3623875175
[Maps] fix bug where toggling Scaling type does not re-fetch data (#63326)
* [Maps] fix bug where toggling Scaling type does not re-fetch data

* reset to empty array instead of deleting

* move setting of layer type to action creator instead of side effect of UPDATE_SOURCE_PROP

* review feedback
2020-04-13 15:53:07 -06:00
Aaron Caldwell 6f46e6b827
Migrate legacy maps service to NP & update refs (#60942)
* Get legacy maps into basic NP plugin form. Swap out legacy services for NP

* Pull service settings from injected vars. Return new instance of service settings from setup

* Use NP service settings in vega maps. Clean up legacy shim

* Use NP maps service in region maps. Clean up shim. Add exports to NP service

* Pull zoom precision out to separate module since it's dependent on config

* Update paths to point to NP resources

* More path updates, clean up, use IServiceSettings

* Remove dependency on legacy service settings. Add tile_map dependency ng-sanitize

* More path cleanup. Use zoomPrecision provided through plugin inteface

* Move getPrecision into contract-provided function since it depends on config

* Move tests to new service location, remove vis dir

* Update test paths. Move origin const declaration into public

* Clean up, fixes

* Fix type errors. General cleaning

* Inject toast service into map when needed

* Fix typo in regionmap config

* i18n fixes

* Update jest test path

* Fix karma tests

* i18n fixes

* Type updates. Add mapsLegacy to np karma mock

* Remove html sanitizer

* Fix vega test that depends on serviceSettings

* Revise xpack license handling to use NP serviceSettings. Remove angular bindings

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-13 14:32:32 -06:00
Corey Robertson 25cedbe60c
[Canvas] Migrate saved object mappings and migrations to Kibana Platform (#58891)
* Move saved object mappings and migratins to kibana platform

* Remove ts-ignore

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-13 16:26:00 -04:00
Thomas Neirynck a6ecd4c278
[Maps] Add SOURCE_TYPES enumeration (#62975) 2020-04-13 15:33:43 -04:00
Nathan Reese 301b795db6
[Maps] update geospatial filters to use geo_shape query for geo_point fields (#62966)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-13 13:30:18 -06:00
Corey Robertson e27526fd92
Move away from npStart for embeddables in canvas (#62680)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-13 15:29:24 -04:00
Corey Robertson 19fcc6111a
Use MapInput type from Maps plugin (#61539) 2020-04-13 14:21:02 -04:00
Maggie Ghamry 1084b1c7b9
Update to pagination for workpad and templates (#62050)
Added logic to hide pagination if no Canvas workpads exists, and disable the previous/next arrows if there is only one page, for both workapds and templates
2020-04-13 13:41:12 -04:00
patrykkopycinski a58cc5da12
[SIEM] Fix AlertsTable id (#63368) 2020-04-13 19:40:48 +02:00
Ryland Herrick 5559b09dcc
Consistent terminology around cypress test data (#63279)
* Uses "data" or "test data" when referring to the general idea
* Uses "archive" when referring to the specific data/implementation
* Adds a few grammar/spelling tweaks
2020-04-13 12:24:09 -05:00
Nathan Reese c604eb9e63
[Maps] fix regression in loading left join fields (#63325)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-13 08:00:15 -06:00
MadameSheema e74d360adb
fixes test flakiness (#63331) 2020-04-13 15:38:32 +02:00
Thomas Neirynck bbd501ea51
[Maps] Cleanup sources (#63175)
- Introduces additional TS typing for sources
- Organizes sources in sub-directories by type
- migrates XYZTMSSource to TS
2020-04-13 09:24:16 -04:00
Shahzad c7f61f956a
[Uptime] Update Ml functional test (#62562)
* update test

* added test

* updated type

* updated test

* updated test

* update test

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-13 13:49:46 +02:00
Shahzad 61271c0652
[Uptime] Simplify monitor param usage (#63121)
* add useMonitorId hook

* update url param hook

* update type

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-13 13:44:10 +02:00
Cauê Marcondes 2be6b7fdce
fixing custom link popover size and hiding scroll (#63240) 2020-04-11 11:06:39 +02:00
The SpaceCake Project 39fbc5e103
bc6 rule import april 9 (#63152)
* bc6 rule import april 9

Increased the lookback of the ML rules

* re-import

with LF chars

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-10 17:50:23 -04:00
Ryland Herrick d8a295dcbc
[SIEM] Link ML Rule card CTA to license_management (#63210)
* Link ML Rule card CTA to license_management

Taking the user directly to the license management page within kibana
(where they could immediately start a trial subscription) is much more
actionable than taking them to the subscriptions marketing page.

* Revert translation key change

Neither of these is totally accurate, and there've already been
translations written for the old one.
2020-04-10 14:00:11 -05:00
Tim Sullivan aed5253b53
[Reporting] convert all server unit tests to TypeScript (#62873)
* [Reporting] convert all server unit tests to TypeScript

* fix ts

* revert unrelated change
2020-04-10 09:57:59 -07:00
Wylie Conlon f96f928e69
[Lens] Fix error in query from generated suggestion (#63018)
* [Lens] Fix error in query from generated suggestion

* Update from review comments

* Fix test

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-10 12:29:26 -04:00
Steph Milovic 55a3cc4583
[SIEM] [Cases] Unit tests for case UI components (#63005) 2020-04-10 09:55:38 -06:00
Nathan L Smith e8491adbab
Use globe icon for "ext" span type on service map (#63205)
Both "external" and "ext" can be returned and should have the same icon.
2020-04-10 09:04:17 -05:00
Cauê Marcondes 77d22f55d9
[APM] Agent config select box doesn't work on IE (#63236)
* adding value property to select options

* fixing test
2020-04-10 14:54:48 +02:00
MadameSheema 34b1d0a10d
[SIEM] Updates cypress readme with documentation about the test data. (#62747)
* updates test data section

* Update x-pack/legacy/plugins/siem/cypress/README.md

Co-Authored-By: Ryland Herrick <ryalnd@gmail.com>

Co-authored-by: Ryland Herrick <ryalnd@gmail.com>
2020-04-10 11:28:59 +02:00
Cauê Marcondes 83b9417d45
[APM] Custom links submit button is off screen in IE11 (#63122) 2020-04-10 09:28:06 +02:00
CJ Cenizal 982c0da78e
Move ILM out of legacy (#61915)
* Rename IndexMgmtSetup to IndexManagementPluginSetup.
* Remove unused fetch index template route and related tests.
* Remove unnecessary custom styles.
2020-04-09 16:51:22 -07:00
Tim Schnell 783e3c17a9
ignore some things for code coverage (#62701)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-09 14:32:24 -05:00
Christos Nasikas 38f7bfb133
[SIEM][CASE] Test configuration API and hooks (#62803)
* Test API

* Test useConnectors

* Test useConfigure

* Fixes
2020-04-09 21:26:13 +03:00
Joel Griffith 2574d0f805
Adds a new config flag to encode with BOM for our CSVs (#63006)
* Adds a new config flag to encode with BOM for our CSVs

* Push out bom-chars to it's own constant

* Getting those snapshots back into shape 💪

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-09 11:01:25 -07:00
Maryia Lapata dfea62187f
[NP] Inline buildPointSeriesData and buildHierarchicalData dependencies (#61575)
* Move buildHierarchicalData to vislib

* Move shortened version of buildPointSeriesData to Discover

* Move buildPointSeriesData to vis_type_vislib

* Convert unit tests to jest

* Remove ui/agg_response

* Convert point_series files to TS

* Update TS in unit tests

* Convert buildHierarchicalData to TS

* Convert buildPointSeriesData to TS in Discover

* Clean TS in Discover

* Update TS for buildHierarchicalData

* Update buildHierarchicalData unit tests

* Clean up TS in point_series

* Add unit tests fro response_handler.js

* Simplify point_series for Discover

* Return array for data

* Add check for empty row

* Simplify point_series for Discover

* Return all points

* Specify TS

* Refactoring

* Simplifying

* improve types

* Update _get_point.test.ts

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Joe Reuter <johannes.reuter@elastic.co>
2020-04-09 18:56:36 +03:00
Joe Reuter 8d21b6b6f3
Move search source parsing and serializing to data (#59919) 2020-04-09 14:06:01 +02:00
Devin W. Hurley 274cb805e1
[SIEM] [Detection Engine] Fixes bug when notification doesn't… (#63013)
Set refresh on bulk create to 'wait_for' when actions are present, so we do not respond until the newly indexed signals are searchable.

* set refresh on bulk create to 'wait_for' when actions are present, so we do not respond until the newly indexed signals are searchable

* fix types in tests
2020-04-08 19:58:50 -04:00
Frank Hassanabad c643148f36
[SIEM][Detection Engine] Fix rule notification critical bugs
## Summary

Fixes critical bugs found during testing of the rule notification.

* Fixes a bug where when you turn on rules quickly such as ML rules you would see these message below. This message can also be seen when you first create a rule with an action notification. This is a race condition with how we update rules multiple times when we really should only update it once and do it before enabling a rule

```
server    log   [12:18:35.986] [error][alerting][alerting][plugins][plugins] Executing Alert "63b828b5-24b9-4d55-83ee-8a8201fe2d76" has resulted in Error: [security_exception] missing authentication credentials for REST request [/_security/user/_has_privileges], with { header={ WWW-Authenticate={ 0="Bearer realm=\"security\"" & 1="ApiKey" & 2="Basic realm=\"security\" charset=\"UTF-8\"" } } 
``` 

* Fixes a bug where we were using `ruleParams.interval` when we should have been using `ruleAlertSavedObject.attributes.schedule.interval`. When changing rule notifications to run daily, weekly, etc.. you would see this exception being thrown:

```
server    log   [21:23:08.028] [error][alerting][alerting][plugins][plugins] Executing Alert "fedcccc0-7c69-4e2f-83f8-d8ee88ab5484" has resulted in Error: "from" or "to" was not provided to signals count query
```

* Fixes misc typing issues found
* Fixes it to where we no longer make multiple DB calls but rather pass down objects we already have.
* Changes the work flow to where we only update, create, or patch the alerting object once which fixes the race condition and improves the backend performance.
* Removes left over unused code
* Applied https://en.wikipedia.org/wiki/Single-entry_single-exit to functions where it made sense and easier to read.


### Checklist

- [x] [Unit or functional tests](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility) were updated or added to match the most common scenarios
2020-04-08 17:36:20 -06:00
Brittany Joiner 0c35762f27
Add Error Exception Type Column (#59596)
* start of error exception type

* width and link

* removed extra line

* updated snapshot

* updated snapshots

* updated snapshots

* Update snapshots

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Nathan L Smith <smith@nlsmith.com>
2020-04-08 18:08:13 -05:00
Matthew Kime e0a519424f
Index pattern management plugin - src/legacy/core_plugins/management => new platform plugin (#62594)
* implement index pattern management plugin in new platform
2020-04-08 15:10:44 -05:00
Oliver Gupte 184f59447b
[APM] Service map - fixes layout issues for maps with no rum services (#62887)
* Closes #62878 in Service Maps by improving the selection algorithm for root nodes

* Fixes some latent centering issues when navigating in the service map.

* Removes unused imports

* Added layoutstopDelayTimeout to cleanup step
2020-04-08 11:13:39 -07:00
Nathan Reese 3598b8c44c
[Maps] fix attribution overflow with exit full screen button (#62699)
* [Maps] fix attribution overflow with exit full screen button

* use margin-left instead of padding-left

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-08 11:24:04 -06:00
Shahzad 8cacbdfaa5
[Uptime]Alerting UI text in case filter is selected (#62570)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-08 19:23:16 +02:00
Yuliia Naumenko 730dcbf638
Implemented actions server API for supporting preconfigured connectors (#62382)
* Implemented actions server API for supporting preconfigured connectors defined in kibana.yaml

* Fixed type check

* Fixed due to comments and extended functional tests

* Fixed tests and renamed connectors

* fixed jest tests

* Fixed type checks

* Fixed failing alert save

* Fixed alert client tests

* fixed type checks

* Fixed language check error

* Fixed jest tests

* Added missing comments and docs

* fixed due to comments

* Fixed json config for preconfigured

* fixed type check, reverted config

* config experiment with json stringify

* revert experiment

* Removed the spaces from connector names in config
2020-04-08 09:54:42 -07:00
Yara Tercero 5d34697ea5
[SIEM][Detection Engine] - Update list values in REST interfaces (#62320)
Summary
- #60022
- Follow up on #60171
- Modifies boolean filters to enum of "included" and "excluded"
- Adds operator types of enum "match", "match_all", "list", and "exists"
- Adds values properties to include those for "list"
- DOES NOT FILTER ON THE VALUES JUST YET (That will be a follow on PR)
2020-04-08 10:46:06 -04:00
Poff Poffenberger d94d7cc719
[Canvas] Fix Canvas-specific storybook after new platform changes (#61876)
* Fix Canvas storybook webpack config

* Temporarily disable workpad export example

* Mock out lib/notify and download_workpad

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-08 09:20:25 -05:00
Aaron Caldwell 67536e4b3c
Fix issue with license not getting obtained & passed to server… (#62883) 2020-04-08 08:12:37 -06:00
MadameSheema aa54929fb5
skips 'Sorts by activated rules' (#62924) 2020-04-08 15:14:07 +02:00
Frank Hassanabad 5218e30487
[SIEM][Detection Engine] Fixes TypeScript types and adds format to time range query
## Summary

* Fixes the Type Script types so we don't have to use non-null-assertions
* Adds null checks where needed
* Changes the time range query to have a format of epoch to avoid mapping issues

### Checklist

- [x] [Unit or functional tests](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility) were updated or added to match the most common scenarios
2020-04-07 19:37:47 -06:00
Tiago Costa 7e3c68bb7a
chore(NA): removes server imports from canvas src plugin (#62783)
* chore(NA): remove server imports from canvas src plugin

* chore(NA): correctly import types for demodata
2020-04-08 00:44:38 +01:00
Cauê Marcondes 20dc67df71
[APM] Agent span_frames_min_duration configuration input cannot handle 0 or -1 (#62777)
* changing duration min value for span_frames_min_duration

* adding min property to number field
2020-04-07 20:18:35 +02:00
Chris Roberson 8ffc08f2f7
[REVERT THE REVERT] [Monitoring] Cluster state watch to Kibana alerting (#62793)
* Revert "Revert "[Monitoring] Cluster state watch to Kibana alerting (#61685)""

This reverts commit f1bd3bdacb.

* Fix i18n error

* Fix test
2020-04-07 13:44:34 -04:00
Cauê Marcondes d70718426f
[APM] Change custom link from EuiListGroupItem to EuiLink (#62742) 2020-04-07 18:39:52 +02:00
Corey Robertson 2c4cc12b98
Removes Pitch Presentation Template from Canvas (#62688)
* Removes Pitch Presentation Template from Canvas

* Fix test

* Keep translation to not fail i18n
2020-04-07 11:55:06 -04:00
Xavier Mouligneau 8eb9fdd6eb
[SIEM] Update beat doc (#61902)
* add new ecs description

* new auditbeat/filebeat description

* update description winlogbeat

* bring back description in pictures

* review I + use ECS doc as last ressource when you do not know the index

* update test

* safety default just in case

* fix functional test

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-07 10:27:11 -04:00
Nathan L Smith cd1e11bce6
Add service map icon for rum-js agent type (#62721)
* Add service map icon for rum-js agent type

We previously were only checking for "js-base" as the RUM `agent.name` but it can report either "js-base" or "rum-js", so make that work.

I saw an "opbeans-react" service on a map generated by apm-integration-testing that Gil had running last week. Not sure if that's a newer or older version because I don't see it on apm.elstc.co.

Also clean up the icons storybook a little.

Fixes #62336.

* use isRumAgentName

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-07 09:08:38 -05:00
Oliver Gupte 30b6d42c42
[APM] Service map - fixes irrelevant services on data refresh (#62750)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-07 16:06:55 +02:00
Oliver Gupte d565db0dbd
[APM] Service map - Fix taxi edge arrow orientation (#62741)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-07 16:06:49 +02:00
Dario Gieselaar 6fdd7b4c9b
[APM] Prevent error rate alert trigger from rendering NaN (#62754)
* [APM] Prevent error rate alert trigger from rendering NaN

Closes #62458.

* Use params instead of alertParams
2020-04-07 16:06:13 +02:00
Tim Roes 3a9e7be8bf
[Lens] Remove all legacy imports (#62596)
* Remove all legacy imports

* Fix import
2020-04-07 11:08:54 +02:00
Shahzad 355cacff7c
[Uptime] Improve Telemetry test (#62428)
* removed unnecessary filter

* update condition

* added a unit test for mix state

* fix types

* fix type

* updated test

* update

* updates test

* updates tests

* updates tests

* updated type

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-07 09:19:36 +02:00
MadameSheema 91a0010668
[SIEM] Adds sort rules Cypress test (#62700)
* adds 'singal detection rules' spec

* adds 'Sorts by activated rules' test

* implements 'Sort by activated rules'

* refactors code

* fixes index
2020-04-07 09:19:08 +02:00
Cauê Marcondes 0458626379
fixing bug (#62577) 2020-04-07 09:08:00 +02:00
Nathan Reese 7882e0c3a8
[Maps] Always show current zoom level (#62684)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-06 21:26:10 -06:00
The SpaceCake Project b65de27458
bc5 siem rules merge (#62679)
* bc5 rule merge

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

* Fixing monitoring i18n (#62715)

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

* Remove CR, only CRLF for rules

* delete two files

for Garrett

* deletes

delete 2 files (for Garrett)

* Revert "deletes"

This reverts commit cc2ac1e05f.

* Revert "Fixing monitoring i18n (#62715)"

This reverts commit 028574037a.

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

* as type for return value

* get default export

* add if checks

* wrap errors in i18n

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

* Update layer path refs

* Update np kibana services to cover all required services

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

* Path updates, supporting file moves, general clean up

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

* Path updates. Typescript warning fixes

* Update test paths

* Clean up unused kibana services usage in legacy

* Remove unused http ref

* Test fixes and clean up

* Remove unused snapshots

* Add np service init to embeddables too

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

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

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

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

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


### All Rules Changes

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

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

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

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

### Create/Edit Rule Changes

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

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

### Checklist

Delete any items that are not applicable to this PR.

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

* adds 'View a signal in timeline' test

* implements test

* fixes implementation

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

* Add new alert with tests

* Fix type issues, and disable new alerting for tests

* Fix up the view all alerts view

* Turn off for merging

* Fix jest test

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

* Test ClosureOptions component

* Test ConnectorsDropdown component

* Test Connectors

* Test FieldMappingRow

* Test FieldMapping

* Create utils functions and refactor to be able to test

* Test Mapping

* Improve tests

* Test ConfigureCases

* Refactor tests

* Fix flacky tests

* Remove snapshots

* Refactor tests

* Test button

* Test reducer

* Move test

* Better structure

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

* Update functional test to handle new UI flow.

* Fix type error.

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

* update

* update

* remove unused

* update fixtures

* update snaps

* remove duplicate test

* type

* update test

* update fixtures

* update interface

* updated type

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

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

* Remove KibanaParsedUrl from visualize

* Fix tests

* Add tests

* Fix saved dashboard

* Fix empty line after resolving conflicts

* Move dashboard to np

* Move migrations back to legacy

* Make it works

* Other fixes

* Move into application folder

* FIx translations

* Make share & home plugins otional

* FIx kbn url tracking, jest tests

* Import from dashboard_constants in FT

* Fix translations order

* Use getStartServices for start plugin deps

* Path fixes

* i18n fix

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

* simplify route register calls

* switch to in-sync worker functions

* fix tests

* comment

* fix set up config with defaults

* reduce loc change

* remove test for removed file

* reportingconfigtype

* revert changing executeJobFactory to synchronous

* imports cleanup

* Clean up some awaits

* undo comment

* clean up async

* clean up imports

* add warning logs for config defaults

* Move around some config shim code

* Register routes params take ReportingCore

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

* canvas fix

* cleanup

* update snapshots in tests

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

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

* linting error

* fixes types and removes a test for manage api keys

* removes manage api key reducer and updates leftover tests

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

* fix test title

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

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

This reverts commit 93912e7e22.

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

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

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

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

* Remove unused component state

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

* Prevent user from initiating multiple job installations

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

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

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

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

* fixes type mismatch for sorting and rulesStatuses

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

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

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

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

### Checklist

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

* updates 'number of signals' selector

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

* simplifying

* additional testing

* revert snapshot changes

* removing dependency on legacy saved objects service

* consolidate mocks

* fixing imports

* addrress PR feedback

* remove unused docs

* adjust tests for updated corestart contract

* address test flakiness

* address flakiness, part 2

* address test flakiness

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

* typescript map embeddable

* More updates

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

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

* fixes

* fixes

* Address more review comments

* fixes

* fixes

* fix jest test

* Fix visualize embeddable

* fixes after master merge

* Fixes

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

* Remove layerList from input state

* fixes

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

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

* review updates

* fixes

* update maps readme

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

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

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

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

* Move telemetry settings into its own document

* Use external reference instead of anchor

* Update docs/migration/migrate_8_0.asciidoc

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

* Update docs/migration/migrate_8_0.asciidoc

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

* Update docs/settings/telemetry-settings.asciidoc

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

* Update docs/settings/telemetry-settings.asciidoc

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

* Update docs/settings/telemetry-settings.asciidoc

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

* Update docs/settings/telemetry-settings.asciidoc

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

* Update docs/settings/telemetry-settings.asciidoc

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

* Update docs/settings/telemetry-settings.asciidoc

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

* Update docs/settings/telemetry-settings.asciidoc

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

* Update docs/settings/telemetry-settings.asciidoc

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

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

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

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

* Use sentence case for remaining changes + fix jest test

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

* update fixture

* fix types

* fix tets

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

* split into to registries

* add EMS file source

* add geojson upload layer

* register rest of sources

* i18n changes

* ts lint errors

* fix jest test

* fix pew-pew source

* review feedback

* import registires in plugin so they exist in embeddable

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

* fix functionalt est

* pass constructor to sourceREgistry instead of factory

* review feedback

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

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

* Fix API filtering bug

* Show username if full name is empty

* fix user in avatar

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

* fix types

* Show errors from actions

* update connector name in configure

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

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

### Before

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

### After

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

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

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

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

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

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

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

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

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

### Checklist

Delete any items that are not applicable to this PR.

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