-
Notifications
You must be signed in to change notification settings - Fork 8.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Security Solution] [Cases] Swimlane Connector for Cases #100086
[Security Solution] [Cases] Swimlane Connector for Cases #100086
Conversation
@elasticmachine merge upstream |
@elasticmachine merge upstream |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - I made a few comments for things that looked like they weren't quite finished, or provide more diagnostic data, and a note about the DX on the SwimlaneMappingConfig
type
x-pack/plugins/actions/server/builtin_action_types/swimlane/service.ts
Outdated
Show resolved
Hide resolved
.../alerting_api_integration/security_and_spaces/tests/actions/builtin_action_types/swimlane.ts
Show resolved
Hide resolved
x-pack/plugins/cases/public/components/connectors/swimlane/validator.ts
Outdated
Show resolved
Hide resolved
...ins/triggers_actions_ui/public/application/components/builtin_action_types/swimlane/types.ts
Outdated
Show resolved
Hide resolved
…ana into field_mapping_connector
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work Christos, Steph, and Xavier! I noticed when testing a swimlane connector configured for alerts that it sends over {{rule.name}}
and {{alert.id}}
(testing through the creation page UI)
The actual values get populated though when a rule runs though:
Mostly just nit comments, and a few questions.
|
||
if (value) { | ||
switch (fieldType) { | ||
case 'numeric': { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might have missed them but should we add some tests for this case?
x-pack/plugins/actions/server/builtin_action_types/swimlane/index.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/actions/server/builtin_action_types/swimlane/service.test.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/cases/public/components/connectors/swimlane/validator.ts
Outdated
Show resolved
Hide resolved
validator: ({ value: connectorId }) => { | ||
const connector = getConnectorById(connectorId as string, connectors); | ||
if (connector != null) { | ||
return validators[connector.actionTypeId]?.(connector); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: we could probably get rid of this if
by doing return validators[connector.actionTypeId]?.(connector);
and have connectorValidator
handle undefined | null
as input.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think is best to leave the check in a central place. I would like to avoid other developers to wonder what to return if the connector is null
. If they return a message
it will be a wrong return value.
...ui/public/application/components/builtin_action_types/swimlane/steps/swimlane_connection.tsx
Outdated
Show resolved
Hide resolved
fullWidth | ||
helpText={ | ||
<EuiLink | ||
href={`${docLinks.ELASTIC_WEBSITE_URL}guide/en/kibana/${docLinks.DOC_LINK_VERSION}/swimlane-action-type.html`} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a note, we need to talk to the docs team to create this right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume it will be created automatically from docs/management/connectors/action-types/swimlane.asciidoc
that is included in this PR.
[editActionConfig, fieldIdMap, mappings] | ||
); | ||
|
||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the comment!
Hey @jonathan-buttner! This is the expected behaviour. When you test a connector there is no alert created so that's why you get the mustache variables instead of real values. |
…ana into field_mapping_connector
@elasticmachine merge upstream |
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
Page load bundle
Unknown metric groupsasync chunk count
History
To update your PR or re-run it, just comment with: |
…103165) Co-authored-by: Josh <[email protected]> Co-authored-by: Xavier Mouligneau <[email protected]> Co-authored-by: Christos Nasikas <[email protected]> Co-authored-by: Jonathan Buttner <[email protected]> Co-authored-by: Kibana Machine <[email protected]> Co-authored-by: Steph Milovic <[email protected]> Co-authored-by: Josh <[email protected]> Co-authored-by: Xavier Mouligneau <[email protected]> Co-authored-by: Jonathan Buttner <[email protected]> Co-authored-by: Kibana Machine <[email protected]>
yayyyy!!! |
Summary
Adapted from an unmerged PR: #95109
Depends on: #101145
Two parter:
.swimlane
.swimlane
as a case connector typeSchema
params
pushToService
.subActionParams (pushToService)
{ commentId: string, version: string, comment: string }
.The following table describes the properties of the
incident
object.Cases
'cases-connector-mappings'
are saved to map tocaseName
for title,description
for description andcomments
for commentscaseName
,description
, andcomments
Screenshots
List of connectors
Create connector: Instance configuration
Create connector: Mapping configuration
Create connector: Type Alerts
Create connector: Type Cases
Create alert
Error message on cases
Warning message on alerts
Checklist
Delete any items that are not applicable to this PR.