Back to Kibana

Stack Connectors

x-pack/platform/plugins/shared/stack_connectors/README.md

9.4.032.4 KB
Original Source

Stack Connectors

The stack_connectors plugin provides connector types shipped with Kibana, built on top of the framework provided in the actions plugin.


Table of Contents

Connector Types

Kibana ships with a set of built-in connector types. See Connectors Documentation.

In addition to the documented configurations, several built in connector type offer additional params configurations.

ServiceNow ITSM

The ServiceNow ITSM user documentation params lists configuration properties for the pushToService subaction. In addition, several other subaction types are available.

params

PropertyDescriptionType
subActionThe subaction to perform. It can be pushToService, getFields, getIncident, and getChoices.string
subActionParamsThe parameters of the subaction.object

subActionParams (pushToService)

PropertyDescriptionType
incidentThe ServiceNow incident.object
commentsThe comments of the case. A comment is of the form { commentId: string, version: string, comment: string }.object[] (optional)

The following table describes the properties of the incident object.

PropertyDescriptionType
short_descriptionThe title of the incident.string
descriptionThe description of the incident.string (optional)
externalIdThe ID of the incident in ServiceNow. If present, the incident is updated. Otherwise, a new incident is created.string (optional)
severityThe severity in ServiceNow.string (optional)
urgencyThe urgency in ServiceNow.string (optional)
impactThe impact in ServiceNow.string (optional)
categoryThe category in ServiceNow.string (optional)
subcategoryThe subcategory in ServiceNow.string (optional)
correlation_idThe correlation id of the incident.string (optional)
correlation_displayThe correlation display of the ServiceNow.string (optional)

subActionParams (getFields)

No parameters for the getFields subaction. Provide an empty object {}.

subActionParams (getIncident)

PropertyDescriptionType
externalIdThe ID of the incident in ServiceNow.string

subActionParams (getChoices)

PropertyDescriptionType
fieldsAn array of fields. Example: [category, impact].string[]

ServiceNow Sec Ops

The ServiceNow SecOps user documentation params lists configuration properties for the pushToService subaction. In addition, several other subaction types are available.

params

PropertyDescriptionType
subActionThe subaction to perform. It can be pushToService, getFields, getIncident, and getChoices.string
subActionParamsThe parameters of the subaction.object

subActionParams (pushToService)

PropertyDescriptionType
incidentThe ServiceNow security incident.object
commentsThe comments of the case. A comment is of the form { commentId: string, version: string, comment: string }.object[] (optional)

The following table describes the properties of the incident object.

PropertyDescriptionType
short_descriptionThe title of the security incident.string
descriptionThe description of the security incident.string (optional)
externalIdThe ID of the security incident in ServiceNow. If present, the security incident is updated. Otherwise, a new security incident is created.string (optional)
priorityThe priority in ServiceNow.string (optional)
dest_ipA list of destination IPs related to the security incident. The IPs will be added as observables to the security incident.(string | string[]) (optional)
source_ipA list of source IPs related to the security incident. The IPs will be added as observables to the security incident.(string | string[]) (optional)
malware_hashA list of malware hashes related to the security incident. The hashes will be added as observables to the security incident.(string | string[]) (optional)
malware_urlA list of malware URLs related to the security incident. The URLs will be added as observables to the security incident.(string | string[]) (optional)
categoryThe category in ServiceNow.string (optional)
subcategoryThe subcategory in ServiceNow.string (optional)
correlation_idThe correlation id of the security incident.string (optional)
correlation_displayThe correlation display of the security incident.string (optional)

subActionParams (getFields)

No parameters for the getFields subaction. Provide an empty object {}.

subActionParams (getIncident)

PropertyDescriptionType
externalIdThe ID of the security incident in ServiceNow.string

subActionParams (getChoices)

PropertyDescriptionType
fieldsAn array of fields. Example: [priority, category].string[]

ServiceNow ITOM

The ServiceNow ITOM user documentation params lists configuration properties for the addEvent subaction. In addition, several other subaction types are available.

params

PropertyDescriptionType
subActionThe subaction to perform. It can be addEvent, and getChoices.string
subActionParamsThe parameters of the subaction.object

subActionParams (addEvent)

PropertyDescriptionType
sourceThe name of the event source type.string (optional)
event_classSpecific instance of the source.string (optional)
resourceThe name of the resource.string (optional)
nodeThe Host that the event was triggered for.string (optional)
metric_nameName of the metric.string (optional)
typeThe type of event.string (optional)
severityThe category in ServiceNow.string (optional)
descriptionThe subcategory in ServiceNow.string (optional)
additional_infoAny additional information about the event.string (optional)
message_keyThis value is used for de-duplication of events. All actions sharing this key will be associated with the same ServiceNow alert.string (optional)
time_of_eventThe time of the event.string (optional)

Refer to ServiceNow documentation for more information about the properties.

subActionParams (getChoices)

PropertyDescriptionType
fieldsAn array of fields. Example: [severity].string[]

Jira

The Jira user documentation params lists configuration properties for the pushToService subaction. In addition, several other subaction types are available.

params

PropertyDescriptionType
subActionThe subaction to perform. It can be pushToService, getIncident, issueTypes, fieldsByIssueType, issues, issue, and getFields.string
subActionParamsThe parameters of the subaction.object

subActionParams (pushToService)

PropertyDescriptionType
incidentThe Jira incident.object
commentsThe comments of the case. A comment is of the form { commentId: string, version: string, comment: string }.object[] (optional)

The following table describes the properties of the incident object.

PropertyDescriptionType
summaryThe title of the issue.string
descriptionThe description of the issue.string (optional)
externalIdThe ID of the issue in Jira. If present, the incident is updated. Otherwise, a new incident is created.string (optional)
issueTypeThe ID of the issue type in Jira.string (optional)
priorityThe name of the priority in Jira. Example: Medium.string (optional)
labelsAn array of labels. Labels cannot contain spaces.string[] (optional)
parentThe ID or key of the parent issue. Only for Sub-task issue types.string (optional)
otherFieldsAn object containing key-value pairs of any other fields in Jira without explicit properties.Record<string, any> (optional)

subActionParams (getIncident)

PropertyDescriptionType
externalIdThe ID of the issue in Jira.string

subActionParams (issueTypes)

No parameters for the issueTypes subaction. Provide an empty object {}.

subActionParams (fieldsByIssueType)

PropertyDescriptionType
idThe ID of the issue type in Jira.string

subActionParams (issues)

PropertyDescriptionType
titleThe title to search for.string

subActionParams (issue)

PropertyDescriptionType
idThe ID of the issue in Jira.string

subActionParams (getFields)

No parameters for the getFields subaction. Provide an empty object {}.


IBM Resilient

The IBM Resilient user documentation params lists configuration properties for the pushToService subaction. In addition, several other subaction types are available.

params

PropertyDescriptionType
subActionThe subaction to perform. It can be pushToService, getFields, incidentTypes, and `severity.string
subActionParamsThe parameters of the subaction.object

subActionParams (pushToService)

PropertyDescriptionType
incidentThe IBM Resilient incident.object
commentsThe comments of the case. A comment is of the form { commentId: string, version: string, comment: string }.object[] (optional)

The following table describes the properties of the incident object.

PropertyDescriptionType
nameThe title of the incident.string (optional)
descriptionThe description of the incident.string (optional)
externalIdThe ID of the incident in IBM Resilient. If present, the incident is updated. Otherwise, a new incident is created.string (optional)
incidentTypesAn array with the IDs of IBM Resilient incident types.number[] (optional)
severityCodeIBM Resilient ID of the severity code.number (optional)

subActionParams (getFields)

No parameters for the getFields subaction. Provide an empty object {}.

subActionParams (incidentTypes)

No parameters for the incidentTypes subaction. Provide an empty object {}.

subActionParams (severity)

No parameters for the severity subaction. Provide an empty object {}.


Swimlane

Refer to the Run connector API documentation for the full list of properties.

params

PropertyDescriptionType
subActionThe subaction to perform. It can be pushToService.string
subActionParamsThe parameters of the subaction.object

subActionParams (pushToService)

PropertyDescriptionType
incidentThe Swimlane incident.object
commentsThe comments of the case. A comment is of the form { commentId: string, version: string, comment: string }.object[] (optional)

The following table describes the properties of the incident object.

PropertyDescriptionType
alertIdThe alert id.string (optional)
caseIdThe case id of the incident.string (optional)
caseNameThe case name of the incident.string (optional)
descriptionThe description of the incident.string (optional)
ruleNameThe rule name.string (optional)
severityThe severity of the incident.string (optional)

Ospgenie

Refer to the Run connector API documentation for the full list of properties.

params

PropertyDescriptionType
subActionThe subaction to perform. It can be createAlert or closeAlert.string
subActionParamsThe parameters of the subaction.object

subActionParams (createAlert)

PropertyDescriptionType
messageThe alert message.string

The optional parameters alias, description, responders, visibleTo, actions, tags, details, entity, source, priority, user, and note are supported. See the Opsgenie API documentation for more information on their types.

subActionParams (closeAlert)

No parameters are required. For the definition of the optional parameters see the Opsgenie API documentation.


PagerDuty

The PagerDuty user documentation params lists configuration properties for the params. For more details on these properties, see PagerDuty v2 event parameters .

params

PropertyDescriptionType
eventActionThe type of event.trigger | resolve | acknowledge
dedupKeyAll actions sharing this key will be associated with the same PagerDuty alert. This value is used to correlate trigger and resolution. The maximum length is 255 characters.string
summaryAn optional text summary of the event. The maximum length is 1024 characters.string (optional)
sourceAn optional value indicating the affected system, preferably a hostname or fully qualified domain name. Defaults to the Kibana saved object id of the action.string (optional)
severityThe perceived severity of on the affected system. Default: info.critical | error | warning | info
timestampAn optional ISO-8601 format date-time, indicating the time the event was detected or generated.date (optional)
componentAn optional value indicating the component of the source machine that is responsible for the event, for example mysql or eth0.string (optional)
groupAn optional value indicating the logical grouping of components of a service, for example app-stack.string (optional)
classAn optional value indicating the class/type of the event, for example ping failure or cpu load.string (optional)
linksList of links to add to the eventArray<{ href: string; text: string }> (optional)
customDetailsAdditional details to add to the event.object

Developing New Connector Types

When creating a new connector type, your plugin will eventually call server.plugins.actions.setup.registerType() to register the type with the actions plugin, but there are some additional things to think about about and implement.

Consider working with the alerting team on early structure /design feedback of new connectors, especially as the APIs and infrastructure are still under development.

Don't forget to ping @elastic/security-detection-rule-management and @elastic/security-detection-engine to see if the new connector should be enabled within their solution.

Licensing

Currently connectors are licensed as "basic" if the connector only interacts with the stack, eg the server log and es index connectors. Other connectors are at least "gold" level.

Plugin location

If the new connector is generic across the stack, it probably belongs in the stack_connectors plugin, but if your connector is very specific to a plugin/solution, it might be easiest to implement it in that plugin/solution.

Connectors that take URLs or hostnames should check that those values are allowed by using the allowed host utilities in the actions plugin.

Documentation

You should create markdown docs for the new connector type. Add an entry to appropriate location in the table of content - docs/reference/toc.yml, which points to a new document for the connector type that should be in the docs/reference/connectors-kibana directory.

We suggest following the template provided in docs/action-type-template.md. The Email action type is an example of documentation created following the template.

Tests

The connector type should have both unit tests and functional tests. For functional tests, if your connector interacts with a 3rd party service via HTTP, you may be able to create a simulator for your service to test with. See the existing functional test servers in the directory x-pack/platform/test/alerting_api_integration/common/plugins/actions_simulators/server

Connector type config and secrets

Connector types must define config and secrets which are used to create connectors. This data should be described with @kbn/config-schema object schemas, and you MUST NOT use schema.maybe() to define properties.

This is due to the fact that the structures are persisted in saved objects, which performs partial updates on the persisted data. If a property value is already persisted, but an update either doesn't include the property, or sets it to undefined, the persisted value will not be changed. Beyond this being a semantic error in general, it also ends up invalidating the encryption used to save secrets, and will render the secrets unable to be unencrypted later.

Instead of schema.maybe(), use schema.nullable(), which is the same as schema.maybe() except that when passed an undefined value, the object returned from the validation will be set to null. The resulting type will be property-type | null, whereas with schema.maybe() it would be property-type | undefined.

User interface

To make this connector usable in the Kibana UI, you will need to provide all the UI editing aspects of the connector. The existing connector type user interfaces are defined in x-pack/platform/plugins/shared/triggers_actions_ui/public/application/components/builtin_action_types. For more information, see the UI documentation.