Commit graph

33090 commits

Author SHA1 Message Date
orfeas0 56c46ae1de
Add example of of local plugin installation (#65986) 2020-05-11 13:20:03 -07:00
spalger 7b5c9c04ed skip flaky suite (#65741) 2020-05-11 12:58:24 -07:00
Ryland Herrick 207df60d6c
[SIEM][Detections] Restrict ML rule modification to ML Admins (#65583)
* Move common ML types and functions into siem/common

These revolve around capabilities/permissions checks which were
previously only used on the client. Now that we have need to make
similar checks on the server, we can/should move these up to be shared.

* Use ML's Capabilities type in lieu of our own

There was already some drift between these types preventing our
helpers from being used with the ML services; this will prevent further
drift.

* Add authorization helpers for ML

Some of this responsibility will move to ML services in the near future,
but for now we still need to restrict SIEM users from performing certain
actions.

* Use mlAuthz on our import rule route

The tests were a little tricky because the use of spyOn/clear was
preventing (rather, clearing the mocks from) the use of jest.mock().

I found a workaround with mockRestore(), which was easy to verify
because the mock would throw an error if it wasn't removed, and we'd
import multiple rules if a default mock was used.

The threading through of ML can go away if/when ML adds their services
to the request handler context.

* Add mlAuthz checks to remaining rule routes

* Remove validateLicenseForRuleType

This is now unused and redundant with the mlAuthz module.

* Fix failing tests

These were missed when the helpers were moved to common/, but are also
unneeded.

* Cleanup: fixing type errors

* Clean up some types from ML

A recent upstream refactor in ML added top-level exports; this uses them
where possible.

* Refactor mlAuthz to defer authz validation until validator is called

This prevents us from unnecessarily calling ml services if e.g. we're
not dealing with an ML rule.

This also adds a failing test for the next-to-be-implemented feature:
cashing the async validation for subsequent validator calls.

* Cache validation promise

The purpose of the `buildMlAuthz` function is to store state (request,
license, ml). Since `validateMlAuthz` should be idempotent for the
duration of this object's lifecycle, we should cache the result the
first time we call it; this is effectively memoization since the
arguments do not change.

* Make our result caching more explicit

Extracts a caching helper function.

* Add additional unit tests around some edge cases

This is the best form of documentation, thanks Frank!

* Remove redundant test setup

* Empty messages are invalid

If we somehow generate an empty message string, the validation should
fail as we were attempting to assign _something_ as a failure message.

* Fix validity logic

valid: message !== null was the opposite of what I wanted; a validation
is valid if it has no message (i.e. it's undefined).

* Prevent patching of ML rules by non-ML admins

This required refactoring patchRules to accept the rule to be patched,
so that we can check its attributes before performing the update.

* Fix our update_prepackaged_rules route

patchRules no longer does the fetch; we need to perform this ourselves.

* Fix update_prepackaged_rules tests

This notably synchronizes the entirety of the updates, as our tests were
failing due to the asynchronous nature of the updates.

* Remove id and ruleId from patchRules parameters

Instead of fetching the rule within patchRules, we now pass it in.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-05-11 14:55:12 -05:00
Tim Sullivan f4d27b2838
[Reporting/Test] Add Functional test for download CSV (#65401)
* [Reporting/Test] Add Functional test for download CSV

* add todo

* add fs.existsSync check to find download

* debug

* handle timeout

* validate toast

* different way of getting repo_root
2020-05-11 12:49:19 -07:00
Zacqary Adam Xeper e2d945ff0b
[Metrics UI] Add framework for recovery messaging to metric threshold alerts (non-functional) (#65339) 2020-05-11 14:04:57 -05:00
Candace Park 4966b2695a
Fixes #65661 failing endpoint host details policy response test (#66060)
* Fixed failing endpoint host details policy response test #65661
2020-05-11 14:56:05 -04:00
Spencer cbe559745a
[procrunner] avoid waiting for processes forever (#65909) 2020-05-11 11:04:23 -07:00
Tiago Costa be7902311d
chore(NA): skip mapping editor shape datatype test (#66041) 2020-05-11 10:23:42 -07:00
Melissa Alvarez 4174bab3cc
[ML] Anomaly Explorer: if filter includes wildcard ensure matching swimlanes are not masked (#65384)
* if wildcard search no mask for matching swimlanes

* update swimlane proptypes

* add helper function

* add tests for helper function
2020-05-11 12:56:25 -04:00
Mikhail Shustov 4912153ce6
don't register any features in LP. (#65611)
* don't register any features in LP. breaks features value reading in KP

* move test plugin to NP

* fix mappings

* update docs

* migrate another test

* use contstants file for BWC with original code

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-05-11 18:43:45 +02:00
Sonja Krause-Harder a1a157dc87
[Ingest] Use Kibana logger for proper server-side logging (#66017)
* Add logger to app context.
2020-05-11 18:06:19 +02:00
Alejandro Fernández Haro 49226ddc1f
[Telemetry] Remove ui_metric from the legacy codebase (#65739) 2020-05-11 16:57:45 +01:00
Gidi Meir Morris e67480d1fc
[Task Manager] restores migrations of old tasks in TM (#65978)
When migrating to KP last week the migrations were missed - this PR restores them.
2020-05-11 16:35:48 +01:00
Nathan Reese 431a7eb07a
[Maps] remove dateline check for geo_shape queries, split geo_bounding_box queries that cross dateline into 2 boxes (#64598)
* remove dateline check for geo_shape queries

* fix jest test

* split bounding box

* replace convertMapExtentToPolygon with formatEnvelopeAsPolygon

* clamp latitudes

* use clampToLatBounds

* use single box where left lon is greater then right lon when crossing 180 meridian

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-05-11 08:50:20 -06:00
Bhavya RM 7526db98e8
Addressing test failures with a11y tests on management (#65758)
fixing test failure #60470
2020-05-11 10:30:50 -04:00
Alison Goryachev a3d3ae9661
[Ingest pipelines] Make description field optional (#65961) 2020-05-11 10:05:27 -04:00
Cauê Marcondes d5737a54c2
[APM] Don't mutating the original waterfall item while reparenting spans (#65840)
* do not mutate the waterfall items

* addressing pr comments

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-05-11 15:57:46 +02:00
Dima Arnautov d1e4d37c46
[ML] Cardinality validation API integration tests (#65971)
* [ML] refactor validate_cardinality to TS

* [ML] cardinality api integration tests

* [ML] resolve PR comments, validateJobObject as TS guard
2020-05-11 15:57:12 +02:00
Jason Rhodes 0ae5e24d01
Initializes alert form with existing values (for editing) (#65926) 2020-05-11 09:56:37 -04:00
Rudolf Meijering b180fd378d
Log error when encountering corrupt saved object during migration (#65829)
* Log error when encountering corrupt saved object during migration

* Fix documentation

* Fix types
2020-05-11 15:00:48 +02:00
Anton Dosov 92c6ffa909
stabilize async_dashboard test (#65976) 2020-05-11 14:22:09 +02:00
Mikhail Shustov d293702071
load VizOptions component lazily (#64778)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-05-11 14:21:55 +02:00
Mikhail Shustov d4ae987dd4
specify last known SO version (#65987) 2020-05-11 14:21:39 +02:00
Nicolas Chaulet 0830a8bd4c
[Ingest] Validate config_id when creating an enrollment API key (#65765) 2020-05-11 08:11:17 -04:00
Dima Arnautov d005a55d16
[ML] API integration tests for fetching anomalies table data (#65844) 2020-05-11 14:06:54 +02:00
Dima Arnautov c3a1b24ea0
[ML] api integration tests for get anomaly detectors (#65828) 2020-05-11 14:06:10 +02:00
Sonja Krause-Harder f4ba630da0
[EPM] Don't crash on invalid characters in integration search bar (#65872)
* Catch and hide EuiSearchBar parse errors in package search.

* Fix typo.

* Remove unnecesary type cast.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-05-11 13:29:13 +02:00
Anton Dosov ae38c6ba4c
[Drilldowns] Copy improvements (#65838)
* update toast messages

* update HelloBar text

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-05-11 12:38:39 +02:00
Walter Rafelsberger e148eb4437
[ML] Anomaly Detection: Fix test to reflect model memory limit change. (#65967)
Adapt jest test mocks to consider update introduced in #65652.
2020-05-11 11:41:01 +02:00
James Gowdy af102afb7a
[ML] Fixing watch creation (#65956) 2020-05-11 10:00:44 +01:00
Anton Dosov 387e28a6a4
[Drilldowns][chore] import dashboard url generator from plugin contract (#64628)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-05-11 10:12:59 +02:00
Anton Dosov e5b4054a8e
fix double flyouts in add panel flow (#65861)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-05-11 09:36:45 +02:00
Søren Louv-Jansen faaa12729e
Point 7.x to 7.9.0 in .backportrc.json 2020-05-10 22:50:43 +02:00
Josh Dover 1c554d9964
Mount ui/new_platform applications in same div structure as Core (#63930) 2020-05-10 14:00:49 -06:00
Shahzad ef1800be76
[Uptime] Settings threshold validation (#65454) 2020-05-10 16:39:17 +02:00
Mike Côté 5e5ad194f6
Fix edit alert flyout to update initialAlert after edit (#65359) 2020-05-09 12:32:26 -04:00
Nathan L Smith 04f37364fd
Fix anomalies display on focused APM service map (#65882)
The map anomlies rings display was working on the global map and on the focused service of a focused map, but not on the other services on a focused map.

This is because we were adding the anomlies to the list of services from the initial query, but not to the list of services derived from the connections data.

Make the transformation that add anomalies happen after the derived services nodes are added.

This is done in the function that was called `dedupeConnections`, but since it does much more than dedupe connections has been renamed to `transformServiceMapResponses`.

Also make the node types extend `cytoscape.NodeDataDefinition` in order to simplify the types in the transformation (we were adding `& { id: string }` in some places which this replaces.)

Fixes #65403.
2020-05-08 16:16:15 -05:00
Frank Hassanabad 4d3261083b
[SIEM][Detection Engine] Increases the template limit for ECS mappings
## Summary

Increases the template limit for ECS mappings from default of 1k to 10k. This mirrors auditbeat, winlogbeat, filebeat, etc..

- [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
### For maintainers
2020-05-08 13:26:31 -06:00
Christos Nasikas 808e02564b
[SIEM][CASE] Moves functional tests from "legacyEs" to "Es" (#65851) 2020-05-08 21:24:44 +03:00
Chris Cowan 1c6e6cb7b7
[Metrics UI] Fix p95/p99 charts and alerting error (#65579)
* [Metrics UI] Fix p95/p99 charts and alerting error

- Fixes #65561

* Fixing open in visualize for percentiles

* Adding test for P95; refactoring to use first consitently
2020-05-08 10:55:43 -07:00
Quynh Nguyen d3b155f843
[ML] Add job timing stats to anomaly jobs (#65696)
* [ML] Add anomaly job timing stats to Counts & JSON

* [ML] Remove roundTo3DecimalPlace and clean up

* [ML] Fix format_values to round decimals for time values

* [ML] Remove timing_stats and forecast_stats from cloneJob

* [ML] Remove timing_stats & forecasts in job_service instead of utils
2020-05-08 12:06:59 -05:00
Matthew Kime 97561d6751
restore index pattern management data-test-subj's (#64697)
* restore index pattern management data-test-subj's
2020-05-08 11:53:42 -05:00
Matthias Wilhelm 3a6c1ceedd
[Discover] Prevent whitespace wrapping of doc table header (#52861)
Co-authored-by: Dave Snider <dave.snider@gmail.com>
2020-05-08 17:56:28 +02:00
Andrew Goldstein e79f331fb4
[SIEM] Fixes a CSS issue with Timeline field truncation (#65789)
## Summary

Fixes [a CSS issue where Timeline field truncation](https://github.com/elastic/kibana/issues/65170) wasn't working, per the following screenshots:

### Before

<img width="1083" alt="before" src="https://user-images.githubusercontent.com/4459398/81349357-16706d80-907d-11ea-8051-7f2db803d701.png">

### After

<img width="1078" alt="after" src="https://user-images.githubusercontent.com/4459398/81349372-1b352180-907d-11ea-8ac7-8bde3f10394f.png">

## Desk testing

* The timeline in the _Before_ and _After_ screenshots above includes columns that typically contain large values (e.g. `process.hash.sha256`). It also contains the `event.module` column, which has special formatting, as detailed below.

* You may re-create the timeline shown in the _Before_ and _After_ screenshots, or download the exported timeline from the following link [truncation.ndjson.txt](https://github.com/elastic/kibana/files/4596036/truncation.ndjson.txt) and import it. (Remove the `.txt` extension after downloading it.)

* The `event.module` field has special formatting that displays an icon link to the endpoint if it's been configured. To desk test this without configuring an endpoint, edit `x-pack/plugins/siem/public/components/timeline/body/renderers/formatted_field_helpers.tsx`, and change the following line:

```
{endpointRefUrl != null && canYouAddEndpointLogo(moduleName, endpointRefUrl) && (
```

to

```
{true && (
```

The above change forces the icon to always appear, even if you don't have an endpoint configured.

### Desk tested in:

- Chrome `81.0.4044.138`
- Firefox `76.0`
- Safari `13.1`
2020-05-08 09:38:38 -06:00
Brian Seeders d40387161e
Skipping failing tests. #65867 #65866 #65865 2020-05-08 11:35:17 -04:00
Stratoula Kalafateli aea6d6448a
[Discover] Deangularize the hits counter and create a react component (#65631)
* Deangularize the hits counter and create a react component

* Add aria-label to button for accessibility

* Add icon to the link button and use EuiText

* Remove snapshots and test with findTestSubject

* Change toString with String()

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-05-08 18:28:05 +03:00
Joe Reuter 5394fa43fe
Tsvb less update (#65467) 2020-05-08 16:53:42 +02:00
Tim Roes f565266a97
[TSVB] Remove remaining lodash.set usage (#65846) 2020-05-08 16:42:15 +02:00
Justin Kambic 523ecd76b5
[Uptime] Add a11y tests (#65514)
* Add test attributes and missing aria labels to uptime UI code.

* Add uptime a11y tests and associated helper functions.

* Append a11y test instructions to uptime README.

* Update some copy on README page.

Refresh outdated snapshot.

* Add test for alert popover on overview page.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-05-08 09:56:58 -04:00
Shahzad 8f05cf0ecf
[Uptime] Enable loading on monitor list (#65670) 2020-05-08 14:43:02 +02:00