Commit graph

9554 commits

Author SHA1 Message Date
Madison Caldwell
0f7afd4402
[SIEM][Security Solution][Endpoint] Endpoint Artifact Manifest Management + Artifact Download and Distribution (#67707)
* stub out task for the exceptions list packager

* Hits list code and pages

* refactor

* Begin adding saved object and type definitions

* Transforms to endpoint exceptions

* Get internal SO client

* update messaging

* cleanup

* Integrating with task manager

* Integrated with task manager properly

* Begin adding schemas

* Add multiple OS and schema version support

* filter by OS

* Fixing sort

* Move to security_solutions

* siem -> securitySolution

* Progress on downloads, cleanup

* Add config, update artifact creation, add TODOs

* Fixing buffer serialization problem

* Adding cleanup to task

* Handle HEAD req

* proper header

* More robust task management

* single -> agnostic

* Fix OS filtering

* Scaffolding digital signatures / tests

* Adds rotue for creating endpoint user

* Cleanup

* persisting user

* Adding route to fetch created user

* Addings tests for translating exceptions

* Adding test for download API

* Download tweaks + artifact generation fixes

* reorganize

* fix imports

* Fixing test

* Changes id of SO

* integration tests setup

* Add first integration tests

* Cache layer

* more schema validation

* Set up for manifest update

* minor change

* remove setup code

* add manifest schema

* refactoring

* manifest rewrite (partial)

* finish scaffolding new manifest logic

* syntax errors

* more refactoring

* Move to endpoint directory

* minor cleanup

* clean up old artifacts

* Use diff appropriately

* Fix download

* schedule task on interval

* Split up into client/manager

* more mocks

* config interval

* Fixing download tests and adding cache tests

* lint

* mo money, mo progress

* Converting to io-ts

* More tests and mocks

* even more tests and mocks

* Merging both refactors

* Adding more tests for the convertion layer

* fix conflicts

* Adding lzma types

* Bug fixes

* lint

* resolve some type errors

* Adding back in cache

* Fixing download test

* Changing cache to be sized

* Fix manifest manager initialization

* Hook up datasource service

* Fix download tests

* Incremental progress

* Adds integration with ingest manager for auth

* Update test fixture

* Add manifest dispatch

* Refactoring to use the same SO Client from ingest

* bug fixes

* build renovate config

* Fix endpoint_app_context_services tests

* Only index the fields that are necessary for searching

* Integ test progress

* mock and test city

* Add task tests

* Tests for artifact_client and manifest_client

* Add manifest_manager tests

* minor refactor

* Finish manifest_manager tests

* Type errors

* Update integ test

* Type errors, final cleanup

* Fix integration test and add test for invalid api key

* minor fixup

* Remove compression

* Update task interval

* Removing .text suffix from translated list

* Fixes hashes for unit tests

* clean up yarn.lock

* Remove lzma-native from package.json

* missed updating one of the tests

Co-authored-by: Alex Kahan <alexander.kahan@elastic.co>
2020-07-02 01:00:27 -04:00
Garrett Spong
591e10355a
[Security] Adds field mapping support to rule creation (#70288)
## Summary

Resolves: https://github.com/elastic/kibana/issues/65941, https://github.com/elastic/kibana/issues/66317, and `Add support for "building block" alerts`

This PR is `Part I` and adds additional fields to the `rules schema` in supporting the ability to map and override fields when generating alerts. A few bookkeeping fields like `license` and `author` have been added as well. The new fields are as follows:

``` ts
export interface TheseAreTheNewFields {
  author: string[];
  building_block_type: string; // 'default'
  license: string;
  risk_score_mapping: Array<
    {
      field: string;
      operator: string; // 'equals'
      value: string;
    }
  >;
  rule_name_override: string;
  severity_mapping: Array<
    {
      field: string;
      operator: string; // 'equals'
      value: string;
      severity: string; // 'low' | 'medium' | 'high' | 'critical'
    }
  >;
  timestamp_override: string;
}
```

These new fields are exposed as additional settings on the `About rule` section of the Rule Creation UI.

##### Default collapsed view, no severity or risk score override specified:
<p align="center">
  <img width="500" src="https://user-images.githubusercontent.com/2946766/86090417-49c0ee80-ba67-11ea-898f-a43af6d9383f.png" />
</p>

##### Severity & risk score override specified:
<p align="center">
  <img width="500" src="https://user-images.githubusercontent.com/2946766/86091165-a8d33300-ba68-11ea-86ac-89393a7ca3f5.png" />
</p>

##### Additional fields in Advanced settings:
<p align="center">
  <img width="500" src="https://user-images.githubusercontent.com/2946766/86091256-cbfde280-ba68-11ea-9b63-acf2524039bd.png" />
</p>


Note: This PR adds the fields to the `Rules Schema`, the `signals index mapping`,  and creates the UI for adding these fields during Rule Creation/Editing. The follow-up `Part II` will add the business logic for mapping fields during `rule execution`, and also add UI validation/additional tests.

### Checklist

Delete any items that are not applicable to this PR.

- [x] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/master/packages/kbn-i18n/README.md)
- [ ] [Documentation](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#writing-documentation) was added for features that require explanation or tutorials
  - Syncing w/ @benskelker 
- [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
- [x] This was checked for [keyboard-only and screenreader accessibility](https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Cross_browser_testing/Accessibility#Accessibility_testing_checklist)

### For maintainers

- [x] This was checked for breaking API changes and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)
2020-07-01 22:49:30 -06:00
nnamdifrankie
e9b81f72ca
SECURITY-ENDPOINT: add fields for events to metadata document (#70491)
SECURITY-ENDPOINT: EMT-492 add fields for events to metadata document
2020-07-01 22:49:56 -04:00
John Dorlus
b21e43d848
Fixed assertion in hybrid index pattern test to iterate through indices (#70130)
* Fixed assertion to check through all indices before making assertion.

* Restored yarn.lock file.

* Removed only from describe.

* Fixed linting issue.

* Fixed nits that were in the PR conversation.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-01 21:04:03 -04:00
Yara Tercero
6581450449
[SIEM][Exceptions] - Exception builder component (#67013)
### Summary

This PR creates the bulk functionality of the exception builder. The exception builder is the component that will be used to create exception list items. It does not deal with the actual API creation/deletion/update of exceptions, it does contain an `onChange` handler that can be used to access the exceptions. The builder is able to:

- accept `ExceptionListItem` and render them correctly
- allow user to add exception list item and exception list item entries
- accept an `indexPattern` and use it to fetch relevant field and autocomplete field values
- disable `Or` button if user is only allowed to edit/add to exception list item (not add additional exception list items)
- displays `Add new exception` button if no exception items exist
    - An exception item can be created without entries, the `add new exception` button will show in the case that an exception list contains exception list item(s) with an empty `entries` array (as long as there is one exception list item with an item in `entries`, button does not show)
- debounces field value autocomplete searches
- bubble up exceptions to parent component, stripping out any empty entries
2020-07-01 20:33:57 -04:00
Jen Huang
4f7da59a51
[Ingest Manager] Rename data sources to package configs (#70259)
* Rename `datasource` saved object to `package_config` (SO type `ingest-datasource` to `ingest-package-config`) and adjust mappings:

- Remove unused `processors` field on input & stream levels
- Remove unnecessary `enabled` field on package config & input levels
- Rename `agent_stream` field to `compiled_stream`
- Reorder other fields so that important fields are closer to top & similar fields are grouped together

Also,
- Remove 7.9.0 migrations as we are not supporting an upgrade path from experimental to beta release

* Pluralize `ingest-package-configs` for consistency

* Rename `Datasource`-related types to `PackageConfig`, update all references (does not include actual type definition changes yet)

* Rename `Datasource` schemas and rest spec typings to `PackageConfig` (does not include actual schema changes yet)

* Change `datasources` on agent config typings and schemas to `package_configs` and update all references

* Add back `enabled` field on package config and input levels. They are needed for current & future UI features. Also:

- Match types and schemas with saved object mappings (`agent_stream` to `compiled_stream`, removal of `processors`)
- Set `namespace` to be a required property on agent config and package config types, add validation support for it on UI

* Rename server-side datasource references in file names, variable names, and routes

* Update spec file and schema file

* Update doc wording

* Rename all instances of datasource in file paths and variable names on client sides, and for Endpoint too

* Minor copy adjustments, fix i18n check

* Replace datasource references in tests and fixtures; remove unused `ingest/policies` es archiver data

* Fix tests

* Fix test field name

* Fix test fixtures fields again

* Fix i18n
2020-07-01 16:14:21 -07:00
spalger
0f418bb7f0 skip suites blocking es snapshot promomotion (#70532) 2020-07-01 16:10:01 -07:00
Zacqary Adam Xeper
515b5dc66c
[Metrics UI] Fix asynchronicity and error handling in Snapshot API (#70503)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-01 18:07:54 -05:00
Angela Chuang
341f38577f
fix export response (#70473)
* fix export response

* update unit tests
2020-07-01 23:46:26 +01:00
nnamdifrankie
eedb5f7115
[SECURITY-ENDPOINT] use ingest manager unenroll services to remove unenrolled endpoint (#70393)
[SECURITY-ENDPOINT] EMT-451 - use ingest manager unenroll services to remove unenrolled endpoint
2020-07-01 17:52:16 -04:00
Sandra Gonzales
80ae5648ad
[Ingest Manager] remove requirements component (#70462)
* remove requirements component

* fix ts error

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-01 17:07:14 -04:00
Shahzad
ba48a9facf
[RUM Dashboard] Added service name filter (#70349)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-01 22:56:05 +02:00
Paul Tavares
3305b22d4f
[ENDPOINT][SIEM] Display dismissible Endpoint notice on Overview page if no endpoints are deployed (#70122) 2020-07-01 16:22:39 -04:00
Dave Snider
f2833f6d00
More permissive with IE warning (#70388)
Show the IE11 warning regardless of if the user supresses the warning
2020-07-01 13:07:48 -07:00
Spencer
ab450c7000 skip flaky suite (#70493) 2020-07-01 12:47:33 -07:00
CJ Cenizal
91b8e7de24
Use modern mount context in Dev Tools and Console (#70379)
* Use modern mount context in Dev Tools and Console, and clean up plugin definitions of Grok Debugger, Search Profiler, and Painless Lab.

* Remove return value from Console lifecycle method.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-01 12:40:52 -07:00
Jonathan Buttner
37d7d788d9
[Security_Solution][Endpoint] Refactor resolver generator for ancestry array (#70129)
* Refactor generator for ancestry support

* Adding optional ancestry array

* Fixing tests and type errors

* Removing useAncestry field

* Fixing test

* An empty array will be returned because that's how ES will do it too

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-01 15:13:03 -04:00
Melissa Alvarez
edad017246
update mse to access value property (#70438) 2020-07-01 14:40:53 -04:00
Robert Austin
bc66737085
fix styling for the SIEM Resolver integration (#70464) 2020-07-01 14:10:11 -04:00
Melissa Alvarez
2c40db8ac7
[ML] DF Analytics: ensure failed job state handled (#70456)
* handle failed job state in progress bar. skip reg test

* skip classification functional tests for now as well

* translate default callout message
2020-07-01 13:51:09 -04:00
Spencer
481dccdb6f
[ui-shared-deps/theme] implement auto-switching theme vars module (#70274)
Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-01 10:14:54 -07:00
Shahzad
9ff68e4c8c
[RUM Dashboard] Update rum title to be consistent with APM (#70460) 2020-07-01 18:52:38 +02:00
Nathan Reese
006670244a
[Maps] convert GeojsonFileSource to typescript (#70365)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-01 10:46:50 -06:00
James Gowdy
eafd2af6aa
[ML] Adding capabilities checks to shared functions (#70069)
* [ML] Adding capabilities checks to shared functions

* small refactor

* disabling capabilities checks for functions called by SIEM alerting

* testing git

* removing comment

* using constant for ml app id

* tiny type clean up

* removing check in ml_capabilities

* fixing types

* removing capabilities checks from ml_capabilities endpoint

* updating types

* better error handling

* improving capabilities check

* adding custom errors

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-01 17:45:36 +01:00
Chris Cowan
b7f33b94a8
[Metrics UI] Enhance Inventory View Tooltips (#69757)
* [Metrics UI] Enhance Inventory View Tooltips

* Fixing typos

* Removing toMetricOpt

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-01 09:45:21 -07:00
Robert Austin
652b11f270
Remove old endpoint routes redux (#70458)
Remove the legacy Endpoint Alerts feature
2020-07-01 12:45:15 -04:00
Charlie Pichette
9438f13939
Issue 63621 Fix Flaky Tests (#70344) 2020-07-01 12:37:42 -04:00
Ryland Herrick
d8d24be3fb
[Security Solution][Lists] More composable hooks/utilities (#70372)
* Add wrapper function to make an AbortSignal arg optional

Components commonly do not care about aborting a request, but are
required to pass `{ signal: new AbortController().signal }` anyway. This
addresses that use case.

* Adds hook for retrieving the component's mount status

This is useful for dealing with asynchronous tasks that may complete
after the invoking component has been unmounted. Using this hook,
callbacks can determine whether they're currently unmounted, i.e.
whether it's safe to set state or not.

* Add our own implemetation of useAsync

This does not suffer from the Typescript issues that the react-use
implementation had, and is generally a cleaner hook than useAsyncTask as
it makes no assumptions about the underlying function.

* Update exported Lists API hooks to use useAsync and withOptionalSignal

Removes the now-unused useAsyncTask as well.

* Add some JSDoc for our new functions
2020-07-01 11:27:08 -05:00
Spencer
bc802c38ee skip flaky suite (#66389) 2020-07-01 09:02:38 -07:00
Sandra Gonzales
275fb9731d
[Ingest Manager] add _meta field to index templates (#70319)
* add _meta field to index templates

* fix typescript issue

* make package an object

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-01 11:53:24 -04:00
Ahmad Bamieh
2212beba68
[i18n] integrate new translations + new i18n check #70193 (#70423)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-01 18:48:41 +03:00
Shahzad
518e88cf28
update (#70424) 2020-07-01 13:20:02 +01:00
Felix Stürmer
e70bc81998
[Logs UI] Avoid CCS-incompatible index name resolution (#70179)
This fixes #70048 by avoiding a CCS-incompatible ES API call when determining the existence of log indices.
2020-07-01 14:05:29 +02:00
Vadim Dalecky
8a6a55097d
Enable "Explore underlying data" actions for Lens visualizations (#70047)
* refactor: 💡 rename folder to "explore_data"

* style: 💄 check for "share" plugin in more semantic way

"explore data" actions use Discover URL generator, which is registered
in "share" plugin, which is optional plugin, so we check for its
existance, because otherwise URL generator is not available.

* refactor: 💡 move KibanaURL to a separate file

* feat: 🎸 add "Explore underlying data" in-chart action

* fix: 🐛 fix imports after refactor

* feat: 🎸 add start.filtersFromContext to embeddable plugin

* feat: 🎸 add type checkers to data plugin

* feat: 🎸 better handle empty filters in Discover URL generator

* feat: 🎸 implement .getUrl() method of explore data in-chart act

* feat: 🎸 add embeddable.filtersAndTimeRangeFromContext()

* feat: 🎸 improve getUrl() method of explore data action

* test: 💍 update test mock

* fix possible stale hashHistory.location in discover

* style: 💄 ensureHashHistoryLocation -> syncHistoryLocations

* docs: ✏️ update autogenerated docs

* test: 💍 add in-chart "Explore underlying data" unit tests

* test: 💍 add in-chart "Explore underlying data" functional tests

* test: 💍 clean-up custom time range after panel action tests

* chore: 🤖 fix embeddable plugin mocks

* chore: 🤖 fix another mock

* test: 💍 add support for new action to pie chart service

* feat: 🎸 enable "Explore underlying data" action for Lens vis

* test: 💍 make tests green again

* refactor: 💡 rename trigger contexts

* chore: 🤖 fix TypeScript errors

Co-authored-by: Anton Dosov <anton.dosov@elastic.co>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-01 12:16:23 +02:00
Andrew Cholakian
e8cf08fb3e
Initial work on uptime homepage API (#70135)
Co-authored-by: Shahzad <shahzad31comp@gmail.com>
2020-07-01 11:06:56 +02:00
Joe Reuter
de79985f92
[Lens] Add "no data" popover (#69147) 2020-07-01 10:08:37 +02:00
Joe Reuter
a49f5cec64
[Lens] Move chart switcher over (#70182) 2020-07-01 10:07:59 +02:00
Joe Reuter
e1665e8b27
[Lens] Multiple y axes (#69911) 2020-07-01 09:57:23 +02:00
Brian Seeders
c1dc53c6fb skip flaky suite (#70386) 2020-06-30 21:29:37 -04:00
Xavier Mouligneau
9af75fa98b
fix bug to add timeline to case (#70343) 2020-06-30 21:05:14 -04:00
Zacqary Adam Xeper
0047eeded6
[Metrics UI] Add context.reason and alertOnNoData to Inventory alerts (#70260) 2020-06-30 16:34:38 -05:00
Robert Austin
893525c74c
Resolver refactoring (#70312)
* remove unused piece of state
* Move related event total calculation to selector
* rename xScale
* remove `let`
* Move `dispatch` call out of HTTP try-catch
2020-06-30 17:32:44 -04:00
Nicolas Chaulet
8903d3427e
[Ingest Manager] Fix agent ack after input format change (#70335) 2020-06-30 17:23:56 -04:00
Christos Nasikas
aa52102edb
[SIEM][Timeline] Reset fields based on timeline (#70209) 2020-06-30 23:46:21 +03:00
Devin W. Hurley
432f93a1a5
[SECURITY SOLUTION] [Detections] Increase lookback when gap is detected (#68339)
* add POC logic to modify the 'from' param in the search

* fixes formatting for appending gap diff to from

* computes new max signals based on how many intervals of rule runs were missed when gap in consecutive rule runs is detected

* adds logging, fixes bug where we could end up with negative values for diff, adds calculatedFrom to the search after query

* remove console.log and for some reason two eslint disables were added so i removed one of them

* rename variables, add test based on log message - need to figure out a better way to test this

* remove unused import

* fully re-worked the algorithm for searching discrete time periods, still need search_after because a user could submit a rule with a custom maxSignals so that would still serve a purpose. This needs heavy refactoring though, and tests.

* updated loop to include maxSignals per time interval tuple, this way we guarantee maxSignals per full rule interval. Needs some refactoring though.

* move logic into utils function, utils function still needs refactoring

* adds unit tests and cleans up new util function for determining time intervals for searching to occur

* more code cleanup

* remove more logging statements

* fix type errors

* updates unit tests and fixes bug where search result would return 0 hits but we were accessing property on non-existent hit item

* fix rebase conflict

* fixes a bug where a negative gap could exist if a rule ran before the lookback time, also fixes a bug where the search and bulk loop would return false when successful.

* gap is a duration, not a number.

* remove logging variable

* remove logging function from test

* fix type import from rebase with master

* updates missed test when rebased with master, removes unused import

* modify log statements to include meta information for logged rule events, adds tests

* remove unnecessary ts-ignores

* indentation on stringify

* adds a test to ensure we are parsing the elapsed time correctly
2020-06-30 16:43:49 -04:00
Xavier Mouligneau
a07526484a
[SECURITY] Bug overview link (#70214)
* fix link bug on overview page

* Rename Signal to Alert in selection of event in timeline

* review I

* fix i18n
2020-06-30 15:25:16 -04:00
Alejandro Fernández Haro
56aac44ac3
[API Integration Tests] usageApi service to expose the private telemetry API (#70057)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-06-30 20:14:59 +01:00
Nathan L Smith
585b3f7e3d
Add Jest configuration and README to observability plugin (#70340)
Also clean up the coverage configuration in the APM jest config.
2020-06-30 14:03:05 -05:00
Clint Andrew Hall
60a86d6396
[easy][bug] Fix thumb rendering observer (#70255) 2020-06-30 14:51:59 -04:00
Dario Gieselaar
b5ceefbaed
[APM] Simpler security check (#69780)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-06-30 20:47:19 +02:00