Commit graph

30774 commits

Author SHA1 Message Date
patrykkopycinski
f4d29abf1c
Bump redux dependencies (#53348) 2020-02-17 09:58:54 +01:00
Sébastien Loix
8e17fdabd4
[Index management] Client-side NP ready (#57295) 2020-02-17 14:22:07 +05:30
Patrick Mueller
5d3797ee0b
change id of x-pack event_log plugin to eventLog (#57612)
change id of x-pack event_log plugin to eventLog
2020-02-16 20:10:35 -05:00
Patrick Mueller
f998174898
[eventLog] get kibana.index name from config instead of hard-coding it (#57607)
fixes https://github.com/elastic/kibana/issues/55629
2020-02-16 17:55:52 -05:00
Liza K
36599fdfac revert 2020-02-16 18:19:37 +02:00
Liza K
335c712992 allow using any path to generate 2020-02-16 18:13:22 +02:00
Ben Skelker
67087e34d1
fixes ui titles (#57535)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-16 10:39:58 +02:00
Joe Portner
3b232ae735
Fix login redirect for expired sessions (#57157) 2020-02-15 19:32:16 -05:00
Anton Dosov
e370df2e5f
Expose Vis on the contract as it requires visTypes (#56968)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-15 12:46:04 +01:00
Frank Hassanabad
94c856dd42
[SIEM][Detection Engine] Fixes queries to ignore errors when signals index is not present
## Summary

Fixes a bug where if you try to query the signals index and it is not present you would get an error that would bubble up to the UI.

Before:
<img width="824" alt="Screen Shot 2020-02-13 at 12 57 55 PM" src="https://user-images.githubusercontent.com/1151048/74499587-74881d00-4ea1-11ea-93b0-8d7258f79404.png">

After:
<img width="790" alt="Screen Shot 2020-02-13 at 8 43 28 PM" src="https://user-images.githubusercontent.com/1151048/74499619-9386af00-4ea1-11ea-889b-cb1853e399e3.png">

<img width="804" alt="Screen Shot 2020-02-13 at 8 43 34 PM" src="https://user-images.githubusercontent.com/1151048/74499624-971a3600-4ea1-11ea-862b-9695ecbadcbe.png">


Also fixes a regression bug with error toasters showing up when they shouldn't because of a signals index not existing. This only effects 7.6.x and master and is _not_ part of 7.6.0 at the moment.

* https://github.com/elastic/kibana/issues/57641

### Checklist

Delete any items that are not applicable to this PR.

~~- [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/master/packages/kbn-i18n/README.md)~~

~~- [ ] [Documentation](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#writing-documentation) was added for features that require explanation or tutorials~~

~~- [ ] [Unit or functional tests](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility) were updated or added to match the most common scenarios~~

~~- [ ] This was checked for [keyboard-only and screenreader accessibility](https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Cross_browser_testing/Accessibility#Accessibility_testing_checklist)~~

~~- [ ] This renders correctly on smaller devices using a responsive layout. (You can test this [in your browser](https://www.browserstack.com/guide/responsive-testing-on-local-server)~~

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

### For maintainers

~~- [ ] This was checked for breaking API changes and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~~
2020-02-14 20:14:59 -07:00
Alison Goryachev
6e3790537d
[Remote clusters] Migrate client-side code out of legacy (#57365) 2020-02-14 21:10:33 -05:00
Spencer
15e4e6c632
Fix failed test reporter for SIEM Cypress use (#57240)
* [@kbn/test] build with source-maps

* [@kbn/test] the jUnit Reporter being used for SIEM Cypress tests sometimes doesn't include testcases in XML

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-14 18:47:32 -07:00
spalger
0cee1a4adb skip flaky suite (#45244) 2020-02-14 18:46:01 -07:00
Dmitry Lemeshko
95b713e69d
update chromedriver to 80.0.1 (#57602)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-15 00:43:32 +01:00
Patrick Mueller
96c39a5a14
change slack action to only report on whitelisted host name (#57582)
Previously, when using the slack action with a url which was not whitelisted, the entire URL was reported in the error.  With this change, only the hostname is reported in the error.
2020-02-14 18:29:50 -05:00
Spencer
5d99576ab1
[kbn/optimizer] throw errors into stream on invalid completion (#57735) 2020-02-14 16:17:07 -07:00
Peter Pisljar
78bff535e0
moving visualize/utils to new platform (#56650) 2020-02-14 18:16:49 -05:00
Chris Roberson
e319269e18
[Monitoring] Support shipping directly to the monitoring cluster (#57022)
* Support shipping directly to the monitoring cluster

* Add timestamp

* PR feedback

* Use utc
2020-02-14 16:07:44 -05:00
Mike Côté
918c0dec9f
Increase stability when initializing the Elasticsearch index for the event log (#57465)
* Fix ILM policy creation

* Handle errors thrown in scenario multiple Kibana instances are started at the same time

* Fix tests and cleanup

* Start adding tests

* Refactor tests, add index template failure test

* Create cluster client adapter to facilitate testing and isolation

* Fix places calling callEs still

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-14 15:38:45 -05:00
Tim Sullivan
34ae99b516
[Reporting/New Platform] Provide async access to server-side dependencies (#56824)
* [Reporting/New Platform] Provide async access to server-side

* consistent name for reportingPlugin

* Prettier changes

* simplify reporting usage collector setup

* add more tests

* extract internals access to separate core class

* fix tests

* fix imports for jest and build

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-14 12:36:08 -07:00
gchaps
52a566d095
[DOCS] Adds link to migration guide (#57702) 2020-02-14 11:33:25 -08:00
Paul Tavares
fe21356020
[Endpoint] Policy List UI route and initial view (#56918)
* Initial Policy List view

* Add `endpoint/policy` route and displays Policy List
* test cases (both unit and functional)

Does not yet interact with API (Ingest).
2020-02-14 14:14:39 -05:00
Pete Harverson
73cb0aa840
[ML] New Platform server shim: update filters routes to use new platform router (#57597)
* [ML] Update filters routes to use new platform router

* [ML] Edits to filters route following review

* [ML] Edits following review and fix job service api docs

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-14 19:08:02 +00:00
Josh Dover
6bd09d616f
Fix maybe behavior with object type (#55932) 2020-02-14 12:06:59 -07:00
Greg Thompson
0abfd3c72f
Upgrade EUI to v19.0.0 (#57284)
* eui to v19.0.0

* typescript updates; idAria removal

* src snapshot updates

* mock euicode and euicodeblock for jest

* x-pack snapshot updates

* mock euicode for jest

* more euicode snapshots

* mock euicode in storyshots

* types/enzyme yarn.lock

* sidenav type update
2020-02-14 13:06:31 -06:00
gchaps
356e3a4776
[DOCS] Adds Save to Advanced Settings doc (#57696)
* [DOCS] Adds Save to Advanced Settings doc

* [DOCS] Incorporates review comments
2020-02-14 08:24:27 -08:00
Corey Robertson
98564f857d
Update Canvas usage of Storage from kibana-utils (#55595)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-14 10:57:06 -05:00
James Gowdy
52b4fe7404
[ML] Categorization wizard functional tests (#57600)
* [ML] Categorization wizard functional tests

* changes based on review

* some idiot left his own name in the code
2020-02-14 15:54:49 +00:00
Nathan Reese
d27fc476dd
[Maps] refactor Join component to remove componentDidUpdate (#57518)
* [Maps] refactor Join component to remove componentDidUpdate

* [Maps] refactor LayerPanel to remove getDerivedStateFromProps

* consolidate async layer state loading into LayerPanel component

* fix jest snapshot

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-14 08:36:49 -07:00
Candace Park
1492d5a372
[Endpoint] Task/basic endpoint list (#55623)
* Adds host management list to endpoint security plugin

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-14 10:12:34 -05:00
Robert Oskamp
f0cb03e599 Transform functional tests - disable saved search test 2020-02-14 16:08:10 +01:00
Robert Austin
a790f61460
Resolver: Animate camera, add sidebar (#55590)
This PR adds a sidebar navigation. clicking the icons in the nav will focus the camera on the different nodes. There is an animation effect when the camera moves.
2020-02-14 09:41:22 -05:00
Mike Côté
c965a9efa8
Skip flaky test (#57675) 2020-02-14 08:55:13 -05:00
Spencer
343bc9c303
[kbn/optimizer] Fix windows support (#57592)
* [kbn/optimizer] simplify run_workers.ts a smidge

* use Path.resolve() to create windows paths from normalized ones

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-14 06:54:24 -07:00
Walter Rafelsberger
cefe28c1f4
[ML] Fix single metric viewer chart resize. (#57578)
Fix to trigger a chart update with the correct width when resizing the browser window. Previously after a browser refresh, or opening the view from a bookmarked URL, the chart would not resize until a state change was made to the view (such as moving the zoom slider or altering the time range).
2020-02-14 14:52:04 +01:00
Angela Chuang
0adda9d270
[SIEM] Remove additional props for matrix histogram (#54979)
* update DNS histogram

* fix indent

* hide dropdown if only one option provided

* update DNS histogram

* fix types

* wip

* isolate matrix histogram on server side

* fix type for graphql

* fix types

* fix tests

* fix types

* fix types

* add unit test

* add unit test

* fix types

* split histogram configs to an object

* an idea to simplify more

* add unit test

* remove updateDateRange passing down to matrixHistogram

* change histogramType to enum

* handle the case which config not available

* fix review

* fix review II

* fix parser for dns histogram

* revert change

* isolate parsers

* fix unit

Co-authored-by: Xavier Mouligneau <189600+XavierM@users.noreply.github.com>
2020-02-14 13:44:18 +00:00
Joe Reuter
948bfa9950
Clean up shims of Graph, Home, Dashboard, Visualize (#57331) 2020-02-14 14:11:18 +01:00
Anton Dosov
098a55a83c
unskip replace flyout test (#57093)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-14 14:07:00 +01:00
Jean-Louis Leysens
7f71c787bd
[Console] Fix performance bottleneck for large JSON payloads (#57668)
* Fix Console performance bug for large request bodies

The legacy_core_editor implemenation was calculating the current editor line
count by .split('\n').length on the entire buffer which was very inefficient
in a tight loop. This caused a performance regression. Now we use the cached
line count provided by the underlying editor implementation.

* Fix performance regression inside of ace token_provider implementation

* Clean up another unnecessary use of getValue().split(..).length.

Probably was not a performance issue, just taking unnecessary steps. Not
sure that this function is even being used.
2020-02-14 13:56:52 +01:00
Walter Rafelsberger
c1cf4896a5
[ML] Fix brush visibility. (#57564)
Fixes brush visibility. The brush will no longer be hidden if it covers the full available timespan. Removes all code that was earlier used to manage brush visibility.
2020-02-14 13:07:54 +01:00
Dario Gieselaar
979c1d24fa
[APM] Add xpack.apm.enabled key to config schema (#57539)
Closes #57418.
2020-02-14 13:06:57 +01:00
igoristic
f8b06e3726
[Monitoring] Fixed logs timezone (#57611)
* Fixed logs timezone

* Passing tz as a param

* Fixed tests

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-14 06:29:49 -05:00
Pierre Gayvallet
f87053e0b5
Use app id instead of pluginId to generate navlink from legacy apps (#57542)
* properly use app id instead of pluginId to generate navlink

* extract convertToNavLink, add more tests

* use distinct mapping methods

* fix linkToLastSubUrl default value

* nits & doc
2020-02-14 12:23:53 +01:00
Cauê Marcondes
1aadf3e021
[APM] Custom actions: Settings list page for managing custom actions (#56853)
* creating customize ui and empty prompt

* new custome ui page, with create custom action flyout

* removing import

* removing import

* fixing translations

* fixing pr comments

* fixing pr comments

* fixing translations

* fixing labels

* renaming

* fixing translations
2020-02-14 10:35:33 +00:00
Joe Reuter
273fa4371a
TSVB validation: Allow empty strings for number inputs (#57294) 2020-02-14 11:11:27 +01:00
Joe Reuter
104d4abecf
Migrate vega and graph configs to new platform (#57011) 2020-02-14 11:10:41 +01:00
Matthias Wilhelm
009d350351
[Discover] Improve functional test of context (#57575)
By converting adding filters to a sequential mode, the test of clicking on a context link in the discover table should no longer be flaky
2020-02-14 09:28:35 +01:00
Pierre Gayvallet
302c598e56
Preserve the original error name instead of returning raw AbortError (#57550)
* Preserve the original error name instead of returning raw AbortError

* use Error as the default error name
2020-02-14 08:58:20 +01:00
spalger
fe3864282a disable firefox smoke tests so we can fix flakiness out of band 2020-02-14 00:46:55 -07:00
Ryland Herrick
8513498e2d
[SIEM] Final Shimming/Prep for Server NP Migration (#56814)
* Route all our server setup through the plugin

Next we'll be trimming down ServerFacade to the final few dependencies,
and using our plugin dependencies for the rest.

* Clean up server plugin exports

For now, let's try to simplify our typings by exporting our plugin's
dependencies from the plugin itself, since we know it already knows
about them.

* Move DE Routes to to conventional location

I'm throwing the alerting registration in the plugin for now, too.

* Loosen up our RequestFacade

Now that we've audited our use of request objects, we can switch to the
more friendly LegacyRequest that all our utilities are expecting.
LegacyRequest doesn't have plugins, either, so our only remaining errant
usage is retrieving clients from it, which we call out explicitly.

* Remove uses of 'src' alias

This just threw an error on startup, so I'm fixing all of them to be
safe.

* Fix types of our GraphQL requests

These come through as new KibanaRequests and not as the LegacyRequest
that I had incorrectly typed them as.

I'm only caring about the `body` property right now, since that's all we
really deal with, and in testing it was all that was populated in our
actual requests, too.

* Initialize our routes with SetupServices

We're using the legacy version for now, but ServerFacade will be gone by
the end of the migration.

* Swap legacy spaces plugin for NP

This changes the signature of getIndex, which is used in quite a few
places. We'll see how bad that looks in the next commit.

* Remove unneeded typing

We're already ignoring another portion of the platform shim due to it
being incompatibly typed, so we might as well remove this.

* WIP: Converting our DE routes to use consolidated services

This contains our legacy stuff for now. Eventually, it will only be our
NP services. This breaks a few tests due to the way createMockServer
works, but I'll clean that up momentarily.

* Fix DE routing tests following refactor

The createMockServer helper does a few things differently:

* returns mocked LegacyServices that can be passed to our route
factories
* does not return a server object as we don't need it, except for:
* returns an inject function that we can use to execute a request

We're casting our services because we're only mocking a subset of what
LegacySetupServices entails.

Mainly, this allows me to continue moving
things off of ServerFacade without significant refactoring of tests.

* Fix incompatible request types

Unfortunately, LegacyRequest does not allow a request's `query` values
to be anything other than a string or string[]. However, in practice
they can (and are) objects, booleans, etc.

Our request types (e.g. QueryRequest) are correct, but because service
functions are LegacyRequest's implementation of `query`, we need to cast
them lest a type error occur.

For now, the easiest solution is to do this in the request handler:
intersecting with our RequestFacade (LegacyRequest) allows us to both a)
pluck our query params off the request and b) pass the request to NP
services.

* Move our use of encryptedSavedObjects to NP

We're just retrieving a boolean from it right now, which is also guarded
against the plugin being unavailable. If this usage becomes more
widespread, we'll make this available at a higher level, probably in
redux.

* Use NP elasticsearch client

* Simplifies our generic type to accept two arguments: params and the
return value
  * Options is fixed and we were never specifying anything meaningful
  there
* Updates all DE cluster calls to use callWithRequestFactory

* Update DE mocks with NP elasticsearch

* createMockServer now returns the callCluster mock, so that you can easily
mock a client response without needing to know the details of how we
define that function

* Remove savedObjects dependency from our legacy dependencies

This was added during a refactor, but we were never actually using this
code. We always retrieve the client from the request via
getSavedObjectsClient.

I think that the NP client has a slightly different interface, so we're
going to create a helper to retrieve it from the request, same as we do
with the elastic client.

In the future, both of these will be available on the request context,
and we can remove the helpers entirely.

* WIP: Convert services to stateful object

In trying to migrate over the savedObjectsClient, I realized that it is
not available during setup in the same way that the ES client is.

Since our routes need pieces from both setup and start phases, I've
added a Services class to accumulate/transform these services and expose
scoped clients when given a legacy request.

In New Platform, these clients will be available upon the request
context and we should be able to remove getScopedServicesFactory for our
routes. A subset of Services' functionality may still be useful, we'll
see.

* WIP: Converting routes to use Services factory

I decided that config shouldn't live in here, as this is only
client-related stuff. Probably going to rename this ClientsService.

Things are still very much broken.

* WIP: Qualifying our Service to ClientsService

This gets us client-related services (ES, SavedObjects, Alerts), but it
is independent of any configuration, which is gonna be another service.

* Fix types on getIndex function

This is a weird helper, I'm not really sure where it should go.

* Our ClientsService is a clients ... service

Return clients, as this is closer to what we'll get in the request
context.

* Clean up our server types

* Declare legacy types at top-level file
* Don't re-export from the plugin solely for convenience, that's a
slippery slope straight to circular dependencies
* Remove RequestFacade as it was a facade for LegacyRequest
* Rename ServerFacade/LegacySetupServices to just LegacyServices

* Refactor mocks for new architecture

* Separates config, server, and client mocks, as they're now independent
in our system, route-wise.
* gets one test working, the rest will follow.

* Simplify our routing mocks

* Adds mock for our new clients service
* Greatly simplifies both server and mock configs
* Renames factory method of client service

* Loosen graphQL endpoint validations

These work fine in production, but it's graphQL so we don't really need
the additional validation of these endpoints, and we weren't leveraging
these types anywhere in Typescript land.

Additionally, these restrictive validations prevent the initial
introspection calls done by graphiQL to get schema information, and
without schemae graphiql wasn't very helpful. This is a dev-only
problem, but that's the audience of graphiql.

* Remove unused graphql endpoint

This was only registered in dev mode; I thought that it was needed by
graphiql. However, after digging further I realized that graphiQL also
only makes POST calls to our real graphQL endpoint, so this route is
unnecessary.

* Reduce our dependence on PluginInitializerContext

After a little more introspection I realized our FrameworkAdapter
doesn't need the kibana version. It was only used in order to make a dev
request via (graphiql), but even that can be performed with a simpler
xsrf header.

This meant that we really only wanted to know whether we're in
production or not, so instead we pass that simple boolean to the
constructor.

* Fix FrameworkAdapter type

We no longer need this property.

* Update detections route tests

Uses the new routes interfaces, and our corresponding new mocks.

* Remove unnecessary null checks

Our savedObjectsClient is always going to be there.

* Remove unused type

YAGNI

* Remove unused savedObjects client

Turns out we were only destructuring this client for the null check.

* Handle case where spaces is disabled

We already null-coalesce properly in the clients service, but this
property access was missed.

* Return default signals index if spaces are disabled

* Remove unnecessary casting of our alerts client mock

I think that this was the result of us importing the wrong AlertsClient
type, or perhaps the types were out of sync. Regardless, they work now.

* Return the 'default' space even when spaces are disabled

This will allow users with spaces disabled to enable spaces without
losing data. The tradeoff is that they may be surprised when signals
don't exist within their configured xpack.siem.signalsIndex.

* Account for spaces being disabled in ClientsService

* Updates types to reflect that spaces may be unavailable
* Adds a test for getSpaceId's behavior when spaces are disabled

* Fix false positives in query signals routes tests

* Refactors mock expectations so that they're actually evaluated; they
can't go within a mockImplementation call as it's evaluated in the wrong
scope.
* Fixes duplicated test to use the proper assertions

* style: Prefer null coalescing over ternary
2020-02-13 22:10:27 -06:00