Commit graph

37474 commits

Author SHA1 Message Date
Larry Gregory bf0f8bbb42
Cleanup feature registration (#80909) 2020-10-20 12:53:43 -04:00
Ryland Herrick b7ffefb48c
[Security Solution][Detections] Fix EQL cypress tests (#80440)
* Unskip EQL tests

These _should_ be fixed with the latest ES on master, but let's see if
CI disagrees.

* Wait until alerts have populated on Rule Details

Occasionally our tests hit a scenario where the rule has executed (its
status is "succeeded"), but the generated alerts have not populated in
the same time frame. In this case the test fails oddly, saying that the
"alert count" element is not there when it is.

I attempted to improve the error message by using a .should() with a
callback, but that lead to even stranger behavior as the .should() would
fail once (expected), and then not be able to find the element a second
time. :(

So we instead focus on fixing the real problem, here: wait until alerts
populate (have a non-zero count) before performing the assertion.
Because the page will not update automatically, we can't rely on
cypress' retryability and must instead assert, click Refresh, and assert
again, much like we're doing while waiting for the rule to execute. And
like `waitForTheRuleToBeExecuted`, we're using a while loop that has no
guarantee of ever exiting :(

* More robust cypress assertions

* Uses should with a text matcher instead of using invoke('text')
* Use of not.equal between a string and an element may have been a false
  positive

* Perform cypress loops in a manner guaranteed to exit

We have a few tasks that require polling for some background work to be
completed. The basic form is: assert the byproduct, or refresh the page
and try again.

We were previously doing this with a while loop, which was not
guaranteed to ever complete, leading to cryptic failures if the process
ever hung.

Instead, this implements a safer polling mechanism with a definite
termination similar to the cypress-wait-until plugin.

* Update other specs that are asserting on alerts

* Do not automatically refresh the page
  * This is only necessary if we're not in the state we need. The
    `waitFor` helper functions automatically reload whatever needs to be
    reloaded, so we're delegating this task to them.
* Ensure we wait for alerts to be nonzero before our assertion
  * Otherwise we get some strange behavior around this field's
    availability; see previous commits

* Remove unused import

* Fix false positive in Rule Creation specs

Threat Match Rules introduced an additional query input, causing our
CUSTOM_QUERY_INPUT to be ambiguous.

However, instead of failing due to the ambiguity, the behavior of
cypress seems to be to pass! While I haven't yet tracked down the cause
of these false positives, disambiguating these selectors is the
immediate fix.

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-10-20 11:44:46 -05:00
Frank Hassanabad f6d41f4b58
[Security Solutions][Detection Engine] Adds number of signals to waitFor() within integration tests to increase determinism
## Summary

* Fixes https://github.com/elastic/kibana/issues/81119
* Fixes https://github.com/elastic/kibana/issues/81186
* Adds an additional parameter to the waitFor and tweaks the different tests to pass in the number of signals to waitFor.

### Checklist

- [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios
2020-10-20 10:40:00 -06:00
Christiane (Tina) Heiligers e7f3044b31
Usage collection plugins to ts project refs (#81090) 2020-10-20 09:32:40 -07:00
Bohdan Tsymbala 02c8c36a4e
Btsymbala/keyboard accesibility trusted app deletion (#81156)
* Added auto focusing of confirm button in trusted apps deletion dialog on opening.

* Updated snapshots.

* Updated snapshots after kbn:bootstrap.
2020-10-20 18:13:25 +02:00
Yara Tercero d38955bb3b
[Security Solution][Detections] - rule query preview bug fix (#80750)
### Summary 

This PR addresses the remaining query preview bugs. 

- it adds index, and request information to eql inspect - it seems that for some reason the eql search strategy response returns `null` for the `params.body` in complete responses, but not in partial responses and does not include index info. As a workaround, I set the inspect info on partial responses and manually add index info
  - added to-dos pointing this out in the code
- updated eql sequence queries preview to use the last event timestamp of a sequence to display the hits within a histogram
- it checks buckets length to determine noise warning for threshold rules, as opposed to total hit count
- remove unused i18n text
- fixes bug where threshold is being passed in for all rule types as it's always defined in the creation step, added a check to only pass through to `useMatrixHistogram` hook when rule type is threshold
2020-10-20 12:07:51 -04:00
Charlie Pichette 81ff3b682f
Rename Security Solution Bug Template (#81187) 2020-10-20 09:22:55 -06:00
EamonnTP 7d0ab3a3e7
Update links (#81125) 2020-10-20 15:57:35 +01:00
Marshall Main 39242f11f7
Specify format for date range query (#81025) 2020-10-20 10:23:00 -04:00
Søren Louv-Jansen 35e21dbf37
[Alerting] Improve toast when alert is created (#80327) 2020-10-20 16:20:30 +02:00
Justin Kambic d2c776d1cf
[UX] Add empty states (#80904)
* Add empty state for user experience metrics.

* Add empty state for page load duration metrics.

* Add empty state for core web vitals.

* Fix bug injected by these changes.

* Add a test.
2020-10-20 10:14:42 -04:00
Nathan L Smith 53770a12c9
Add TS config for kibana_legacy (#80992)
* Add TS config for kibana_legacy

To support project references.

References #80508.
2020-10-20 09:12:04 -05:00
Ahmad Bamieh dd5e5279f1
[Telemetry] Add method to enable endpoint security data usage example (#80940) 2020-10-20 17:03:47 +03:00
Justin Kambic cc43b14d17
[Alerting] Add scoped cluster client to alerts and actions services (#80794)
* Add scoped cluster client to alerts and actions services.

* Modify functional test to use new ES client.
2020-10-20 09:54:48 -04:00
Yulia Čech c5bcef45f7
Fix reactRouterNavigate when used with a string (#80520)
* Fix reactRouterNavigate when used with a string

* Update license management snapshots

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-10-20 15:44:28 +02:00
Devin W. Hurley b1d04df1f6
[Security Solution] [Detections] Read privileges for dependencies (#80852)
* remove all privileges on hidden saved object type of alert and change alerting privileges to read when read privileges are set for security solution.
2020-10-20 09:44:03 -04:00
James Gowdy 6db108b914
[ML] Fixing exclude frequent in advanced wizard (#81121)
* [ML] Fixing exclude frequent in advanced wizard

* updating description

* adding exclude_frequent to test
2020-10-20 14:00:29 +01:00
Charlie Pichette 8162b961e9
Fix security solution template label (#80976) 2020-10-20 06:42:10 -06:00
James Rodewig 383fa56bf9
[DOCS] Update index management docs (#80893) 2020-10-20 08:38:55 -04:00
Cauê Marcondes 17ccf376d5
[APM] Error rate on service list page is not in sync with the value at the transaction page (#80814)
* fixing error rate

* addressing pr comments

* addressing pr comments

* fixing TS issue

* fixing api test
2020-10-20 14:32:23 +02:00
Tiago Costa bbec35f16e
skip flaky suite (#81072) 2020-10-20 13:18:37 +01:00
Gidi Meir Morris 5460ad741c
[Task Manager] Cleans up legacy plugin structure (#80381)
This PR addresses a list of legacy code debt the plugin has incurred over the past year due to extensive changes in its internals and the adoption of the Kibana Platform.

It includes:
1. The `TaskManager` class has been split into several independent components: `TaskTypeDictionary`,  `TaskPollingLifecycle`,  `TaskScheduling`,  `Middleware`. This has made it easier to understand the roles of the different parts and makes it easier to plug them into the observability work.
2. The exposed `mocks` have been corrected to correctly express the Kibana Platform api
3. The lifecycle has been corrected to remove the need for  intermediary streames/promises which we're needed when we first introduced the `setup`/`start` lifecycle to support legacy.
4. The Logger mocks have been replaced with the platform's `coreMocks` implementation
5. The integration tests now test the plugin's actual public api (instead of the internals).
6. The Legacy Elasticsearch client has been replaced with the typed client in response to the deprecation notice.
7. Typing has been narrowed to prevent the `type` field from conflicting with the key in the `TaskDictionary`. This could have caused the displayed `type` on a task to differ from the `type` used in the Dictionary itself (this broke a test during refactoring and could have caused a bug in production code if left).
2020-10-20 13:00:13 +01:00
Tim Roes 3a206ab198
Support unsigned_long fields (#81115)
* Support unsigned_long fields

* Change API docs
2020-10-20 13:58:48 +02:00
Sébastien Loix 702e0c7d73
[Form lib] Export internal state instead of raw state (#80842) 2020-10-20 13:51:11 +02:00
Kim S. Ly 08a6ddf25b
[Lens] Add toast notification when visualization is saved (#80788) 2020-10-20 13:46:10 +02:00
Matthew Kime c8e40d52f0
Index pattern edit field formatter API (#78352)
* Index pattern edit field formatter API
2020-10-20 06:31:58 -05:00
Søren Louv-Jansen f57518a48f
[APM] Add correlations API (#78882) 2020-10-20 12:19:54 +02:00
Joe Reuter e1bd1e8373
Add cumulative sum expression function (#80129) 2020-10-20 10:53:02 +02:00
Søren Louv-Jansen 8cd02b9831
[APM] Fix link to trace (#80993) 2020-10-20 09:55:17 +02:00
Mikhail Shustov eb29ab8e2f
Provide url rewritten in onPreRouting interceptor (#80810)
* keep url rewritten in onPreRouting interceptor

* update docs

* add test on undefined
2020-10-20 07:56:40 +02:00
spalger 45cb8134c4 limit renovate to npm packages 2020-10-19 19:40:27 -07:00
PavithraCP 0ab073828d
Fix bug in logs UI link (#80943) 2020-10-19 22:21:04 -04:00
Chris Roberson b019b57422
[Monitoring] Fix bug with setup mode appearing on pages it shouldn't (#80343)
* Ensure we check for local setup mode data first

* Use a context to ensure deeply nested components have access

* Fix snapshots

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-10-19 22:05:25 -04:00
Frank Hassanabad b6562bde31
[Security Solution][Detection Engine] Fixes false positives caused by empty records in threat list
## Summary

Fixes false positives that can be caused by empty records in the threat list. Previously I would drop a piece of data in an AND clause if it did not exist in the threat list rather than dropping the entire A clause.

* Adds unit tests
* Adds backend integration tests
* Reduces some boiler plate across the integration tests as suggested in earlier PR reviews

Example is if you create a threat list mapping and add records like so without a field/value such as `host.name`:
```json
"_source" : {
  "@timestamp" : "2020-09-10T00:49:13Z",
  "source" : {
    "ip" : "127.0.0.1",
    "port" : "1001"
}
```

And then you would create an "AND" relationship against the data like so using `host.name` which does not exist in your list:
<img width="1060" alt="Screen Shot 2020-10-16 at 7 29 45 AM" src="https://user-images.githubusercontent.com/1151048/96264530-8581b480-0f81-11eb-8ab9-16160d55c26b.png">

What would happen is that part of the AND would drop and you would match all the `source.ip` which gives us false positives or unexpected results. Instead, with this PR we now drop the entire AND clause if it cannot find part of a record. 

This protection is per record level, so if you have N records where some M set is missing `host.name` only those M record sets would have this "AND" removed.

If you have 1 or more "OR"'s, it will still match the records against those OR's as long as their inner AND clauses have both records in your list match.   

### Checklist

Delete any items that are not applicable to this PR.

- [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios
2020-10-19 19:14:09 -06:00
Nathan Reese 9da5df9ee6
docs test (#81080) 2020-10-19 18:41:37 -06:00
Yuliia Naumenko ea7c255ed1
Fixed alerts ui test timeout issue, related to the multiple server calls for delete all alerts, by reducing the number of alerts to the two and increasing retry timeout. (#81067) 2020-10-19 17:18:44 -07:00
Oliver Gupte caba25c294
[APM] Fix service map highlighted edge on node select (#80791)
* Closes #80633 by passing a reference to the core cytoscape options to correctly reset all edges in the map

* removed commented out debugger statement
2020-10-19 16:49:26 -07:00
Justin Kambic babddf4325
Fix typo in toast, slight copy adjustment. (#80843)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-10-19 19:27:25 -04:00
Robert Austin a74cea30c5
[Security Solution] reduce optimizer limits (#80997) 2020-10-19 18:04:21 -04:00
Nathan Reese 22c1b9e8ac
[maps] 7.10 documentation updates (#79917)
* [maps] 7.10 documenation updates

* clean up

* clean up connect-to-elasticsearch reference to renamed page

* Update docs/maps/vector-layer.asciidoc

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* review feedback

* move upload intro sentences into geospatial import block

* improvements to Import geospatial data

* fix typo

* Update docs/maps/import-geospatial-data.asciidoc

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* Update docs/maps/import-geospatial-data.asciidoc

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* Update docs/maps/import-geospatial-data.asciidoc

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* Update docs/maps/import-geospatial-data.asciidoc

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* Update docs/maps/import-geospatial-data.asciidoc

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* review feedback

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>
2020-10-19 15:42:15 -06:00
Scotty Bollinger cf13fe2b7c
[Workplace Search] Fix Group Prioritization route and clean up design (#80903)
* Update route path for prioritizations

* Update prioritization spacing

* Lint fix

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-10-19 17:08:34 -04:00
Jason Stoltzfus e74613a45f
[Enterprise Search] Added reusable HiddenText component to Credentials (#80033) 2020-10-19 17:06:14 -04:00
Chandler Prall 42a1744af6
Upgrade EUI to v29.5.0 (#80753)
* Upgraded eui to v29.5.0; snapshot updates

* Cleaned up some types

* addresses feedback on types change

* Update EuiIcon snapshots in jest integration tests

* Updated snapshot from rebasing on master
2020-10-19 14:48:33 -06:00
Thomas Neirynck db14725038
[Maps] Fix layer-flash when changing style (#80948) 2020-10-19 15:57:48 -04:00
Devin W. Hurley 2f01a0911c
[Security Solution] [Detections] Disable edit button when user does not have actions privileges w/ rule + actions (#80220)
* disable edit button only when there is an action present on the rule to be edited, but the user attempting the edit does not have actions privileges

* adds tooltip to explain why the edit rule button is disabled

* prevent user from editing rules with actions on the all rules table

* adds tooltip to appear on all rules table

* updates tests for missing params and missing mock of useKibana

* disable activate switch on all rules table and rule details page

* remove as casting in favor of a boolean type guard to ensure actions.show capabilities are a boolean even though tye are typed as a boolean | Record

* disable duplicate rule functionality for rules with actions

* fix positioning of tooltips and add tooltip to rule duplicate button in overflow button

* update tests

* WIP - display bulk actions dropdown options as disabled + add tooltips describing why they are disabled

* add eui tool tip as child of of each context menu item

* PR feedback and utilize map of rule ids to rules to replace usage of array.finds

* update snapshot

* fix mocks

* fix mocks

* update wording with feedback from design team

Co-authored-by: Patryk Kopycinski <contact@patrykkopycinski.com>
2020-10-19 15:45:32 -04:00
Jason Stoltzfus 4c81b1a64b
[Enterprise Search] Handle loading state on Credentials page (#80035) 2020-10-19 15:10:27 -04:00
Chris Roberson 3f97872055
[Monitoring] Fix cluster listing page in how it handles global state (#78979)
* Properly unset global state on the listing page

* Fix how we handle global state in getSafeForExternalLink

* Fix breadcrumbs for clusters link

* Fix tests

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-10-19 15:10:11 -04:00
Jason Stoltzfus 67ec846549
[Enterprise Search] Added an EuiEmptyState to Credentials page #2 (#80034) 2020-10-19 15:09:52 -04:00
Mikhail Shustov a2fe54aef4
promote --focus flag in docs to speed up the build (#80626) 2020-10-19 20:49:57 +02:00
Tyler Smalley a48f02bee4
[docker] Removes unnecessary setguid permissions on source directories (#80452)
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2020-10-19 11:24:00 -07:00