Commit graph

145 commits

Author SHA1 Message Date
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
Yuliia Naumenko 67564b9776
Added default dedupKey value as an {{alertInstanceId}} to provide grouping functionality for PagerDuty incidents. (#84598)
* Added default dedupKey value as an {{alertInstanceId}} to provide grouping functionality for PagerDuty incidents.

* fixed type check
2020-11-30 19:23:26 -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
Yuliia Naumenko 3ee6e476ee
Fixed usage of isReady for usage collection of alerts and actions (#83760)
* Fixed usage of `isReady` for usage collection of alerts and actions

* fixed index

* fixed due to comments

* fixed type check

* fixed due to comments
2020-11-20 20:27:03 -08:00
Brian Seeders 21995e6c5f
Revert "Added default dedupKey value as an {{alertInstanceId}} to provide grouping functionality for PagerDuty incidents. (#83226)"
This reverts commit f79188aace.
2020-11-20 17:22:06 -05:00
Yuliia Naumenko f79188aace
Added default dedupKey value as an {{alertInstanceId}} to provide grouping functionality for PagerDuty incidents. (#83226)
* Added default dedupKey value as an {{alertInstanceId}} to provide grouping functionality for PagerDuty incidents. Set default savedObjectId as  {{alertInstanceId}} for ServiceNow, Resilient and Jira

* fixed comment

* fixed due to comments

* fixed doc

* fixed due to comments
2020-11-20 13:04:33 -08:00
ymao1 8ca1e93763
[Actions] Microsoft Teams connector (#83169)
* First cut at adding teams connector

* Getting teams connector working

* Unit tests

* Updating docs

* PR comments

* PR comments

* Changing error to debug log

* Fixing imports

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-11-20 11:14:17 -05:00
Jonathan Budzenski 6c23302b36
[cli] Add bin/kibana-encryption-keys (#82838)
Co-authored-by: Aleh Zasypkin <aleh.zasypkin@gmail.com>
Co-authored-by: Tyler Smalley <tylersmalley@me.com>
2020-11-19 12:41:48 -06:00
Larry Gregory 7f962e5839
Removing circular dependency between spaces and security (#81891)
* Removing circular dependency between spaces and security

* Apply suggestions from code review

Co-authored-by: Constance <constancecchen@users.noreply.github.com>
Co-authored-by: Aleh Zasypkin <aleh.zasypkin@gmail.com>

* Tests refactor

- Reorganize top level describes into 3 space-based blocks into based on spaces:
  - space disabled
  - spaces plugin unavailable
  - space enabled (most previous tests go under this new block) with new beforeEach

- wrote new tests for uncovered lines 58, 66-69

* Review1: address PR feedback

* changing fake requests for alerts/actions

* Fixing tests

* fixing more tests

* Additional testing and refactoring

* Apply suggestions from code review

Co-authored-by: Aleh Zasypkin <aleh.zasypkin@gmail.com>

* Review 2: Address feedback

* Make ESLint happy again

Co-authored-by: Constance <constancecchen@users.noreply.github.com>
Co-authored-by: Aleh Zasypkin <aleh.zasypkin@gmail.com>
Co-authored-by: Constance Chen <constance.chen.3@gmail.com>
2020-11-19 13:41:13 -05:00
Thomas Watson 4c49d5d1be
Upgrade Node.js to version 12 (#61587) 2020-11-12 22:00:57 +01: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
Steph Milovic e1b7073a64
[Alerting][Connectors] Add new executor subaction to get 3rd party case fields (#82519) 2020-11-09 10:08:00 -07: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
ymao1 057e9a72e0
Initialize to empty state when registering telemetry tasks (#82169)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-11-02 15:34:16 -05:00
Thomas Watson 700225061a
Upgrade to hapi version 18 (#80468) 2020-11-02 13:18:00 +01:00
Christos Nasikas 22f4b8400b
[Actions] Fix type contract (#82168) 2020-10-31 00:26:12 +02:00
Christos Nasikas 70807c98bd
[Actions] Fix actionType type on registerType function (#82125) 2020-10-30 16:45:24 +02:00
Thomas Watson 1407f713e5
Update KibanaRequest to use the new WHATWG URL API (#80713) 2020-10-29 14:35:48 +01:00
Mikhail Shustov 2782204cc1
Get rid of global types (#81739)
* move global typings to packages/kbn-utility-types

* update all imports

* add tests

* mute error

* update docs

* ok

* rename kbn-utility-types/test --> kbn-utility-types/jest
2020-10-28 11:03:04 +01:00
ymao1 8b1ff4ca59
[Actions] Adding hasAuth to Webhook Configuration to avoid confusing UX (#81778)
* Adding hasAuth to server and client

* Adding migration and fixing tests

* Fixing test

* Adding spacing

* Adding functional test

* Fixing migration

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-10-27 13:34:23 -04:00
Ying Mao 9d602e364e Revert "[Actions] Adding hasAuth to Webhook Configuration to avoid confusing UX (#81390)"
This reverts commit fd7f6b5716.
2020-10-27 09:38:36 -04:00
ymao1 fd7f6b5716
[Actions] Adding hasAuth to Webhook Configuration to avoid confusing UX (#81390)
* Adding hasAuth to server and client

* Adding migration and fixing tests

* Fixing test

* Adding spacing

* Adding functional test

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-10-27 07:45:02 -04:00
Yuliia Naumenko ee7f16e312
Fixed migration issue for case specific actions, by extending email action migrator checks (#81673)
* Fixed migration issue for case specific actions, by extending email action migrator checks

* Fixed e2e test

* fixed due to comments
2020-10-26 17:03:41 -07:00
Larry Gregory bf0f8bbb42
Cleanup feature registration (#80909) 2020-10-20 12:53:43 -04:00
Justin Kambic cc43b14d17
[Alerting] Add scoped cluster client to alerts and actions services (#80794)
* Add scoped cluster client to alerts and actions services.

* Modify functional test to use new ES client.
2020-10-20 09:54:48 -04:00
Gidi Meir Morris 5460ad741c
[Task Manager] Cleans up legacy plugin structure (#80381)
This PR addresses a list of legacy code debt the plugin has incurred over the past year due to extensive changes in its internals and the adoption of the Kibana Platform.

It includes:
1. The `TaskManager` class has been split into several independent components: `TaskTypeDictionary`,  `TaskPollingLifecycle`,  `TaskScheduling`,  `Middleware`. This has made it easier to understand the roles of the different parts and makes it easier to plug them into the observability work.
2. The exposed `mocks` have been corrected to correctly express the Kibana Platform api
3. The lifecycle has been corrected to remove the need for  intermediary streames/promises which we're needed when we first introduced the `setup`/`start` lifecycle to support legacy.
4. The Logger mocks have been replaced with the platform's `coreMocks` implementation
5. The integration tests now test the plugin's actual public api (instead of the internals).
6. The Legacy Elasticsearch client has been replaced with the typed client in response to the deprecation notice.
7. Typing has been narrowed to prevent the `type` field from conflicting with the key in the `TaskDictionary`. This could have caused the displayed `type` on a task to differ from the `type` used in the Dictionary itself (this broke a test during refactoring and could have caused a bug in production code if left).
2020-10-20 13:00:13 +01:00
Thom Heymann bc8a1dac99
ECS audit logging (#74640)
* ECS audit logging

* Apply suggestions from code review

Co-authored-by: Larry Gregory <larry.gregory@elastic.co>

* Update x-pack/plugins/security/server/authentication/audit_events.ts

Co-authored-by: Larry Gregory <larry.gregory@elastic.co>

* Update docs/settings/security-settings.asciidoc

Co-authored-by: Larry Gregory <larry.gregory@elastic.co>

* remove audit trail service from core

* fix test

* Updated docs and added beta warning

* Added dev docs

* Tweaks

* Plugin list changes

* Apply suggestions from technical writers

Co-authored-by: Kaarina Tungseth <kaarina.tungseth@elastic.co>

* Added docs suggestion

* Added api integration tests

* Added suggestions from platform team

* Update x-pack/plugins/security/server/audit/audit_service.test.ts

Co-authored-by: Joe Portner <5295965+jportner@users.noreply.github.com>

* Update x-pack/plugins/security/server/audit/audit_service.test.ts

Co-authored-by: Joe Portner <5295965+jportner@users.noreply.github.com>

* Update x-pack/plugins/security/server/audit/audit_service.test.ts

Co-authored-by: Joe Portner <5295965+jportner@users.noreply.github.com>

* Update docs/user/security/audit-logging.asciidoc

Co-authored-by: Joe Portner <5295965+jportner@users.noreply.github.com>

* Update docs/settings/security-settings.asciidoc

Co-authored-by: Joe Portner <5295965+jportner@users.noreply.github.com>

* Update x-pack/plugins/security/server/config.ts

Co-authored-by: Joe Portner <5295965+jportner@users.noreply.github.com>

* Added suggestions from PR

* Grouped events table

* Update x-pack/plugins/security/server/audit/audit_events.ts

Co-authored-by: Larry Gregory <larry.gregory@elastic.co>

* Update x-pack/plugins/security/server/audit/audit_events.ts

Co-authored-by: Larry Gregory <larry.gregory@elastic.co>

* Fixed ECS version number in docs

Co-authored-by: Larry Gregory <larry.gregory@elastic.co>

* Added suggestions from code review

* Removed beta

* Added suggestions from code review

Co-authored-by: Larry Gregory <larry.gregory@elastic.co>
Co-authored-by: Kaarina Tungseth <kaarina.tungseth@elastic.co>
Co-authored-by: Joe Portner <5295965+jportner@users.noreply.github.com>
2020-10-16 20:40:38 +01:00
Mike Côté 3ad698d6a0
Licensed feature usage for connectors (#77679)
* Initial work

* Fix type check and jest failures

* Add unit tests

* No need to notifyUsage from alert execution handler

* Fix ESLint

* Log action usage from alerts

* Add integration tests

* Fix jest test

* Skip feature usage of basic action types

* Fix types

* Fix ESLint issue

* Clarify comment

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-10-15 14:47:46 -04: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
Gidi Meir Morris 25c5daa83a
Renames "Built-In Alerts" feature to "Stack Alerts" and "Actions" feature to "Actions and Connectors" (#79513)
Renames "Built-In Alerts" feature to "Stack Alerts" and "Actions" feature to "Actions and Connectors" as we've decided these names make more appropriate and better communicate what these features are.
2020-10-06 17:51:05 +01:00
Patrick Mueller 6b80eb20ab
[Actions] write action executor errors to the Kibana log (#79474)
resolves https://github.com/elastic/kibana/issues/72058

Finally, we're logging the action executor error responses to the Kibana log.
We have not been doing this previously, out of an abundance of caution.  The
message written may contain data returned from a 3rd party service call, and
we weren't sure this would be "safe" to log, in a PII sense.

After several minor releases, and seeing these service messages in the event
log for almost all the built-in action types, we've decided they are "safe" and
it's time to add them, as they provide some **very** helpful diagnostic
feedback to customers.
2020-10-06 11:40:35 -04:00
Gidi Meir Morris 4fdf2f1566
[Actions] makes savedObjectId field optional (#79186)
This PR makes the `savedObjectId` parameter optional in the Jira, ServiceNow and IBM Resilient Connectors.
This allows them to execute without this field outside of Alerts, as it is currently populated using the `alertId` which isn't available in other places.
Additionally this adds an optional field in the `Params` Components for all three of the connectors, which allows users to provide a value for the `savedObjectId` field if the so wish.
2020-10-05 18:21:20 +01:00
Alejandro Fernández Haro f398b49200
[Usage Collection] [schema] actions (#78832) 2020-10-02 16:03:42 +01:00
Yuliia Naumenko 63ff0606df
Extended Email action configuration with hasAuth property to identify if the connector require user credentials. Improved UX for Email connector (#78235)
* Extended Email action configuration with hasAuth property to identify if the connector require user credentials. Improved UX for Email connector

* Fixed failing tests and comments

* Fixed type check and reverted logic of Add user and password switch button

* Fixed due to the latest design requirenments

* Fixed due to review comments
2020-10-01 13:57:28 -07:00
Christos Nasikas cbc83003d3
[Actions][Jira] Fix bug with Jira sub-task (#79070) 2020-10-01 14:21:34 +03:00
Alejandro Fernández Haro 65cf6393c7
[Task names in TaskManager] Rename "telemetry" to "usage" (#78129)
* [Task names in TaskManager] Rename "telemetry" to "usage"

* Revert task IDs but leaving renamed titles

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-10-01 08:26:14 +01:00
Alejandro Fernández Haro 9fdb23769b
[Loggers] Rename "telemetry" to "usage" (#78130)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-10-01 08:25:05 +01:00
Christos Nasikas 3d9ea52803
[Actions][Jira] Set parent issue for Sub-task issue type (#78772) 2020-10-01 09:34:25 +03:00
Christos Nasikas 4f6df624e9
[Actions] Migrate cases configuration object (#77998)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Gidi Meir Morris <github@gidi.io>
2020-09-29 21:10:57 +03:00
Gidi Meir Morris 8547b32bab
[Actions] avoids setting a default dedupKey on PagerDuty (#77773)
The PagerDuty Action currently defaults to a dedupKey that's shared between all action executions of the same connector.
To ensure we don't group unrelated executions together this PR avoids setting a default, which means each execution will result in its own incident in PD.

As part of this change we've also made the `dedupKey` a required field whenever a `resolve` or `acknowledge` event_action is chosen. This ensure we don't try to resolve without a dedupKey, which would result in an error in PD.

A migration has been introduced to migrate existing alerts which might not have a `dedupKey` configured.
2020-09-28 14:56:20 +01:00
Pierre Gayvallet 0d09cea436
Remove legacy plugins support (#77599)
* remove ALL the things.

* adapt some types and tests

* restore ensureValidConfiguration

* fix legacy service tests

* adapt uiRender mixin

* remove legacy types

* update generated doc

* restore legacy plugin schema

* update generated doc

* remove remaining code of x-pack/legacy

* adapt imports due to merge

* cleanup CODEOWNERS

* cleanup gitignore & i18nrc

* cleanup tsconfig.json

* remove unused i18n keys

* add back `"legacy/plugins/**/*",` to tsconfig until legacy space plugin is deleted

* fix create_jest_config

* remove references from eslintrc

* more eslint cleanup

* remove `x-pack/index.js`

* fix xpack gulp scripts

* fix bug with default + named imports from boom

* remove rules from eslintrc

* remove LegacyInternals

* review comments

* update generated doc

* cleanup legacy metadatas

* revert changes to eslintrc

* update generated doc
2020-09-23 09:52:51 +02:00
Gidi Meir Morris 41a7f1a1c2
[Actions] adds a Test Connector tab in the Connectors list (#77365)
Adds a tab in the _Edit Alert_ flyout which allows the user to _test_ their connector by executing it using an example action. The execution relies on the connector being updated, so is only enabled when there are no saved changes in the Connector form itself.
2020-09-22 11:18:33 +01:00
Larry Gregory 9f3992f6c2
Grouped features for space management (#74151)
* Grouped features for space management

* Apply suggestions from code review

Co-authored-by: Joe Portner <5295965+jportner@users.noreply.github.com>

* Address PR Feedback

* docs changes

* updating types/docs

* update APM feature name

* Reintroduce extraAction following EUI update

* change ordering of infra features, and render callout for management category

Co-authored-by: Joe Portner <5295965+jportner@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-09-18 12:30:59 -04:00
Gidi Meir Morris 3101ca3195
[Alerting] renames code in alerting RBAC exemption to make it easier to maintain (#77598)
Refactor of code to make it a little clearer what it's doing and improve maintenance.
2020-09-18 09:54:49 +01:00
Gidi Meir Morris fd624b1077
[Alerting & Actions] Overwrite SOs when updating instead of partially updating (#73688)
This PR changes the Alerts & Actions clients to ensure they require full updates (rather than partial) to SOs and overwrites the entire document when making the update.
This is to prevent the situation where nested objects get _merged_ instead of replaced when a user makes an `update`.

We also enhanced the EncryptedSavedObjectsClient to allow specified `id`s when overwriting an existing object.
2020-09-18 09:53:35 +01:00
Gidi Meir Morris efe76121c7
[Alerting] Exempt Alerts pre 7.10 from RBAC on their Action execution until updated (#75563)
Marks all Alerts with a `versionApiKeyLastmodified ` field that tracks what version the alert's Api Key was last updated in. We then use this field to exempt legacy alerts (created pre `7.10.0`) in order to use a _dialed down_ version of RBAC which should allow old alerts to continue to function after the upgrade, until they are updates (at which point they will no longer be **Legacy**).

More details here: https://github.com/elastic/kibana/issues/74858#issuecomment-688324039
2020-09-16 11:47:37 +01:00
Pierre Gayvallet 043ef5e1d7
Create the @kbn/std package (#77329)
* move `src/core/utils` to the @kbn/std package

* update README

* update codeowners and add yarn lock file

* remove export from src/core/public and src/core/server and use package import instead

* update generated doc

* adapt forgotten import

* update `data` plugin doc
2020-09-15 15:21:05 +02:00
Larry Gregory 2e34eb239f
Hide management sections based on cluster/index privileges (#67791)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-09-14 09:30:47 -04: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