Commit graph

31673 commits

Author SHA1 Message Date
Angela Chuang ab44099739
[SIEM] Export timeline (#58368)
* update layout

* add utility bars

* add icon

* adding a route for exporting timeline

* organizing data

* fix types

* fix incorrect props for timeline table

* add export timeline to tables action

* fix types

* add client side unit test

* add server-side unit test

* fix title for delete timelines

* fix unit tests

* update snapshot

* fix dependency

* add table ref

* remove custom link

* remove custom links

* Update x-pack/legacy/plugins/siem/common/constants.ts

Co-Authored-By: Xavier Mouligneau <189600+XavierM@users.noreply.github.com>

* remove type ExportTimelineIds

* reduce props

* Get notes and pinned events by timeline id

* combine notes and pinned events data

* fix unit test

* fix type error

* fix type error

* fix unit tests

* fix for review

* clean up generic downloader

* review with angela

* review utils

* fix for code review

* fix for review

* fix tests

* review

* fix title of delete modal

* remove an extra bracket

Co-authored-by: Xavier Mouligneau <189600+XavierM@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-20 10:09:12 +00:00
patrykkopycinski 8f1e22f078
[SIEM] Add support for actions and throttle in Rules (#59641) 2020-03-20 10:54:51 +01:00
Jean-Louis Leysens b841526979
Fix ace a11y listener (#60639)
Also move the hook use_ui_ace_keyboard_mode.tsx into es_ui_shared

This was defined (and used) in both Console and SearchProfiler.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-20 10:14:44 +01:00
Liza Katz ef0935ff45
Add addInfo toast to core notifications service (#60574)
* addInfo toast

* md files

* fis types

* Added options to toast methods

* Export ToastOptions

* Export ToastOptions

* added test

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-20 08:38:02 +02:00
Pierre Gayvallet c638cc2a11
fix test description (#60638) 2020-03-20 07:17:00 +01:00
MadameSheema 19f719ccb5
[SIEM] Cypress screenshots upload to google cloud (#60556)
* testing screenshots upload to google cloud

* testing another pattern

* fixes artifact pattern

* uploads only the .png files

* only limit uploads from kibana-siem directory

Co-authored-by: spalger <spalger@users.noreply.github.com>
2020-03-19 19:44:54 -07:00
Spencer c3957d8554
[canvas/shareable_runtime] sync sass loaders with kbn/optimizer (#60653)
* [canvas/shareable_runtime] sync sass loaders with kbn/optimizer

* limit sass options to those relevant in this context

Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-19 17:41:28 -07:00
Ryland Herrick 182acdb666
[SIEM] Fixes Modification of ML Rules (#60662)
* Fix updating of ML rules

* Add a regression test for updating ML Rules

* Allow ML Rules to be patched

And adds a regression unit test.

* Allow ML rule params to be imported when overwriting

* Add a basic regression test for creating a rule with ML params

* Prevent users from changing an existing Rule's type
2020-03-19 19:33:36 -05:00
Steph Milovic 0163a71d24
[SIEM] [Case] Bulk status update, add comment avatar, id => title in breadcrumbs (#60410) 2020-03-19 17:08:53 -06:00
Patrick Mueller d5989e8baa
[Alerting] add functional tests for index threshold alertType (#60597)
resolves https://github.com/elastic/kibana/issues/58902
2020-03-19 18:29:26 -04:00
nnamdifrankie d1aaa4430a
[Ingest]EMT-248: add post action request handler and resources (#60581)
[Ingest]EMT-248: add resource to allow to post new agent action.
2020-03-19 18:15:56 -04:00
Christos Nasikas 3acbbcd2b0
Return incident's url (#60617) 2020-03-19 23:23:37 +02:00
Eric Davis 347160b71a
[Endpoint] TEST: GET alert details - boundary test for first alert retrieval (#60320)
* boundary test for first alert retrieval

* boundary test for first alert retrieval cleaned up

* redo merge conflict resolving for api test

* redo merge conflict resolving for api test try 2

* updating to current dataset expectations

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-19 17:10:56 -04:00
Walter Rafelsberger b2b5fcedcc
[ML] Transforms: Fix pivot preview table mapping. (#60609)
- Fixes regression caused by elastic/elasticsearch#53572.
- Adjusts the TS mappings and code to reflect the newly returned API response.
- Re-enables functional tests.
2020-03-19 22:02:16 +01:00
marshallmain 404e941e63
[Endpoint] Log random seed for sample data CLI to console (#60646)
* log random seed to console

* fix off by 1 error with children
2020-03-19 17:01:39 -04:00
kqualters-elastic cd2d54d59a
Use common event model for determining if event is v0 or v1 (#60667) 2020-03-19 16:14:45 -04:00
Tyler Smalley f47022a41d Disables PR Project Assigner workflow
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2020-03-19 13:05:01 -07:00
Tim Sullivan ce2e3fd621
[Reporting] Allow reports to be deleted in Management > Kibana > Reporting (#60077)
* [Reporting] Feature Delete Button in Job Listing

* refactor listing buttons

* multi-delete

* confirm modal

* remove unused

* fix test

* mock the id generator for snapshotting

* simplify

* add search bar above table

* fix types errors
2020-03-19 12:36:19 -07:00
Dario Gieselaar 915b784cd6
Use static initializer in ValidatedDualRange for storybook com… (#60601)
Closes #60356.
2020-03-19 20:29:13 +01:00
Zacqary Adam Xeper 431b06fee0
[Metrics Alerts] Add functional and unit tests (#60442)
* Add tests for metric threshold alerts

* Fix count aggregator

* Remove redundant typedefs

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-19 14:12:01 -05:00
Alex Holmansky 020e4d0f03
Switch back to a dedicated workflow token (#60673) 2020-03-19 15:07:29 -04:00
Paul Tavares 58b7e20795
Refactor to use new top-level PackageIcon component (#60628)
- removes PackageIcon from EPM section
- refactors code to use new top-level `PackageIcon` component
2020-03-19 14:38:12 -04:00
Melissa Alvarez f5355a9ee8
[ML] Data Visualizer: Replace KqlFilterBar with QueryStringInput (#60544)
* data visualizer:replace kqlFilterBar

* remove unused translation

* show syntax error toast
2020-03-19 14:35:04 -04:00
Mike Côté bafd45fff2
Fix race condition in flaky alerting test (#60438)
* Fix race condition in flaky test

* Fix flakiness in test

* Fix more flakiness
2020-03-19 13:20:48 -04:00
Catherine Liu 3bd3364a55
[Canvas] Add Lens embeddables (#57499)
* Added lens embeddables to embed flyout

Fixed import

embedded panel styles (#58654)

Merging to WIP draft branch

* Added i18n strings for savedLens

* Added tests for lens embeddables

* Updated tests

* Updated tests

* Added style overrides for lens table

* DDisables triggers on lens emebeddable

* Updated test

* Sets embeddable view mode according to app state

* Fix embeddable component

* Removed embeddable view mode logic

* Removed unused import
2020-03-19 09:58:22 -07:00
Justin Kambic fcf439625b
[Uptime] Add Alerting UI (#57919)
* WIP trying things.

Add new alert type for Uptime.

Add defensive checks to alert executor.

Move status check code to dedicated adapter function.

Clean up code.

* Port adapter function to dedicated file.

* WIP.

* Working on parameter selection.

* Selector expressions working.

* Working on actions.

* Change anchor prop for popovers.

* Reference migrated alerting plugin.

* Clean up code for draft.

* Add button to expose flyout. Clean up some client code.

* Add test for requests function, add support for filters.

* Reorganize and clean up files.

* Add location and filter support to monitor status request function.

* Add tests for monitor status request function.

* Specify default action group id in alert registration.

* Extract repeated string value to a constant.

* Move test file to server in NP plugin.

* Update imports after NP migration.

* Fix UI bug that caused incorrect location selections in alert creation.

* Change alert expression language to clarify meaning.

* Add ability for user to select timerange units.

* Add code that fixes active item highlighting.

* Add better default value for active index selection.

* Introduce dedicated field number component.

* Add message to status check alert.

* Add tests for context message.

* Formalize alert action group definitions.

* Extract monitor id squashing from context message generator.

* Write test for monitor ID uniqueness function.

* Add alert state creator function and tests.

* Update action group id value.

* Add tests for alert factory and executor function.

* Rename alert context props to be more domain-specific.

* Clean up unnecessary type markup.

* Clean up alert ui controls file.

* Better organize new registration code.

* Simplify some logic code.

* Clean up bootstrap code.

* Add unit tests for alert type.

* Delete temporary test code from triggers_actions_ui.

* Rename a test file.

* Add some comments to annotate a file.

* Add io-ts type checking to alert create validation and alert executor.

* Add translation of plaintext content string.

* Further simplify monitor status alert validation.

* Add io-ts type checking to alert params.

* Update a comment.

* Prefer inline snapshots to more error-prone assertions.

* Clean up and comment request function.

* Rename a symbol.

* Fix broken types in reducer file and add a test.

* Fix a validation logic error and add tests.

* Delete unused import.

* Delete obsolete dependency.

* Fix function call to have correct parameters.

* Fixing some import weirdness.

* Reintroduce accidentally-deleted code.

* Delete unneeded require from legacy entry file.

* Remove unneeded connected component.

* Update flyout controls for new interface and delete connected components.

* Remove unneeded require from app index file.

* Introduce data-test-subj attributes to various components to assist with functional tests.

* Introduce functional test helpers for alert flyout.

* Add functional test arch and a test for alerting UI to ES SSL test suite.

* Add explicit exports to module index.

* Reorganize file to keep interfaces closer to their implementations.

* Move create alert button to better position.

* Clean up a file.

* Update a functional test attribute, clean up a file, rename a selector, add tests.

* Add a comment.

* Make better default alert message, translate messages, add/update tests.

* Fix broken type.

* Update obsolete snapshot.

* Introduce mock provider to tests and update snapshots.

* Reduce a strange type to `any`.

* Add alert flyout button connected component.

* Add alert flyout wrapper connected component.

* Create connected component for alert monitor status alert.

* Clean up index files.

* Update i18nrc file to cover translation in server plugin code.

* Fix broken imports.

* Update test snapshots.

* Prefer more descriptive type.

* Prefer more descriptive type.

* Prefer built-in React propType to custom.

* Prefer simpler validation.

* Add whitespace to clean up file.

* Extract function and write tests.

* Simplify validation function.

* Add navigate to alerting button.

* Move context item inside the items list.

* Clean up alert creation component.

* Update type check parsing and error messaging, and update snapshot/test assertions.

* Update broken snapshot.

* Update README for running functional tests.

* Update functional test service to reflect improved UX.

* Fix broken type that resulted from a mistake during a merge resolution.

* Add spacer between alert title and kuery bar.

* Update the id and name of our alert type because it was never changed from placeholder value.

* Rename alert keys.

* Fix broken unit tests.

* Add aria-labels to alert UI.

* Implement design feedback.

* Fix broken test snapshots.

* Add missing props to unit tests to staisfy updated types.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-19 12:50:05 -04:00
James Gowdy a0730f7951
[ML] Fixing file data visualizer override arguments (#60627) 2020-03-19 16:42:53 +00:00
Jean-Louis Leysens 304b322a47
[Console] Refactor and cleanup of public and server (#60513)
* Clean up use of ace in autocomplete in public

Remove ace from lib/autocomplete.ts and set up hooking up of ace
in legacy_core_editor. Also remove use of ace mocks in tests.

* Added TODO in lib/kb (console public)

* Server-side cleanup

Refactored the loading of spec into a new SpecDefinitionsService.
In this way, state can be contained inside of the service as much
as possible. Also converted all JS spec to TS and updated the
Console plugin contract so that processors (which alter loaded
spec) happen at plugin "start" phase.

* Fix types

* Small refactor

- Updated naming of argument variable in registerAutocompleter
- Refactored the SpecDefinitionsService to handle binding of
it's own functions
2020-03-19 17:32:39 +01:00
Steph Milovic d5ed93ee63
[SIEM] [Cases] Case closed and add user email (#60463) 2020-03-19 10:27:41 -06:00
Alejandro Fernández fe4c164681
[Logs UI] Use the Super date picker in the log stream (#54280) 2020-03-19 17:19:21 +01:00
Dima Arnautov 7aa4651292
[ML] Use a new ML endpoint to estimate a model memory (#60376)
* [ML] refactor calculate_model_memory_limit route, use estimateModelMemory endpoint

* [ML] refactor validate_model_memory_limit, migrate tests to jest

* [ML] fix typing issue

* [ML] start estimateModelMemory url with /

* [ML] fix typo, filter mlcategory

* [ML] extract getCardinalities function

* [ML] fields_service.ts

* [ML] wip getMaxBucketCardinality

* [ML] refactor and comments

* [ML] fix aggs keys with special characters, fix integration tests

* [ML] use pre-defined job types

* [ML] fallback to 0 in case max bucket cardinality receives null

* [ML] calculateModelMemoryLimit on influencers change

* [ML] fix maxModelMemoryLimit

* [ML] cap aggregation to max 1000 buckets

* [ML] rename intervalDuration
2020-03-19 16:45:40 +01:00
Felix Stürmer ae0e35041e
[Logs UI] Correctly update the expanded log rate table rows (#60306)
This ensures that the content of the expanded rows in the log rate table reflect the most recent results.

Fixes #60300
2020-03-19 16:42:58 +01:00
MadameSheema b0a6b302ad
fixes drag and drop flakiness (#60625) 2020-03-19 16:32:19 +01:00
Maja Grubic 73a8548d3b
Removing isEmptyState from embeddable input (#60511) 2020-03-19 14:51:17 +00:00
Jean-Louis Leysens 254cf99339
[Cross Cluster Replication] NP Shim (#60121)
* Public in WiP state, removed all 'ui/' imports

* First iteration of public shimmed and working

* A whole lotta WIP server side

* Server-side to using the NP router + client side changes

Updated the client code to properly encode requests to the
server. Did first E2E test.

Route tests are probably broken, need to fix them.

* Removed unused error wrapping code

* Update client Jest tests

* Add breadcrumbs service mock

* Fix server side Jest tests

* Add helper functions file for server side Jest tests

* Fix API integration tests

* Fixed boolean logic mistake in due to refactor in index mgmt ext.

Also migrated to the a more NP friendly version of index mgmt
extension.

* Remove unused import

* Clean up some cruft and refactor URL variable names

* Fix stringification of body and fix boolean server logic

* Fix mocha

Folder called __tests__ with Jest tests was breaking mocha.

* Refactor to Jest test

* Fix types issues in jest test

* Migrate to new config-schema API

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-19 15:42:25 +01:00
Mike Côté 05a0625048
Clear changes when canceling an edit to an alert (#60518)
* Clear alerting edit flyout after canceling an edit

* Add functional test

* Fix merge conflicts
2020-03-19 10:40:22 -04:00
Alex Holmansky 80a84070e4
Update workflow syntax (#60626)
* Updated workflow syntax
2020-03-19 10:17:47 -04:00
Alex Holmansky eaf3deabea
Updating project assigner workflows to v2.0.0 of the action and back to default tokens (#60577)
* Updating workflows to v2.0.0 of the action and back to the default token
2020-03-19 09:30:40 -04:00
Pierre Gayvallet 395d621249
migrate saved objects management edition view to react/typescript/eui (#59490)
* migrate so management edition view to react

* fix bundle name + add forgotten data-test-subj

* add FTR tests for edition page

* EUIfy react components

* wrap form with EuiPanel + caps btns labels

* Wrapping whole view in page content panel and removing legacy classes

* improve delete confirmation modal

* update translations

* improve delete popin

* add unit test on view components

* remove kui classes & address comments

* extract createFieldList and add tests

* disable form submit during submition

Co-authored-by: cchaos <caroline.horn@elastic.co>
2020-03-19 14:09:44 +01:00
Christos Nasikas 6ed2918b6c
[SIEM][CASE] Configuration page action bar (#60608)
* Add bottom bar

* Add listeners
2020-03-19 15:06:33 +02:00
Alison Goryachev ee6bb64f13
[Remote clusters] Update copy (#60382) 2020-03-19 08:23:20 -04:00
Mike Côté 4efeeac560
Sort by name when fetching alerts and connectors (#60506)
* Sort by name when fetching alerts and connectors

* Fix jest tests

* Add functional test

* Fix failing jest test
2020-03-19 08:06:51 -04:00
Mike Côté 27045e0942
Make slack param validation handle empty messages (#60468) 2020-03-19 08:02:07 -04:00
Gidi Meir Morris 8fd317c55a
[Alerting] Adds navigation by consumer and alert type to alerting (#58997)
Adds Navigation APIs to Alerting.

Parts to this PR:

Adds a client side (Public) plugin to Alerting, including two APIs: registerNavigation & registerDefaultNavigation. These allow a plugin to register navigation handlers for any alerts which it is the consumer of- one for specific AlertTypes and one for a default handler for all AlertTypes created by the plugin.
The Alert Details page now uses these navigation handlers for the View In App button. If there's an AlertType specific handler it uses that, otherwise it uses a default one and if the consumer has not registered a handler - it remains disabled.
A generic Alerting Example plugin that demonstrates usage of these APIs including two AlertTypes - one that always fires, and another that checks how many people are in Outer Space and allows you to trigger based on that. 😉 To enable the plugin run yarn start --ssl --run-examples
2020-03-19 09:49:05 +00:00
Liza Katz 2eda06e770
Introduce search interceptor (#60523)
* Add async search strategy

* Add async search

* Fix async strategy and add tests

* Move types to separate file

* Revert changes to demo search

* Update demo search strategy to use async

* Add async es search strategy

* Return response as rawResponse

* Poll after initial request

* Add cancellation to search strategies

* Add tests

* Simplify async search strategy

* Move loadingCount to search strategy

* Update abort controller library

* Bootstrap

* Abort when the request is aborted

* Add utility and update value suggestions route

* Fix bad merge conflict

* Update tests

* Move to data_enhanced plugin

* Remove bad merge

* Revert switching abort controller libraries

* Revert package.json in lib

* Move to previous abort controller

* Add support for frozen indices

* Fix test to use fake timers to run debounced handlers

* Revert changes to example plugin

* Fix loading bar not going away when cancelling

* Call getSearchStrategy instead of passing  directly

* Add async demo search strategy

* Fix error with setting state

* Update how aborting works

* Fix type checks

* Add test for loading count

* Attempt to fix broken example test

* Revert changes to test

* Fix test

* Update name to camelCase

* Fix failing test

* Don't require data_enhanced in example plugin

* Actually send DELETE request

* Use waitForCompletion parameter

* Use default search params

* Add support for rollups

* Only make changes needed for frozen indices/rollups

* Only make changes needed for frozen indices/rollups

* Add back in async functionality

* Fix tests/types

* Fix issue with sending empty body in GET

* Don't include skipped in loaded/total

* Don't wait before polling the next time

* Add search interceptor for bulk managing searches

* Simplify search logic

* Fix merge error

* Review feedback

* Add service for running beyond timeout

* Refactor abort utils

* Remove unneeded changes

* Add tests

* cleanup mocks

* Update src/legacy/core_plugins/kibana/public/dashboard/np_ready/dashboard_app.html

Co-Authored-By: Lukas Olson <olson.lukas@gmail.com>

Co-authored-by: Lukas Olson <olson.lukas@gmail.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-19 10:28:43 +02:00
Robert Oskamp 836b3d00ef
[ML] Add functional tests for file data visualizer (#60413)
This PR adds basic functional tests for the file data visualizer, covering a file import and error messages for non-log files. It also moves the file input path handling to a common location in order to avoid code duplication.
2020-03-19 09:08:43 +01:00
Dario Gieselaar 9cd0a36740
[APM] Optimize service map query (#60412)
* [APM] Optimize service map query

Closes #60411.

- Chunk trace lookup
- Remove pagination, move dedupe logic to server

* Fix imports

* Fix imports again

Co-authored-by: Nathan L Smith <smith@nlsmith.com>
2020-03-19 08:37:58 +01:00
Frank Hassanabad 01571b6739
[SIEM][Detection Engine] Adds lists feature flag and list values to the REST interfaces
## Summary

* https://github.com/elastic/kibana/issues/60022
* Adds the feature flag for simple list values
* Adds the boolean filters of "and", "and not" to further filter based on simple values
* Adds unit tests and e2e tests for the values.
* Most tests can include the simple list values but some have to be skipped until we move those to more functions or just enable simple list values as a permanent feature. 
* DOES NOT FILTER ON THE VALUES JUST YET (That will be a follow on PR)

## Testing:

To turn on/off the feature flag do this with an env variable (set this in your .bashrc/.zshrc):

```ts
export ELASTIC_XPACK_SIEM_LISTS_FEATURE=true
```

Expect to see this error in the console when the environment variable is set:

```ts
server    log   [11:41:16.245] [error][plugins][siem] You have activated the lists feature flag which is NOT currently supported for SIEM! You should turn this feature flag off immediately by un-setting the environment variable: ELASTIC_XPACK_SIEM_LISTS_FEATURE and restarting Kibana
```

Expect create and update to work when the environment variable is set and look like this:

```ts
./update_rule.sh ./rules/updates/update_list.json 
{
  "created_at": "2020-03-15T17:42:37.074Z",
  "updated_at": "2020-03-15T17:54:22.427Z",
  "created_by": "yo",
  "description": "Query with a list",
  "enabled": true,
  "false_positives": [],
  "from": "now-6m",
  "id": "c602e3f6-713b-4f43-9bdd-b60fbfead1c5",
  "immutable": false,
  "interval": "5m",
  "rule_id": "query-with-list",
  "language": "kuery",
  "output_index": ".siem-signals-hassanabad-frank-default",
  "max_signals": 100,
  "risk_score": 1,
  "name": "Query with a list",
  "query": "user.name: root or user.name: admin",
  "references": [],
  "severity": "high",
  "updated_by": "yo",
  "tags": [],
  "to": "now",
  "type": "query",
  "threat": [],
  "version": 6,
  "lists": [
    {
      "field": "source.ip",
      "boolean_operator": "and",
      "values": [
        {
          "name": "127.0.0.1",
          "type": "value"
        }
      ]
    },
    {
      "field": "host.name",
      "boolean_operator": "and not",
      "values": [
        {
          "name": "rock01",
          "type": "value"
        }
      ]
    }
  ],
  "status": "succeeded",
  "status_date": "2020-03-15T17:42:40.718Z",
  "last_success_at": "2020-03-15T17:42:40.718Z",
  "last_success_message": "succeeded"
}
```

```ts
./post_rule.sh ./rules/queries/query_with_list.json 
{
  "created_at": "2020-03-15T17:42:37.074Z",
  "updated_at": "2020-03-15T17:42:37.116Z",
  "created_by": "yo",
  "description": "Query with a list",
  "enabled": true,
  "false_positives": [],
  "from": "now-6m",
  "id": "c602e3f6-713b-4f43-9bdd-b60fbfead1c5",
  "immutable": false,
  "interval": "5m",
  "rule_id": "query-with-list",
  "language": "kuery",
  "output_index": ".siem-signals-hassanabad-frank-default",
  "max_signals": 100,
  "risk_score": 1,
  "name": "Query with a list",
  "query": "user.name: root or user.name: admin",
  "references": [],
  "severity": "high",
  "updated_by": "yo",
  "tags": [],
  "to": "now",
  "type": "query",
  "threat": [],
  "version": 1,
  "lists": [
    {
      "field": "source.ip",
      "boolean_operator": "and",
      "values": [
        {
          "name": "127.0.0.1",
          "type": "value"
        }
      ]
    },
    {
      "field": "host.name",
      "boolean_operator": "and not",
      "values": [
        {
          "name": "rock01",
          "type": "value"
        },
        {
          "name": "mothra",
          "type": "value"
        }
      ]
    }
  ]
}
```

```ts
./patch_rule.sh ./rules/patches/update_list.json   
{
  "created_at": "2020-03-15T18:02:52.434Z",
  "updated_at": "2020-03-15T18:02:57.675Z",
  "created_by": "yo",
  "description": "Query with a list",
  "enabled": true,
  "false_positives": [],
  "from": "now-6m",
  "id": "40b7c2fb-83b4-4820-bf7c-056f3a631126",
  "immutable": false,
  "interval": "5m",
  "rule_id": "query-with-list",
  "language": "kuery",
  "output_index": ".siem-signals-hassanabad-frank-default",
  "max_signals": 100,
  "risk_score": 1,
  "name": "Query with a list",
  "query": "user.name: root or user.name: admin",
  "references": [],
  "severity": "high",
  "updated_by": "yo",
  "tags": [],
  "to": "now",
  "type": "query",
  "threat": [],
  "version": 1,
  "lists": [
    {
      "field": "source.ip",
      "boolean_operator": "and",
      "values": [
        {
          "name": "127.0.0.1",
          "type": "value"
        }
      ]
    },
    {
      "field": "host.name",
      "boolean_operator": "and not",
      "values": [
        {
          "name": "rock01",
          "type": "value"
        },
        {
          "name": "mothra",
          "type": "value"
        }
      ]
    }
  ],
  "status": "succeeded",
  "status_date": "2020-03-15T18:02:56.426Z",
  "last_success_at": "2020-03-15T18:02:56.426Z",
  "last_success_message": "succeeded"
}
```

```ts
./get_rule_by_rule_id.sh query-with-list
{
  "created_at": "2020-03-15T18:10:07.657Z",
  "updated_at": "2020-03-15T18:10:08.479Z",
  "created_by": "yo",
  "description": "Query with a list",
  "enabled": true,
  "false_positives": [],
  "from": "now-6m",
  "id": "9854162b-003c-47be-af59-8c3c9545aafa",
  "immutable": false,
  "interval": "5m",
  "rule_id": "query-with-list",
  "language": "kuery",
  "output_index": ".siem-signals-hassanabad-frank-default",
  "max_signals": 100,
  "risk_score": 1,
  "name": "Query with a list",
  "query": "user.name: root or user.name: admin",
  "references": [],
  "severity": "high",
  "updated_by": "yo",
  "tags": [],
  "to": "now",
  "type": "query",
  "threat": [],
  "version": 1,
  "lists": [
    {
      "field": "source.ip",
      "boolean_operator": "and",
      "values": [
        {
          "name": "127.0.0.1",
          "type": "value"
        }
      ]
    },
    {
      "field": "host.name",
      "boolean_operator": "and not",
      "values": [
        {
          "name": "rock01",
          "type": "value"
        },
        {
          "name": "mothra",
          "type": "value"
        }
      ]
    }
  ],
  "status": "going to run",
  "status_date": "2020-03-15T18:10:10.738Z"
}
```

Expect these errors when the environment variable is not set:

```ts
./post_rule.sh ./rules/queries/query_with_list.json 
{
  "statusCode": 400,
  "error": "Bad Request",
  "message": "[request body]: child \"lists\" fails because [\"lists\" is not allowed]"
}
```

```ts
./update_rule.sh ./rules/queries/query_with_list.json
{
  "statusCode": 400,
  "error": "Bad Request",
  "message": "[request body]: child \"lists\" fails because [\"lists\" is not allowed]"
}
```

```ts
./patch_rule.sh ./rules/patches/update_list.json
{
  "statusCode": 400,
  "error": "Bad Request",
  "message": "[request body]: child \"lists\" fails because [\"lists\" is not allowed]"
}
```

Expect that this is _backwards_ compatible with the feature flag but not necessarily _forwards_ compatible. This means:

* You can have older data that never had lists and it will show up as an empty list when you query it. (backwards compatible)
* You _might_ have lists and remove the env. variable and get back items as if the list was not there for (forwards compatible) 

* You can export without lists, flip on the env flag and import with newer lists feature (backwards compatible)
* You can export lists and it will _not_ work with an older system (not forwards compatible)

### Checklist

Delete any items that are not applicable to this PR.

- [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
2020-03-18 23:57:36 -06:00
Maggie Ghamry cf08850489
Enhancement/update esdocs datasource (#59512)
* Initial Commit

Update to ESDocs datasource per team feedback

* Updates

Updates per Ryan's mockups

* Updates II

Updates per Poff's review

* Updates III

Update to some of the verbiage and card sizes - working on re-ordering and adding a link to the lucen query syntax

* design tweaks

* Adding lucene hyperlink

update to add hyperlink help for Lucene query syntax

* Consollidating datasources to sort

Consolidating the ESDocs datasource with the rest, so that we can order them

* updates for i18n

updates for i18n

* Updates

Updates from Gail for verbiage and integrating Ryan's change for style

* Update ui.ts

Updates for i18n

* Updates for datasource order

moving the esdocs datasource to live with the rest of the UI datasources, and sorting them accordingly.

* Update datasource_component.js

removing console log, whoops

* Update ui.ts

Update to fix i18n essql issue

* Update ui.ts

Updates to fix i18n references for the esdocs datasource move

* Update to Timelion URL

I noticed that the Timelion datasource showed "Lucene query syntax" which wasn't relevant, so I updated it to "Timelion", along with a tutorial, as the link for current Timelion docs does not provide any syntax tutorial.

* Update ui.ts

update for i18n

* Update ui.ts

update for i18n

* Update ui.ts

Update to removed unused value - the i18n check gave me latent errors, sorry for the repost

* i18n updates

Updating nomenclature to get past i18n errors

* Updates

Code review updates to remove extraneous code

* Update timelion.js

update to remove extraneous comment per code review

* More i18n updates

translation updates to accommodate the esdocs datasource move

* Update datasource_component.js

Update to toggle datasource icon in selected element mode

* Update ui.ts

hopefully last i18n fix

Co-authored-by: Ryan Keairns <contactryank@gmail.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-18 21:36:21 -04:00
Spencer 18f973ea61
[junit] only include stdout in report for failures (#60530)
* [junit] only include stdout in report for failures

* fix assertion

Co-authored-by: spalger <spalger@users.noreply.github.com>
2020-03-18 17:49:40 -07:00