Commit graph

30123 commits

Author SHA1 Message Date
Anton Dosov 27c8a4bc25
[State Management] remove AppState from Dashboard app (#54105)
Removes AppState from dashboard app and replaces it with state containers and state syncing utilities.
2020-01-21 13:04:49 +01:00
Mikhail Shustov 4971a2c772
Expose fatalErrors API from the Start contract (#55300)
* Expose FatalErrors from the Start contract.

This API is intended to be used for runtime as well.

* update docs

* update data plugin snapshot to fix tests

* address comments

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-21 12:58:40 +01:00
Liza Katz 4ca2fbdb11
[BUG] Data fetching twice on discover timefilter change (#55279)
* Fix bug #54887
 - Filters are not only fetch once on timefilter change
 - Make sure that discover doesn't fetch data when a disabled filter is changed
 - Support compareFilters on an array of filters.
 - Added tests to compare filters
 - Exctracted sortFilters and added tests to it.

* code review + FilterCompareOptions

* Remove sort by

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-21 11:03:55 +02:00
Sébastien Loix a20ac0d710
[Mappings editor] Add missing max_shingle_size parameter to search_as_you_type (#55161) 2020-01-21 14:27:51 +05:30
Alejandro Fernández cdb0021ac6
[Logs UI] Fix z-index of logs page toolbar (#54469)
* Fix z-index of logs page toolbar

* Extract `FixedDatePicker` from log setup page, and use it in the stream page

* Clean unused import

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-20 18:28:55 +01:00
Gidi Meir Morris 638792a557
removes CTA from Task Manager info message (#55334)
removes CTA from Task Manager info message
2020-01-20 17:24:17 +00:00
James Gowdy bf0bcfe703
[ML] Fixing missing job_type in job messages search (#55330) 2020-01-20 16:12:25 +00:00
Walter Rafelsberger 3e567b5cf2
[ML] Correctly pass on severity value to anomaly explorer charts. (#55207)
- Fixes passing on the severity value correctly to anomaly explorer charts. The wrong value of undefined being passed down caused anomaly markers not showing up.
- This bug surfaced that the severity value was never applied to filter multi-bucket anomalies which is now also fixed by this PR.
- Adds a check if topInfluencers is an array.
2020-01-20 15:43:22 +01:00
Walter Rafelsberger bd7f7ab48a
[ML] Single Metric Viewer: Fix job check. (#55191)
Fixes switching via navigation to Single Metric Viewer from Anomaly Explorer for a job which isn't supported in the Single Metric Viewer.
2020-01-20 15:37:41 +01:00
Pierre Gayvallet de7a22d523
Show error page when accessing unavailable app (#54656)
* display not found page instead of throwing an error when accessible unavailable app

* move types to public folder

* fix types import

* remove updater from start app

* remove unnecessary await
2020-01-20 15:00:11 +01:00
James Gowdy 82ab1a604f
[ML] Improving job wizards with datafeed aggregations (#55180)
* [ML] Improving job wizards with datafeed aggregations

* picking all agg keys for fields

* function move and rename
2020-01-20 13:24:48 +00:00
Mikhail Shustov a9824f476b
remove flaly assetion. a license presence tested anyway (#55289) 2020-01-20 13:37:07 +01:00
Shahzad 6c420b7d86
fix commonly used ranges uptime (#54930) 2020-01-20 12:19:30 +01:00
patrykkopycinski 4328265c5d
[SIEM] Use proper icons on Detections view (#55215) 2020-01-20 12:06:17 +01:00
Marcin Tojek 641fe3da44
Fix: invalid translation referenced (#54901) 2020-01-20 12:04:02 +01:00
Anton Dosov 940b53399e
[State Management] Remove AppState from edit_index_pattern page (#54104)
Replaces AppState in edit_index_pattern with state containers and state syncing utils.
In addition makes tab navigation on edit_index_pattern work with browser's undo history

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-20 11:40:53 +01:00
Pierre Gayvallet 2d10350d77
Implements getStartServices on server-side (#55156)
* implements server-side getStartServices

* add unit test

* add integration test

* update generated doc

* improve test
2020-01-20 11:19:40 +01:00
Daniil Suleiman 22e7ae80dc
Move vis_vega_type/data_model tests to jest (#55186)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-20 11:00:33 +03:00
Devin W. Hurley 9567cca7d0
[SIEM] [Detection Engine] Update status on rule details page (#55201)
* adds logic for returning / updating status when a rule is switched from enabled to disabled and vice versa.

* update response for find rules statuses to include current status and failures

* update status on demand and on enable/disable

* adds ternary to allow removal of 'let'

* adds savedObjectsClient to the add and upate prepackaged rules and import rules route.

* fix bug where convertToSnakeCase would throw error 'cannot convert null or undefined to object' if passed null

* genericize snake_case converter and updates isAuthorized to snake_case (different situation)

* renaming to 'going to run' instead of executing because when task manager exits because of api key error it won't write the error status so the actual status is 'going to run' on the next interval. This is more accurate than being stuck on 'executing' because of an error we don't control and can't write a status for.

* fix missed merge conflict

Co-authored-by: Xavier Mouligneau <189600+XavierM@users.noreply.github.com>
2020-01-18 12:41:47 -05:00
Matt Bargar 8ae51abe19 Fix KQL value suggestions for nested fields (#54820)
* Revert "Flag nested fields as non-aggregatable (#51774)"

This reverts commit c7046a08

* Filter out nested fields at the agg param level

* Forbid nested fields in TSVB

* Revert "Forbid nested fields in TSVB"

This reverts commit afcaa348

Co-authored-by: Tim Roes <mail@timroes.de>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-18 16:25:51 +01:00
Mikhail Shustov ec31611911
Enforce camelCase format for a plugin id (#53759)
* add isCamelCase  function

* add a warning if id is not in camelCase

* document pluginId expected in camelCase

* regen docs

* add a test for logging

* update tests. warn can be called several times for different reasons

* pluginPath falls back to plugin id in snake_case

* update tests

* update docs

* add example with id & configPath different formats

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-18 14:17:36 +01:00
Xavier Mouligneau 13c648b47a
[SIEM] Detection engine cleanup for rule details/creation/edit page (#55069)
* update extra action on rule detail to match design

* remove experimental label

* allow pre-package to be deleted + do not allow wrong user to create pre-packages rules

* Additional look back minimum value to 1

* fix flow with edit rule

* add success toaster when rule is created or updated

* Fix Timeline selector loading

* review ben doc + change detectin engine to detection even in url

* Succeeded text size consistency in rule details page

* fix description of threats

* fix test

* fix type

* fix internatinalization

* Update x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/create/translations.ts

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

* Update x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/edit/translations.ts

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

* Update x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/components/step_schedule_rule/schema.tsx

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

* review I

* fix type

Co-authored-by: Garrett Spong <spong@users.noreply.github.com>
2020-01-18 07:49:31 -05:00
Matt Bargar b98a636de2 Remove nested root from index pattern (#54978)
* Revert "Add label and icon to nested fields in the doc table (#54199)"

This reverts commit f77b3620

* Apply label and icon to nested fields in the doc table

* Add nested type to field_icon

* Improve nested test and add comment

* Fix tests

* Always pass the field type
2020-01-18 11:01:05 +01:00
Tim Sullivan 2598d15ea1
[Reporting/Migration] ReportingSetup, LegacySetup (#54198)
* ReportingSetup, LegacySetup

* fix ts
2020-01-17 21:47:01 -07:00
Garrett Spong dfb3578793
[SIEM] [Detection Engine] Fixes duplicate rule action (#55252)
## Summary

This PR fixes the duplication of rules. The DE backend was updated to not allow `immutable` when creating a rule, so this broke the `Duplicate Rule` action as we were creating a new rule with `immutable: false`.

This PR also switches rule duplication over to use the bulk `create` API introduced in https://github.com/elastic/kibana/pull/53543, so now we can duplicate multiple rules.

And lastly, this PR removes the limitation of not being able to delete immutable rules. So long as you have the appropriate `write` permissions the delete action is now always available.

![duplicate_batch](https://user-images.githubusercontent.com/2946766/72652638-cee69a00-3944-11ea-9e15-cce3f2b8cefe.gif)


### 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)~
- [x] 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)~
2020-01-17 18:41:00 -07:00
Xavier Mouligneau 6760c3394d
[SIEM] Detections add alert & signal tab (#55127)
* add alert on detections

* review I + fix unit test

* review II

* review III

* review IV + bug fixes found during review

* review VI
2020-01-17 19:22:22 -05:00
Matthew Kime c1ccb304b6
Management API - redirect on disabled app path (#55136)
* redirect on disabled management app path
2020-01-17 17:57:24 -06:00
Frank Hassanabad 6cfd1d48b3
[SIEM][Detection Engine] Fixes critical regression on the backend with immutable and tags
## Summary

Fixes regression with immutable caused from:
https://github.com/elastic/kibana/pull/55004

* Updated types of Prepackaged 
* Updated unit tests
* Fixed unit test for it

Testing:

```
./post_rule.sh 
{
  "created_at": "2020-01-17T19:11:31.813Z",
  "updated_at": "2020-01-17T19:11:31.813Z",
  "created_by": "elastic_kibana",
  "description": "Query with a rule_id that acts like an external id",
  "enabled": true,
  "false_positives": [],
  "from": "now-6m",
  "id": "41ef6309-ef98-4c9f-8d2d-90a070361fb7",
  "immutable": false,
  "interval": "5m",
  "rule_id": "query-rule-id",
  "language": "kuery",
  "output_index": ".siem-signals-frank-hassanabad-default",
  "max_signals": 100,
  "risk_score": 1,
  "name": "Query with a rule id",
  "query": "user.name: root or user.name: admin",
  "references": [],
  "severity": "high",
  "updated_by": "elastic_kibana",
  "tags": [],
  "to": "now",
  "type": "query",
  "threats": [],
  "version": 1
}
```

Then get the saved object using whatever the id is comes back from above. In this example it is 41ef6309-ef98-4c9f-8d2d-90a070361fb7, yours will be different

```
./get_saved_objects.sh alert 41ef6309-ef98-4c9f-8d2d-90a070361fb7
{
  "id": "41ef6309-ef98-4c9f-8d2d-90a070361fb7",
  "type": "alert",
  "updated_at": "2020-01-17T19:11:32.844Z",
  "version": "WzY5NTQsMV0=",
  "attributes": {
    "name": "Query with a rule id",
    "tags": [
      "__internal_rule_id:query-rule-id",
      "__internal_immutable:false"
    ],
    "alertTypeId": "siem.signals",
    "consumer": "siem",
    "params": {
      "createdAt": "2020-01-17T19:11:31.813Z",
      "description": "Query with a rule_id that acts like an external id",
      "ruleId": "query-rule-id",
      "index": null,
      "falsePositives": [],
      "from": "now-6m",
      "immutable": false,
      "query": "user.name: root or user.name: admin",
      "language": "kuery",
      "outputIndex": ".siem-signals-frank-hassanabad-default",
      "savedId": null,
      "timelineId": null,
      "timelineTitle": null,
      "meta": null,
      "filters": null,
      "maxSignals": 100,
      "riskScore": 1,
      "severity": "high",
      "threats": [],
      "to": "now",
      "type": "query",
      "updatedAt": "2020-01-17T19:11:31.813Z",
      "references": [],
      "version": 1
    },
    "schedule": {
      "interval": "5m"
    },
    "enabled": true,
    "actions": [],
    "throttle": null,
    "apiKeyOwner": "elastic_kibana",
    "createdBy": "elastic_kibana",
    "updatedBy": "elastic_kibana",
    "createdAt": "2020-01-17T19:11:32.245Z",
    "muteAll": false,
    "mutedInstanceIds": [],
    "scheduledTaskId": "2c5cc340-395d-11ea-9276-d3c1c264ca9a"
  },
  "references": []
}
```

Ensure you have the internal immutable of "__internal_immutable:false" In your tags


Next test is to do a find filter of non-packaged rules:

```
./find_rule_by_filter.sh "alert.attributes.tags:%20%22__internal_immutable:false%22"
```

You should get back the above rule any others you created.

### 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-17 16:53:04 -07:00
Shahzad 81bcaed7ae
update local (#55177) 2020-01-18 00:24:34 +01:00
Ryland Herrick 27103bd4a5
[SIEM] Fix mocks for kibana context (#54996)
* Use our internal uiSettings mock in all context mocks

We were previously only using our internal uiSettings mock (which
returns real values) in our TestProviders component, as
all tests either needed:

* specific mocks, in which case we'd call jest.mock() ourselves
* broad mocks, for which platform's kibana_react mocks were usually
sufficient

However, a recent addition in the Timeline component added a usage of
uiSettings that could not use the default mock.

With this change, one can either jest.mock('lib/kibana') or use the
TestProviders wrapper to get real values for UI settings in test.

* Remove production code guarding against tests

This coalescence was due to the service not being properly mocked in
test, which is now fixed.
2020-01-17 16:28:38 -06:00
Josh Dover 92c4604b5d
Remove kibana-platform pr-project-assigner (#55244) 2020-01-17 15:10:33 -07:00
Mike Côté 66e2c720fd
Re-enable mute all test now that API is no longer flaky (#55172) 2020-01-17 16:26:09 -05:00
Kaarina Tungseth 4dd31a50ef
[DOCS] Added to Add a field column definition (#55116) 2020-01-17 15:13:22 -06:00
Joel Griffith e8b859bf2f
[Reporting] Fix map tiles not loading by using Chrome's Remote Protocol (#55137)
* WIP Fixing map tiles and such

* Small comment and importing map from dolash

* Better destructuring and comments

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-17 12:18:24 -08:00
Alexey Antonov 801302e3ce
[Data Plugin] combine autocomplete provider and suggestions provider (#54451)
* [Data Plugin] combine autocomplete provider and suggestions provider

Closes: #52843

* [Data Plugin] combine autocomplete provider and suggestions provider - add skeleton for SuggestionsProvider

* autocomplete_provider -> autocomplete

* value_suggestions.ts - change getSuggestions method

* remove suggestions_provider folder

* fix PR comments

* fix PR comments

* fix CI

* fix CI

* getFieldSuggestions -> getValueSuggestions

* update Jest snaphots

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-17 22:42:51 +03:00
Peter Schretlen 2234210369
resolves #53038 - remove references to specific license levels (#53858) 2020-01-17 14:41:55 -05:00
Jean-Louis Leysens a1fe536f6d highlighting rules should still know about url parts when in sql state (#55200) 2020-01-17 11:04:30 -08:00
Tre' Seymour 867c4df24d Merge branch 'master' of github.com:elastic/kibana 2020-01-17 11:41:07 -07:00
Nick Partridge 119eabe271
[Metric] convert mocha tests to jest (#54054)
* Add fixtures/* alias to tsconfig and jest config
* Convert metric tests to jest
* Convert remaining js files to ts
2020-01-17 12:00:35 -06:00
Nathan Reese 56482ab043
[skip-ci] Update vector styling docs for 7.6 UI changes and new features (#55087)
* Quantitative data driven styling

* quantitative styling

* clean up

* clean up

* review feedback
2020-01-17 12:34:40 -05:00
Tre' Seymour a5d7201728 Merge branch 'master' of github.com:elastic/kibana 2020-01-17 09:38:09 -07:00
Mike Côté 9c2d778d1c
Fix enable API to schedule task after alert is updated (#55095) 2020-01-17 10:48:48 -05:00
Tiago Costa 5af378a2fb
chore(NA): add 7.6 branch to the list of backport branches (#54998) 2020-01-17 14:52:23 +00:00
Daniil Suleiman b9161e7682
Convert tests to jest in vis_type_timeseries/public & common folders (#55023)
* Convert tests to jest in vis_type_timeseries/public & common folders

* Remove unused translation
2020-01-17 17:04:00 +03:00
Pete Harverson d740ec34b3
[ML] Accessibility fix for structural markup on table rows (#55075)
* [ML] Accessibility fix for structural markup on table rows

* [ML] Fix type error on Transforms table cell for scope property
2020-01-17 13:48:31 +00:00
Alison Goryachev 102bd2bcda
[Mappings editor] include/exclude fields only support custom options (#54949) 2020-01-17 08:22:17 -05:00
Maryia Lapata 9e07a427c7
[Vis] Move Timelion Vis to vis_type_timelion (#52069)
* Deangularize timelion vis

* Refactoring

* Fix path

* Update timelion_controller.ts

* Remove unused deps

* Create vis_type_timelion

* Create ChartComponent

* Render chart in react

* Reactify timelion editor

* Change translation ids

* Use hooks

* Add @types/pegjs into renovate.json5

* Add validation, add hover suggestions

* Style fixes

* Change plugin setup, use kibana context

* Update

* Fix ticks

* Fix plotselected listener

* Fix plothover handler

* Add TS for options

* Update TS

* Restructuring

* Change plugin start

* Remove vis from timelion plugin

* Rename class

* Mock services

* Fix other comments

* Remove duplicate files

* Convert test to jest

* Remove kibana_services from timelion

* Delete visualize_app.ts.~LOCAL

* Refactoring

* Fix TS

* Refactoring, TS

* Import eui variables

* Import styling constants

* Move react components to vis_type_timelion

* Fix TS

* Move ui imports to legacy_imports.ts

* Move chain.peg to vis_type_timelion

* Fix path

* Use KibanaContext instead kibana_services.ts

* Refactoring

* Refactoring

* Add @types/flot

* Fix issue with hovered series color

* Update renovate.json5

* Pass timelionPanels as dependencies

* Move common folder to vis_type_timelion

* Move back tick_formatters.ts

* Rename styles file

* Refactoring

* Update _index.scss

* Move to_milliseconds to common

* Revert yaxes formatting

* Refactoring

* Refactoring

* Use Panel directly

* Refactoring of to_milliseconds.ts

Co-authored-by: Daniil Suleiman <31325372+sulemanof@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-17 15:30:26 +03:00
Pierre Gayvallet 856c85b400
Deprecate chrome.navlinks.update and add documentation (#54893)
* add migration example on application status updater

* update example with proper licensing plugin usage

* fix line width
2020-01-17 13:27:09 +01:00
Walter Rafelsberger f13adfab5b
[ML] Single Metric Viewer: Fix time bounds with custom strings. (#55045)
Makes sure to set bounds via timefilter.getBounds() again and not infer directly from globalState to correctly consider custom strings like now-15m.
2020-01-17 13:16:02 +01:00
Daniil Suleiman 3e46060854
[Vis: Default editor] EUIficate and Reactify the sidebar (#49864)
* EUIficate the sidebar

* Create a state reducer and a state context

* Create an editor context and actions

* Improve types

* Apply aggs reordering

* Fix functionality

* Improve types

* Fix sub_agg changes

* Remove legacy dependencies

* Watch dirty state

* Fix dirty state changes

* Update actions and reducers

* Handle keyboard submit

* Apply editor form validation

* Remove fancy forms

* Update validation

* Use embeddable instead of visualize loader

* Add auto apply behavior

* Remove legacy styles

* Remove the sidebar

* Restrict responsive to the bottom_bar

* Upgrade @elastic/eui to v14.10.0

* Replace EuiBottomBar with EuiControlBar

* Get rid of mutations in control vis

* Revert "Upgrade @elastic/eui to v14.10.0"

This reverts commit 2cd86c51d2.

* Replace bottom bar with a control panel for sidebar

* Replace selectors

* Use editor resizer

* Apply selectors

* Change selectors

* Fix sub agg change values

* Add collapse button

* Fix tests

* Get rid of editor editor_state_context, simplify the code

* Fix jest tests, update snapshots

* Fix types

* Moving collapse button to right of index pattern

* Tweaks bottom buttons

* Moved Vega buttons so they don’t scroll away

* Fix responsiveness

* Resolve UI comments

* Fix console resizer

* Update dev docs

* Bail out of additional render in metrics and axes

* Apply performance optimizations for metrics and axis panel

* Remove unused translations

* Use debounce when autoapply enabled

Co-authored-by: Caroline Horn <549577+cchaos@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-17 14:01:44 +03:00