Commit graph

86 commits

Author SHA1 Message Date
Jonathan Buttner 4739eab490
[Security Solution][Case][Bug] Prevent closing collection when pushing (#93095)
* Prevent closing collection when pushing

* Fixing translations
2021-03-01 17:11:47 -05:00
Christos Nasikas 31889a589d
[Security Solution][Case] Migrate category & subcategory fields of ServiceNow ITSM connector (#93092) 2021-03-01 16:21:00 -05:00
Jonathan Buttner d9043c1c46
[Security Solution][Case][Bug] Removing empty collections when filtering on status (#92048)
* Removing empty collections when not filtering on status

* Fixing add comment response

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-03-01 14:47:38 -05:00
Jonathan Buttner b5cd44e7ac
[Security Solution][Case][Bug] Only add rule object for alert comments (#92977)
* Adding test for alert rule fields migration

* Fixing directory issue

* Add more descriptive message

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-03-01 11:14:14 -05:00
Jonathan Buttner 993ac50105
[Security Solution][Case][Bug] Improve case logging (#91924)
* First pass at bringing in more logging

* Adding more logging to routes

* Adding more logging fixing tests

* Removing duplicate case string in logs

* Removing unneeded export

* Fixing type error

* Adding line breaks to make the messages more readable

* Fixing type errors

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-02-26 12:48:09 -05:00
Christos Nasikas c2877a6d96
[Security Solution][Case] Fix subcases bugs on detections and case view (#91836)
Co-authored-by: Jonathan Buttner <jonathan.buttner@elastic.co>
2021-02-26 15:35:43 +02:00
Spencer 0aabc317ec
[kbn/test] add import/export support to KbnClient (#92526)
Co-authored-by: Tre' Seymour <wayne.seymour@elastic.co>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: spalger <spalger@users.noreply.github.com>
2021-02-25 16:13:27 -07:00
Christos Nasikas 32ffc80768
[Security Solution][Case] Fix alerts push (#91638)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-02-24 21:48:40 +02:00
Jonathan Buttner 3c29f38adf
[Security Solution][Case] Adding tests for updating the status of alerts (#91301)
* Adding tests for updating the status of alerts

* Adding more alert tests and unskipping
2021-02-22 19:21:25 -05:00
Jonathan Buttner a108469ec7
Allowing deletion of collections (#91926) 2021-02-19 10:50:35 -05:00
Angela Chuang 97d391a636
[Security Solution] Detection rules for case UI (#91434)
* Adding type field to client

* Removing context and adding association type

* Handle alerts from multiple indices

* Adding flow for adding a sub case

* Making progress on creating alerts from rules

* Refactored add comment to handle case and sub case

* Starting sub case API and refactoring of case client

* Fleshing out find cases

* Finished the find cases api

* Filtering comments by association type

* Fixing tests and types

* Updating snapshots

* Cleaning up comment references

* Working unit tests

* Fixing integration tests and got ES to work

* Unit tests and api integration test working

* Refactoring find and get_status

* Starting patch, and update

* script for sub cases

* Removing converted_by and fixing type errors

* Adding docs for script

* Removing converted_by and fixing integration test

* init expanded rows

* Adding sub case id to comment routes

* Removing stringify comparison

* styling

* clean up

* add status column

* styling

* hide actions if it has sub-cases

* Adding delete api and tests

* generated alert

* Updating license

* missed license files

* Integration tests passing

* Adding more tests for sub cases

* wip

* Find int tests, scoped client, patch sub user actions

* fixing types and call cluster

* fixing get sub case param issue

* Adding user actions for sub cases

* Preventing alerts on collections and refactoring user

* Allowing type to be updated for ind cases

* subcases attached to api

* combine enum on UI for simplification

* Refactoring and writing tests

* Fixing sub case status filtering

* add alerts count

* Adding more tests not allowing gen alerts patch

* Working unit tests

* Push to connector gets all sub case comments

* Writing more tests and cleaning up

* Updating push functionality for generated alerts and sub cases

* Adding comment about updating collection sync

* use CaseType to check if it is a sub-case

* fix types and disable selection if it has subcases

* isEmpty

* Detection rule correctly adding alerts to sub case

* update api and functionality to accept sub case

* integration part I

* fix integration with case connector

* Fix manual attach

* Fix types

* Fix bug when updating

* Fix bug with user actions

* Fix react key error

* Fix bug when pushing a lot of alerts

* fix lint error

* Fix limit

* fix title on sub case

* fix unit tests

* rm bazel

* fix unit tests and cypress test

* enable delete case icon

* revert change

* review

* Fix the scripts alerts generation code

* temp work

* Fix rule types and add migration

* fix types

* fix types error

* Remove query alerts

* Fix rules

* fix types

* fix lint error

* fix types

* delete a sub case

* rm unused i18n

* fix delete cases

* fix unit tests

* fix unit test

* update Case type

* fix types

* fix unit test

* final integration between rule and case

* fix integration test

* fix unit test + bring back connector in action of rule

Co-authored-by: Jonathan Buttner <jonathan.buttner@elastic.co>
Co-authored-by: Xavier Mouligneau <189600+XavierM@users.noreply.github.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Christos Nasikas <christos.nasikas@elastic.co>
2021-02-17 20:32:40 -05:00
Jonathan Buttner f8b8d5b33d
[Case] Detection rules for case (#88726)
* Adding type field to client

* Removing context and adding association type

* Handle alerts from multiple indices

* Adding flow for adding a sub case

* Making progress on creating alerts from rules

* Refactored add comment to handle case and sub case

* Starting sub case API and refactoring of case client

* Fleshing out find cases

* Finished the find cases api

* Filtering comments by association type

* Fixing tests and types

* Updating snapshots

* Cleaning up comment references

* Working unit tests

* Fixing integration tests and got ES to work

* Unit tests and api integration test working

* Refactoring find and get_status

* Starting patch, and update

* script for sub cases

* Removing converted_by and fixing type errors

* Adding docs for script

* Removing converted_by and fixing integration test

* Adding sub case id to comment routes

* Removing stringify comparison

* Adding delete api and tests

* Updating license

* missed license files

* Integration tests passing

* Adding more tests for sub cases

* Find int tests, scoped client, patch sub user actions

* fixing types and call cluster

* fixing get sub case param issue

* Adding user actions for sub cases

* Preventing alerts on collections and refactoring user

* Allowing type to be updated for ind cases

* Refactoring and writing tests

* Fixing sub case status filtering

* Adding more tests not allowing gen alerts patch

* Working unit tests

* Push to connector gets all sub case comments

* Writing more tests and cleaning up

* Updating push functionality for generated alerts and sub cases

* Adding comment about updating collection sync

* Refactoring update alert status for sub cases and removing request and cleaning up

* Addressing alert service feedback

* Fixing sub case sync bug and cleaning up comment types

* Addressing more feedback

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-02-12 09:03:53 -05:00
Christos Nasikas a9f2c91673
[Security Solution][Case] ServiceNow ITSM: Add category & subcategory fields (#90547) 2021-02-11 13:08:39 +02:00
Christos Nasikas a0d4b04155
[Security Solution][Case] ServiceNow SIR Connector (#88655)
Co-authored-by: Xavier Mouligneau <189600+XavierM@users.noreply.github.com>
2021-02-09 12:28:43 +02:00
Christos Nasikas f6a8d6edc4
[Security Solution][Case] Fix unhandled promise when updating alert status (#90605) 2021-02-08 18:45:31 +02:00
Pierre Gayvallet 3b3327dbc3
Migrate most plugins to synchronous lifecycle (#89562)
* first pass

* migrate more plugins

* migrate yet more plugins

* more oss plugins

* fix test file

* change Plugin signature on the client-side too

* fix test types

* migrate OSS client-side plugins

* migrate OSS client-side test plugins

* migrate xpack client-side plugins

* revert fix attempt on fleet plugin

* fix presentation start signature

* fix yet another signature

* add warnings for server-side async plugins in dev mode

* remove unused import

* fix isPromise

* Add client-side deprecations

* update migration examples

* update generated doc

* fix xpack unit tests

* nit

* (will be reverted) explicitly await for license to be ready in the auth hook

* Revert "(will be reverted) explicitly await for license to be ready in the auth hook"

This reverts commit fdf73feb

* restore await on on promise contracts

* Revert "(will be reverted) explicitly await for license to be ready in the auth hook"

This reverts commit fdf73feb

* Revert "restore await on on promise contracts"

This reverts commit c5f2fe51

* add delay before starting tests in FTR

* update deprecation ts doc

* add explicit contract for monitoring setup

* migrate monitoring plugin to sync

* change plugin timeout to 10sec

* use delay instead of silence
2021-02-08 10:19:54 +01:00
Brandon Kobel 4584a8b570
Elastic License 2.0 (#90099)
* Updating everything except the license headers themselves

* Applying ESLint rules

* Manually replacing the stragglers
2021-02-03 18:12:39 -08:00
Christos Nasikas 7a45fc45e1
[Alerts] ServiceNow SIR Connector (#88190)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-02-02 11:29:42 +02:00
Christos Nasikas 61d4d870e2
[Security Solution][Case] Allow users with Gold license to use Jira (#89406) 2021-01-29 19:19:19 +02:00
Christos Nasikas 1714b22de7
[Security Solution][Case] Improve cases and actions docs (#87817) 2021-01-25 17:41:25 +02:00
Mikhail Shustov b3a9754394
[Core] Explicit typings for request handler context (#88718)
* move context to server part. couple with RequestHandlerContext

Context implementation will be simplified in follow-up.

* adopt core code

* adopt bfetch code

* adopt data code

* adopt search examples

* adopt vis_type_timelion

* adopt vis_type_timeseries

* adopt plugin functional tests

* adopt actions

* adopt alerting plugin

* adopt APM plugin

* adopt beats_management

* adopt case plugin

* adopt cross_cluster_replication

* adopt data_enhanced

* adopt event_log

* adopt global_search

* adopt index_management

* adopt infra

* adopt licensing

* adopt lists

* adopt logstash

* adopt reporting

* adopt observability

* adopt monitoring

* adopt rollup

* adopt so tagging

* adopt security

* adopt security_solutions

* adopt watcher

* adopt uptime

* adopt spaces

* adopt snapshot_restore

* adopt features changes

* mute error when null used to extend context

* update docs

* small cleanup

* add type safety for return type

* refactor registerRouteHandlerContext type

* update docs

* update license header

* update docs

* fix type error. fetch body does not accept array of strings

* fix telemetry test

* remove unnecessary ts-ignore

* address comments

* update docs
2021-01-21 15:20:22 +01:00
Robert Austin c3a69fe28b
Remove plugin circular deps between actions -> case and case -> securitySolution (#88106) 2021-01-21 08:47:15 -05:00
Christos Nasikas a1931acdc5
[Security Solution][Case] Attach alerts to cases: Tests (#86305)
Co-authored-by: Steph Milovic <stephanie.milovic@elastic.co>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-01-11 17:44:35 +02:00
Steph Milovic b0ba4f47ab
[Security Solution] [Case] Fixes "Case connector cannot be updated when created with a wrong field" (#87223) 2021-01-05 15:33:36 -07:00
Thomas Watson e8b21bc6c1
Upgrade to hapi version 20 (#85406) 2020-12-19 13:10:11 +01:00
Steph Milovic f8f1711688
[Security Solution] [Cases] Follow up jest tests for #84587 (#86231) 2020-12-18 09:23:09 -07:00
Steph Milovic 335cd1f6fc
[Security Solution] [Cases] Move field mappings from actions to cases (#84587) 2020-12-15 07:06:11 -07:00
Christos Nasikas ea4e2224a9
[Security Solution][Case] Sync cases with alerts (#84731) 2020-12-14 21:11:53 +02:00
Christos Nasikas fcccb016f4
[Security Solution][Case] Add in-progress status to case (#84321) 2020-12-04 21:36:23 +02:00
Tyler Smalley b593781009
Jest multi-project configuration (#77894)
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2020-12-02 11:42:23 -08:00
Mikhail Shustov 95861a0fb0
[DX] Prettier v2.2 (#83899)
* update prettier with ts version support

* mute type-error

* run prettier on codebase

* fix examples

* fix errors after master merged
2020-11-23 13:17:05 +01:00
Christos Nasikas 52c6b7b81b
[Security Solution][Case] Create comment types (#82715) 2020-11-20 21:03:05 +02:00
Christos Nasikas 01b1710eb7
[Security Solution][Case] Change case connector minimum required license to basic (#83401) 2020-11-16 15:34:40 +02:00
Gidi Meir Morris 3151e7e5e4
enables actions scoped within the stack to register at Basic license (#82931)
Enables actions scoped within the stack to register at Basic license
2020-11-12 17:31:44 +00:00
Christos Nasikas 7abb1e3033
[Security Solution][Case] Case action type (#80870)
* Init connector

* Add test

* Improve comment type

* Add integration tests

* Fix i18n

* Improve tests

* Show unknown when username is null

* Improve comment type

* Pass connector to case client

* Improve type after PR #82125

* Add comment migration test

* Fix integration tests

* Fix reporter on table

* Create case connector ui

* Add connector to README

* Improve casting on executor

* Translate name

* Improve test

* Create comment type enum

* Fix type

* Fix i18n

* Move README to cases

* Filter out case connector from alerting

Co-authored-by: Mike Côté <mikecote@users.noreply.github.com>

Co-authored-by: Mike Côté <mikecote@users.noreply.github.com>
2020-11-04 12:07:17 +02:00
Thomas Watson 700225061a
Upgrade to hapi version 18 (#80468) 2020-11-02 13:18:00 +01:00
Christos Nasikas 30a0323d7a
[Seurity Solution][Case] Create case plugin client (#81018) 2020-10-27 21:01:36 +02:00
Christos Nasikas ca8b03823b
[Security Solution][Cases] Fix bug with case connectors (#80642)
* Fix bug with case connectors

* Improve isCaseOwned function
2020-10-16 18:07:11 +03:00
Christos Nasikas 16e1598c05
[Security Solution][Case] Improve ServiceConnectorCaseParams type (#80109)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-10-13 16:12:03 +03:00
Christos Nasikas 85ad8a4f3d
[Security Solution][Case] Fix bug when changing connectors (#80002) 2020-10-09 09:25:47 +03:00
Christos Nasikas 287541891e
[Security Solutions][Case] Settings per case per connector (#77327)
Co-authored-by: Xavier Mouligneau <189600+XavierM@users.noreply.github.com>
Co-authored-by: Steph Milovic <stephanie.milovic@elastic.co>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-10-06 20:03:46 +03:00
Christos Nasikas 22b4e40ea0
[Alerting][Connectors] Refactor IBM Resilient: Generic Implementation (phase one) (#74357)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-09-11 10:24:46 +03:00
Christos Nasikas db5652e020
[Alerting][Connectors] Refactor Jira: Generic Implementation (phase one) (#73778) 2020-09-09 16:17:11 +03:00
Mikhail Shustov 88c0631344
Update @typescript-eslint to ensure compatibility with TypeScript v3.9 (#74091)
* bump @typescript-eslint deps

* update rules

* fix errors in pacakges

* fix src/

* fix x-pack

* fix test

* fix typings

* fix examples

* allow _ as prefix and suffix

* roll back prefix and suffix changes

* add eslint-plugin-eslint-comments

* report unused rules

* remove unused eslint comments from tests

* remove unused eslint comments 2nd pass

* remove unused eslint comments from src/

* remove unused comments in x-pack

* use no-script-url and no-unsanitized/property for ts files

* remove unused eslint comments

* eui/href-or-on-click removed when not complained

* no import/* rules for ts files

* cleanup

* remove the unused eslint-disable

* rollback unnecessary changes

* allow underscore prefix & sufix in type name

* update docs

* fix type error in enterprise search plugin mocks

* rename platform hack __coreProvider --> _coreProvider

* rollback space removal in src/core/public/legacy/legacy_service.test.ts

* fix naming convention in APM
2020-08-05 17:32:19 +02:00
Christos Nasikas 1a81eb5c19
[SIEM][CASE] IBM Resilient Connector (#66385) 2020-07-10 02:23:20 +03:00
Yuliia Naumenko 57915e1641
ServiceNow push to Incident generic implementation (supporting both Case specific and generic Alerts) (#68464)
* Draft ServiceNow generic implementation

* simple working servicenow incident per alert

* fixed running times

* rely on externalId for update incident on the next execution

* Added consumer to the action type to be able to split ServiceNow for Cases and Alerts

* Added subActions support for ServiceNow action form

* Basic version for Alerts part for ServiceNow

* Keep Case ServiceNow functionality working

* Revert changes on app_router

* Fixed type checks

* Fixed language check issues

* Fixed actions unit tests

* Fixed functional tests

* Fixed jest tests

* fixed tests

* Copied case mappings to alerting plugin

* made consumer optional

* Cleanup tests

* more cleanup

* Fixed jest tests and type checks

* fixed tests

* fixed servicenow validation tests

* Added ServiceNow unit tests

* Removed consumer for actions

* fixed client side isCaseOwned support

* fixed failing tests

* fixed jest tests

* Fixed URL validation

* fixed due to comments

* fixed tests

* fixed jest tests

* Fixed due to comments. Moved ServiceNow filtering in case plugin to server side

* fixed mock for ServiceNow

* fixed consumer config

* fixed test

* fixed type check

* Fixed jest test

* fixed type check
2020-07-06 16:38:45 -07:00
Josh Dover 200957bb63
Add plugin API for customizing the logging configuration (#68704) 2020-06-23 14:45:47 -06:00
Pierre Gayvallet 9e8448fc06
HttpService: duplicate some APIs from setup to start and clean mocks. (#69021)
* add apis to http start contract and clean mocks

* add apis to http start contract and clean mocks

* add `getStartContract` method

* fix new calls

* remove isTlsEnabled

* deprecates HttpServiceSetup.auth
2020-06-18 15:55:47 +02:00
Pierre Gayvallet d2006ea8a0
savedObjects: add score to repository.find results (#68894)
* add `score` to repository.find results

* update generated doc

* fix FTR result set

* remove score from exports

* fix FTR for find API

* fix label

* fix tsdoc
2020-06-18 11:39:25 +02:00
Mikhail Shustov f593455a62
Bump TypeScript to v3.9 (#67666)
* add babel support for export type

* bump ts version to 3.9.3

* rebuild kbn-pm

* bump typescript-eslint

* fix error in security plugin UI

* check export as works

* fix app migration type

* use correct test subj attribute

* fix errors from the old PR

* embeddable is already passed in props

* explicitly define type of fetch

* add some types for viz

* fix fetch type p.2

* add null to allow spreading without type errors due to override

* add type guard to fix type error

* cast to any, since cannot assign unknown

* add timestamp to known types

* fix type error in fetch

* fix type error. id is always defined in attibutes

* declare a type

* move ts-ignore to the lines with errors

* declare tuple type explicitly

* mute type error. cannot assign unknown

* fix errors. id is always defined

* fix error type

* fix override errors. id is always defined

* fix error. extends any doesn't work anymore

* fix type error. type is always defined

* env doesn't always contain values

* fix type error

* cast to string

* add: logs is already declared in getNodeLogsUrl

* state is already  passed in props

* fix some errors in timelion

* number of fragments is always defined

* 'absolute' is not just string, but value

* TEMP: option is always defined

* always true if cast to promise manually

* both props are always defined

* explicitly define returned SO type

* workaround type

* bump tslib to be compatible with ts v3.9

* test private property

* rebuild kbn-pm

* Fix ts errors for beats management

* Fix type inference broken by the TS 3.9 upgrade

* Fix ingest manager saved object attributes typings

* Fix TS errors in cross_cluster_replication and index_management.

* Fix TS error in Watcher.

* roll back colorRange wrong type

* fix security plugin types

* TypeScript 3.9 fixes for APM

* Fix ColorRange types.

* fix actions & alerts errors. ByGidi

* fix lists error

* More APM fixes

* Remove paramaterization from `removeEmpty in agent config SettingsPage component (it's only used there and doesn't need to be parameterized.)
* Add option chain for case in registerTransactionDurationAlertType
* Cast `overallValue` in transform_metrics_chart
* Use more specific type for custom link filters
* Add more option chaining for local UI filters buckets response
* Remove unused parameters from routes
* Fix getProjection type parameter
* Use destructuring in serviceNodesLocalFiltersRoute to hide `never` error
* Revert `UnionToIntersection` change in `AggregationResponseMap`

Fixes #67804.

* fix platform type error

* Fix visualizations types.

* Fix data plugin types.

* bump TS version to 3.9.5

* Fix telemetry TS errors

* Fix dashboard code

* Adding Canvas Fixes for TS 3.9

* Fix case and security_solution types

* roll back to the old export syntax. new one might cause problems in api-extractor

* update docs

* Fix timelion code

* Fix meta

* Fix types

* fix type errors om ingest_manager

* bump babel deps

* enable private props & methods syntax

* update kbn-pm dist

* whitelist 0BSD license

* use @babel/plugin-proposal-private-methods in default set as well

* disable new babel plugins

* Revert "disable new babel plugins"

This reverts commit 04d959431d.

* cleanup security_solution types

* Fixes type error for newer TypeScript

* update docs

Co-authored-by: Nicolas Chaulet <nicolas.chaulet@elastic.co>
Co-authored-by: Felix Stürmer <stuermer@weltenwort.de>
Co-authored-by: CJ Cenizal <cj@cenizal.com>
Co-authored-by: Larry Gregory <larry.gregory@elastic.co>
Co-authored-by: Nathan L Smith <smith@nlsmith.com>
Co-authored-by: Walter Rafelsberger <walter@elastic.co>
Co-authored-by: Luke Elmers <luke.elmers@elastic.co>
Co-authored-by: Alejandro Fernández Haro <alejandro.haro@elastic.co>
Co-authored-by: Tim Roes <tim.roes@elastic.co>
Co-authored-by: Clint Andrew Hall <clint.hall@elastic.co>
Co-authored-by: Patryk Kopycinski <contact@patrykkopycinski.com>
Co-authored-by: FrankHassanabad <frank.hassanabad@elastic.co>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-06-11 10:04:09 +02:00