Commit graph

9690 commits

Author SHA1 Message Date
Yuliia Naumenko
21efd235f7
Fixed adding an extra space character on selecting alert variable in action text fields (#70028)
* Fixed adding an extra space character on selecting alert variable in action text fields.

* Made components for variables to be able to insert the variable by the cursor position

* cleanup

* Added variables support for all components

* update on handle selections for text

* Fixed functional tests
2020-07-02 18:08:14 -07:00
Nathan Reese
ebcec3a904
[Maps] show vector tile labels on top (#69444)
* [Maps] show vector tile labels on top

* experiment with new sort algorithm

* clean up

* remove old sort method

* add unit test for sort layer

* tslint

* clean up

* make labelsOnTop configurable

* tslint

* more tslint

* add another test case for single layer move

* clarify should messages

* fix assert not null operators

* review feedback

* update snapshot

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-02 18:50:50 -06:00
Tiago Costa
6c62c686cf
chore(NA): upgrade to lodash@4 (#69868)
* chore(NA): upgrade oss to lodash4

chore(NA): migrate cli, cli_plugin, cli_keystore,  dev, test_utils and apm src script to lodash4

chore(NA): missing file for cli plugin

chore(NA): add src core

chore(NA): es archiver and fixtures

chore(NA): try to fix functional test failure

chore(NA): migrate src/legacy entirely to lodash4 except src/legacy/core_plugins

chore(NA): move legacy core plugins to lodash4

chore(NA): upgrade optimize to lodash4

chore(NA): upgrade to lodash4 on advanced_settings, charts, console and dashboard

chore(NA): migrate to lodash4 on dev_tools, discover, embeddable, es_ui)shared, expressions, home plugins

chore(NA): upgrade data plugin to lodash4

chore(NA): upgrade usage_collection, ui_actions, tile_map, telemtry, share, saved_objects, saved_objects_management, region_map and navigation to lodash4

chore(NA): missing data upgrades to lodash4

Revert "chore(NA): upgrade usage_collection, ui_actions, tile_map, telemtry, share, saved_objects, saved_objects_management, region_map and navigation to lodash4"

This reverts commit 137055c5fed2fc52bb26547e0bc1ad2e3d4fe309.

Revert "Revert "chore(NA): upgrade usage_collection, ui_actions, tile_map, telemtry, share, saved_objects, saved_objects_management, region_map and navigation to lodash4""

This reverts commit f7e73688782998513d9fb6d7e8f0765e9beb28d1.

Revert "chore(NA): missing data upgrades to lodash4"

This reverts commit 92b85bf947a89bfc70cc4052738a6b2128ffb076.

Revert "chore(NA): upgrade data plugin to lodash4"

This reverts commit 88fdb075ee1e26c4ac979b6681d8a2b002df74c6.

chore(NA): upgrade idx_pattern_mgt, input_control_vis, inspector, kbn_legacy, kbn_react, kbn_usage_collections, kbn_utils, management and maps_legacy to lodash4

chore(NA): map src plugin data to lodash3

chore(NA): missing lodash.clonedeep dep

chore(NA): change packages kbn-config-schema deps

chore(NA): update renovate config

chore(NA): upgrade vis_type plugins to lodash4

chore(NA): move vis_type_vislib to lodash3

chore(NA): update visualizations and visualize to lodash4

chore(NA): remove lodash 3 types from src and move test to lodash4

chore(NA): move home, usage_collection and management to lodash 3

Revert "chore(NA): move home, usage_collection and management to lodash 3"

This reverts commit f86e8585f02d21550746569af54215b076a79a3d.

chore(NA): move kibana_legacy, saved_objects saved_objects_management into lodash3

chore(NA): update x-pack test to mock lodash4

Revert "chore(NA): move kibana_legacy, saved_objects saved_objects_management into lodash3"

This reverts commit 2d10fe450533e1b36db21d99cfae3ce996a244e0.

* chore(NA): move x-pack and packages to lodash 4

* chore(NA): remove mention to lodash from main package.json

* chore(NA): remove helper alias for lodash4 and make it the default lodash

* chore(NA): fix last failing types in the repo

* chore(NA): fix public api

* chore(NA): fix types for agg_row.tsx

* chore(NA): fix increment of optimizer modules in the rollup plugin

* chore(NA): migrate `src/core/public/http/fetch.ts` (#5)

* omit undefined query props

* just remove merge usage

* fix types

* chore(NA): fixes for feedback from apm team

* chore(NA): recover old behaviour on apm LoadingIndeicatorContext.tsx

* chore(NA): fixes for feedback from watson

* Platform lodash4 tweaks (#6)

* chore(NA): fix types and behaviour on src/core/server/elasticsearch/errors.ts

* Canvas fixes for lodash upgrade

* [APM] Adds unit test for APM service maps transform (#7)

* Adds a snapshot unit test for getConnections and rearranges some code to make testing easier

* reverts `ArrayList` back to `String[]` in the painless script within `fetch_service_paths_from_trace_ids.ts`

* chore(NA): update yarn.lock

* chore(NA): remove any and use a real type for alerts task runner

Co-authored-by: Gidi Meir Morris <github@gidi.io>

* chore(NA): used named import for triggers_actions_ui file

* chore(NA): fix eslint

* chore(NA): fix types

* Delete most uptime lodash references.

* Simplify. Clean up types.

* [Uptime] Delete most uptime lodash references (#8)

* Delete most uptime lodash references.

* Simplify. Clean up types.

* chore(NA): add eslint rule to avoid using lodash3

* chore(NA): apply changes on feedback from es-ui team

* fix some types (#9)

* Clean up some expressions types.

* chore(NA): missing ts-expect-error statements

* Upgrade lodash 4 vislib (#11)

* replace lodash 3 with lodash 4 on vislib plugin

* Further changes

* further replacement of lodash3 to 4

* further work on upgrading to lodash 4

* final changes to update lodash

* chore(NA): upgrade data plugin to lodash4

chore(NA): upgrade data plugin public to lodash4

chore(NA): fix typecheck task

chore(NA): fix agg_config with hasIn

chore(NA): assign to assignIn and has to hasIn

chore(NA): upgrade data plugin server to lodash4

chore(NA): new signature for core api

fix(NA): match behaviour between lodash3 and lodash4 for set in search_source

* chore(NA): remove lodash3 completely from the repo

* chore(NA): fix x-pack/test/api_integration/apis/metrics_ui/snapshot.ts missing content

* chore(NA): fix lodash usage on apm

* chore(NA): fix typecheck for maps

* Patch lodash template (#12)

* Applying changes from https://github.com/elastic/kibana/pull/64985

* Using isIterateeCall, because it seems less brittle

* Also patching `lodash/template` and `lodash/fp/template`

* Reorganizing some files...

* Revising comment

* Ends up `_` is a function also... I hate JavaScript

Co-authored-by: Pierre Gayvallet <pierre.gayvallet@gmail.com>
Co-authored-by: Josh Dover <me@joshdover.com>
Co-authored-by: Clint Andrew Hall <clint.hall@elastic.co>
Co-authored-by: Oliver Gupte <ogupte@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Gidi Meir Morris <github@gidi.io>
Co-authored-by: Justin Kambic <justin.kambic@elastic.co>
Co-authored-by: Stratoula Kalafateli <stratoula1@gmail.com>
Co-authored-by: Luke Elmers <luke.elmers@elastic.co>
Co-authored-by: Brandon Kobel <brandon.kobel@gmail.com>
Co-authored-by: kobelb <brandon.kobel@elastic.co>
2020-07-03 01:30:13 +01:00
CJ Cenizal
67c70e762c
Add Snapshot Restore README with quick-testing steps. (#70494) 2020-07-02 16:00:05 -07:00
Jonathan Buttner
20237b8d5b
[EPM] Use higher priority than default templates (#70640)
* Use higher priority than default templates

* Fixing the jest tests
2020-07-02 18:40:39 -04:00
Nathan Reese
23ea7acb15
[Maps] Fix cannot select Solid fill-color when removing fields (#70621)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-02 16:35:16 -06:00
Spencer
f5b280007f
[kbn/optimizer] only build specified themes (#70389)
Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: cchaos <caroline.horn@elastic.co>
2020-07-02 15:06:32 -07:00
patrykkopycinski
5fcf803d3d
Fix saved query modal overlay (#68826) 2020-07-02 23:48:41 +02:00
CJ Cenizal
113962e12a
Update component templates list to render empty prompt inside of content container. Show detail panel when deep-linked, even if there are no component templates. (#70633)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-02 14:47:08 -07:00
Andrew Goldstein
81d26fc9f8
[Security Solution] Renames the Investigate in Resolver Timeline action (#70634)
## [Security Solution] Renames the `Investigate in Resolver` Timeline action

- Renames the `Investigate in Resolver` Timeline action, a follow-up item from the `What's next?` section of https://github.com/elastic/kibana/pull/70111
- Fixes a CSS issue where the icon didn't align with the others on non-default row-heights

## Before

![before-investigate-in-resolver](https://user-images.githubusercontent.com/4459398/86393038-a97eeb80-bc59-11ea-9ba4-449ab20ddd25.png)

## After

![after-analyze-event](https://user-images.githubusercontent.com/4459398/86393050-ad127280-bc59-11ea-8040-7f254b0255b0.png)

Desk tested in:
- Chrome `83.0.4103.116`
- Firefox `78.0.1`
- Safari `13.1.1`
2020-07-02 15:37:42 -06:00
Yara Tercero
6a33a78f31
fix 400 error on initial signals search (#70618)
### Summary

On initial render of the SIEM pages, a 400 error was showing for POST http://localhost:5601/api/detection_engine/signals/search. This PR is a temporary fix for this bug. This initial call is being used to populate the Last alert text that shows at the top of a number of the pages. The reason the size was 0 is because we weren't interested in the signals themselves, just the timestamp of the last alert. Teamed up with @XavierM and it seems to us that the issue is the server side validation. It may be Hapi misreading the 0 as false or our updated validation not accepting size 0.
2020-07-02 17:04:48 -04:00
Nathan Reese
e7749210b4
[Maps] fix unable to edit heatmap metric (#70606)
* [Maps] fix unable to edit heatmap metric

* add comment

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-02 14:48:04 -06:00
Søren Louv-Jansen
fa70afb5ef
[APM] Disable flaky useFetcher test (#70638) 2020-07-02 22:34:53 +02:00
Kevin Logan
a921bbf4c2
[SECURITY SOLUTION] Remove unneeded options from default policy, remove Notify user option from UI (#70546) 2020-07-02 16:18:52 -04:00
Chris Cowan
a3e9f39aff
[Metrics UI] Register function for Observability homepage (#70529)
* [Metrics UI] Register function for Observability homepage

* Updating types; removing relative path from appLink

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-02 13:01:18 -07:00
Nicolas Ruflin
5b8fb95d00
Remove the base package from the default packages (#70437)
As the base assets will be shipped by ES directly, the base package is not needed anymore. https://github.com/elastic/elasticsearch/pull/57629

In the future we might reintroduce it to update the installed assets.
2020-07-02 15:46:57 -04:00
Jonathan Budzenski
0e008e30e9 skip fleet agent flow tests 2020-07-02 12:46:40 -05:00
Melissa Alvarez
67067ec9a9
update reg evaluate property names (#70604) 2020-07-02 12:23:40 -04:00
patrykkopycinski
55922cb9a0
[Security Solution] Reposition EuiPopovers on scroll (#69433)
* [Security Solution] Reposition EuiPopovers on scroll

* update snapshots

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-02 17:37:29 +02:00
Michael Hirsch
8a09f247e3
[ML] Updates APM Module to Work with Service Maps (#70361)
* updates apm integration job to work with service maps

* rename apm job in setup_module test

* modifies detector description

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-02 11:35:40 -04:00
CJ Cenizal
59ece7992b
Make Index Management functional and API integration tests robust against side effects introduced by Ingest Manager. (#70533) 2020-07-02 08:24:42 -07:00
Dima Arnautov
854e7a5204
[ML] Anomaly Explorer swim lane pagination (#70063)
* [ML] use explorer service

* [ML] WIP pagination

* [ML] add to dashboard without the limit

* [ML] WIP

* [ML] loading states

* [ML] viewBySwimlaneDataLoading on field change

* [ML] fix dashboard control

* [ML] universal swim lane container, embeddable pagination

* [ML] fix css issue

* [ML] rename anomalyTimelineService

* [ML] rename callback

* [ML] rename container component

* [ML] empty state, increase pagination margin

* [ML] check for loading

* [ML] fix i18n

* [ML] fix unit test

* [ML] improve selected cells

* [ML] fix overall selection with changing job selection

* [ML] required props for pagination component

* [ML] move RESIZE_IGNORED_DIFF_PX

* [ML] jest tests

* [ML] add test subject

* [ML] SWIM_LANE_DEFAULT_PAGE_SIZE

* [ML] change empty state styling

* [ML] fix agg size for influencer filters

* [ML] remove debounce

* [ML] SCSS variables, rename swim lane class

* [ML] job selector using context

* [ML] set padding for embeddable panel

* [ML] adjust pagination styles

* [ML] replace custom time range subject with timefilter

* [ML] change loading indicator to mono

* [ML] use swim lane type constant

* [ML] change context naming

* [ML] update jest snapshot

* [ML] fix tests
2020-07-02 16:30:18 +02:00
Nicolas Ruflin
335c9bb148
[Ingest Manager] Update asset paths to use _ instead of - (#70320)
In https://github.com/elastic/package-registry/issues/517 the naming of the file paths inside a package is standardised to only use `_` and not `-`. This adjusts the paths for `ilm-policy`, `component-template`, `index-template` to the correct path.

An additional change here is to get rid of assets we don't support yet, like rollup jobs and ml jobs. We will reintroduce these when we support them.
2020-07-02 16:03:44 +02:00
Nick Partridge
f8ba824ebc
Fix discover, tsvb and Lens chart theming issues (#69695) 2020-07-02 09:02:30 -05:00
Jean-Louis Leysens
0066c4b5b0
[S&R] Support data streams (#68078)
* Sort endpoint responses into indices and datastreams

The server endpoint for policies now returns data streams and
filters out backing indices from the indices array it returned
previously

* Refactor indices switch and field out of the step settings file

* Fix indices field form behaviour

* WiP on UI. Added the second table per mockup for add and edit.

* add support for creating a policy that backs up data streams end to end

* wip on restore flow - added data streams to server response

* add logic for detecting whether an index is part of a data stream

* fix public jest tests

* fix server side jest tests

* pivot to different solution in UI while we do not have data streams nicely separated

* added data stream to snapshot summary details

* move the data streams badge file closer to where it used

* add data stream badge when restoring snapshots too

* update restore copy

* fix pattern specification in indices and data streams field

* first iteration of complete policy UX

* First iteration that is ready for review

Given the contraints on working with data streams and indices in policies
at the moment the simplest implementation is to just include data streams
with indices and have the user select them there for now.

The way snapshotting behaviour is currently implemented relies entirely
on what is specified inside of "indices", this is also where data
streams must be placed. This unfortunately means that capture patterns
defined in indices will capture entire data streams too.

* delete unused import

* fix type issue in tests

* added logic for rendering out previous selection as custom pattern

* refactor indices fields to make component smaller

* added CIT for data streams badge

* Data streams > indices

* updates to relevant pieces of copy

* more copy updates

* fix types and remove unused import

* removed backing indices from restore view

* Added data stream restore warning message

* restore CITs

* first round of copy feedback

* refactor help text to provide clearer feedback, for both restore and policy forms

* Restore updates

- added spacer between title and data streams callout
- added copy to the restore settings tab to indicate that settings
  also apply to backing indices

* further copy refinements

* second round of copy feedback

* fix i18n

* added comment to mock

* line spacing fixes and created issue for tracking backing index discovery in snaphots

* refactor collapsible list logic and tests

* refactor editing managed policy check

* refactor copy to be clearer about pluralisation of data streams

* refactor file structure in components for data stream badge

* added tests for indices and data streams field helper

* refactored types and fixed i18n id per guidelines

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-02 15:38:24 +02:00
Thomas Neirynck
9c76f19186
[Maps] Add styling and tooltip support to mapbox mvt vector tile sources (#64488)
* tmp commit

* rename

* more boilerpalte

* more boiler

* more boilerpalte

* typing

* fix import

* boilerplate

* more boiler

* enable custom palettes

* fix label text and orientation

* fix merge errors

* remove dupe import

* stash commit

* tmp commit

* debounce settings

* return null

* slight rearrangement

* tooltip guard

* minor tweaks

* feedback

* ts fixes

* ts fixes

* more ts fixes

* ts fixes

* jest test

* fix typo

* spacing

* fix typing

* add unit test

* add more tests

* add snapshot test

* add snapshot

* add field editor snapshot test

* fix snapshot

* add snapshot

* remove unused import

* test stub for mvt layer

fix optional param

more checks

* add snapshot test

more unit tests

more unit tests

ts fixes

* add data syncing unit test

* fix autorefactor

* fix merge and replace snapshots

* field editor changes

* field editor changes

* ts fixes

* update snapshots

* fix things

* fix names

* fix tooltip

* add more error handling

* improve copy

* styling changes

* style option box a little better

* ts fixes

* fix console error

* remove mbProperties from interface

* remove unused method

* remove cruft

* rename for consistency

* remove unused param

* feedback

* feedback

* ensure properties are always present

* handle possible null values

* feedback

* typo

* update SIEM

* feedback

* remove cruft

* remove unused translations

* feedback

* improve readability

* fix brittle test

* fix snapshot after master merge

* remove unused method

* feedback

* revert some feedback

* remove micro-optimization

* initialize in constructor

* simplify wording

* add snapshot

* naming

* add clarifying comment

* remove unused import

* sanitize tooltips

* remove cruft

* feedback

* fix typo

* remove export

* Design fixes

* clean up supportsAutoDomain

* remove patch.txt

* cleanup

* clean-up

* Merge in styling changes

* Tweak message format

* fix broken import

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: miukimiu <elizabet.oliveira@elastic.co>
Co-authored-by: Nathan Reese <reese.nathan@gmail.com>
2020-07-02 09:24:56 -04:00
Dario Gieselaar
429805d1b8
[APM] Don't fetch dynamic index pattern in setupRequest (#70308)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-02 15:19:21 +02:00
Jonathan Buttner
c081caa634
[Security_Solution][Endpoint] Leveraging msearch and ancestry array for resolver (#70134)
* Refactor generator for ancestry support

* Adding optional ancestry array

* Refactor the pagination since the totals are not used anymore

* Updating the queries to not use aggregations for determining the totals

* Refactoring the children helper to handle pagination without totals

* Pinning the seed for the resolver tree generator service

* Splitting the fetcher into multiple classes for msearch

* Updating tests and api for ancestry array and msearch

* Adding more comments and fixing type errors

* Fixing resolver test import

* Fixing tests and type errors

* Fixing type errors and tests

* Removing useAncestry field

* Fixing test

* Removing useAncestry field from tests

* An empty array will be returned because that's how ES will do it too
2020-07-02 08:47:37 -04:00
Tiago Costa
7d63cafd5d
chore(NA): disable alerts_detection_rules cypress suites (#70577) 2020-07-02 12:31:51 +01:00
Pierre Gayvallet
1cfc9356bd
add getVisibleTypes API to SO type registry (#70559)
* add getVisibleTypes API

* doc nit

* fix mocking in tests
2020-07-02 13:17:33 +02:00
Jean-Louis Leysens
83beede50c
[Ingest Pipelines] Error messages (#70167)
* improved error messages

* traverse recursive error struct

* add check for object with keys

* update button position and copy

* size adjustments

* Refactor i18n texts and change wording

Also added missing translation and refactored maximum errors in
collapsed state to external constant

* use io-ts, add CIT and unit tests

* refactor error utilities to separate file

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-02 11:02:52 +02:00
Cauê Marcondes
6aeda644c8
[APM] Show transaction rate per minute on Observability Overview page (#70336)
* changing transaction count to transaction rate per second

* sanity check coordinates before calculate the mean

* sanity check coordinates before calculate the mean

* removing extend_bounds to return empty when no data is available
2020-07-02 11:01:10 +02:00
Alejandro Fernández Haro
6607bf7b49
[Telemetry] Report data shippers (#64935)
Co-authored-by: Christiane (Tina) Heiligers <christiane.heiligers@elastic.co>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-02 08:08:35 +01:00
Marta Bondyra
8fe5d154c1
[Lens] fix dimension label performance issues (#69978) 2020-07-02 08:05:08 +02:00
Spencer
eca4cc5d3e
Skip failing endgame tests (#70548)
Co-authored-by: spalger <spalger@users.noreply.github.com>
2020-07-01 23:01:21 -07:00
MadameSheema
257c115f66
[SIEM] Reenabling Cypress tests (#70397)
* reenabling cypress

* skips Overview tests

* skips search bar test

* skips URL test
2020-07-02 07:49:01 +02:00
Madison Caldwell
0f7afd4402
[SIEM][Security Solution][Endpoint] Endpoint Artifact Manifest Management + Artifact Download and Distribution (#67707)
* stub out task for the exceptions list packager

* Hits list code and pages

* refactor

* Begin adding saved object and type definitions

* Transforms to endpoint exceptions

* Get internal SO client

* update messaging

* cleanup

* Integrating with task manager

* Integrated with task manager properly

* Begin adding schemas

* Add multiple OS and schema version support

* filter by OS

* Fixing sort

* Move to security_solutions

* siem -> securitySolution

* Progress on downloads, cleanup

* Add config, update artifact creation, add TODOs

* Fixing buffer serialization problem

* Adding cleanup to task

* Handle HEAD req

* proper header

* More robust task management

* single -> agnostic

* Fix OS filtering

* Scaffolding digital signatures / tests

* Adds rotue for creating endpoint user

* Cleanup

* persisting user

* Adding route to fetch created user

* Addings tests for translating exceptions

* Adding test for download API

* Download tweaks + artifact generation fixes

* reorganize

* fix imports

* Fixing test

* Changes id of SO

* integration tests setup

* Add first integration tests

* Cache layer

* more schema validation

* Set up for manifest update

* minor change

* remove setup code

* add manifest schema

* refactoring

* manifest rewrite (partial)

* finish scaffolding new manifest logic

* syntax errors

* more refactoring

* Move to endpoint directory

* minor cleanup

* clean up old artifacts

* Use diff appropriately

* Fix download

* schedule task on interval

* Split up into client/manager

* more mocks

* config interval

* Fixing download tests and adding cache tests

* lint

* mo money, mo progress

* Converting to io-ts

* More tests and mocks

* even more tests and mocks

* Merging both refactors

* Adding more tests for the convertion layer

* fix conflicts

* Adding lzma types

* Bug fixes

* lint

* resolve some type errors

* Adding back in cache

* Fixing download test

* Changing cache to be sized

* Fix manifest manager initialization

* Hook up datasource service

* Fix download tests

* Incremental progress

* Adds integration with ingest manager for auth

* Update test fixture

* Add manifest dispatch

* Refactoring to use the same SO Client from ingest

* bug fixes

* build renovate config

* Fix endpoint_app_context_services tests

* Only index the fields that are necessary for searching

* Integ test progress

* mock and test city

* Add task tests

* Tests for artifact_client and manifest_client

* Add manifest_manager tests

* minor refactor

* Finish manifest_manager tests

* Type errors

* Update integ test

* Type errors, final cleanup

* Fix integration test and add test for invalid api key

* minor fixup

* Remove compression

* Update task interval

* Removing .text suffix from translated list

* Fixes hashes for unit tests

* clean up yarn.lock

* Remove lzma-native from package.json

* missed updating one of the tests

Co-authored-by: Alex Kahan <alexander.kahan@elastic.co>
2020-07-02 01:00:27 -04:00
Garrett Spong
591e10355a
[Security] Adds field mapping support to rule creation (#70288)
## Summary

Resolves: https://github.com/elastic/kibana/issues/65941, https://github.com/elastic/kibana/issues/66317, and `Add support for "building block" alerts`

This PR is `Part I` and adds additional fields to the `rules schema` in supporting the ability to map and override fields when generating alerts. A few bookkeeping fields like `license` and `author` have been added as well. The new fields are as follows:

``` ts
export interface TheseAreTheNewFields {
  author: string[];
  building_block_type: string; // 'default'
  license: string;
  risk_score_mapping: Array<
    {
      field: string;
      operator: string; // 'equals'
      value: string;
    }
  >;
  rule_name_override: string;
  severity_mapping: Array<
    {
      field: string;
      operator: string; // 'equals'
      value: string;
      severity: string; // 'low' | 'medium' | 'high' | 'critical'
    }
  >;
  timestamp_override: string;
}
```

These new fields are exposed as additional settings on the `About rule` section of the Rule Creation UI.

##### Default collapsed view, no severity or risk score override specified:
<p align="center">
  <img width="500" src="https://user-images.githubusercontent.com/2946766/86090417-49c0ee80-ba67-11ea-898f-a43af6d9383f.png" />
</p>

##### Severity & risk score override specified:
<p align="center">
  <img width="500" src="https://user-images.githubusercontent.com/2946766/86091165-a8d33300-ba68-11ea-86ac-89393a7ca3f5.png" />
</p>

##### Additional fields in Advanced settings:
<p align="center">
  <img width="500" src="https://user-images.githubusercontent.com/2946766/86091256-cbfde280-ba68-11ea-9b63-acf2524039bd.png" />
</p>


Note: This PR adds the fields to the `Rules Schema`, the `signals index mapping`,  and creates the UI for adding these fields during Rule Creation/Editing. The follow-up `Part II` will add the business logic for mapping fields during `rule execution`, and also add UI validation/additional tests.

### 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
  - Syncing w/ @benskelker 
- [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
- [x] 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

- [x] This was checked for breaking API changes and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)
2020-07-01 22:49:30 -06:00
nnamdifrankie
e9b81f72ca
SECURITY-ENDPOINT: add fields for events to metadata document (#70491)
SECURITY-ENDPOINT: EMT-492 add fields for events to metadata document
2020-07-01 22:49:56 -04:00
John Dorlus
b21e43d848
Fixed assertion in hybrid index pattern test to iterate through indices (#70130)
* Fixed assertion to check through all indices before making assertion.

* Restored yarn.lock file.

* Removed only from describe.

* Fixed linting issue.

* Fixed nits that were in the PR conversation.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-01 21:04:03 -04:00
Yara Tercero
6581450449
[SIEM][Exceptions] - Exception builder component (#67013)
### Summary

This PR creates the bulk functionality of the exception builder. The exception builder is the component that will be used to create exception list items. It does not deal with the actual API creation/deletion/update of exceptions, it does contain an `onChange` handler that can be used to access the exceptions. The builder is able to:

- accept `ExceptionListItem` and render them correctly
- allow user to add exception list item and exception list item entries
- accept an `indexPattern` and use it to fetch relevant field and autocomplete field values
- disable `Or` button if user is only allowed to edit/add to exception list item (not add additional exception list items)
- displays `Add new exception` button if no exception items exist
    - An exception item can be created without entries, the `add new exception` button will show in the case that an exception list contains exception list item(s) with an empty `entries` array (as long as there is one exception list item with an item in `entries`, button does not show)
- debounces field value autocomplete searches
- bubble up exceptions to parent component, stripping out any empty entries
2020-07-01 20:33:57 -04:00
Jen Huang
4f7da59a51
[Ingest Manager] Rename data sources to package configs (#70259)
* Rename `datasource` saved object to `package_config` (SO type `ingest-datasource` to `ingest-package-config`) and adjust mappings:

- Remove unused `processors` field on input & stream levels
- Remove unnecessary `enabled` field on package config & input levels
- Rename `agent_stream` field to `compiled_stream`
- Reorder other fields so that important fields are closer to top & similar fields are grouped together

Also,
- Remove 7.9.0 migrations as we are not supporting an upgrade path from experimental to beta release

* Pluralize `ingest-package-configs` for consistency

* Rename `Datasource`-related types to `PackageConfig`, update all references (does not include actual type definition changes yet)

* Rename `Datasource` schemas and rest spec typings to `PackageConfig` (does not include actual schema changes yet)

* Change `datasources` on agent config typings and schemas to `package_configs` and update all references

* Add back `enabled` field on package config and input levels. They are needed for current & future UI features. Also:

- Match types and schemas with saved object mappings (`agent_stream` to `compiled_stream`, removal of `processors`)
- Set `namespace` to be a required property on agent config and package config types, add validation support for it on UI

* Rename server-side datasource references in file names, variable names, and routes

* Update spec file and schema file

* Update doc wording

* Rename all instances of datasource in file paths and variable names on client sides, and for Endpoint too

* Minor copy adjustments, fix i18n check

* Replace datasource references in tests and fixtures; remove unused `ingest/policies` es archiver data

* Fix tests

* Fix test field name

* Fix test fixtures fields again

* Fix i18n
2020-07-01 16:14:21 -07:00
spalger
0f418bb7f0 skip suites blocking es snapshot promomotion (#70532) 2020-07-01 16:10:01 -07:00
Zacqary Adam Xeper
515b5dc66c
[Metrics UI] Fix asynchronicity and error handling in Snapshot API (#70503)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-01 18:07:54 -05:00
Angela Chuang
341f38577f
fix export response (#70473)
* fix export response

* update unit tests
2020-07-01 23:46:26 +01:00
nnamdifrankie
eedb5f7115
[SECURITY-ENDPOINT] use ingest manager unenroll services to remove unenrolled endpoint (#70393)
[SECURITY-ENDPOINT] EMT-451 - use ingest manager unenroll services to remove unenrolled endpoint
2020-07-01 17:52:16 -04:00
Sandra Gonzales
80ae5648ad
[Ingest Manager] remove requirements component (#70462)
* remove requirements component

* fix ts error

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-01 17:07:14 -04:00
Shahzad
ba48a9facf
[RUM Dashboard] Added service name filter (#70349)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-01 22:56:05 +02:00
Paul Tavares
3305b22d4f
[ENDPOINT][SIEM] Display dismissible Endpoint notice on Overview page if no endpoints are deployed (#70122) 2020-07-01 16:22:39 -04:00
Dave Snider
f2833f6d00
More permissive with IE warning (#70388)
Show the IE11 warning regardless of if the user supresses the warning
2020-07-01 13:07:48 -07:00
Spencer
ab450c7000 skip flaky suite (#70493) 2020-07-01 12:47:33 -07:00
CJ Cenizal
91b8e7de24
Use modern mount context in Dev Tools and Console (#70379)
* Use modern mount context in Dev Tools and Console, and clean up plugin definitions of Grok Debugger, Search Profiler, and Painless Lab.

* Remove return value from Console lifecycle method.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-01 12:40:52 -07:00
Jonathan Buttner
37d7d788d9
[Security_Solution][Endpoint] Refactor resolver generator for ancestry array (#70129)
* Refactor generator for ancestry support

* Adding optional ancestry array

* Fixing tests and type errors

* Removing useAncestry field

* Fixing test

* An empty array will be returned because that's how ES will do it too

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-01 15:13:03 -04:00
Melissa Alvarez
edad017246
update mse to access value property (#70438) 2020-07-01 14:40:53 -04:00
Robert Austin
bc66737085
fix styling for the SIEM Resolver integration (#70464) 2020-07-01 14:10:11 -04:00
Melissa Alvarez
2c40db8ac7
[ML] DF Analytics: ensure failed job state handled (#70456)
* handle failed job state in progress bar. skip reg test

* skip classification functional tests for now as well

* translate default callout message
2020-07-01 13:51:09 -04:00
Spencer
481dccdb6f
[ui-shared-deps/theme] implement auto-switching theme vars module (#70274)
Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-01 10:14:54 -07:00
Shahzad
9ff68e4c8c
[RUM Dashboard] Update rum title to be consistent with APM (#70460) 2020-07-01 18:52:38 +02:00
Nathan Reese
006670244a
[Maps] convert GeojsonFileSource to typescript (#70365)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-01 10:46:50 -06:00
James Gowdy
eafd2af6aa
[ML] Adding capabilities checks to shared functions (#70069)
* [ML] Adding capabilities checks to shared functions

* small refactor

* disabling capabilities checks for functions called by SIEM alerting

* testing git

* removing comment

* using constant for ml app id

* tiny type clean up

* removing check in ml_capabilities

* fixing types

* removing capabilities checks from ml_capabilities endpoint

* updating types

* better error handling

* improving capabilities check

* adding custom errors

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-01 17:45:36 +01:00
Chris Cowan
b7f33b94a8
[Metrics UI] Enhance Inventory View Tooltips (#69757)
* [Metrics UI] Enhance Inventory View Tooltips

* Fixing typos

* Removing toMetricOpt

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-01 09:45:21 -07:00
Robert Austin
652b11f270
Remove old endpoint routes redux (#70458)
Remove the legacy Endpoint Alerts feature
2020-07-01 12:45:15 -04:00
Charlie Pichette
9438f13939
Issue 63621 Fix Flaky Tests (#70344) 2020-07-01 12:37:42 -04:00
Ryland Herrick
d8d24be3fb
[Security Solution][Lists] More composable hooks/utilities (#70372)
* Add wrapper function to make an AbortSignal arg optional

Components commonly do not care about aborting a request, but are
required to pass `{ signal: new AbortController().signal }` anyway. This
addresses that use case.

* Adds hook for retrieving the component's mount status

This is useful for dealing with asynchronous tasks that may complete
after the invoking component has been unmounted. Using this hook,
callbacks can determine whether they're currently unmounted, i.e.
whether it's safe to set state or not.

* Add our own implemetation of useAsync

This does not suffer from the Typescript issues that the react-use
implementation had, and is generally a cleaner hook than useAsyncTask as
it makes no assumptions about the underlying function.

* Update exported Lists API hooks to use useAsync and withOptionalSignal

Removes the now-unused useAsyncTask as well.

* Add some JSDoc for our new functions
2020-07-01 11:27:08 -05:00
Spencer
bc802c38ee skip flaky suite (#66389) 2020-07-01 09:02:38 -07:00
Sandra Gonzales
275fb9731d
[Ingest Manager] add _meta field to index templates (#70319)
* add _meta field to index templates

* fix typescript issue

* make package an object

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-01 11:53:24 -04:00
Ahmad Bamieh
2212beba68
[i18n] integrate new translations + new i18n check #70193 (#70423)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-01 18:48:41 +03:00
Shahzad
518e88cf28
update (#70424) 2020-07-01 13:20:02 +01:00
Felix Stürmer
e70bc81998
[Logs UI] Avoid CCS-incompatible index name resolution (#70179)
This fixes #70048 by avoiding a CCS-incompatible ES API call when determining the existence of log indices.
2020-07-01 14:05:29 +02:00
Vadim Dalecky
8a6a55097d
Enable "Explore underlying data" actions for Lens visualizations (#70047)
* refactor: 💡 rename folder to "explore_data"

* style: 💄 check for "share" plugin in more semantic way

"explore data" actions use Discover URL generator, which is registered
in "share" plugin, which is optional plugin, so we check for its
existance, because otherwise URL generator is not available.

* refactor: 💡 move KibanaURL to a separate file

* feat: 🎸 add "Explore underlying data" in-chart action

* fix: 🐛 fix imports after refactor

* feat: 🎸 add start.filtersFromContext to embeddable plugin

* feat: 🎸 add type checkers to data plugin

* feat: 🎸 better handle empty filters in Discover URL generator

* feat: 🎸 implement .getUrl() method of explore data in-chart act

* feat: 🎸 add embeddable.filtersAndTimeRangeFromContext()

* feat: 🎸 improve getUrl() method of explore data action

* test: 💍 update test mock

* fix possible stale hashHistory.location in discover

* style: 💄 ensureHashHistoryLocation -> syncHistoryLocations

* docs: ✏️ update autogenerated docs

* test: 💍 add in-chart "Explore underlying data" unit tests

* test: 💍 add in-chart "Explore underlying data" functional tests

* test: 💍 clean-up custom time range after panel action tests

* chore: 🤖 fix embeddable plugin mocks

* chore: 🤖 fix another mock

* test: 💍 add support for new action to pie chart service

* feat: 🎸 enable "Explore underlying data" action for Lens vis

* test: 💍 make tests green again

* refactor: 💡 rename trigger contexts

* chore: 🤖 fix TypeScript errors

Co-authored-by: Anton Dosov <anton.dosov@elastic.co>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-01 12:16:23 +02:00
Andrew Cholakian
e8cf08fb3e
Initial work on uptime homepage API (#70135)
Co-authored-by: Shahzad <shahzad31comp@gmail.com>
2020-07-01 11:06:56 +02:00
Joe Reuter
de79985f92
[Lens] Add "no data" popover (#69147) 2020-07-01 10:08:37 +02:00
Joe Reuter
a49f5cec64
[Lens] Move chart switcher over (#70182) 2020-07-01 10:07:59 +02:00
Joe Reuter
e1665e8b27
[Lens] Multiple y axes (#69911) 2020-07-01 09:57:23 +02:00
Brian Seeders
c1dc53c6fb skip flaky suite (#70386) 2020-06-30 21:29:37 -04:00
Xavier Mouligneau
9af75fa98b
fix bug to add timeline to case (#70343) 2020-06-30 21:05:14 -04:00
Zacqary Adam Xeper
0047eeded6
[Metrics UI] Add context.reason and alertOnNoData to Inventory alerts (#70260) 2020-06-30 16:34:38 -05:00
Robert Austin
893525c74c
Resolver refactoring (#70312)
* remove unused piece of state
* Move related event total calculation to selector
* rename xScale
* remove `let`
* Move `dispatch` call out of HTTP try-catch
2020-06-30 17:32:44 -04:00
Nicolas Chaulet
8903d3427e
[Ingest Manager] Fix agent ack after input format change (#70335) 2020-06-30 17:23:56 -04:00
Christos Nasikas
aa52102edb
[SIEM][Timeline] Reset fields based on timeline (#70209) 2020-06-30 23:46:21 +03:00
Devin W. Hurley
432f93a1a5
[SECURITY SOLUTION] [Detections] Increase lookback when gap is detected (#68339)
* add POC logic to modify the 'from' param in the search

* fixes formatting for appending gap diff to from

* computes new max signals based on how many intervals of rule runs were missed when gap in consecutive rule runs is detected

* adds logging, fixes bug where we could end up with negative values for diff, adds calculatedFrom to the search after query

* remove console.log and for some reason two eslint disables were added so i removed one of them

* rename variables, add test based on log message - need to figure out a better way to test this

* remove unused import

* fully re-worked the algorithm for searching discrete time periods, still need search_after because a user could submit a rule with a custom maxSignals so that would still serve a purpose. This needs heavy refactoring though, and tests.

* updated loop to include maxSignals per time interval tuple, this way we guarantee maxSignals per full rule interval. Needs some refactoring though.

* move logic into utils function, utils function still needs refactoring

* adds unit tests and cleans up new util function for determining time intervals for searching to occur

* more code cleanup

* remove more logging statements

* fix type errors

* updates unit tests and fixes bug where search result would return 0 hits but we were accessing property on non-existent hit item

* fix rebase conflict

* fixes a bug where a negative gap could exist if a rule ran before the lookback time, also fixes a bug where the search and bulk loop would return false when successful.

* gap is a duration, not a number.

* remove logging variable

* remove logging function from test

* fix type import from rebase with master

* updates missed test when rebased with master, removes unused import

* modify log statements to include meta information for logged rule events, adds tests

* remove unnecessary ts-ignores

* indentation on stringify

* adds a test to ensure we are parsing the elapsed time correctly
2020-06-30 16:43:49 -04:00
Xavier Mouligneau
a07526484a
[SECURITY] Bug overview link (#70214)
* fix link bug on overview page

* Rename Signal to Alert in selection of event in timeline

* review I

* fix i18n
2020-06-30 15:25:16 -04:00
Alejandro Fernández Haro
56aac44ac3
[API Integration Tests] usageApi service to expose the private telemetry API (#70057)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-06-30 20:14:59 +01:00
Nathan L Smith
585b3f7e3d
Add Jest configuration and README to observability plugin (#70340)
Also clean up the coverage configuration in the APM jest config.
2020-06-30 14:03:05 -05:00
Clint Andrew Hall
60a86d6396
[easy][bug] Fix thumb rendering observer (#70255) 2020-06-30 14:51:59 -04:00
Dario Gieselaar
b5ceefbaed
[APM] Simpler security check (#69780)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-06-30 20:47:19 +02:00
Corey Robertson
a9f72bc5e4
[Canvas] Move Templates to be stored as Saved Objects (#69438)
* Moves Canvas templates to live server side

* Adds Clone from template test

* Fix url

* Clean up

* PR Feedback

* i18n
2020-06-30 14:21:01 -04:00
Nicolas Chaulet
4784686978
[Ingest Manager] Validate agent version <= Kibana version (#70339) 2020-06-30 14:15:47 -04:00
Zacqary Adam Xeper
c948e47714
[Metrics UI] Design updates for alert preview results (#69328)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-06-30 13:00:15 -05:00
Zacqary Adam Xeper
0f78bc9ba5
[Metrics UI] Make alert instance IDs more useful (#70100)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-06-30 12:59:19 -05:00
Jason Rhodes
bb7bc782b2
[Logs and Metrics UI] Initial setup for registering observability overview data fetchers (#69999)
* Switches mount callbacks to only use start deps

Fixes #58014

* Sets up skeleton logs data fetchers for overview

* Fixes type hacks for logs fetcher

* Prevent kibana from crashing on initial load

* Fixes types and linting errors

* Fixes some linting import/export issues

Co-authored-by: Alejandro Fernández Gómez <alejandro.fernandez@elastic.co>
2020-06-30 13:56:35 -04:00
John Schulz
2118439d87
[Ingest Manager] Make setupIngestManager wait if setup is in progress (#70008)
* Make setupIngestManager wait if another setup is in progress
2020-06-30 13:53:53 -04:00
Nicolas Chaulet
7c9db862ab
[Ingest Manager] Do not index every saved object field (#70162) 2020-06-30 12:07:06 -04:00
Matthew Kime
2fe0051ec2
Index patterns - Server API (#69105)
* index patterns on the server
2020-06-30 10:14:29 -05:00
Kevin Logan
04b8d108d5
remove logs link and alerts count (#70282) 2020-06-30 11:14:04 -04:00
István Zoltán Szabó
43bfa4ab66
[ML] Modifies page title to Create job (#70191)
Changes Create data frame analytics job to Create job.
2020-06-30 16:56:40 +02:00
Søren Louv-Jansen
606eb6b3d8
[APM] Add API test for service maps (#70185)
* [APM] Add API test for service maps

* Re-add custom links test

* Improved test names

* Disable eslint rule

* Undo readme changes

* Fix ts errors
2020-06-30 16:35:52 +02:00
Christiane (Tina) Heiligers
93ef5c0c41
[Usage Collection] Report nodes feature usage (#70108)
* Adds nodes feature usage stats merged into cluster_stats.nodes when usage collection is local
2020-06-30 07:30:31 -07:00
Thomas Watson
ad01223c5a
chore: improve support for mjs file extension (#70186) 2020-06-30 16:13:28 +02:00
Melissa Alvarez
233d261674
[ML] Anomaly Detection: ensure 'Category examples' tab in the expanded table row can be seen (#70241)
* remove space from tab id

* update test
2020-06-30 10:07:50 -04:00
Aaron Caldwell
3caab366c7
[Maps] Add maps telemetry saved object in with mappings disabled (#69995)
Co-authored-by: Rudolf Meijering <skaapgif@gmail.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-06-30 08:04:48 -06:00
MadameSheema
351629f8e9
updates wording in Cases connectors (#70298) 2020-06-30 13:04:21 +02:00
Walter Rafelsberger
06ee7bd2a3
[ML] Fix license subscription race condition. (#70074)
Fixes a race condition where the ML plugin would be mounted before receiving its first license information update and thus redirecting to a fallback page (Kibana Home, Space-Chooser or Data Visualizer page depending on the setup).
2020-06-30 12:14:21 +02:00
Kerry Gallagher
ceb8595151
[Logs UI] [Alerting] "Group by" functionality (#68250)
- Add "group by" functionality to logs alerts
2020-06-30 10:28:54 +01:00
Mikhail Shustov
159369b719
Use ts-expect-error in platform code (#69883)
* ts-ignore --> ts-expect-error

* fix error with mutable array

* fix errors in consumers code

* update SOM

* fix FeatureConfig & Feature compatibility

* do not re-export from code. it breaks built version

* update docs

* add eslint rule for platform team code

* remove test. this is covered by ts-expect-error in unit tests

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-06-30 07:37:42 +02:00
Frank Hassanabad
7144db201f
[SIEM][Detection Engine][Lists] Moves getQueryFilter to common folder for use by both front and backend
## Summary

* Moves querying and tests from server to common

The function we are interested using on the front end is:

```ts
export const getQueryFilter = (
  query: Query,
  language: Language,
  filters: Array<Partial<Filter>>,
  index: Index,
  lists: ExceptionListItemSchema[]
) => {
```

### 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-06-29 20:44:27 -06:00
Kevin Logan
b3f19dad74
[Ingest Manager][SECURITY SOLUTION] adjust config reassign link and add roundtrip to Reassignment flow (#70208) 2020-06-29 21:43:47 -04:00
Ryland Herrick
590fc8d2ff
[Security][Lists] Add API functions and react hooks for value list APIs (#69603)
* Add pure API functions and react hooks for value list APIs

This also adds a generic hook, useAsyncTask, that wraps an async
function to provide basic utilities:
  * loading state
  * error state
  * abort/cancel function

* Fix type errors in hook tests

These were not caught locally as I was accidentally running typescript
without the full project.

* Document current limitations of useAsyncTask

* Defines a new validation function that returns an Either instead of a tuple

This allows callers to further leverage fp-ts functions as needed.

* Remove duplicated copyright comment

* WIP: Perform request/response validations in the FP style

* leverages new validateEither fn which returns an Either
* constructs a pipeline that:
  * validates the payload
  * performs the API call
  * validates the response
and short-circuits if any of those produce a Left value.

It then converts the Either into a promise that either rejects with the
Left or resolves with the Right.

* Adds helper function to convert a TaskEither back to a Promise

This cleans up our validation pipeline considerably.

* Adds request/response validations to findLists

* refactors private API functions to accept the encoded request schema
(i.e. snake cased)
* refactors validateEither to use `schema.validate` instead of
`schema.decode` since we don't actually want the decoded value, we just
want to verify that it'll be able to be decoded on the backend.

* Refactor our API types

* Add request/response validation to import/export functions

* Fix type errors

* Continue to export decoded types without a qualifier
* pull types used by hooks from their new location
* Fix errors with usage of act()

* Attempting to reduce plugin bundle size

By pulling from the module directly instead of an index, we can
hopefully narrow down our dependencies until tree-shaking does this for
us.

* useAsyncFn's initiator does not return a promise

Rather than returning a promise and requiring the caller to handle a
rejection, we instead return nothing and require the user to watch the
hook's state.

* success can be handled with a useEffect on state.result
* errors can be handled with a useEffect on state.error

* Fix failing test

Assertion count wasn't updated following interface changes; we've now
got two inline expectations so this isn't needed.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-06-29 20:02:39 -05:00
Alison Goryachev
771f3ae098
[ILM] Fix bug when clearing priority field (#70154) 2020-06-29 20:34:33 -04:00
Nicolas Chaulet
88a41b2b1e
[IngestManager] Allow to filter agent by packages (#69731) 2020-06-29 18:48:18 -04:00
Dmitry Lemeshko
8e524477bc
[code coverage] exclude folders: test_helpers, tests_bundle (#70199) 2020-06-29 23:55:29 +02:00
Phillip Burch
470397075f
[Metrics UI] UX improvements for saved views (#69910)
* Works-ish

* Load the default view without throwing error

* Design feedback

* Update Saved Views design on Metrics explorer

* Fix types

* UX improvements when saving and editng

* Only load default view if there is no state from anywhere else.

* Add loading indicator and other polish

* Hide saved view menu when opening modals

* Fix typecheck

* Fix typo

* Fix translations
2020-06-29 16:53:36 -05:00
Rashmi Kulkarni
d79a6883bf
Cross cluster search functional test with minimun privileges assigned to the test_user (#70007)
* using test_user with limited read permission to search profiler test

* gitcheck

* search profiler test using test_user

* using limited roles and privileges for CCR

* changed the global ccr role kibana section to be consistent with other roles with no feature controls

* removed canvas role

* changes to include pagination for 100 rows

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-06-29 14:42:49 -07:00
Nathan Reese
917598141f
[Maps] choropleth layer wizard (#69699)
* [Maps] choropleth layer wizard

* add boundaries radio group

* geo_index_pattern_select

* consolidate more logic into geo_index_pattern_select

* small clean-up

* left geo field and join field

* move EuiPanel into render wizard

* cleanup

* right panel

* createEmsChoroplethLayerDescriptor

* createEsChoroplethLayerDescriptor

* i18n cleanup

* tslint

* snapshot update

* review feedback

* review feedback

* update snapshot

* make EMS default source

* tslint

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-06-29 15:12:09 -06:00
John Schulz
7db95a1691
Make custom errors by extending Error (#69966)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-06-29 17:08:50 -04:00
Jen Huang
d9fcc585cf
[Ingest Manager] Support updated package output structure (#69864)
* Update EPM package registry typings to reflect registry changes

* Change `dataset.id` references to `dataset.name`

* Fix RegistryStream

* Fix packageToConfigDatasourceInputs service

* Fix assignPackageStream service

* Fix validateDatasource service

* Fix configure data source components

* Fix variable

* Fix stream template installation

* Add support for `input[].dataset.type` and change `stream.dataset` mapping to be object containing `name` with instead of just a string

* Nest package information under `meta` in agent config yaml

* Move `dataset.type` to stream level instead of input level

* Make single call to fetch registry package information instead of doing it per stream

* Fix type issues

* Update endpoint test assertion

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-06-29 14:06:05 -07:00
Robert Austin
ad9d3dcb9c
Resolver test coverage (#70246)
* Move AABB, Matrix3, and Vector2 modules from lib to models

* Add tests for AABB

* remove dead code
2020-06-29 17:04:29 -04:00
Lee Drengenberg
752fa6e01e
Async Discover search test (#64388)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-06-29 15:40:02 -05:00
Spencer
9c965fef72
[ui-shared-deps] include styled-components (#69322)
* [ui-shared-deps] include styled-components

* update snapshots caused by react-is upgrade

* fix jest snapshots

* declare react-is dep in x-pack too so it uses the right version

Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-06-29 13:06:14 -07:00
nnamdifrankie
f196546f4b
SECURITY-ENDPOINT: add host properties (#70238) 2020-06-29 16:03:02 -04:00
MadameSheema
04991d40c2
[SIEM] Fixes 'sets and reads the url state for timeline by id' Cypress test (#69882)
* fixes 'sets and reads the url state for timeline by id' test

* fixes merge issue

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-06-29 21:20:54 +02:00
Shahzad
df44a3e779
[RUM Dashboard] Chart breakdowns (#69420)
Co-authored-by: Casper Hübertz <casper@formgeist.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-06-29 20:54:52 +02:00
Wylie Conlon
736e64c60f
[Lens] Fix cross cluster bug and optimize existence query (#70132)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-06-29 13:47:08 -04:00
MadameSheema
c2944855bd
renames 'detections' to 'alerts' (#70164) 2020-06-29 19:29:37 +02:00
MadameSheema
2a25df3f1c
[SIEM] Fixes Cypress 'Search Bar' test (#69952)
* fixes 'Search Bar' test

* [DEBUG] executes only Security Cypress tests

* Revert "[DEBUG] executes only Security Cypress tests"

This reverts commit e727790dbf.

* [DEBUG] executes only Security Cypress tests

* [DEBUG] fixes jenkins file

* [DEBUG] fixes Jenkinsfile

* Revert "[DEBUG] fixes Jenkinsfile"

This reverts commit 8f42e82edd.

* Revert "[DEBUG] fixes jenkins file"

This reverts commit 98487467eb.

* Revert "[DEBUG] executes only Security Cypress tests"

This reverts commit 6a089305e1.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-06-29 19:28:46 +02:00
Robert Austin
8ffdd4568b
[Security Solution] Resolver in Timeline (#69728)
Display Resolver in Security Solution's Timeline.
2020-06-29 13:10:39 -04:00
Joel Griffith
c53f036f5d
Ensure that security is enabled before doing user authentication checks (#70127)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-06-29 09:26:11 -07:00
Luke Elmers
851e7ff9b8
[data.search.aggs] Remove fieldFormats from AggConfig & AggConfigs (#69762) 2020-06-29 10:10:34 -06:00
Brian Seeders
462bf1520f skip flaky suite (#69617) 2020-06-29 11:48:39 -04:00
Vadim Dalecky
9f6ad5a8d8
"Explore underlying data" in-chart action kibana.yml flag (#70045)
* refactor: 💡 rename folder to "explore_data"

* style: 💄 check for "share" plugin in more semantic way

"explore data" actions use Discover URL generator, which is registered
in "share" plugin, which is optional plugin, so we check for its
existance, because otherwise URL generator is not available.

* refactor: 💡 move KibanaURL to a separate file

* feat: 🎸 add "Explore underlying data" in-chart action

* fix: 🐛 fix imports after refactor

* feat: 🎸 add start.filtersFromContext to embeddable plugin

* feat: 🎸 add type checkers to data plugin

* feat: 🎸 better handle empty filters in Discover URL generator

* feat: 🎸 implement .getUrl() method of explore data in-chart act

* feat: 🎸 add embeddable.filtersAndTimeRangeFromContext()

* feat: 🎸 improve getUrl() method of explore data action

* test: 💍 update test mock

* fix possible stale hashHistory.location in discover

* style: 💄 ensureHashHistoryLocation -> syncHistoryLocations

* docs: ✏️ update autogenerated docs

* test: 💍 add in-chart "Explore underlying data" unit tests

* test: 💍 add in-chart "Explore underlying data" functional tests

* test: 💍 clean-up custom time range after panel action tests

* chore: 🤖 fix embeddable plugin mocks

* chore: 🤖 fix another mock

* test: 💍 add support for new action to pie chart service

* feat: 🎸 add kibana.yml to disable in-chart "explore data" actio

Co-authored-by: Anton Dosov <anton.dosov@elastic.co>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-06-29 17:47:08 +02:00
Larry Gregory
28b70923df
Consolidate capabilities check for Stack Management (#69437)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-06-29 11:43:43 -04:00
Pierre Gayvallet
fe1c508d8d
Move and rename legacy elasticsearch client (#69797)
* move last snapshot to inline

* move legacy files to legacy subfolder

* move request types out of legacy

* export Headers from http instead of elasticsearch

* renaming - first pass

* renaming - second pass

* fix core mocks

* adapt new calls

* update generated doc

* fix IT test mocks

* fix new usages
2020-06-29 17:43:31 +02:00
patrykkopycinski
821aa9903b
Bump react-router (#69608) 2020-06-29 16:55:38 +02:00
Nicolas Chaulet
6e9972e693
[Ingest Manager] expose method to get agent and list agents to other plugins (#70087) 2020-06-29 10:51:30 -04:00
Corey Robertson
f47b3e50c7
[Canvas] Update Canvas Plugin documentation (#65910)
* Update Canvas Plugin documentation

* Small fix

* Update x-pack/plugins/canvas/README.md

Co-authored-by: Clint Andrew Hall <clint@clintandrewhall.com>

* Update x-pack/plugins/canvas/README.md

Co-authored-by: Clint Andrew Hall <clint@clintandrewhall.com>

* Update x-pack/plugins/canvas/README.md

Co-authored-by: Clint Andrew Hall <clint@clintandrewhall.com>

* Update x-pack/plugins/canvas/README.md

Co-authored-by: Clint Andrew Hall <clint@clintandrewhall.com>

* Update x-pack/plugins/canvas/README.md

Co-authored-by: Clint Andrew Hall <clint@clintandrewhall.com>

* Update x-pack/plugins/canvas/README.md

Co-authored-by: Clint Andrew Hall <clint@clintandrewhall.com>

* Update x-pack/plugins/canvas/README.md

Co-authored-by: Clint Andrew Hall <clint@clintandrewhall.com>

* Update x-pack/plugins/canvas/README.md

Co-authored-by: Clint Andrew Hall <clint@clintandrewhall.com>

* Update x-pack/plugins/canvas/README.md

Co-authored-by: Clint Andrew Hall <clint@clintandrewhall.com>

Co-authored-by: Clint Andrew Hall <clint@clintandrewhall.com>
2020-06-29 10:39:49 -04:00
Daniil Suleiman
19bda1fcee
Reactify visualize app (#67848)
* Reactify visualize app

* Fix typescript failures after merging master

* Make sure refresh button works

* Subscribe filter manager fetches

* Use redirect to landing page

* Update savedSearch type

* Add check for TSVB is loaded

* Fix comments

* Fix uiState persistence on vis load

* Remove extra div around TableListView

* Update DTS selectors

* Add error handling for embeddable

* Remove extra argument from useEditorUpdates effect

* Update comments, fix typos

* Remove extra div wrapper

* Apply design suggestions

* Revert accidental config changes

* Apply navigating to dashboard

* Apply redirect legacy urls

* Apply incoming changes

* Apply incoming changes

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-06-29 17:21:49 +03:00
Dario Gieselaar
dbdc3cd01a
[APM] Run API tests as restricted user (#70050) 2020-06-29 16:17:32 +02:00
Sandra Gonzales
81022a3206
[Ingest Manager] rollover data stream when index template mappings are not compatible (#69180)
* rollover data stream when index template mappings are not compatible

* update error messages

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-06-29 10:01:59 -04:00
Shahzad
64e87cd6b5
[Uptime] Use ML Capabilities API to determine license type (#66921)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-06-29 15:36:59 +02:00
Sonja Krause-Harder
e91594aeb9
[Ingest Manager] Use DockerServers service in integration tests. (#69822)
* Partially disable test files.

* Use DockerServers in EPM tests.

* Only run tests when DockerServers have been set up

* Reenable ingest manager API integration tests

* Pass new test_packages to registry container

* Enable DockerServers tests in CI.

* Correctly serve filetest package for file tests.

* Add helper to skip test and log warning.

* Reenable further file tests.

* Add developer documentation about Docker in Kibana CI.

* Document use of yarn test:ftr

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-06-29 15:24:11 +02:00
Nathan L Smith
8e57db696a
[APM] Use licensing from context (#70118)
* [APM] Use licensing from context

We added the usage of `featureUsage.notifyUsage` from the licensing plugin in #69455.

This required us to use `getStartServices to add `licensing` to `context.plugins`.

In #69838 `featureUsage` was added to `context.licensing`, so we don't need to add it to `context.plugins`.
2020-06-29 08:23:52 -05:00
Pierre Gayvallet
7e5cff4be9
[GS] add application result provider (#68488)
* add application result provider

* remove empty contracts & cache searchable apps

* fix types
2020-06-29 15:17:00 +02:00
Alison Goryachev
3571100bcc
[CCR] Fix reducer function when finding missing privileges (#70158) 2020-06-29 08:31:59 -04:00
Wylie Conlon
40ff82d779
[Lens] Fix broken test (#70117) 2020-06-27 08:20:29 +02:00
Angela Chuang
f4e7f14ffe
[SIEM] Import timeline fix (#65448)
* fix import timeline and clean up

fix unit tests

apply failure checker

clean up error message

fix update template

* add unit tests

* clean up common libs

* rename variables

* add unit tests

* fix types

* Fix imports

* rename file

* poc

* fix unit test

* review

* cleanup fallback values

* cleanup

* check if title exists

* fix unit test

* add unit test

* lint error

* put the flag for disableTemplate into common

* add immutiable

* fix unit

* check templateTimelineVersion only when update via import

* update template timeline via import with response

* add template filter

* add filter count

* add filter numbers

* rename

* enable pin events and note under active status

* disable comment and pinnedEvents for template timelines

* add timelineType for openTimeline

* enable note icon for template

* add timeline type for propertyLeft

* fix types

* duplicate elastic template

* update schema

* fix status check

* fix import

* add templateTimelineType

* disable note for immutable timeline

* fix unit

* fix error message

* fix update

* fix types

* rollback change

* rollback change

* fix create template timeline

* add i18n for error message

* fix unit test

* fix wording and disable delete btn for immutable timeline

* fix unit test provider

* fix types

* fix toaster

* fix notes and pins

* add i18n

* fix selected items

* set disableTemplateto true

* move templateInfo to helper

* review + imporvement

* fix review

* fix types

* fix types

Co-authored-by: Patryk Kopycinski <contact@patrykkopycinski.com>
Co-authored-by: Xavier Mouligneau <189600+XavierM@users.noreply.github.com>
2020-06-27 04:53:53 +01:00
Candace Park
684289d6e3
[SECURITY SOLUTION][INGEST] UX update for ingest manager edit/create datasource for endpoint (#70079)
[security solution][ingest]UX update for ingest manager edit/create datasource for endpoint
2020-06-26 20:25:01 -04:00
Ahmad Bamieh
266f853b0b
[Telemetry] Collector Schema (#64942)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-06-27 02:52:26 +03:00
Kevin Logan
5236335d63
[Endpoint] Add Endpoint empty states for onboarding (#69626) 2020-06-26 18:08:07 -04:00
Michael Olorunnisola
5c8df21ca0
Hide unused resolver buttons (#70112)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-06-26 17:38:02 -04:00
Andrew Goldstein
295ac7ef12
[Security] Investigate in Resolver Timeline Integration (#70111)
## [Security] `Investigate in Resolver` Timeline Integration

This PR adds a new `Investigate in Resolver` action to the Timeline, and all timeline-based views, including:

- Timeline
- Alert list (i.e. Signals)
- Hosts > Events
- Hosts > External alerts
- Network > External alerts

![investigate-in-resolver-action](https://user-images.githubusercontent.com/4459398/85886173-c40d1c80-b7a2-11ea-8011-0221fef95d51.png)

### Resolver Overlay

When the `Investigate in Resolver` action is clicked, Resolver is displayed in an overlay over the events. The screenshot below has placeholder text where Resolver will be rendered:

![resolver-overlay](https://user-images.githubusercontent.com/4459398/85886309-10f0f300-b7a3-11ea-95cb-0117207e4890.png)

The Resolver overlay is closed by clicking the `< Back to events` button shown in the screenshot above.

The state of the timeline is restored when the overlay is closed. The scroll position (within the events), any expanded events, etc, will appear exactly as they were before the Resolver overlay was displayed.

### Case Integration

Users may link directly to a Timeline Resolver view from cases via the `Attach to new case` and `Attach to existing case...` actions show in the screenshot below:

![case-integration](https://user-images.githubusercontent.com/4459398/85886773-e3587980-b7a3-11ea-87b6-b098ea14bc5f.png)

![investigate-in-resolver](https://user-images.githubusercontent.com/4459398/85885618-daff3f00-b7a1-11ea-9356-2e8a1291f213.gif)

When users click the link in a case, Timeline will automatically open to the Resolver view in the link.

### URL State

Users can directly share Resolver views (in saved Timelines) with other users by copying the Kibana URL to the clipboard when Resolver is open.

When another user pastes the URL in their browser, Timeline will automatically open and display the Resolver view in the URL.

### Enabling the `Investigate in Resolver` action

In this PR, the `Investigate in Resolver` action is only enabled for events where all of the following are true:

- `agent.type` is `endpoint`
- `process.entity_id` exists

### Context passed to Resolver

The only context passed to `Resolver` is the `_id` of the event (when the user clicks `Investigate in Resolver`)

### What's next?

- @oatkiller will replace the placeholder text shown in the screenshots above with the actual call to Resolver in a separate PR
- I will follow-up this PR with additional tests
- The action text `Investigate in Resolver` may be changed in a future PR
- Hide the `Add to case` action in timeline-based views (it's currently visible, but disabled)
2020-06-26 15:36:51 -06:00