Commit graph

30391 commits

Author SHA1 Message Date
Brian Seeders
4df1c4c9c1
[CI] Retry flaky tests (#53961) 2020-01-27 14:46:05 -05:00
Alexey Antonov
5d6dbf07b0
Expose NP FieldFormats service to server side (#55419)
* Expose NP FieldFormats service to server side

* fix CI

* fix PR comments

* fix PR comments

* fix CI

* getFieldFormatsRegistry -> getFieldFormatRegistry

* fix CI

* memoize - add resolve cache function

* fix Jest

* move IFieldFormatMetaParams to types.ts

* FieldFormatRegistry -> FieldFormatsRegistry

* update src/core/MIGRATION.md

* update public contract

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-27 22:25:39 +03:00
nnamdifrankie
9301531249
[Endpoint] EMT-65: make endpoint data types common, restructure (#54772)
[Endpoint] EMT-65: make endpoint data types common, use schema changes
2020-01-27 14:23:56 -05:00
Mikhail Shustov
aa695ec637
Normalize EOL symbol in platform docs (#56021)
* use api-extractor generate command with api-documenter config

* update docs

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-27 18:42:45 +01:00
Kaarina Tungseth
17011b7559
[DOCS] Empty dashboard screen (#55727)
* [DOCS] AdEmpty dashboard screen redesign

* Review comments f from Gail

* Comments from Gaiail pt 2
2020-01-27 11:33:20 -06:00
Joe Reuter
c71f4dd162
Switch back to first page when fetching new items (#55821) 2020-01-27 17:58:46 +01:00
Matthias Wilhelm
66be6ffae8
Don't throw exception when refreshing fields of an indexpattern (#55836)
* An exception when refreshing fields of an selected index pattern causes Discover to load incompletely
* Add index ID + Title to the error message for
2020-01-27 17:40:51 +01:00
Joe Portner
13593344a0
Add lockfile symlinks (#55440)
This is to enable dependency scanning tools to correctly resolve
the dependencies in each package.json file that is used in
production.
2020-01-27 11:38:20 -05:00
Tim Roes
455a96e107
Hide nested fields across Kibana apps (#55278)
* Hide nested fields across Kibana apps

* Filter out nested fields in TSVB

* Fix import paths

* Hide nested fields in timelion autocomplete

* Fix remaining map places

* Filter out nested fields in graph

* Fix remaining map places

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-27 17:25:54 +01:00
Dmitry Lemeshko
82446048cf
skip tests due to issue #55992 (#55995) 2020-01-27 16:49:59 +01:00
James Gowdy
7fa5707ad6
[ML] Fixing module setup error for insufficient index pattern privileges (#55989) 2020-01-27 15:48:36 +00:00
Brian Seeders
1a856c7de7
Skip failing watcher tests 2020-01-27 10:39:06 -05:00
Mikhail Shustov
efd3e99064
Revert "Normalize EOL symbol for the platform docs (#55689)" (#56020)
This reverts commit 1ea175e2c6.
2020-01-27 16:29:27 +01:00
James Gowdy
6f0bfa009a
[ML] Fixing "aggs" use in datafeeds (#56002)
* [ML] Fixing "aggs" use in datafeeds

* removing use of Record
2020-01-27 15:22:53 +00:00
Alejandro Fernández Haro
4c2d901dc5
[X-Pack][Monitoring][Telemetry] Ensure 24h time range when fetching Kibana usage stats (#55171)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-27 14:50:08 +00:00
Mike Côté
72a8da2dcb
Re-enable skipped tests for unmuting an alert (#55861)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-27 09:39:02 -05:00
Liza Katz
133c2994ca
Move search service code to NP (#55430)
* Move get search params into search strategy

* Move search strategy to NP and clean up courier exports

* Move fetch to NP

* Moved search source to NP

* Move shard failure to data/ui folder

* move getflattenedobject to core/utils

* fix discover

* eslint

* fix scss

* fix ts

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-27 16:18:27 +02:00
Mikhail Shustov
1ea175e2c6
Normalize EOL symbol for the platform docs (#55689)
* use api-extractor generate command with api-documenter config

* update docs
2020-01-27 14:39:56 +01:00
Mikhail Shustov
e00f2628af
[NP] Platform exposes API to get authenticated user data (#55327)
* expose auth.get/isAuthenticated. move getAuthHeaders to internal type

* update mocks

* update docs

* update docs

* add integration test for auth
2020-01-27 13:57:06 +01:00
Jean-Louis Leysens
35edfb0e56
[Watcher] More robust handling of license at setup (#55831)
* Only register watcher app if we have received an indication of license first
Enable app to react to license updates from backend

* Return setup to a synchronous function.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-27 13:35:40 +01:00
Dima Arnautov
94297f37b8
[ML] fix the annotation area tooltip offset (#55955) 2020-01-27 11:19:51 +01:00
Anton Dosov
987dfbc5b7
[State Management] - Remove GlobalState from dashboard (#55158)
Removes GlobalState from dashboard app
2020-01-27 10:51:24 +01:00
patrykkopycinski
2d3b569653
[SIEM] Unify Histograms loading states (#55961) 2020-01-27 08:15:46 +01:00
Liza Katz
55b7905fb5
Es client cleanup (#54337)
* Add esClient instance to data.__LEGACY and replace old usages

* add es clinet to setup karma mock

* delete unneeded import

* fix get inner angular

* Fix karma test

* Fix vega browser test

* Update esClient usage

* ts fixes

* ts + karma tests

* update tests

* Fix karma test

* eslint

* Register default strategy from plugin

* export

* Revert map change

* Delete legacy saved objects client provider

* Fix management digest cycle

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-26 13:55:48 +02:00
Ryland Herrick
9c1c94121a
[Fix] Siem Telemetry Improvements (#55598)
* Fix typo in ML Job toggle state

We were passing the wrong argument in to this predicate function,
meaning that the job not correctly shown as loading if it's data feed
was loading.

* Refresh ML Popover after job has been toggled

Previously, toggling a job would put the component into a permanent
loading state. Now we wait for the callback to resolve before updating
the component's loading state, and once the job itself is updated the
reset will rerender as necessary.

* Rename folder for consistency

* Export our function as its common alias

Until we need to distinguish between different types of tracking, the
extra qualifiers on the name aren't really necessary.

* Add telemetry middleware for redux

Rather than adding lots of tracking calls throughout the app, this
allows us to track specific events as redux sees them, regardless of
their source.

* Track a timeline being saved

Whether this happens due to a new timeline or an update, this metric
signifies a timeline having been persisted to the user's index.

* Move 'timeline opened' tracking into middleware

* Only track timeline opening when we truly open it

This action fires for both opening and closing, which is not quite the
logic we need. This refactors the middleware to leverage
typescript-fsa to type these actions' payloads, allowing us to inspect
them. Hopefully we won't have to do this often.

* Track when a timeline name is modified

In the future we can fire the title as it's part of the payload, but for
now we can only say "someone changed the name of their timeline."

* Initialize telemetry in an NP-friendly way

With the previous solution, we were invoking createUiStatsReporter,
which pulls modules from ui/new_platform, in the module scope. Since
only a few components used this module, it was mostly fine.

However, with our new telemetry middleware the redux setup itself also
referenced this file, and thus indirectly ui/new_platform. This lead to
hundreds of tests breaking, as any test that loaded a module from the
store folder (actions, etc.) without also mocking ui/new_platform would
blow up when those modules were undefined.

Instead of adding hundreds of `jest.mock` calls and deferring the issue,
this creates a singleton module that is initialized during our plugin's
setup and can then be freely imported by any module thereafter.

Also throws an error in case this singleton gets misused; we should only
be initializing telemetry once, during plugin setup.

* Track when rules are enabled or disabled

* Update type of incoming function prop

This is always given an async method, currently, and we should type it
as such because we're now leveraging that fact with an await.

* Guard against errors from our telemetry calls

This ensures that we always have a tracking function so as to prevent
errors at the call sites. Also guards against errors during either setup
or from the underlying telemetry call.
2020-01-25 20:37:58 -06:00
Walter Rafelsberger
88ba41f39a
[ML] Anomaly Explorer: Fix cell selection when view-by is job id. (#55841)
Fixes loading influencers, charts and anomaly table if view-by selection is job ID and cells in the overall swimlanes are selected.

Previously, the check to return the job ids to filter on for the query would return the wrong value for a selection in the overall swimlane. This PR move the wrong and redundant code to a fixed util function getSelectionJobIds().
2020-01-25 12:07:03 +01:00
Frank Hassanabad
a63e8a4304
[SIEM][Detection Engine] Critical blocker rule changes and ECS changes
## Summary

* Changes ECS `techniques` to the word `technique` as `techniques` is incorrect ECS and incorrect mapping and without this our product could crash
* Changes ECS `threats` to the word `threat` as `threats` is incorrect ECS and incorrect mapping and without this our product could crash
* Added histogram mapping for `signal.rule.threat.tactic.name` as that was missing
* Added `Elastic` and removed `EIA` for tags
* Updates unit tests
* Cleans up rules by removing extra characters and removing fields not required.
* Adds concrete index'es as this was a critical breaking bug
* Fixes issues with imports where imports could change an immutable from false to true and suddenly cause out of band immutables to occur.

### Checklist

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

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

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

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

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

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

### For maintainers

~~- [ ] This was checked for breaking API changes and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~~

- [x] This includes a feature addition or change that requires a release note and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)
2020-01-24 22:18:52 -07:00
Xavier Mouligneau
f4b4695c7b
[SIEM] [BUG] Detections inspect + refresh histogram (#55912)
* Fix flow of all rules

* fix the multitude http request + fix table timeline re-rendering

* add inspect on detections histogram + refresh detections histogram

* formatting inspect request&response

* Update x-pack/legacy/plugins/siem/public/pages/detection_engine/components/signals_histogram_panel/signals_histogram/index.tsx

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

* fix type

Co-authored-by: Garrett Spong <spong@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-24 20:54:15 -05:00
Frank Hassanabad
cb7c003c34
[SIEM][Detection Engine] Rules content additions
## Summary

Rule updates from @randomuserid and team


### Checklist

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

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

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

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

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

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

### For maintainers

~~- [ ] This was checked for breaking API changes and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~~

- [x] This includes a feature addition or change that requires a release note and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)
2020-01-24 18:17:22 -07:00
Xavier Mouligneau
88ee484f18
[SIEM] [BUG] Detections fix additional look back (#55928)
* fix time

* fix unnecessary export

* fix humanize
2020-01-24 19:19:58 -05:00
Josh Dover
703a3c22da Add @kbn/i18n to @kbn/ui-shared-deps (#55891)
* Add @kbn/i18n to @kbn/ui-shared-deps

* Use string DI syntax for i18n angular modules
2020-01-25 00:24:32 +02:00
Josh Dover
1bb59af44a
Add isSystemRequest support to Kibana Platform (#53734) 2020-01-24 15:20:09 -07:00
igoristic
2e6fbc396a
Doing fix on master (#55894) 2020-01-24 17:16:43 -05:00
Devin W. Hurley
a6d1856222
[SIEM] [Detection Engine] Change Status to Last response (#55886)
* do not change rule status if rule is enabled/disabled

* keep the 'going to run' status when enabling rule
2020-01-24 17:03:28 -05:00
Chris Cowan
0e09e5f455
[Metrics UI] Fix Metrics Explorer exception when deleting metric (#55893) 2020-01-24 15:44:04 -06:00
Xavier Mouligneau
459b8c4df8
[SIEM] Detections bugs rules (#55885)
* Fix flow of all rules

* fix the multitude http request + fix table timeline re-rendering

* Update x-pack/legacy/plugins/siem/public/components/events_viewer/events_viewer.tsx

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

Co-authored-by: Garrett Spong <spong@users.noreply.github.com>
2020-01-24 16:42:53 -05:00
Frank Hassanabad
5801de0800
[SIEM][Detection Engine] critical blocker, fixs broken rules versioning
## Summary

* Fixes broken rules versioning
* Fixes unit tests

Implementation is more safe in that it ensures that if you have a factory/immutable rule it will do an early bail out unless the immutable rule is asking for a version change from the file system.

If it's not an immutable it will still _not_ bump the version number if it is a change to the enabled/disabled only.

Testing:
---

* Test that if you enable either a factory or non-factory rule it does not bump the version number. 
* Test that if you go to an immutable rule on the file system and bump the version number on the file system and reinitialize it either through the UI or backend scripts then it will bump the version number.
* Test that if you update a non-factory rule then it does auto-increment the version number.

Things to look out for
---
Did I forget to whitelist anything in the code that would cause it to _not_ bump the version number for some reason?

## Checklist

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

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

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

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

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

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

### For maintainers

~~- [ ] This was checked for breaking API changes and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~~

- [x] This includes a feature addition or change that requires a release note and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)
2020-01-24 13:54:07 -07:00
Mike Côté
4db0382259
Update CONTRIBUTING.md --ssl documentation to mention it covers Elasticsearch as well (#55876)
* Update CONTRIBUTING.md to mention --ssl flag works with Elasticsearch as well

* Change while to for
2020-01-24 15:35:04 -05:00
Wylie Conlon
25765a9d36 [Canvas] Improve expression autocomplete (#52035)
* [Canvas] Autocomplete improvements

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Poff Poffenberger <poffdeluxe@gmail.com>
2020-01-24 13:04:34 -06:00
Jamie Smith
7165b26b51
fix URL for handlebar docs for markdown, and make sure they are https (#55866) 2020-01-24 13:58:31 -05:00
Ryland Herrick
157ed3945b
[Fix] Hide timeline and ML Popover when SIEM has no data (#55754)
* Hide ML Popover when SIEM index DNE

* Hide timeline when SIEM has no data

In cases where there's nothing to inspect (i.e. the user hasn't
populated data), we don't want to show them the mostly inert timeline.

* Update snapshot for header

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-24 12:37:44 -06:00
Dima Arnautov
510587e431
[ML] Fix Anomaly Explorer swimlane tooltip issue (#55827)
* [ML] check drag start element

* [ML] remove conditional chaining from js
2020-01-24 18:51:25 +01:00
Mike Côté
ea3aa9c9b1
Fix skipped alerting UI tests (#55058)
* Fix skipped alerting UI tests

* Fix switch click to use new pageobject function

* Use .click function directly instead of find then click

* Merge state variables into one for alerts and alert types

* Fix flaky tests by fixing react code

* Could this be it?? The one thing missing that caused all this flakiness??

* Cleanup convertAlertsToTableItems function

* Remove I from interface names, fix disabled boolean logic

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-24 12:50:22 -05:00
Andrew Cholakian
06aeb8196f
[Uptime] Expand timespan range to fix missing data in UI (#55250)
* [Uptime] Expand timespan range to fix missing data in UI

With a short timespan range of 10s as originally here we can miss data
in the case of long refresh intervals in ES or other delays in data
coming from heartbeat to ES. If data is more than 10s stale we show
empty screens. Expanding this to 5m provides most of the performance
benefits and also quite a bit of safety in terms of delays. It lets
users query very large timespans (say a year), and still only really
query 5m of data, keeping the general purpose of this perf enhancement
going.

* Remove unnecessary complexity

* Revert "Remove unnecessary complexity"

This reverts commit 97c74804f4.

* Check for data rather than field

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-24 10:07:49 -07:00
Gidi Meir Morris
bb29cec20b
fixes shared types across alerting plugins (#55824)
This addresses two issues that have come up:

Alerting and Actions have TypeScript types that are needed across server and public plugins, and need to be extracted to a common path (thanks @chrisronline for bringing this to our attention)
Due to the above, types have been duplicated between the alerting and actions when needed in the Alerting UI, which has led to them diverging. This forces the UI to type check against the API, which will help reduce these errors in the future.
2020-01-24 17:06:59 +00:00
Chris Mark
943e450ead
Add dashboard in Stan kibana tutorial (#55837) 2020-01-24 18:16:31 +02:00
Thomas Neirynck
837c9092e3
[Maps] Should be able to open layer settings from add layer wizard 2020-01-24 10:59:08 -05:00
Thomas Neirynck
5c19f9db4e
[Maps] Do not mutate state in resetDataRequest (#55624) 2020-01-24 10:58:14 -05:00
Jean-Louis Leysens
f7c53b5690
Disallow importing Joi client side (#55018)
* Disallow importing Joi client side

* Move elasticsearch lib into server folder

* Add a comment about the 'joi' eslint rule

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-24 15:38:44 +01:00
Jean-Louis Leysens
b8f774866c
[SearchProfiler] Fix handling of bad profile data and update tab behaviour (#55806)
* Fix searchprofiler's ability to handle badly formed profile data
Also fix tab changing upon subsequent requests

* Fix comment typo
2020-01-24 15:37:03 +01:00