Commit graph

215 commits

Author SHA1 Message Date
Yuliia Naumenko d09bd63786
Changed actions API endpoints urls to follow Kibana STYLEGUIDE (#65936)
* Changed actions API endpoints urls to follow Kibana STYLEGUIDE

* Fixed tests

* fixed test

* fixed test

* resolved conflicts

* Fixed siem tests

* Fixed failing test

* fixed readme and test

* Changed actions api urls to follow the template 'api/{plugin}/{type}/{id}

* Fixed type checks

* Fixed tests and API

* fixed tests

* Fixed type checks

* fixed type check
2020-05-24 20:27:42 -07:00
Gidi Meir Morris def6526384
[Alerting] Hides the action and action_task_params SavedObjects types (#67109)
As part of the work towards adding RBAC & Feature Controls support in Alerting (https://github.com/elastic/kibana/issues/43994), we've decided that the ActionsClient will handle authorisation against Actions instead of relying on the SavedObjectsClient on its own.

To prevent (or at least, minimise the chances of) bypassing this auth model by using the SavedObjects client this PR makes the `action` and `action_task_params` SavedObject types  _hidden_ types and given the ActionsClient permission to interact with it.
2020-05-22 09:07:09 +01:00
restrry bf04235dae apply prettier styles 2020-05-22 09:08:58 +02:00
Gidi Meir Morris dfa22d17b9
[Saved Objects] adds support for including hidden types in saved objects client (#66879)
As part of the work needed for RBAC & Feature Controls support in Alerting (https://github.com/elastic/kibana/issues/43994) we've identified a need to make the Alert Saved Object type a _hidden_ type.

As we still need support for Security and Spaces, we wish to use the standard SavedObjectsClient and its middleware, but currently this isn't possible with _hidden_ types.

To address that, this PR adds support for creating a client which includes hidden types.
2020-05-20 09:55:02 +01:00
Patrick Mueller 39427f5ed3
[Alerting] changes preconfigured actions config from array to object (#65397)
resolves https://github.com/elastic/kibana/issues/63171

Previously, preconfigured actions were specified as an array of action
properties.  This ended up being problematic when using the kibana keystore
for secrets, as you'd have to reference specific actions via index.

This changes preconfigured actions to be specified as an object, where the
property key is the id, and the body is the remainder of the action properties.

As access to preconfigured actions has leaked across the code base, it's
probably time to consider changing the internal representation from an array
to a Map, to provide easier access by action id.  For a future PR.
2020-05-07 15:12:01 -04:00
Mike Côté b71b13947e
Shallow clone properties when adding to registry (#65309) 2020-05-06 13:39:09 -04:00
Gidi Meir Morris 94127d803a
[Alerting] migrates acceptance and functional test fixtures to KP (#64888)
This PR migrates the vast majority of Alerting legacy code to the Kibana Platform.

This includes:

1. Removed legacy Task Manager
2. Migrates Fixture plugins in Alerting, Triggers UI and Task Manager Perf

This does not includes:

1. The PagerDuty simulator due to a lack of support for custom responses in the platform. issue opened. https://github.com/elastic/kibana/issues/65045
2. The Webhooks simulator due to a lack of support for custom authorisation. Requires investigation.
2020-05-06 09:57:26 +01:00
Spencer ee270c7c3f
disallow external imports to src/core/utils (#64852) 2020-05-05 14:56:22 -07:00
Christos Nasikas 47b8ba5d5b
[SIEM][CASE] Refactor Connectors - Jira Connector (#63450) 2020-05-01 00:20:00 +03:00
Patrick Mueller f85b3898f6
[Event Log] add rel=primary to saved objects for query targets (#64615)
resolves https://github.com/elastic/kibana/issues/62668

Adds a property named `rel` to the nested saved objects in the event
documents, whose value should not be set, or set to `primary`.
The query by saved object function changes to only match event documents
with that saved objects if it has the `rel: primary` value.

This is used to limit searching alerting's executeAction event document
with only the alert saved object, and not the action saved object (this
document has an alert and action saved object). The alert saved object
has the `rel: primary` field set, and the action does not.  Previously,
those documents were returned with a query of the action saved object.
2020-04-30 00:27:51 -04:00
Gidi Meir Morris 9fe7229357
[Alerting] migrates all remaining plugins to new platform (#64335)
Completes the migration of all Alerting Services plugins onto the Kibana Platform

It includes:

1. Actions plugin
2. Alerting plugin
3. Task Manager plugin
4. Triggers UI plugin

And touches the Uptime and Siem plugins as their use of the Task Manager relied on some of the legacy lifecycle to work (registering AlertTypes and Telemetry tasks after the Start stage has already began). The fix was simply to moves these registrations to the Setup stage.
2020-04-29 15:46:54 +01:00
Patrick Mueller 5457a62fdb
[Event Log] add event.outcome to relevant event log documents (#64389)
resolves https://github.com/elastic/kibana/issues/61891

Adds a relatively new ECS field `event.outcome`. Value of `success`, `failure`,
or `unknown`. This is nice, as the only way we have currently of determining an
error for an alert or action execution in the log is the existence of an
`error.message` field.  It is added to to the documents for those events.

see: https://www.elastic.co/guide/en/ecs/current/ecs-event.html
2020-04-27 23:11:43 -04:00
Mike Côté db374fc950
Ability to get scoped call cluster from alerting and action executors (#64432)
* Initial work

* Rename to getScopedCallCluster

* Fix typecheck

* Fix more type check issues

* Add tests

* Add docs

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-27 13:46:04 -04:00
Yuliia Naumenko 6bf0e731b6
Extended existing alerting functionality to support preconfigured only action types (#64030)
* Extended existing alerting functionality to support preconfigured only action types

* fixed functional test

* Adding documentation

* Fixed UI part due to comments

* added missing tests

* fixed action type execution

* Fixed documentation

* Fixed due to comments

* fixed type checks

* extended isActionExecutable to check exact action id if it is in the preconfigured list
2020-04-24 14:38:28 -07:00
Gidi Meir Morris a012ddf9df
[alerting] removes usage of any throughout Alerting Services code (#64161)
This removes unneeded use of `any` throughout:
1. alerting
2. alerting_builtin
3. actions
4. task manager
5. event log

It also adds a linting rule that will prevent us from adding more `any` in the future unless an explicit exemption is made.
2020-04-24 17:04:36 +01:00
Patrick Mueller 59a946394d
[Alerting] change server log action type .log to .server-log in README (#64124)
The README for actions referenced the server log action type as having an id
of `.log`, but it's actually `.server-log`.
2020-04-23 23:09:17 -04:00
Tyler Smalley feed406c77
[eslint] no_restricted_paths config cleanup (#63741)
Major cleanup of the no_restricted_paths rule for imports of core.

For relative imports, we use eslint-module-utils/resolve which resolves
to the full filesystem path. So, to support relative and absolute
imports from the src alias we need to define both the directory and the
index including file extension.

This rule was handling both core imports, as well as imports from other
plugins. Imports from other plugins are being used much more liberally
allowed through the exceptions in tests. I choose to break these up,
removing this exception for tests for core imports.

Fixes:
Absolute imports of src/core/server/mocks were not allowed in src. This
was not an issue in x-pack due to the target excluding
!x-pack/**/*.test.* and !x-pack/test/**/*.

Non-top-level public and server imports were allowed from X-Pack tests
to the previously mentioned exclusion.

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2020-04-23 15:59:01 -07:00
Yuliia Naumenko f7e1c17f28
Implemented do not return the config from the action APIs get and getAll (#64266) 2020-04-23 07:53:54 -07:00
Gidi Meir Morris 02d55db6cd
[Alerting] Improve validation and errors handling in PagerDuty action (#63954)
Improves the messaging when the Pager Duty action has trouble parsing the timestamp field and adds trimming on the timestamp's field to make us more flexible in handling the parsing and hence more likely to be forgiving of the input by the user.

As the timestamp relies on context variables provided via mustcahe templates, we can't reliably validate this field at alert creation time.
We address by:
1. Trimming the edges, which is required when parsing a date, should help prevent accidental spaces from breaking the parsing.
2. Checking for a mustache template on the client side and if there are none - we validate for a valid timestamp when the action is created.
2020-04-21 12:32:14 +01:00
Christos Nasikas 10ccc0a2f2
[SIEM][CASE] Create comments sequentially (#63692) 2020-04-16 21:26:32 +03:00
Rudolf Meijering 00a1144ae2
Refactor Plugins to access elasticsearch from CoreStart (#59915)
* x-pack/watcher: use Elasticsearch from CoreStart

* x-pack/upgrade_assistant: use Elasticsearch from CoreStart

* x-pack/actions: use Elasticsearch from CoreStart

* x-pack/alerting: use Elasticsearch from CoreStart

* x-pack/lens: use Elasticsearch from CoreStart

* expressions: use Elasticsearch from CoreStart

* x-pack/remote_clusters: remove unused Elasticsearch dependency on CoreSetup

* x-pack/oss_telemetry: use Elasticsearch from CoreStart

* Cleanup after #59886

* x-pack/watcher: create custom client only once

* Revert "x-pack/watcher: create custom client only once"

This reverts commit 78fc4d2e93.

* Revert "x-pack/watcher: use Elasticsearch from CoreStart"

This reverts commit b621af9388.

* x-pack/task_manager: use Elasticsearch from CoreStart

* x-pack/event_log: use Elasticsearch from CoreStart

* x-pack/alerting: use Elasticsearch from CoreStart

* x-pack/apm: use Elasticsearch from CoreStart

* x-pack/actions: use Elasticsearch from CoreStart

* PR Feedback

* APM review nits

* Remove unused variable

* Remove unused variable

* x-pack/apm: better typesafety

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-15 17:07:57 +02:00
Patrick Mueller 7677764c65
[Alerting] fixes to allow pre-configured actions to be executed (#63432)
resolves https://github.com/elastic/kibana/issues/63162

Most of the support for pre-configured actions has already been added
to Kibana, except for one small piece.  The ability for them to be
executed.  This PR adds that support.
2020-04-14 18:20:50 -04:00
Gidi Meir Morris 1f732ad29a
[Event Log] Adds namespace into save objects (#62974)
Adds a namespace attribute to the saved object object within the Event Log so that each Saved Object can have its own. This change also removes the existing kibana.namespace field.

As Event Log is not yet in use, this does not include a migration.
2020-04-14 10:57:46 +01:00
Patrick Mueller 500b069efd
[Alerting] set correct parameter for unauthented email action (#63086)
PR https://github.com/elastic/kibana/pull/60839 added support for
unauthenticated emails, but didn't actually do enough to make it work.

This PR completes that support, and adds some tests.

You can do manual testing now with [maildev](http://maildev.github.io/maildev/).
2020-04-13 17:41:22 -04:00
Yuliia Naumenko 730dcbf638
Implemented actions server API for supporting preconfigured connectors (#62382)
* Implemented actions server API for supporting preconfigured connectors defined in kibana.yaml

* Fixed type check

* Fixed due to comments and extended functional tests

* Fixed tests and renamed connectors

* fixed jest tests

* Fixed type checks

* Fixed failing alert save

* Fixed alert client tests

* fixed type checks

* Fixed language check error

* Fixed jest tests

* Added missing comments and docs

* fixed due to comments

* Fixed json config for preconfigured

* fixed type check, reverted config

* config experiment with json stringify

* revert experiment

* Removed the spaces from connector names in config
2020-04-08 09:54:42 -07:00
Patrick Mueller 459d6ec365
[Alerting] for email action, set tls.rejectUnauthorized: false when secure: false (#62380)
resolves https://github.com/elastic/kibana/issues/62372

See the referenced issue for background.  Eventually we will probably have to
have a separate setting for `tls.rejectUnauthorized`, not base it on the
value of the `secure` config property.  But this will likely be useful for
a number of smtp servers used by customers.
2020-04-07 08:30:17 -04:00
Mikhail Shustov bdf628d29a
use union of strings instead of enum (#62493)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-06 12:31:36 +02:00
Christos Nasikas b4ee6a8fff
[SIEM][CASE] Fix dates when updating (#61603)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-27 20:50:12 +02:00
Yuliia Naumenko 40d50343c9
Fix alert and action telemetry reporting to stop sending data that contains dot in the name (#61389)
* fix alert and action telemetry reporting to stop sending data that starts or ends with a '.'

* Fixed due to comments

* fixed test

* revert testing data
2020-03-26 16:49:07 -07:00
Christos Nasikas f462b10863
[SIEM][CASE] Add the correct user information to each comment (#61513) 2020-03-26 22:17:52 +02:00
Pierre Gayvallet 468de51153
Add plugin start contract to getStartServices return value (#61216)
* add plugin own contract as third element of getStartServices result

* adapt plugins code

* update tests

* revert unknown to use void again

* update generated doc

* fix UT

* update mock to allow non-object `pluginStartContract`

* add @typeParam documentation
2020-03-26 10:49:05 +01:00
Patrick Mueller aa73e2aee3
[Alerting] change index action config executionTimeField to nullable (#61127)
resolves https://github.com/elastic/kibana/issues/61056

When the index action params moved into config, the `schema.maybe()` on the
`executionTimeField` should have been changed to `schema.nullable()`, otherwise
you can never "unset" the field, once it's set.

Changes rippled down to the UI as well.

To be extra safe, we also check that the `executionTimeField` isn't an empty
string when trimmed, as ES will not accept a document with a property that is
the empty string.
2020-03-24 23:19:56 -04:00
Patrick Mueller 72bc0eae32
[Alerting] allow email action to not require auth (#60839)
resolves https://github.com/elastic/kibana/issues/57143

Currently, the built-in email action requires user/password properties to be
set in it's secrets parameters.  This PR changes that requirement, so they
are no longer required.
2020-03-23 19:02:28 -04:00
Gidi Meir Morris 55814addac
[Alerting] Unifies the use of a single constant for Api urls in alerting & actions (#60430)
Unifies the use of a single constant for Api urls in alerting & actions
2020-03-20 17:39:07 +00:00
Mike Côté 851b8a82a5
License checks for actions plugin (#59070)
* Define minimum license required for each action type (#58668)

* Add minimum required license

* Require at least gold license as a minimum license required on third party action types

* Use strings for license references

* Ensure license type is valid

* Fix some tests

* Add servicenow to gold

* Add tests

* Set license requirements on other built in action types

* Use jest.Mocked<ActionType> instead

* Change servicenow to platinum

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

* Make actions config mock and license state mock use factory pattern and jest mocks (#59370)

* Add license checks to action HTTP APIs (#59153)

* Initial work

* Handle errors in update action API

* Add unit tests for APIs

* Make action executor throw when action type isn't enabled

* Add test suite for basic license

* Fix ESLint errors

* Fix failing tests

* Attempt 1 to fix CI

* ESLint fixes

* Create sendResponse function on ActionTypeDisabledError

* Make disabled action types by config return 403

* Remove switch case

* Fix ESLint

* Add license checks within alerting / actions framework (#59699)

* Initial work

* Handle errors in update action API

* Add unit tests for APIs

* Verify action type before scheduling action task

* Make actions plugin.execute throw error if action type is disabled

* Bug fixes

* Make action executor throw when action type isn't enabled

* Add test suite for basic license

* Fix ESLint errors

* Stop action task from re-running when license check fails

* Fix failing tests

* Attempt 1 to fix CI

* ESLint fixes

* Create sendResponse function on ActionTypeDisabledError

* Make disabled action types by config return 403

* Remove switch case

* Fix ESLint

* Fix confusing assertion

* Add comment explaining double mock

* Log warning when alert action isn't scheduled

* Disable action types in UI when license doesn't support it (#59819)

* Initial work

* Handle errors in update action API

* Add unit tests for APIs

* Verify action type before scheduling action task

* Make actions plugin.execute throw error if action type is disabled

* Bug fixes

* Make action executor throw when action type isn't enabled

* Add test suite for basic license

* Fix ESLint errors

* Stop action task from re-running when license check fails

* Fix failing tests

* Attempt 1 to fix CI

* ESLint fixes

* Return enabledInConfig and enabledInLicense from actions get types API

* Disable cards that have invalid license in create connector flyout

* Create sendResponse function on ActionTypeDisabledError

* Make disabled action types by config return 403

* Remove switch case

* Fix ESLint

* Disable when creating alert action

* Return minimumLicenseRequired in /types API

* Disable row in connectors when action type is disabled

* Fix failing jest test

* Some refactoring

* Card in edit alert flyout

* Sort action types by name

* Add tooltips to create connector action type selector

* Add tooltips to alert flyout action type selector

* Add get more actions link in alert flyout

* Add callout when creating a connector

* Typos

* remove float right and use flexgroup

* replace pixels with eui variables

* turn on sass lint for triggers_actions_ui dir

* trying to add padding around cards

* Add callout in edit alert screen when some actions are disabled

* improve card selection for Add Connector flyout

* Fix cards for create connector

* Add tests

* ESLint issue

* Cleanup

* Cleanup pt2

* Fix type check errors

* moving to 3-columns cards for connector selection

* Change re-enable to enable terminology

* Revert "Change re-enable to enable terminology"

This reverts commit b497dfd6b6.

* Add re-enable comment

* Remove unecessary fragment

* Add type to actionTypeNodes

* Fix EuiLink to not have opacity of 0.7 when not hovered

* design cleanup in progress

* updating classNames

* using EuiIconTip

* Remove label on icon tip

* Fix failing jest test

Co-authored-by: Andrea Del Rio <delrio.andre@gmail.com>

* Add index to .index action type test

* PR feedback

* Add isErrorThatHandlesItsOwnResponse

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Andrea Del Rio <delrio.andre@gmail.com>
2020-03-20 10:49:37 -04:00
Christos Nasikas 3acbbcd2b0
Return incident's url (#60617) 2020-03-19 23:23:37 +02:00
Mike Côté 4efeeac560
Sort by name when fetching alerts and connectors (#60506)
* Sort by name when fetching alerts and connectors

* Fix jest tests

* Add functional test

* Fix failing jest test
2020-03-19 08:06:51 -04:00
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
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
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
Rudolf Meijering 80e6ff729a
Make context.core required argument to context providers (#59996)
* Make context.core required argument to context providers

* Refactor plugins: context.core isn't optional anymore

* Update docs
2020-03-12 20:39:29 +01:00
Yuliia Naumenko d3f53f6f6b
Adds telemetry support to alerting and actions plugins (#58081)
* Added base telemetry functionality

* Fixed actions collector due to NP plugin changes

* Fixed type checks

* Fixed alerting plugin usage collector

* Added actions and alerting telemetry tasks

* Fixed failing tests and resolved comments

* Extended telemetry for alerts by adding aggregations for throttle, schedule and connectors count

* Fixed tests

* Refactored using callCluster aggregations

* Fixed compare

* Fixed time convertion
2020-03-12 10:46:24 -07:00
Christos Nasikas e6327d32b0
[SIEM][CASE] ServiceNow executor (#58894)
* Refactor structure

* Init ServiceNow class

* Add constants

* Add configuration scheme

* Refactor configuration schema

* Refactor parameters schema

* Create new types

* Add supported source fields

* Create helpers

* Create ServiceNow lib

* Push incident

* Declare private methods

* Create UpdateIncident type

* Create updateIncident method

* Create executor actions

* Refactor response

* Test helpers

* Remove unnecessary validation

* Fix validation errors

* Throw error for unsupported actions

* Create mock incident

* Test executor

* Test ServiceNow lib

* Convert to camelCase

* Remove caller_id

* Refactor helpers

* Refactor schema

* Remove executorAction

* Test action handlers

* Refactor tests

* Create and update comments

* Remove closure option & change attribute name

* Fix tests

* Change lib structure

* Validate empty mapping

* Fix functional tests

* Fix type

* Change API to only add comments through incident's API

* Add instruction to README

* Change API version

* Test

* Test simulator

* Fix version on tests

* Remove SIEM reference in README
2020-03-11 16:01:07 +02:00
Pierre Gayvallet 45fb6f38b8
Hide input value from kbn-config-schema error messages (#58843)
* use inline snapshots instead of snapshots

* hide input value from error messages

* update core snapshots

* update xpack snapshots

* fix ftr assertions

* fix new snapshots

* hide values for byte_size and duration

* update new snapshots

* remove another byte_size value reference

* fix yet another value references in error messages

* update xpack snapshots

* update xpack ftr assertions
2020-03-06 17:47:28 +01:00
Yuliia Naumenko 4883d4bb2a
Fixed ci type check errors for alerting and actions properties for SIEM RouteHandlerContext (#59400)
* Fixed ci type check errors for alerting and actions optional properties on RouteHandlerContext

* Reverted git revert b83f81458c
2020-03-05 07:52:24 -08:00
spalger b83f81458c Revert "Makes alerting and actions optional properties for interface RequestH… (#59264)"
This reverts commit 755439d5e7.
2020-03-04 22:13:11 -07:00
Yuliia Naumenko 755439d5e7
Makes alerting and actions optional properties for interface RequestH… (#59264)
* Makes alerting and actions optional properties for interface RequestHandlerContext

* Added an error response result if context for actions and alerting is not registered
2020-03-04 17:30:15 -08:00
Mike Côté 24b8ecf74d
Add localization to missing action types (#58554) 2020-02-25 21:47:53 -05:00
Mikhail Shustov d61ef267d5
force savedObject API consumers to define SO type explicitly (#58022)
* force savedObject consumers to define type explicitly

* address comments

* regen docs
2020-02-21 22:11:05 +01:00
Yuliia Naumenko c07ff7174e
Alerting plugin migrate to Kibana platform (#57635)
* Moved alerting plugin to new platform

* Fixed type checks

* Fixed failing tests

* Fixed functional tests

* Fixed plugin context initialization

* small typo

* Fixed type checks

* Fixed create alert schema

* Moved alerting files to Kibana platform folder

* Fixed duration validation

* Fixed find page size

* Fixed type check

* Fixed due to comments

* Fixed merge issues

* Added missing

* Fixed alerting functional tests

* Fixed tests

* Fixed update schema validation

* Added throttle update

* Fixed failing tests

* test

* fixed setup alerting dependencies for siem and monitoring plugins

* Fixed siem setup dependancies
2020-02-18 09:05:56 -08:00
Patrick Mueller 5d3797ee0b
change id of x-pack event_log plugin to eventLog (#57612)
change id of x-pack event_log plugin to eventLog
2020-02-16 20:10:35 -05:00
Patrick Mueller 96c39a5a14
change slack action to only report on whitelisted host name (#57582)
Previously, when using the slack action with a url which was not whitelisted, the entire URL was reported in the error.  With this change, only the hostname is reported in the error.
2020-02-14 18:29:50 -05:00
Mike Côté 3da8a76fc2
Disable action plugin functionality when ESO plugin is using an ephemeral encryption key (#56906)
* Disable actions client when ESO using generated key

* Add test for getActionsClientWithRequest

* Add other part to plugin.test.ts

* Cleanup tests a bit

* Cleanup tests

* plugin.test.ts cleanup

* Add warning logs on setup

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-12 13:49:16 -05:00
Pierre Gayvallet c13b0751f3
kbn-config-schema: allow parsing of array and object types from string (#57189)
* allow parsing from string for object-ish and array types

* update snapshots

* fix FTR assertion

* add documentation note about using a json string as input
2020-02-11 11:19:02 +01:00
Peter Schretlen bb7e152211
Webhook action - make user and password secrets optional (#56823) 2020-02-10 17:08:56 -05:00
Mike Côté b5e28a8eb1
Create plugin mock for event log plugin (#57048)
* Create plugin mock for event log plugin

* Share event logger mock with event log service

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-10 14:24:35 -05:00
Mike Côté 0748c5c32f
Create plugin mock for actions plugin (#57002)
* Create plugin mock for actions plugin

* Expose actionsClientMock and set as default resolve value for getActionsClientWithRequest
2020-02-06 14:47:41 -05:00
Chris Roberson 6398a9911d
[Monitoring] Migrate license expiration alert to Kibana alerting (#54306)
* License expiration

* Flip off

* Only require alerting and actions if enabled

* Support date formating and timezones in the alert UI messages, support ccs better

* Fix status tests

* Fix up front end tests

* Fix linting, and switch this back

* Add this back in so legacy alerts continue to work

* Fix type issues

* Handle CCS better

* Code cleanup

* Fix type issues

* Flip this off, and fix test

* Moved the email address config to advanced settings, but need help with test failures and typescript

* Fix issue with task manager

* Deprecate email_address

* Use any until we can figure out this TS issue

* Fix type issue

* More tests

* Fix mocha tests

* Use mock instead of any

* I'm not sure why these changed...

* Provide timezone in moment usage in tests for consistency

* Fix type issue

* Change how we get dateFormat and timezone

* Change where we calculate the dates to show in the alerts UI

* Show deprecation warning based on the feature toggle

* Ensure we are using UTC

* PR feedback

* Only add this if the feature flag is enabled

* Fix tests

* Ensure we only attempt to look this up if the feature flag is enabled

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-03 15:55:50 -05:00
Aleh Zasypkin 8def60e1da
Unify Security and EncryptedSavedObjects public contract names according to NP migration guide. (#56597) 2020-02-03 14:43:10 +01:00
Mike Côté 8fe39aef9d
Cleanup action task params objects after successful execution (#55227)
* Cleanup action task params saved objects after use

* Fix jest tests

* Add integration test to ensure object gets cleaned up

* Add unit tests

* Fix comment

* Re-use updated_at instead of creating createdAt

* Consider null/undefined returned from executor as success as well

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-27 15:02:44 -05:00
Gidi Meir Morris bb29cec20b
fixes shared types across alerting plugins (#55824)
This addresses two issues that have come up:

Alerting and Actions have TypeScript types that are needed across server and public plugins, and need to be extracted to a common path (thanks @chrisronline for bringing this to our attention)
Due to the above, types have been duplicated between the alerting and actions when needed in the Alerting UI, which has led to them diverging. This forces the UI to type check against the API, which will help reduce these errors in the future.
2020-01-24 17:06:59 +00:00
Peter Schretlen e39ef65c4c
Add developer docs for built-in pagerduty and webhook actions. Add TOC. (#55352) 2020-01-23 17:00:14 -05:00
Mike Côté bc70c99c79
Add legacy support for actions client (#55604) 2020-01-22 16:26:34 -05:00
Gidi Meir Morris 838d7ba213
migrate Actions to Kibana platform (#55026)
Migrates the Actions plugin from Legacy on to the Kibana Platform.
2020-01-22 17:08:54 +00:00