Commit graph

7596 commits

Author SHA1 Message Date
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
renovate[bot] b9d2affc73
Update dependency nock to v12 (#60422)
* Update dependency nock to v12

* update yarn.lock file

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-18 17:48:42 -07:00
Spencer cc8f7c43dd
upgrade execa to get stdout/stderr in error messages (#60537)
* upgrade execa to get stdout/stderr in error messages

* rebuild kbn/pm

Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-18 17:45:04 -07:00
spalger 650943df79 skip flaky suite (#60471) 2020-03-18 17:42:01 -07:00
Paul Tavares 8c5071939b
[Ingest] Agent Config Details - Data sources list ui (#60429)
* refactor `use_details_uri` hook and introduce `useAgentConfigLink`
* Refactor structure for datasources view
* Sync up table columns
* Added row actions to Datasources list
* Datasources table filters
* Support deleting datasource action
* Added PackageIcon to datasources list
2020-03-18 20:28:34 -04:00
Ryland Herrick a05a61286f
[SIEM] Create ML Rules (#58053)
* Remove unnecessary linter exceptions

Not sure what was causing issues here, but it's gone now.

* WIP: Simple form to test creation of ML rules

This will be integrated into the regular rule creation workflow, but for
now this simple form should allow us to exercise the full ML rule
workflow.

* WIP: Adds POST to backend, and type/payload changes necessary to make that work

* Simplify logic with Math.min

* WIP: Failed spike of making an http call

* WIP: Hacking together an ML client

The rest of this is going to be easier if I have actual data. For now
this is mostly copy/pasted and simplified ML code. I've hardcoded time
ranges to a period I know has data for a particular job.

* Threading through our new ML Rule params

It's a bummer that we normalize our rule alert params across all rule
types currently, but that's the deal.

* Retrieve our anomalies during rule execution

Next step: generate signals

* WIP: Generate ECS-compatible ML Signals

This uses as much of the existing signal-creation code as possible. I
skipped the search_after stuff for now because it would require us
recreating the anomalies query which we really shouldn't own. For now,
here's how it works:

* Adds a separate branch of the rule executor for machine_learning rules
* In that branch, we call our new bulkCreateMlSignal function
  * This function first transforms the anomaly document into ECS fields
  * We then pass the transformed documents to singleBulkCreate, which
  does the rest
* After both branches, we update the rule's status appropriately.

We need to do some more work on the anomaly transformation, but this
works!

* Extract setting of rule failure to helper function

We were doing this identically in three places.

* Remove unused import

* Define a field for our Rule Type selection

This adds most of the markup and logic to allow an ML rule type to be
selected. We still need to add things like license-checking and
showing/hiding of fields based on type.

* Hide Query Fields when ML is selected

These are still getting set on the form. We'll need to filter these
fields before we send off the data, and not show them on the readonly
display either.

ALso, edit is majorly broken.

* Add input field for anomaly threshold

* Display numberic values in the readonly view of a step

TIL that isEmpty returns false for numbers and other non-iterable
values. I don't think it's exactly what we want here, but until I figure
out the intention this gets our anomalyThreshold showing up without a
separate logic branch here. Removes the unnecessary branch that was
redundant with the 'else' clause.

* Add field for selecting an ML job

This is not the same as the mockups and lacks some functionality, but
it'll allow us to select a job for now.

* Format our new ML Fields when sending them to the server

So that we don't get rejected due to snake case vs camelcase.

* Put back code that respects a rule's schedule

It was previously hardcoded to a time period I knew had anomalies.

* ML fields are optional in our creation step

In that we don't initialize them like we do the query (default) fields.

* Only send along type-specific Rule fields from form

This makes any query- or ML-specific fields optional on a Rule, and
performs some logic on the frontend to group and include these fieldsets
conditionally based on the user's selection. The one place we don't
handle this well is on the readonly view of a completed step in the
rules creation, but we'll address that.

* Rename anomalies query

It's no longer tabular data. If we need that, we can use the ML client.

* Remove spike page with simple form

* Remove unneeded ES option

This response isn't going to HTTP, which is where this option would
matter.

* Fix bulk create logic

I made a happy accident and flipped the logic here, which meant we
weren't capping the signals we created.

* Rename argument

Value is a little more ambiguous than data, here: this is our step data.

* Create Rule form stores all values, but filters by type for use

When sending off to the backend, or displaying on the readonly view, we
inspect which rule type we've currently selected, and filter our form
values appropriately.

* Fix editing of ML fields on Rule Create

We need to inherit the field value from our form on initial render, and
everything works as expected.

* Clear form errors when switching between rule types

Validation errors prevent us from moving to the next step, so it was
previously possible to get an error for Query fields, switch to an ML
rule, and be unable to continue because the form had Query errors.

This also adds a helper for checking whether a ruleType is ML, to
prevent having to change all these references if the type string
changes.

* Validate the selection of an ML Job

* Fix type errors on frontend

According to the types, this is essentially the opposite of formatRule,
so we need to reinflate all potential form values from the rule.

* Don't set defaults for query-specific rules

For ML rules these types should not be included.

* Return ML Fields in Rule responses

This adds these fields to our rule serialization, and then adds
conditional validation around those fields if the rule type is ML.
Conversely, we moved the 'language' and 'query' fields to be
conditionally validated if the rule is a query/saved_query rule.

* Fix editing of ML rules by changing who controls the field values

The source of truth for their state is the parent form object; these
inputs should not have local state.

* Fix type errors related to new ML fields

In adding the new ML fields, some other fields (e.g. `query` and
`index`) that were previously required but implicitly part of Query
Rules are now marked as optional.

Consequently, any downstream code that actually required these fields
started to complain. In general, the fix was to verify that those fields
exist, and throw an error otherwise as to appease the linter.

Runtime-wise, the new ML rules/signals follow a separate code path and
both branches should be unaffected by these changes; the issue is simply
that our conditional types don't work well with Typescript.

* Fix failing route tests

Error message changed.

* Fix integration tests

We were not sending required properties when creating a rule(index and
language).

* Fix non-ML Rule creation

I was accidentally dropping this parameter for our POST payload. Whoops.

* More informative logging during ML signal generation

The messaging diverged from the normal path here because we don't have
index patterns to display. However, we have the rest of the rule
context, and should report it appropriately.

* Prefer keyof for string union types

* Tidy up our new form components

* Type them as React.FCs
* Remove unnecessary use of styled-components

* Prefer destructuring to lodash's omit

* Fix mock params for helper functions

These were updated to take simpler parameters.

* Remove any type

This could have been a boolean all along, whoops

* Fix mock types

* Update outdated tests

These were added on master, but behavior has been changed on my branch.

* Add some tests around our helper function

I need to refactor it, so this is as good a time as any to pin down the
behavior.

* Remove uses of any in favor of actual types

Mainly leverages ML typings instead of our placeholder types. This
required handling a null case in our formatting of anomalies.

* Annotate our anomalies with @timestamp field

We were notably lacking this ECS field in our post-conversion anomalies,
and typescript was rightly complaining about it.

* ml_job_id -> machine_learning_job_id

* PR Feedback

* Stricter threshold type
* More robust date parsing
* More informative log/error messages
* Remove redundant runtime checks

* Cleaning up our new ML types

* Fix types on our Rest types
* Use less ambiguous machineLearningJobId over mlJobId
* Declare our ML params as required keys, and ensure we pass them around
everywhere we might need them (creating, importing, updating rules).

* Use implicit type to avoid the need for a ts-ignore

FormSchema has a very generic index signature such that our
filterRuleFieldsForType helper cannot infer that it has our necessary
rule fields (when in fact it does). By removing the FormSchema hint we
get the actual keys of our schema, and things work as expected.

All other uses of schema continue to work because they're expecting
FormSchema, which is effectively { [key: string]: any }.

* New ML params are not nullable

Rather than setting a null and then never using it, let's just make it
truly optional in terms of default values.

* Query and language are conditional based on rule type

For ML Rules, we don't use them.

* Remove defaulted parameter in API test

We don't need to specify this, and we should continue not to for
backwards compatibility.

* Use explicit types over implicit ones

The concern is that not typing our schemae as FormSchema could break our
form if there are upstream changes. For now, we simply use the
intersection of FormSchema and our generic parameter to satisfy our use
within the function.

* Add integration test for creation of ML Rule

* Add ML fields to route schemae

* threshold and job id are conditional on type
* makes query and language mutually exclusive with above

* Fix router test for creating an ML rule

We were sending invalid parameters.

* Remove null check against index for query rules

We support not having an index here, as getInputIndex will return the
current UI setting if none is specified.

* Add regression test for API compatibility

We were previously able to create a rule without an input index; we
should continue to support that, as verified by this test!

* Respect the index pattern determined at runtime when performing search_after

If a rule does not specify an input index pattern on creation, we use
the current UI default when the rule is evaluated. This ensures that any
subsequent searches use that same index.

We're not currently persisting that runtime index to the generated
signal, but we should.

* Fix type errors in our bulk create tests

We added a new argument, but didn't update the tests.
2020-03-18 19:26:42 -05:00
spalger 357ed0e10c skip flaky suite (#60559) 2020-03-18 17:13:34 -07:00
marshallmain cf1a330206
fix agent type (#60554)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-18 19:46:54 -04:00
Yuliia Naumenko 3600f5b90b
Fixed default message for index threshold includes both threshold values (#60545)
* Fixed default message for index threshold includes both threshold values even if not used

* fixed due to review comments

* Fixed validation errors with ability to clear input
2020-03-18 16:43:22 -07:00
Jen Huang 60d385ed89
[Ingest] Add support for yaml field types (#60440)
* Support yaml var type:
* Change stream config model to save type and value, instead of just value
* Add code editor for configuring yaml vars
* Adjust tests

* Account for empty yaml value

* Better account for invalid yaml parsing
2020-03-18 15:59:38 -07:00
Yuliia Naumenko 2d44870e06
Solved the issue for a GROUP BY expression validation (#60558)
* Solved the issue for a GROUP BY expression validation

* fixed labels
2020-03-18 14:29:40 -07:00
Thomas Neirynck a35267afd5
[Maps] Mark instance state as readonly (#60557) 2020-03-18 17:18:03 -04:00
CJ Cenizal 9aad8986e1
Move ui/indices into es_ui_shared plugin. (#60186)
* Convert js files to ts.
* Add indices namespace.
2020-03-18 13:07:41 -07:00
Christos Nasikas 24534e832e
ServiceNow action improvements (#60052)
* Apply action types to fields

* Add information to each field

* Do not create or update comments when actionType is set to nothing

* Improve helpers tests

* Improve tests

* Refactor: Use transformers and pipes

* Better types

* Refactor tests to new changes

* Better error messages

* Improve field formatting and display

* Improve integration tests

* Make username mandatory field

* Translate transformers

* Refactor schema

* Translate appendInformationToField helper

* Improve intergration tests

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-18 20:46:05 +02:00
Nicolas Chaulet 4e5aa93f45
[Fleet] Fix privileges for enrollment and access api keys (#60534) 2020-03-18 14:45:17 -04:00
Nathan Reese 7e085eabf5
[Maps] Blended layer that switches between documents and clusters (#57879)
* [Maps] Blended layer that switches between documents and clusters

* change layer type when scalingType changes

* getSource

* use cluster source when count exceeds value

* ensure doc source stays in editor

* start creating cluster style

* pass all parts of style descriptor

* get toggling between sources working

* derive cluster style from document style

* remove references to METRIC_TYPE

* fix import

* start typescripting blended_vector_layer

* more typescript work

* last of the TS errors

* add migration to convert useTopTerm to scalingType

* clean up

* remove MapSavedObject work since its in a seperate PR now

* fix EsSearchSource update editor jest test

* fix map_selector jest test

* move mutable state out of BlendedVectorLayer

* one more change for removing mutable BlendedVectorLayer state

* integrate newly merged MapSavedObjectAttributes type

* review feedback

* use data request for fetching feature count

* add functional test

* fix functional test

* review feedback

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-18 12:06:54 -06:00
Steph Milovic 4fc89aeb0d
[SIEM] [Cases] Shell scripts and unit tests (#60183) 2020-03-18 11:42:08 -06:00
Sandra Gonzales 4c9d95318e
change index pattern id to be the same as index pattern title (#60436) 2020-03-18 13:21:49 -04:00
kqualters-elastic 64af78045b
[Endpoint] resolver v1 events (#59233)
* Unifying the test index name for resolver and alerts

* Endpoint isn't sending the agent field so check for it

* Update resolver to use either legacy or ecs events

* Use correct format for child events api

* Adding string or array for category and type

* Add return types to process event models

* Create a common/models.ts for common event logic

* Decrease resolver min height

* Update types to match cli tool

* Add a smoke test for resolver rendering nodes, remove unused selector

* Add common/models/event

* Internationalize some strings, address pr comments

Co-authored-by: Jonathan Buttner <jonathan.buttner@elastic.co>
2020-03-18 13:18:35 -04:00
Dave Snider 52dd5e0f7a
Branding fixes for dashboard, loader and space selector (#60073) 2020-03-18 10:15:47 -07:00
spalger 696b19e67a skip flaky suite (#60535) 2020-03-18 10:09:58 -07:00
Frank Hassanabad 3e10276b20
[SIEM][Detection Engine] Fixes bug with timeline templates not working
### Summary

Fixes a bug with the timeline templates not working when specifying filters.

* Creates a type safe mechanism for getting StringArrays or regular strings
* AddsType Script function returns to functions in the helpers file
* Adds unit tests for the effected areas of code and corner cases

Before this fix you would get these toaster errors if you tried to use a template name such as `host.name` in the timeline filters:

<img width="677" alt="Screen Shot 2020-03-18 at 12 58 01 AM" src="https://user-images.githubusercontent.com/1151048/76934058-0bd2fc80-68b4-11ea-8dad-7c257bb81a1d.png">

After this fix it will work for you.

Testing:

1) Create a timeline template that has a host.name as both a query and a filter such as this. You can give the value of the host.name any value such as placeholder.

<img width="1125" alt="Screen Shot 2020-03-18 at 12 56 04 AM" src="https://user-images.githubusercontent.com/1151048/76934108-20af9000-68b4-11ea-8a11-4ba9c935506f.png">

2) Create a signal that uses it and produces a lot of signals off of something such as all host names
<img width="1054" alt="Screen Shot 2020-03-18 at 12 50 47 AM" src="https://user-images.githubusercontent.com/1151048/76934198-4f2d6b00-68b4-11ea-8ae3-6de76154cbb7.png">

3) Ensure you select your **Timeline template** you saved by using the drop down
<img width="1071" alt="Screen Shot 2020-03-18 at 12 51 21 AM" src="https://user-images.githubusercontent.com/1151048/76934281-73894780-68b4-11ea-9a2a-a0a9176f28ce.png">

4) Once your signals have run, go to the signals page and send one of the signals for your newly crated rule which has a host name to the timeline from "View in timeline"
<img width="568" alt="Screen Shot 2020-03-18 at 12 52 10 AM" src="https://user-images.githubusercontent.com/1151048/76934365-a4697c80-68b4-11ea-91a5-e0dea7e3e18f.png">

You should notice that your timeline has both the query and the filter set correctly such as this
<img width="1114" alt="Screen Shot 2020-03-18 at 12 56 23 AM" src="https://user-images.githubusercontent.com/1151048/76934432-c105b480-68b4-11ea-9a82-3e8a2da19376.png">


### Other notes

All the different fields you can choose from for templates are:
```
  'host.name',
  'host.hostname',
  'host.domain',
  'host.id',
  'host.ip',
  'client.ip',
  'destination.ip',
  'server.ip',
  'source.ip',
  'network.community_id',
  'user.name',
  'process.name',
```

And it should not work with anything outside of those. You should be able to mix and match them into different filters and queries to have a multiples of them.

### Checklist

- [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 11:00:44 -06:00
Yuliia Naumenko 18aa8245b7
Fixed errors which are happening if switch between alert types (#60453) 2020-03-18 09:48:10 -07:00
Sonja Krause-Harder f93ec7988b
[EPM] Add mapping field types to index template generation v2 (#60266)
* Add properties needed for index templates to Field

* Add data type handling to template generation

* Adjust tests

* Update fields test snapshots

* Remove duplicate fields from test file

* Add test cases

* Enhance processFields

* move expand stage to expandFields
* fix expandFields
* add deduplication stage dedupFields

* Use processField() to preprocess fields

* Remove alias fields with invalid path

* Remove obsolete code.

* Fix documentation.

* Add unit tests for getField()

* Don't fail on invalid input for now.

* Validate array fields.

* Guard against invalid input.
2020-03-18 17:14:45 +01:00
Oliver Gupte 6abb9d7d18
Closes #60265. Adds Beta badge to service map (#60482) 2020-03-18 08:19:50 -07:00
Robert Oskamp fb8175816f [ML] Disable functional transform tests 2020-03-18 15:31:14 +01:00
Nathan L Smith c8b2b05897
Fixes to service map single node banner (#60072)
* Fixes to service map single node banner

* Make the banner 95% width so it takes up the full width
* Check the actual count of cytoscape nodes to determine whether or not to show the banner
* Make the Cytoscape component able to take a function as children so we can access the cytoscape instance directly
* Update the .NET icon

* rework

* Update x-pack/legacy/plugins/apm/public/components/app/ServiceMap/EmptyBanner.tsx

Co-Authored-By: Oliver Gupte <ogupte@users.noreply.github.com>

Co-authored-by: Oliver Gupte <ogupte@users.noreply.github.com>
2020-03-18 09:23:03 -05:00
Shahzad 95a42ed2c9
[Uptime] replace fetch with kibana http (#59881)
* use kibana http

* unused import

* fix type

* update type

* refactor

* fix types

* fix type

* fix type
2020-03-18 14:43:30 +01:00
Thomas Watson 59a522b4ef
Upgrade @types/node to match Node.js runtime (#60368)
Kibana uses Node.js v10.19.0. The closest version of @types/node to this
version is currently v10.17.17.

This commit updates the resolutions field in package.json to ensure that
the latest version less than 10.20.0 is always used.
2020-03-18 14:27:56 +01:00
Sébastien Loix 2a8a7d7970
[License Management] NP migration (#60250) 2020-03-18 13:36:20 +01:00
Mike Côté a97ecaae69
Fix create alert button from not showing in alerts list (#60444) 2020-03-18 08:31:03 -04:00
Christos Nasikas 70c1b69eb0
[SIEM][Case] Update connector through flyout (#60307)
* Move add flyout to parent

* Disable mapping

* Show edit flyout

* Do not update connectors throught cases API

* Fix uncontrolled input error

* Disable edit button

* Add comments

* Change undefined to null

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-18 14:04:25 +02:00
Aleh Zasypkin 45f59f7d9e
Enforce required presence for value/key validation of recordOf and mapOf. (#60406) 2020-03-18 12:19:50 +01:00
James Gowdy fd16c46128
[ML] Re-enabling file upload telemetry (#60418)
* [ML] Re-enabling file upload telemetry

* small refactor

* removing exported function

* removing commented out code

* removing commented out include

* cleaning up types
2020-03-18 08:33:53 +00:00
Jean-Louis Leysens fae93176e2
[Console] Fix for _settings and x-pack autocomplete (#60246)
* Add settings completion to index create endpoint and clean up.

The cleanup is largely for moving settings data completion to JS
and removing the dynamic logic for loading different ES versions.

This is unused and unnecessary at this point.

* Add new settings JS files and move BOOLEAN to shared file.

* Important fix for loading x-pack console extensions.

After migrating the x-pack console extensions were being loaded
too late and were not being served to the client.

* Reorder imports to convention
2020-03-18 08:11:36 +01:00
Candace Park 65a111f189
Task/host enhancements (#59671)
functional tests and ui updates to endpoint host details
2020-03-17 23:31:41 -04:00
Lukas Olson ac5e323af8
[Search service] Asynchronous ES search strategy (#53538)
* 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

* Simplify search logic

* Fix merge error

* Review feedback

* Fix issue with hits.total

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-17 18:47:54 -07:00
Yuliia Naumenko 2207e0ab26
Index Action - Moved index params fields to connector config (#60349)
* Moved index params fields to connector config

* Fixed type check issue

* Fixing functional tests

* Fixed due to comments

* Fixed functional tests

* Fixed tests and type check
2020-03-17 18:20:00 -07:00
Lisa Cawley c1435db29f
Edits UI text for ML nodes and job button (#60184)
* Edits UI text for ML nodes and job button

* Update x-pack/plugins/ml/public/application/explorer/components/explorer_no_jobs_found/explorer_no_jobs_found.js

Co-Authored-By: Brandon Morelli <bmorelli25@gmail.com>

* Update x-pack/plugins/ml/public/application/explorer/components/explorer_no_jobs_found/explorer_no_jobs_found.js

Co-Authored-By: Brandon Morelli <bmorelli25@gmail.com>

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Brandon Morelli <bmorelli25@gmail.com>
2020-03-17 18:15:58 -07:00
Yuliia Naumenko 2e6c76fda7
Disabled edit alert button on management ui for non registered UI alert types (#60439) 2020-03-17 16:33:37 -07:00
Alison Goryachev 3e0b6fb65d
[IM] Use EuiCodeBlock to render index mapping (#60420) 2020-03-17 18:55:56 -04:00
Jen Huang f168b6abb8
Add additional safeguards for data source wizard step 2 (#60426)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-17 15:26:29 -07:00
Spencer 2367d749c1
upgrade react-use (#60427)
Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-17 15:24:59 -07:00
James Gowdy 9f31565b88
[ML] Fixing custom urls to dashboards (#60355)
* [ML] Fixing custom urls to dashboards

* missing file

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-17 19:25:01 +00:00
Nick Peihl 928454afa4
Update the ems-client dependency to 7.7.0 (#59936)
* Update the ems-client dependency

This PR adds the `appName` and `appVersion` parameters used by ems-client. The `appVersion` parameter replaces the now deprecated `kbnVersion` parameter in ems-client.

* Review feedback

* Fix borked merge

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-17 11:51:17 -07:00
Melissa Alvarez f875b7165e
do not update cell background if is label cell (#60308) 2020-03-17 13:41:46 -04:00
Rashmi Kulkarni 89f9260da2
FTR configurable test users (#52431)
* initial implementation of configurable test users

* user superuser by default to match master

* referenced the configs in reporting and api integration

* setting the minimum number of default roles

* looking for x-pack tests with users and roles

* add testUserService in dashboard mode tests

* running only ciGroup7

* uncommenting - addign visualization

* re-enabling all CI groups to run on CI

* reinstating Jenkinsfile

* disable Test user for OIDC config

* improved logging and added Roles for OSS tests to get better info on the runs.

* disable test_user for auth tests

* don't fetch enabledPlugins when testuser disabled

* fix es-lint

* running oss tests with x-pack enabled

* [revertme] build default dist for oss tests

* updating NOTICE.txt file as it complained in the kibana intake tests

* changed to pick OSS builds

* trying a license change to trial

* switch back to xpack builds

* created a new sample data role and used it in homepage tests

* revert test/scripts/jenkins_ci_group.sh

* only refresh browser and wait for chrome if we are already on Kibana page

* fix large_string test to use minimum set of roles and privileges

* fix for date nanos custom timestamp with a configured role

* changes to the files with addition of new roles for the test_user

* reverting to OSS changes and few additions to the time_zone test to run as a test_user

* changes to security

* changes to the x-pack test to use elastic superuser

* fix for chart_types test

* fixes to area chart , input control test

* fix for dashboard filtering test and a new config role

* changes to handle the x-pack tests

* additional role for date nanos mixed

* added the logstash role to the accessibility tests

* removed telemetry setting

* docs+few changes to the tests

* removed Page navigation

* removed pageNavigation which was unused

* test/accessibility/apps/management.ts

* update management.ts

* aria label, and other changes

* accidentally checked in a piped file with results.

* accidentally checked in a piped file with results.

* accidentally checked in a piped file with results.

* accidentally checked in a piped file with results.

* accidentally checked in a piped file with results.

* accidentally checked in a piped file with results.

* accidentally checked in a piped file with results.

* accidentally checked in a piped file with results.

* reverted

* unloading of logstash data, fixing aria label

* aria-label

* added the required role

* fix for tsvb chart

* fix for sample data test reverted home_page pageobject file

* changes to sample data test and visualize index file to incorporate OSS changes

* changes to describe() and some more changes to incorporate in settings_page

* re-adding the after()

* removed unwanted roles

* replaced kibana_user with kibana_admin

* added the check of deprecated kibana_user

* testing with kibana_admin  role

* fix for discover test

* incorporated the review comments

* incorporated the review comments

* incorporate review comments and added restoreDefaults()

* removed describe.only

* reverted the OSS logic change I had here- pulled into seperate PR

* incorporated the review comments

* incorporated review changes

* adding hidden=true to find hidden kibanaChrome

* change field.test.tsx to be same as that of master branch

Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-17 10:41:23 -07:00
Joel Griffith 6b7731bb74
[Reporting] Wholesale moves client to newest-platform (#58945)
* Move over to new plugin space, working implementation

* Fixing tests for report_listing snapshots

* WIP: Fixing react-component tests

* Fixing report_info_button tests

* Fixing download linksies

* WIP: Final working implementation

* Fixing attachAction API + API URLs

* Let the past die. Kill it if you have to. That’s the only way to become what you were meant to be.

* Fixing stream-client for new platform APIs

* Fixing types and tests

* Fix broken mock

* Adds back in warnings to report info button

* kibana.json line-breaks on required plugins

* Fixing broked snapshots

* Fix license checks in client-side components

* Adding back in warnings to report_listing component

* Fix danglig unused import

* Adds license checks for basic to our csv panel action

* Fixes issues from prior fork

* Move relative pathing to absolute

* Fix POST URL copying as we've moved from static methods

* Fix layoutId props

* Fixes types for layoutId

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-17 10:41:06 -07:00
Jen Huang 4da0cb3684
[Ingest] Support show_user package registry flag (#60338)
* Support registry `show_user` var definition property (elastic/package-registry#266)

* Add tests
2020-03-17 10:24:58 -07:00
MadameSheema 79b04547db
[SIEM] Adds 'Closes one signal when more than one opened signals are selected' test again (#60380)
* Revert "Revert "adds new test (#60064)""

This reverts commit 4a8fd0afee.

* waits for having 25 signals displayed
2020-03-17 18:14:02 +01:00
Yara Tercero cea277e7c2
[SIEM][Detections Engine] - Add rule markdown field to rule create, detail, and edit flows (#60108)
* add rule note markdown field to rule creation, rule details, and rule edit flows

Co-authored-by: Gloria Hornero <snootchie.boochies@gmail.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-17 13:06:12 -04:00
Nicolas Chaulet 156066dc6f
[Fleet] Add config revision to fleet agents (#60292) 2020-03-17 12:34:03 -04:00
Larry Gregory 9318862f19
Allow kbn-config-schema to ignore unknown keys (#59560)
* allow kbn-config-schema to ignore unknown keys

* Consolidate unknown key configuration

* updates following merge

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-17 12:30:17 -04:00
Robert Oskamp 6a70d21ef3 [ML] Functional tests - disable df analytics clone tests 2020-03-17 16:29:01 +01:00
spalger b71099d620 skip flaky suite (#58643) (#58991) 2020-03-17 08:13:32 -07:00
Xavier Mouligneau 0f9f81c30a
[SIEM] Fix link on overview page (#60348)
* Fix link on overview page

* no needs of useMemo

* clean up

* review I

* review II

* review III
2020-03-17 10:46:54 -04:00
spalger b9cc3e940c skip flaky test (#60369) 2020-03-17 07:39:04 -07:00
Davis Plumlee 53d23fcb3b
[Endpoint] Adds take action dropdown and tests to alert details flyout (#59242)
* adds dropdown

* changes i18n fields

* switches to buttons

* adds tests for alert details flyout

* updates es archiver data

* finishes functional and react tests

* cleanup tests for alerts

* updates alert esarchive data

* replaces es archives and fixes tests

* rebase

* fixes functional tests

* suggested changes to take action button

* addresses comments

Co-authored-by: oatkiller <robert.austin@elastic.co>
2020-03-17 10:34:39 -04:00
Wylie Conlon caed9ba5ac
[Lens] Simplify state management from visualization (#58279)
* [Lens] Declarative right panel

* Fix memoized operations

* Add error checking

* Fix dimension panel tests

* More updates

* Fix all editor frame tests

* Fix jest tests

* Fix bug with removing dimension

* Update tests

* Fix frame tests

* Fix all tests I could find

* Remove debugger

* Style config panels

* Update i18n

* Fix dashboard test

* Fix bug when switching index patterns
2020-03-17 09:57:52 -04:00
Jonathan Buttner 9c3c2a2372
Changing default type to start and allowing it to be configured by the event category (#60323) 2020-03-17 09:39:59 -04:00
Dima Arnautov dd680c790c
[ML] Adds the class_assignment_objective to classification (#60358)
* [ML] add maximize_minimum_recall to classification analysis

* [ML] fix mutation of the original job during the cloning
2020-03-17 13:34:33 +01:00
Daniil Suleiman eddbdc896b
[NP] Get rid of usage redirectWhenMissing service (#59777)
* Move redirect_when_missing to kibana utils

* Replace redirectWhenMissing in dashboard

* Replace redirectWhenMissing in discover

* Remove redirect in monitoring

* Remove extra import

* Move invalid vistype check into editor.js

* Mock the history folder

* Fix redirect when missing index or saved object

* Move history to discover services

* Use redirect to listing page

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-17 14:02:03 +03:00
patrykkopycinski 55003b61dd
[SIEM] Fix Timeline footer styling (#59587) 2020-03-17 11:50:34 +01:00
Pete Harverson 7f901f9e03
[ML] Fixes to error handling for analytics jobs and file data viz (#60249)
* [ML] Fixes to error handling for analytics jobs and file data viz

* [ML] Fix failing tests and address comments from review

* [ML] Add key prop to error messages map

* [ML] Add errors.ts
2020-03-17 09:20:00 +00:00
Patrick Mueller d5665921c7
resolves https://github.com/elastic/kibana/issues/58905 (#60120)
The current index threshold alert uses a `size` limit on term aggregation, when used, but does not sort the buckets, so it's just using descending count on the grouped buckets as the sort to determine what to return.

The watcher API for the index threshold notes this as "top N of", implying a sort.

This PR applies sorting when the using `groupBy: top`, and the `aggType != count`.  For count, ES is already sorting the way we want.

The sort is calculated as a separate agg beside the date_range aggregation, which is the same metrics agg specified in the query - `aggType(aggField)`.  This field is then referenced in a new `order` property in the terms agg, using 'asc' sorting for `min`, and `desc` sorting for `avg`, `max`, and `sum`.

This doesn't change the shape of the output at all, just changes which term buckets will be returned, if there are more term buckets than requested with the `termSize` parameter.
2020-03-17 00:29:33 -04:00
Yuliia Naumenko 90f3778bc6
Added variables button for text fields in Pagerduty component. (#60189)
* Added variables button for text fields in Pagerduty component. Fixed bugs mentioned in https://github.com/elastic/kibana/issues/60067

* Fixed due to comments

* fixed language check issue

* Fixed tests

* Fixed due to comments
2020-03-16 19:39:21 -07:00
Patrick Mueller 35d6a0a635
adds test that action vars are rendered for alert action parms (#60310)
resolves https://github.com/elastic/kibana/issues/60083
2020-03-16 22:20:51 -04:00
Oliver Gupte 59551e7e81
Closes 59786 by removing the update toast (#60172)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-16 18:46:38 -07:00
Jen Huang 466da684a9
[EPM] Packages list tabs (#60167)
* Memo'ize some layout and EPM header components

* Split EPM home page into two tabs

* Clean up dead files and import paths

* Add empty state

* Use react routing for rendering tab content

* Fix import paths (again)
2020-03-16 17:05:11 -07:00
Yuliia Naumenko 4ebdc4edad
Added message variables button for Webhook body form field (#60174)
* Added message variables button for Webhook body form field

* Fixed test issue
2020-03-16 17:02:41 -07:00
spalger 4a8fd0afee Revert "adds new test (#60064)"
This reverts commit a946adbf10.
2020-03-16 15:58:53 -07:00
Nathan Reese ef3261132a
[Maps] move MapSavedObject type out of telemetry (#60127)
* [Maps] move MapSavedObject type out of telemetry

* move SavedObject from server to core/types

* review feedback

* results from check_published_api_changes
2020-03-16 15:40:52 -06:00
Tim Sullivan 537fa8c1eb
[Reporting] Fix error handling for job handler in route (#60161)
* fix bogus rison error

* add generate route test

* update test name
2020-03-16 14:26:47 -07:00
Eric Davis 132383c28c
[Endpoint] TEST: verify alerts page header says 'Alerts' (#60206)
* test to verify alerts page header says alerts

* updating test with pr feedback

* updating test with pr feedback and better verbiage

* updating test with pr feedback for better test titling

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-16 17:25:14 -04:00
nnamdifrankie 69ec60d744
EMT-248: implement ack resource to accept event payload to acknowledge agent actions (#60218)
[Ingest]EMT-248: implement ack resource to accept event payload to acknowledge agent actions
2020-03-16 17:18:49 -04:00
Aaron Caldwell c898e799a5
Migrate dual validated range (#59689)
* Move validated range files to new NP location

* Update refs in code

* Clean up old validated range files

* Change relative paths to 'kibana-react'. Some clean up

* Change to relative paths

* Fix i18n errors

* i18n clean up. Export module explicitly

* Change files over to TS to prevent build issue where validated range was missing

* Clean up TS conversion

* More clean up. Extend EuiRangeProps

* Remove unneeded ts-ignore

* Review feedback and test fixes

* Change double to single quotes

* min and max aren't always passed, make optional

* Type updates

* Review feedback. Set state to empty on init and add ignore comment

* Review feedback

* Add back in last 2 ts-ignores. Build fails without focusable attribute on EuiDualRange & No good alternatives for spread syntax in TS components

* Rollback change to state init. Initializing state to null actually triggers a react browser warning and complicates using 'prevState' in getDerivedStateFromProps

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-16 14:33:56 -06:00
marshallmain 93914b6cb5
[Endpoint] Sample data generator CLI script (#59952)
* start on cli

* make it work

* cleanup

* remove failed attempt code

* update package and tsconfig

* remove empty file

* generate resolver events from multiple endpoints

* re-add child randomization

* align index names with real plugin

* remove duplication

* better naming

* add temporary mapping to sample data generator

* error handling, move tsconfig

* add readme

* Update README.md

* move mapping from common to scripts

* make delete index option

* remove unnecessary map call

* fix import style

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-16 15:53:49 -04:00
Alison Goryachev 77a859d43d
[Remote clusters] Add support for proxy mode (#59221) 2020-03-16 15:46:17 -04:00
Stacey Gammon dccfa593dc
Embeddable API cleanup (#60207)
* wip

* Remove test in legacy functional plugin
2020-03-16 15:37:42 -04:00
Nathan Reese 6cbfa274cf
[Maps] add draw control to create distance filter (#58163)
* [Maps] add distance filter to draw controls

* create distance filter

* update jest snapshot

* remove duplicated code

* reset circle draw when user hits escape

* i18n cleanup

* ts MultiIndexGeoFieldSelect

* ts DistanceFilterForm

* remove unused prop

* make interface a type

* move geo_field_with_index to components folder

* convert draw_circle to TS

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-16 13:33:40 -06:00
Felix Stürmer 6cd888f75f
[Logs UI] Fix log rate table row expansion (#60096)
This fixes the log rate table row expansion button, which broke in #54586 during a refactoring.
2020-03-16 19:47:56 +01:00
Frank Hassanabad dfff4fd6fa
[SIEM][Detection Engine] Refactors signal rule alert type into smaller code by creating functions
Refactors signal rule alert type into a smaller executor

## Summary

* Breaks out the schema into its own file and function
* Breaks out the action group into its own file and function
* Moves misc types being added to this into the `./types` file
* Breaks out all the writing of errors and success into their own functions
* Uses destructuring to pull data out of some of the data types
* Tweaks the gap detection to accept a date instead of moment to ease "ergonomics"   
* Updates unit tests for the gap detection

### 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-16 12:18:27 -06:00
James Gowdy 8a578960c0
[ML] Use real datafeed ID for datafeed preview (#60275) 2020-03-16 17:28:07 +00:00
Jean-Louis Leysens 1f8e938b9c
[Searchprofiler] Spacing between rendered shards (#60238)
* Added unique key and some spacing to rendered shards

* Give key to React.Fragment
2020-03-16 14:38:31 +01:00
Mikhail Shustov dd7531deb4
Add UiSettings validation & Kibana default route redirection (#59694)
* add schema to ui settings params

* add validation for defaults and overrides

* validate in ui settings client

* ui settings routes validation

* clean up tests

* use schema for defaultRoutes

* move URL redirection to NP

* fix spaces test

* update docs

* update kbn pm

* fix karma test

* fix tests

* address comments

* get rid of getDEfaultRoute

* regen docs

* fix tests

* fix enter-spaces test

* validate on relative url format

* update i18n

* fix enter-spoace test

* move relative url validation to utils

* add CoreApp containing application logic

* extract public uiSettings params in a separate type

* make schema required

* update docs
2020-03-16 14:30:20 +01:00
Christos Nasikas 271c9597be
[SIEM][CASE] Change configuration button (#60229)
* Change button

* Make URLs constants
2020-03-16 14:33:03 +02:00
MadameSheema a946adbf10
adds new test (#60064) 2020-03-16 13:01:48 +01:00
Shahzad 168239ca07
[Uptime] Index Status API to Rest (#59657)
* gql to rest

* update snap

* fix api

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-16 12:39:27 +01:00
MadameSheema 746e236869
[SIEM] Adds 'Closes and opens signals' Cypress test (#59950)
* adds signals data

* adds 'closes and opens signals'

* refactors test

* adds extra check to see that the selected number of signals is correct

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-16 10:44:28 +01:00
Maryia Lapata 7d12b7650f
[NP] Graph migration (#59409)
* Move graph to NP

* Styles

* Clean up

* Fix eslint

* Fix ESlint

* Fix path

* Fix container height

* Clean up

* Update index.ts

* Update graph_client_workspace.js

* Refactoring

* Remove unused methods

* Update graph_client_workspace.test.js

* Rename npData to data

* Move Readme

* Inline parsing discover url

* Remove import of legacy styles

* Update README

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-16 10:36:39 +03:00
Dima Arnautov 96ac1aa9bd
[ML] Clone analytics job (#59791)
* [ML] clone analytics job

* [ML] flyout clone header

* [ML] improve clone action context menu item

* [ML] support advanced job cloning

* [ML] extractCloningConfig

* [ML] fix isAdvancedSetting condition, add test

* [ML] clone job header

* [ML] job description placeholder

* [ML] setEstimatedModelMemoryLimit on source index change

* [ML] Fix types.

* [ML] useUpdateEffect in create_analytics_form.tsx

* [ML] setJobClone action

* [ML] remove CreateAnalyticsFlyoutWrapper instance from the create_analytics_button.tsx

* [ML] fix types

* [ML] hack to align Clone button with the other actions

* [ML] unknown props lead to advanced editor

* [ML] rename maximum_number_trees ot max_trees

* [ML] fix forceInput

* [ML] populate excludesOptions on the first update, skip setting mml on the fist update

* [ML] init functional test for cloning analytics jobs

* [ML] functional tests

* [ML] fix functional tests imports

* [ML] fix indices names for functional tests

* [ML] functional tests for outlier detection and regression jobs cloning

* [ML] delete james tag

* [ML] fix tests arrangement

Co-authored-by: Walter Rafelsberger <walter@elastic.co>
2020-03-15 22:41:27 +01:00
Matthew Kime 7e369506a7
Move VALUE_CLICK_TRIGGER and APPLY_FILTER_TRIGGER to ui_action… (#60202)
* move triggers

* move triggers

* fix import path

* fix import path

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-15 09:09:04 -07:00
CJ Cenizal 36d6590d2d
Handle improperly defined Watcher Logging Action text parameter. (#60169) 2020-03-13 18:23:18 -07:00
Christos Nasikas 5fb747ee32
[SIEM][CASES] Configure cases: Final (#59358)
* Create action schema

* Create createRequestHandler util function

* Add actions plugins

* Create action

* Validate actionTypeId

* [SIEM][CASE] Add find actions schema

* Create find actions route

* Create HttpRequestError

* Support http status codes

* Create check action health types

* Create check action health route

* Show field mapping

* Leave spaces between sections

* Export CasesConfiguration from servicenow action type

* Create IdSchema

* Create UpdateCaseConfiguration interface

* Create update action route

* Add constants

* Create fetchConnectors api function

* Create useConnector

* Create reducer

* Dynamic connectors

* Fix conflicts

* Create servicenow connector

* Register servicenow connector

* Add ServiceNow logo

* Create connnectors mapping

* Create validators in utils

* Use validators in connectors

* Validate URL

* Use connectors from config

* Enable triggers_aciton_ui plugin

* Show flyout

* Add closures options

* cleanup configure api

* simplify UI + add configure API

* Add mapping to flyout

* Fix error

* add all plumbing and main functionality to get configure working

* Fix naming

* Fix tests

* Show error when failed

* Remove version from query

* Disable when loading connectors

* fix config update

* Fix flyout

* fix two bugs

* Change defaults

* Disable closure options when no connector is selected

* Use default mappings from lib

* Set mapping if empty

* Reset connector to none if deleted from settings

* Change lib structure

* fix type

* review with christos

* Do not patch connector with id none

* Fix bug

* Show icon in dropdown

* Rename variable

* Show callout when connectors does not exists

* Adapt to new error handling

* Fix rebase wrong resolve

* Improve errors

* Remove async

* Fix spelling

* Refactor hooks

* Fix naming

* Better translation

* Fix bug with different action type attributes

* Fix linting errors

* Remove unnecessary comment

* Fix translation

* Normalized mapping before updating connector

* Fix type

* Memoized capitalized

* Dynamic data-subj-test variable

* Fix routes

Co-authored-by: Xavier Mouligneau <189600+XavierM@users.noreply.github.com>
2020-03-14 01:36:57 +02:00