Commit graph

235 commits

Author SHA1 Message Date
Steph Milovic 8f8e933741
[Actions] [Security solution] Jest tests for case_params files (#86028) 2020-12-15 17:20:22 -07:00
ymao1 853f30e23d
[Alerts] Remove Add Alerts flyout onClose (#85462)
* Remove add alerts flyout after onClose

* Updating tests

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Gidi Meir Morris <github@gidi.io>
2020-12-15 09:58:57 -05:00
Steph Milovic 335cd1f6fc
[Security Solution] [Cases] Move field mappings from actions to cases (#84587) 2020-12-15 07:06:11 -07:00
Yuliia Naumenko 37525f80a0
License checks for alerts plugin (#85649)
* [Alerts][License] Define minimum license required for each alert type (#84997)

* Define minimum license required for each alert type

* fixed typechecks

* fixed tests

* fixed tests

* fixed due to comments

* fixed due to comments

* removed file

* removed casting to LicenseType

* [Alerts][License] Add license checks to alerts HTTP APIs and execution (#85223)

* [Alerts][License] Add license checks to alerts HTTP APIs and execution

* fixed typechecks

* resolved conflicts

* resolved conflicts

* added router tests

* fixed typechecks

* added license check support for alert task running

* fixed typechecks

* added integration tests

* fixed due to comments

* fixed due to comments

* fixed tests

* fixed typechecks

* [Alerting UI][License] Disable alert types in UI when the license doesn't support it. (#85496)

* [Alerting UI][License] Disable alert types in UI when the license doesn't support it.

* fixed typechecks

* added licensing for alert list and details page

* fixed multy select menu

* fixed due to comments

* fixed due to comments

* fixed due to comments

* fixed typechecks

* fixed license error message

* fixed license error message

* fixed typechecks

* fixed license error message

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-12-14 19:29:39 -08:00
Gidi Meir Morris fde0fe52ed
removed unnecessary field (#85792) 2020-12-14 17:30:49 +00:00
ymao1 ab082647ac
[Actions] Notify only on action group change (#82969)
* plugged Task Manager lifecycle into status reactively

* fixed tests

* Revert "fixed tests"

This reverts commit e9f2cd05bd.

* made action group fields optional

* revert deletion

* again

* extracted action type for mto its own component

* extracted more sections of the action form to their own components

* updated icon

* added docs

* fixed always firing alert

* fixed export of components

* fixed react warning

* Adding flag for notifying on state change

* Updating logic in task runner

* Starting to update tests

* Adding tests

* Fixing types check

* Tests and types

* Tests

* Tests

* Tests

* Tests

* Tests

* Renaming field to a more descriptive name. Adding migrations

* Renaming field to a more descriptive name. Adding migrations

* Fixing tests

* Type check and tests

* Moving schedule and notify interval to bottom of flyout. Implementing dropdown from mockup in new component

* Changing boolean flag to enum type and updating in triggers_actions_ui

* Changing boolean flag to enum type and updating in alerts plugin

* Fixing types check

* Fixing monitoring jest tests

* Changing last references to old variable names

* Moving form inputs back to the top

* Renaming to alert_notify_when

* Updating functional tests

* Adding new functional test for notifyWhen onActionGroupChange

* Updating wording

* Incorporating action subgroups into logic

* PR fixes

* Updating functional test

* Fixing types check

* Changing default throttle interval to hour

* Fixing types check

Co-authored-by: Gidi Meir Morris <github@gidi.io>
2020-12-10 15:51:52 -05:00
Christos Nasikas 8b5c68ab63
[Alerts] Hide case connector (#85398)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-12-09 21:38:41 +02:00
ymao1 f3d60c519d
[Actions] Disable 'Resolved' action group for ServiceNow, Jira and IBM Resilient action types (#83829)
* Adding disabled action groups to action type definition

* Adding tests

* Adding tests

* renamed Resolved to Recovered

* fixed missing import

* fixed buggy default message behaviour

* added missing test

* fixed typing

* fixed resolved in tests

* allows alert types to specify their own custom recovery group name

* removed unnecesery field on always fires

* allows alert types to specify their own custom recovery group

* fixed mock alert types throughout unit tests

* fixed typing issues

* reduce repetition of mock data

* fixed alert type list test

* support legacy event log alert recovery syntax

* added doc

* removed unneeded change in jira

* correct callback name in siem

* renamed resolved to  recovered

* fixed mistaken rename

* Moving to alert plugin

* Updating tests

* elvated default params to alert concern instead of actions concern

* made default params optional

* Adding test

* Moving where default action params are retrieved

* Revert "Moving where default action params are retrieved"

This reverts commit 76e7608229.

* Moving where default action params are retrieved

* Cleanup

* Fixing test

* PR fixes

Co-authored-by: Gidi Meir Morris <github@gidi.io>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-12-09 09:45:38 -05:00
Mike Côté 5cc9bf82d2
Add capability of defining message variables that don't escape (#84357)
* Add capability of defining message variables that don't escape

* Fix ESLint

* Rename noEscape to useWithTripleBracesInTemplates

* Add unit tests pt 1

* Add unit tests pt 2

* Fix tests

* Fix test failures

* Docs

* PR feedback
2020-12-08 09:46:04 -05:00
DeFazio 0a0ead802c
Update widths on columns in Alert Detail view (#83823)
* Update widths on columns

* Add custom class for truncation fix

* Use euiTruncate mixin and shrink column width of status column

* Update imports to fix checks

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-12-08 08:02:07 -05:00
Yuliia Naumenko 6757b95b1e
[Alerting UI] Replaced AlertsContextProvider with KibanaContextProvider and exposed components in API (#84604)
* [Alerting UI] Replaced AlertsContextProvider with KibanaContextProvider and exposed components in API

* removed AlertContextProvider

* exposed AlertAdd and EditAlert flyouts with triggers_actions_ui plugin start

* fixed type check

* fixed tests

* fixed typechecks

* fixed wrong consumer

* fixed monitoring flyout flickering

* fixed due to comments

* fixed typechecks

* fixed typechecks

* fixed typechecks

* fixed typechecks

* fixed due to comments
2020-12-07 16:44:40 -08:00
Gidi Meir Morris c85f2545da
[Actions] Fixes issue which causes PagerDuty Params to rerender continuously. (#85050)
* prevent aciton form from rerendering constantly

* fixed typing
2020-12-04 14:50:50 -05:00
Gidi Meir Morris 249a1a41aa
[Alerting] Enables AlertTypes to define the custom recovery action groups (#84408)
In this PR we introduce a new `recoveryActionGroup` field on AlertTypes which allows an implementor to specify a custom action group which the framework will use when an alert instance goes from _active_ to _inactive_.
By default all alert types will use the existing `RecoveryActionGroup`, but when `recoveryActionGroup` is specified, this group is used instead.

This is applied across the UI, event log and underlying object model, rather than just being a label change.
To support this we also introduced the `alertActionGroupName` message variable which is the human readable version of existing `alertActionGroup` variable.
2020-12-04 13:54:48 +00:00
Gidi Meir Morris ad498530e3
[Actions] fixes bug where severity is auto selected but not applied to the action in PagerDuty (#84891)
In this PR we ensure the EuiSelects in the PagerDuty params components don't auto select a value when the field doesn't have a default value.
2020-12-04 09:28:07 +00:00
Gidi Meir Morris 6da6db28ac
Revert the Revert of "[Alerting] renames Resolved action group to Recovered (#84123)" (#84662)
Reapplies the #84123 PR:
This PR changes the default term from “Resolved” to “Recovered”, as it fits most use cases and we feel users are most likely to understand its meaning across domains.
2020-12-01 17:30:05 +00:00
Christos Nasikas 636f91c29a
[Security Solution][Detections] Fix labels and issue with mandatory fields (#84525)
* Fix labeling and bugs

* Improve naming
2020-12-01 18:01:37 +02:00
Tyler Smalley 0b5c55c597 Revert "[Alerting] renames Resolved action group to Recovered (#84123)"
This reverts commit 7dcaff5ddd.
2020-12-01 07:10:09 -08:00
Gidi Meir Morris 7dcaff5ddd
[Alerting] renames Resolved action group to Recovered (#84123)
This PR changes the default term from “Resolved” to “Recovered”, as it fits most use cases and we feel users are most likely to understand its meaning across domains.
2020-12-01 10:38:28 +00: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
Gidi Meir Morris bc1fd6ceb8
[Alerting] fixes buggy default message behaviour (#84202)
This PR addresses some weird UX we've identified with default values in Action Params components and their inferred defaults when placed inside of an Alerts flyout.
Key changes:

1. Typing of these components has been corrected to reflect that we expect these parameters to only be _partial_, as the form is used to set these values (for example, the `message` field of the Server Log action, might or might not be set, so it should be nullable, but in the typing we treated it as the _final_ valid state, which is message not being nullable).
2. When a default message is set by the params components, the are tracked against the value of the default, which means that if the default changes, then so will the value in the field. Custom values provided by the user will not be overridden when the default changes. This has to be handled by the component itself at the moment (hopefully in the future we can make this a concern of the flyout and not each component).
3. The concept of the "Recovered" action group has been removed from these components - that's an Alerting concern, not actions, and shouldn't appear in the action components' code.
2020-11-30 17:16:04 +00:00
Rudolf Meijering ee5c9bceeb
Upgrade fp-ts to 2.8.6 (#83866)
* Upgrade fp-ts to 2.8.6

* reduce import size from io-ts

* removed unused imports

* remove usage of fpts from alerts

Co-authored-by: Gidi Meir Morris <github@gidi.io>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-11-26 20:34:06 +01:00
Yuliia Naumenko b11f7830cb
[Alerting UI] Replaced AppContextProvider introduced by the plugin with KibanaContextProvider (#83248)
* Replaced AppContextProvider introduced by the plugin with KibanaContextProvider

* Removed unused files

* Fixed jest test

* Removed ActionsConnectorContext

* exposed addConnectorFlyout and editConnectorFlyouts as a plugin start result

* removed rest of unused connectors context

* fixed capabilities

* fixed jest tests

* fixed jest tests

* fixed jest tests

* fixed uptime

* fixed typecheck errors

* fixed typechecks

* fixed jest tests

* fixed type

* fixed uptime settings by pathing the correct plugin dependancy

* fixed security detection rules

* fixed due to commetns

* fixed jest tests

* fixed type check

* removed orig files

* fixed cases UI issues

* fixed due to comments

* fixed due to comments

* fixed kibana crash

* fixed es-lint
2020-11-24 00:07:47 -08:00
Gidi Meir Morris 348f6b6500
Prevents errors in Action and Alert Type UIs from cascading through Alerts Management (#83925)
This PR wraps the components injected by Alert Type and Action in `EuiErrorBoundary` components, which ensures you can still edit the Alert and other Actions when these components fail.
2020-11-23 15:38:42 +00: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
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
Gidi Meir Morris 8aa7e13cb5
[Alerting] Adds generic UI for the definition of conditions for Action Groups (#83278)
This PR adds two components to aid in creating a uniform UI for specifying the conditions for Action Groups:
1. `AlertConditions`: A component that generates a container which renders custom component for each Action Group which has had its _conditions_ specified.
2. `AlertConditionsGroup`: A component that provides a unified container for the Action Group with its name and a button for resetting its condition.

This can be used by any Alert Type to easily create the UI for adding action groups with whichever UI is specific to their component.
2020-11-20 09:26:27 +00:00
Patrick Mueller f83e06f718
[alerts] adds action group and date to mustache template variables for actions (#83195)
resolves: https://github.com/elastic/kibana/issues/67389

Adds new variables to the existing set of variables that can be used in mustache templates to be used in action parameters when creating alerts.

- `alertActionGroup` - the action group associated with the alert scheduling actions
- `date` - the current date, in ISO format
2020-11-19 12:01:44 -05:00
Gidi Meir Morris ffdc507668
fixed pagination in connectors list (#83638)
Ensures we specify the page on the EuiTable so that pagination is retain after rerenders.
2020-11-19 12:50:26 +00:00
Christos Nasikas 893b2961c0
[Security Solution][Detections] Fix adding an action to detection rules (#83722) 2020-11-19 10:24:38 +02:00
Aaron Caldwell 0546f98070
[Maps] Add query bar inputs to geo threshold alerts tracked points & boundaries (#80871)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-11-18 14:47:46 -07:00
Yuliia Naumenko 3651748b77
Fixed console error, which appears when saving changes in Edit Alert flyout (#83610) 2020-11-18 13:13:50 -08:00
ymao1 4b603da9c6
Not resetting server log level if level is defined (#83651) 2020-11-18 15:59:26 -05:00
Mikhail Shustov 4917df30b9
Update typescript eslint to v4.8 (#83520)
* update deps

* update rules

use type-aware @typescript-eslint/no-shadow instead of no-shadow. do not use no-undef, rely on TypeScript instead

* fix or mute all lint errors

* react-hooks eslint plugin fails on ? syntax

* fix wrong typings in viz

* remove React as a global type

* fix eslint errors

* update version to 4.8.1

* fix a new error
2020-11-18 18:23:08 +01:00
Greg Thompson 8a7af5bbda
Upgrade EUI to v30.2.0 (#82730)
* eui to v30.2.0

* src snapshot updates

* x-pack euipanel snapshot updates

* x-pack external link updates

* security_solution_cypress external link text

* clean up
2020-11-17 14:29:57 -07:00
ymao1 ee81b5fc04
[Alerting UI] Fix console error when setting connector params (#83333)
* Fixing console errors

* Setting defaults for undefined inputs in text area/field with message variables

* Cleanup

* Cleanup

* Fixing pagerduty timestamp validation

* Fixing test

* Pagerduty params

* Reverting unnecessary changes
2020-11-17 07:29:10 -05:00
Shahzad daa7cc92f4
[Uptime] Monitor status alert use url as instance (#81736)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-11-16 11:54:19 +01:00
Yuliia Naumenko 228387cb6e
[Alerting UI] Added ability to assign alert actions to resolved action group in UI (#83139)
* Added ability to assign alert actions to resolved action group in UI

* Added unit test

* Fixed due to comments
2020-11-15 09:49:17 -08:00
Tyler Smalley aba2068291
Consolidates Jest configuration files and scripts (#82671)
Jest tests are currently organized into main configuration files (src/dev/jest/config.js and x-pack/dev-tools/jest/create_jest_config.js). Both of these are similar, but very slightly due to  previously being in separate repositories. This change consolidates the scripts referenced in those configs and moves them to the `@kbn/test` project.

OSS contained an alias for `test_utils`. Those aliases have been removed in favor of importing these utilities from `@kbn/test/jest`

Blocker to #72569

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2020-11-12 16:19:56 -08:00
ymao1 3412843958
[Actions] Removing placeholders and updating validation messages on connector forms (#82734)
* Removing placeholders. Updating validation messages

* Splitting out url and protocol validation

* Adding url validation for slack webhook urls

* Fixing test

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-11-12 15:07:12 -05:00
Gidi Meir Morris ab72206da3
[Alerting] Moves the Index & Geo Threshold UIs into the Stack Alerts Public Plugin (#82951)
This PR includes the following refactors:
1. Moves the Index Pattern Api from _Stack Alerts_ to the _Server_ plugin of _Trigger Actions UI_. This fixes a potential bug where a user could disable the _Stack Alerts_ plugin and inadvertently break the UI of the _ES Index _ action type.
2. Extracts the UI components for _Index Threshold_ and _Geo Threshold_ from the _Trigger Actions UI_ plugin and moves them into _Stack Alerts_.
2020-11-12 16:39:40 +00:00
DeFazio 2c05957582
Update alert type selection layout to rows instead of grid (#73665)
* Update layout to rows for alert types

* Fix gutter usage

* Update heading, remove icons

* Non-working update to the combo box

* Add incorrect updates with questions to fix

* Fix combo box

* Cleanup changes to specific to this module

* fixed type checks and made combobox always visible

* Added groups by producer

* Added get producer name from kibana features names

* Added search bar with list of alert types

* Added search support functionality

* fixed links to alert type

* added alert type title

* Fixed failing tests

* Design updates to list

* Remove unsed items in import list

* fixed merge issue

* Fixed due to comments

* fixed tests

* Design fixes

Co-authored-by: Yuliia Naumenko <yuliia.naumenko@elastic.com>
2020-11-09 08:38:39 -08:00
Dhruv Bodani c78cf35ba8
Added defaultActionMessage to index threshold alert UI type definition (#80936)
* resolves https://github.com/elastic/kibana/issues/78148

Adds a `defaultActionMessage` to the index threshold alert, so that the `message` parameter for actions will be pre-filled with a useful message
2020-11-09 08:35:05 -05:00
Gidi Meir Morris 3c525d7341
[Alerting] adds an Run When field in the alert flyout to assign the action to an Action Group (#82472)
Adds a `RunsWhen` field to actions in the Alerts Flyout when creating / editing an Alert which allows the user to assign specific actions to a certain Action Groups
2020-11-09 12:56:56 +00:00
Yuliia Naumenko 802c6dccb4
Implemented Alerting health status pusher by using task manager and status pooler for Kibana status plugins 'kibanahost/api/status' (#79056)
* Implemented Alerting health status pusher by using task manager and status pooler for Kibana status plugins 'kibanahost/api/status'

* Exposed health task registration to alerts plugin

* Fixed type error

* Extended health API endpoint with info about decryption failures, added correct health task implementation

* adjusted query

* Tested locally and got it working as expected, fixed tests and type check

* Added unit tests

* Changed AlertExecutionStatusErrorReasons to be enum

* Uppercase the enum

* Replaced string values to enum

* Fixed types

* Extended AlertsClient with getHealth method

* added return type to healthStatus$

* Added configurable health check interval and timestamps

* Extended update core status interval to 5mins

* Fixed failing tests

* Registered alerts config

* Fixed date for ok health state

* fixed jest test

* fixed task state

* Fixed due to comments, moved getHealth to a plugin level

* fixed type checks

* Added sorting to the latest Ok state last update

* adjusted error queries

* Fixed jest tests

* removed unused

* fixed type check
2020-11-06 16:20:39 -08:00
ymao1 dae28519e6
[Alerting] Display Action Group in Alert Details (#82645)
* Adding action group id to event log. Showing action group as part of status in alert details view

* Simplifying getting action group id

* Cleanup

* Adding unit tests

* Updating functional tests

* Updating test

* Fix types check

* Updating test

* PR fixes

* PR fixes
2020-11-06 07:28:08 -05:00
Mike Côté 1ecd12cdf3
Add description and documentation link in alert flyout (#81526)
* Add description and documentation URL in alert flyout

* Add unit tests

* Fix type check

* Add horizontal rule

* Design fixes

* Fix uptime alert link

* Fix uptime urls

* Add anchor tag

* Fix jest test failures

* Fix monitoring links
2020-11-05 19:50:50 -05: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
Mike Côté eb43158bdd
Add descriptions to alert types (#81850)
* Initial attempt at adding descriptions to alert types

* Fix typecheck failures

* Fix i18n check

* Fix failing jest test

* Fix i18n check again

* Apply changes for Uptime

* Update x-pack/plugins/apm/public/components/alerting/register_apm_alerts.ts

Co-authored-by: Casper Hübertz <casper@formgeist.com>

* Update x-pack/plugins/apm/public/components/alerting/register_apm_alerts.ts

Co-authored-by: Casper Hübertz <casper@formgeist.com>

* Fix jest test

* Update geo threshold description

* Update description of some alert types based on feedback from Gail

* Update description of some alert types based on feedback from Gail

* Fix i18n

* Fix i18n

* Fix ESLint

* Update some copy

* Update uptime alert description

* Fix typos

Co-authored-by: Casper Hübertz <casper@formgeist.com>
2020-11-03 14:09:41 -05:00