Commit graph

29134 commits

Author SHA1 Message Date
Sébastien Loix 439708a6f9 [Dependencies]: upgrade react to latest v16.12.0 (#51145) 2019-11-28 10:56:47 +01:00
Alejandro Fernández Haro 066613e2a6
Allow routes to define some payload config values (#50783)
* Allow routes to define some payload config values

* Documentation typo

* Move hapi `payload` config under `body` + additional validations

* Update API docs

* Amend explanation in API docs

* Add stream and buffer types to @kbn/config-schema

* Fixes based on PR feedback:
- Add 'patch' and 'options' to valid RouteMethod
- Add tests for all the new flags
- Allow `stream` and `buffer` schema in the body validations (findings from tests)

* API documentation update

* Fix type definitions

* Fix the NITs in the PR comments + better typing inheritance

* API docs update

* Fix APM-legacy wrapper's types

* Fix KibanaRequest.from type exposure of hapi in API docs

* Move RouterRoute interface back to private + Expose some public docs

* Update @kbn/config-schema docs
2019-11-28 09:23:56 +00:00
Liza Katz bbd517b3ca
Move saved queries service + language switcher ⇒ NP (#51812)
* Move saved queries service + language switcher to NP

* test fixes

* test fix

* fix ts

* mock search service
2019-11-28 11:22:29 +02:00
Robert Oskamp 85d438cb03
[ML] Re-activate after method in transform test (#51815) 2019-11-28 08:18:11 +01:00
Xavier Mouligneau 60896e80a6
[SIEM] [Detection Engine] Add edit on rule creation (#51670)
* Add creation rule on Detection Engine

* review + bug fixes

* review II + clean up

* fix persistence saved query

* fix eui prop + add type security to add rule

* fix more bug from review III

* review IV

* add edit on creation on rule

* review

* fix status icon color

* fix filter label translation
2019-11-27 22:58:41 -05:00
Nick Partridge 3ed18b4e06
De-angularize visLegend (#50613)
* deangularize visLegend
* update vislib controller to mount react legend directly
* convert legend components to eui
* Position popover based on legend position
* Styles cleanup including removing of unused/unnecessary styles
2019-11-27 20:07:27 -06:00
Frank Hassanabad 7d34a113eb
[SIEM][Detection Engine] Change security model to use SIEM permissions
## Summary

* Changes incorrect `access:signals-all` to be the correct `access:siem`
* Adds a boom transformer to push back better error messages to the client in some cases

### 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)
2019-11-27 14:18:32 -07:00
Andrea Del Rio 2ce0f789bb
[Monitoring] Sass cleanup (#51100) 2019-11-27 12:32:49 -08:00
Liza Katz 7a09409587
Move errors and validate index pattern ⇒ NP (#51805)
* Move errors and validate index pattern to NP

* removed unused mock

* remvoed irrelevant mock

* Removed unneeded mocks

* fix test
2019-11-27 18:40:28 +02:00
MadameSheema 6b5108a57d
fixes pagination tests (#51822) 2019-11-27 17:22:15 +01:00
Rudolf Meijering f29af1219d
Split legacy plugin discovery, expose SavedObjects scopedClient, wrappers, repository (#48882)
* Split legacy plugin discovery, expose internal SavedObjectsClient

* Expose internal SavedObjectsClient to plugins

* Add more documentation

* Expose client wrappers, repository, scoped client from SavedObjects

* Remove unused onBeforeWrite

* Refactor Service / Repository for testability

* Bind exposed clientProvider methods

* Fix eArchiver's KibanaMigrator

* Cleanup

* Use APICaller type

* Expose SavedObjectsServiceStart to plugins

* API documentation

* Rename API methods to be verbs
2019-11-27 16:47:22 +01:00
Devin W. Hurley dbca711524
[SIEM][Detection Engine] Adds ecs threat properties to rules (#51782)
* allows addition of ecs threat properties to rules and signals for mitre attack info

* adds default empty array to threats on creation of rule, removes optional from update rules schema as it is implied, updates and adds relevant tests

* adds sample rule with mitre attack threats property
2019-11-27 10:24:21 -05:00
Chris Davies 09125323c2
[Lens] Remove client-side reference to server source code (#51763) 2019-11-27 10:03:32 -05:00
Joe Portner 7830946f6a
Fix infinite redirect loop when multiple cookies are sent (#50452)
Cookies are now checked for attributes that match the current
Kibana configuration. Invalid cookies are cleared more reliably.
2019-11-27 09:26:21 -05:00
MadameSheema c790ef277c
fixes drag and drop in tests (#51806) 2019-11-27 14:17:52 +01:00
Jean-Louis Leysens 7c315128ab
[Console] Proxy fallback (#50185)
* First iteration of liveness manager for Console

* First iteration of PoC working

* Updated console proxy fallback behaviour after feedback

* remove @types/node-fetch

* If all hosts failed due to connection refused errors 502

* Remove unnecessary existence check
2019-11-27 12:33:50 +01:00
Liza Katz 8797e68db0
Query String(Bar) Input - cleanup (#51598)
* Moved Suggestions to NP
Renamed QueryBarInput to QueryStringInput
Changed IndexPattern to IIndexPattern

* fix import

* Update snapshot

* css import

* scss

* eslint
2019-11-27 12:50:19 +02:00
Peter Pisljar 0cc4060d4f
shim visualizations plugin (#50624) 2019-11-27 05:12:05 -05:00
Anton Dosov 0fd63ee5ce
Expressions service fixes: better error and loading states handling (#51183)
1. This pr fixes regression in v7.6 - #51153.

Visualisation which are using ExpressionLoader directly are swallowing render errors in 7.6, because generic error handling is happening only on expression_renderer.tsx level (react component wrapper around renderer).

Now react agnostic render code render.ts, loader.ts:

has it's own default error handler which is toast from notification service.
It also allows to pass custom error handler instead of default one
React expression renderer expression_renderer.tsx:

if consumer wants to render error as react component inline, then the component uses custom error handler from render.ts to wire up react component.

2. This pr fixes issue of loader.ts where initial loading$ was not emitted

Had to change loadingSubject from Subject to BehaviorSubject to remember the last value

3. This pr fixes dependencies in effects of expression_renderer.tsx
2019-11-27 10:55:28 +01:00
MadameSheema 04b91e786e
fixes url state tests (#51746) 2019-11-27 10:40:20 +01:00
MadameSheema 85ede04f85
fixes browser field tests (#51738) 2019-11-27 10:39:46 +01:00
Robert Oskamp 93654d5ff9
[ML] Fix anomaly detection test suite (#51712)
This PR re-enables the anomaly detection test suite and disables Firefox test execution for now. It also increases stability for `clickEditDetector` and removes unneeded retries.
2019-11-27 09:49:54 +01:00
patrykkopycinski 517fcb98b8
[SIEM] Fix Timeline drag and drop behavior (#51558) 2019-11-27 09:35:08 +01:00
Dario Gieselaar 2d696eb7ba
[APM] Handle APM UI config keys (#51668)
`xpack.apm.ui.*` keys were not properly handled due to object path parsing.
2019-11-27 08:58:49 +01:00
Justin Kambic ce166099a3
[Uptime] Update snapshot counts (#48035)
* Add snapshot count function that uses monitor iterator class.

* Add js-doc comment.

* Add snapshot count route.

* Start adding snapshot state management.

* Commit changes that were missed in previous.

* Finish implementing snapshot count redux code.

* Add basePath setter and type to ui state.

* Dispatch basePath set action on app render.

* Replace GQL-powered Snapshot export with Redux/Rest-powered version.

* Extract presentational element to dedicated component.

* Update broken test.

* Rename action.

* Add comments to clarify adapter function.

* Remove obsolete code.

* Add ui state field to store for tracking when app refreshes.

* Make snapshot component refresh on global refresh via redux state.

* Remove obsolete @ts-igore.

* Alphabetize imports.

* Port functional test fixture to REST test.

* Delete snapshot GQL query.

* Update API test fixtures to match new snapshot count REST response shape.

* Update Snapshot count type check to be stricter.

* Add tests for Snapshot API call.

* Rename new test file from tsx to ts, it has no JSX.

* Add tests for snapshot reducer.

* Add tests for UI reducer.

* Add tests for selectors.

* Delete unused test file.

* Move snapshot getter and map/reduce logic to dedicated helper function.

* Add test for snapshot helper function.

* Export type from module.

* Rename outdated snapshot file.

* Add action creator for fetch success.

* Reorganize ui actions file.

* Update snapshot effect to put error when input params are not valid.

* Simplify typing code for a function.

* Simplify snapshot count reduction.

* Rename a function.

* Rewrite a function to increase code clarity.

* Remove duplicated interface.

* Add very high ceiling for snapshot count iteration.

* Update broken test assertion.
2019-11-26 19:44:46 -05:00
Ahmad Bamieh 0039e97747
[Telemetry] collector set to np (#51618)
* first iteration

* local collection ready

* type check

* fix collectorSet tests

* unskip test

* ordering

* collectors as array in constructor

* update README files

* update README and canvas to check for optional dep

* update README with more details

* Add file path for README example

* type UsageCollectionSetup

* run type check after refactor
2019-11-27 01:55:48 +02:00
Frank Hassanabad 9d8c93158c
[SIEM][Detection Engine] Adds signal to ECS event.kind and fixes status in signals (#51772)
## Summary

* Adds signal to the ECS event.kind when it copies over a signal
* Creates a `original_event` if needed within signal so additional look ups don't have to happen
* Fixes a bug with `signal.status` where it was not plumbed correctly
* Adds extra unit tests around the filter
* Adds missing unit tests around utils I didn't add before
* Fixes a typing issue with output of a signal

Example signal output:

Original event turns into this:
```ts
  "event" : {
    "dataset" : "socket",
    "kind" : "signal",
    "action" : "existing_socket",
    "id" : "ffec6797-b92f-4436-bb40-69bac2c21874",
    "module" : "system"
  },
```

Signal amplification turns into this where it contains original_event looks like this:

```ts
  "signal" : {
    "parent" : {
      "id" : "xNRlqW4BHe9nqdOi2358",
      "type" : "event",
      "index" : "auditbeat",
      "depth" : 1
    },
    "original_time" : "2019-11-26T20:27:11.169Z",
    "status" : "open",
    "rule" : {
      "id" : "643fbd2f-a3c9-449e-ba95-e3d89000a72a",
      "rule_id" : "rule-1",
      "false_positives" : [ ],
      "max_signals" : 100,
      "risk_score" : 1,
      "description" : "Detecting root and admin users",
      "from" : "now-6m",
      "immutable" : false,
      "interval" : "5m",
      "language" : "kuery",
      "name" : "Detect Root/Admin Users",
      "query" : "user.name: root or user.name: admin",
      "references" : [
        "http://www.example.com",
        "https://ww.example.com"
      ],
      "severity" : "high",
      "tags" : [ ],
      "type" : "query",
      "to" : "now",
      "enabled" : true,
      "created_by" : "elastic_some_user",
      "updated_by" : "elastic_some_user"
    },
    "original_event" : {
      "dataset" : "socket",
      "kind" : "state",
      "action" : "existing_socket",
      "id" : "ffec6797-b92f-4436-bb40-69bac2c21874",
      "module" : "system"
    }
  }
```
### 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)
2019-11-26 16:19:13 -07:00
Lisa Cawley a234e8b836
[DOCS] Fixes broken links (#51634) 2019-11-26 12:36:35 -08:00
Alexey Antonov c415311221 Move @kbn/es-query into data plugin (#51014) 2019-11-26 13:28:04 -07:00
Corey Robertson f5296293c2
[Canvas] Move workpad api routes to New Platform (#51116)
* Move workpad api routes to New Platform

* Cleanup

* Clean up/Pr Feedback

* Adding missing dependency to tests

* Fix typecheck

* Loosen workpad schema restrictions
2019-11-26 14:22:02 -05:00
patrykkopycinski 3b6e51b2d8
[SIEM] Fix styled-components bump in siem app (#51559) 2019-11-26 19:56:52 +01:00
Tim Roes 84489619bb
Upgrade typescript-eslint to 2.9.0 (#51737)
* Upgrade typescript-eslint to 2.9.0

* Remove redundant APM eslint disable
2019-11-26 18:21:02 +01:00
Chris Roberson c8f0a751a7
[Timepicker] Ensure we filter out undefined values (#51458)
* Fix error with undefined from or to

* PR feedback

* Remove unnecessary test
2019-11-26 12:20:37 -05:00
Dario Gieselaar 074f24ee32
[APM] Fix watcher integration (#51721)
Closes #51720.
2019-11-26 18:03:16 +01:00
John Dorlus 1fb779b7d0
Skipped these tests because their apps are not enabled on cloud. (#51677) 2019-11-26 11:34:03 -05:00
Joe Portner 38c17d6c7d
Improve session idle timeout, add session lifespan (#49855)
This adds an absolute session timeout (lifespan) to user sessions.
It also improves the existing session timeout toast and the overall
user experience in several ways.
2019-11-26 10:47:40 -05:00
Nathan L Smith e721ec4ca8
[APM] Replace StaticIndexPattern with IIndexPattern (#51689) 2019-11-26 09:17:06 -06:00
Frank Hassanabad f7d9e7bbf6
[SIEM][Detection Engine] Disambiguates signals, rules, alerts, and detection engine by renaming them (#51684)
## Summary

* Renames `signals -> rules` when it is specific about rules
* Renames `signals -> detection engine` when is generically talking about both rules and signals
* Renames `signals -> alerts` in a few spots when it is talking specifically about alerting plugins
* Keeps the name of signal when it involves the signals output index or a source input index for potential signals to be generated from
* Did a `git mv <file_1> <file_2>` for everything
* Updated local variables as well per rules above.

### 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)~~

- [ ] 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)
2019-11-26 08:10:25 -07:00
Nathan Reese 61b3972e5d
[Maps] refactor static can skip logic from layer class (#51627) 2019-11-26 08:01:20 -07:00
Liza Katz 75d261d48c
Move IndexPatternsSelector ⇒ NP (#51620)
* Move IndexPatternsSelector to NP
Replace import from ui/index_patterns with new platform imports

* karma mock

* added mock

* Fix jest tests
2019-11-26 15:49:53 +02:00
ffknob 07bc690777 [SR] Prevents negative values for Snapshot retention policies (#51295) 2019-11-26 08:29:56 -05:00
Jean-Louis Leysens ac0e3e12e2
[SearchProfiler] Copy updates (#51700)
* Update search profiler copy

* Fix pristine logic

* Update searchprofiler styles
2019-11-26 14:24:06 +01:00
Jean-Louis Leysens 5899aa5a8c
Calculate Console app height (#51707) 2019-11-26 14:23:10 +01:00
Anton Dosov 80879368a1
Typescriptify and shim kbn_tp_run_pipeline test plugin (#50645)
* Typscriptify and shim kbn_tp_run_pipeline test plugin

* fix imports to not re-export ‘legacy’ from root of plugin
2019-11-26 14:22:34 +01:00
Søren Louv-Jansen e8e517475a
[Security] Add message to login page (#51557)
* [Security] Add loginAssistanceMessage to login page

* Fix tests

* Fix login_page.test.tsx

* Fix defaultValue

* Render login assistance message independently of other messages and use EuiText instead of EuiCallOut

* Use small text

Co-Authored-By: Caroline Horn <549577+cchaos@users.noreply.github.com>

* Flip order of message around
2019-11-26 13:19:11 +01:00
Aleh Zasypkin 0557a40a9d
Document @kbn/config-schema. (#50307) 2019-11-26 12:56:31 +01:00
Marcin Tojek 5dc24c9ee5
Define spec provider for ActiveMQ meatricbeat module (#51698) 2019-11-26 12:49:30 +01:00
Liza Katz 9e168391af
Move apply filters popover ⇒ NP (#51566)
* Move ApplyFiltersPopoverContent and applyFiltersPopover to NP

* code review
2019-11-26 13:45:37 +02:00
Gidi Meir Morris cfed9c6c48
[Task Manager] Tests for the ability to run tasks of varying durations in parallel (#51572)
This PR adds a test that ensures Task Manager is capable of picking up new tasks in parallel to a long running tasks that might otherwise hold up task execution.

This doesn't add functionality - just a missing test case.
2019-11-26 10:35:56 +00:00
Pierre Gayvallet 7fef618ea6
Add compatibility wrapper for Boom errors thrown from route handler (#51157)
* add wrapErrors method to router

* add RouteRegistrar type

* update generated doc

* add migration example

* rename wrapErrors to handleLegacyErrors
2019-11-26 10:21:49 +01:00