[FR] [DaC] Add support for Kibana workflows#6211
Open
eric-forte-elastic wants to merge 1 commit into
Open
Conversation
Contributor
Enhancement - GuidelinesThese guidelines serve as a reminder set of considerations when addressing adding a feature to the code. Documentation and Context
Code Standards and Practices
Testing
Additional Checks
|
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Issue link(s):
Resolves #6212
Summary - What I changed
Adds support for custom Kibana Workflows attached to detection rule actions. Previously, they were stripped every time rules were updated through the DaC CI/CD pipeline (
kibana import-rules/kibana export-rules,import-rules-to-repo,export-rules-from-repo).Kibana's Workflows connector uses the action type id
.workflowsand, like.cases, is registered as a system action (isSystemActionType: true)..workflowswas missing from theActionTypeIdliteral indefinitions.py, so any standalone action TOML carrying a workflow action failed validation on load._add_known_nullsinjectsfrequency.throttle: nullinto every action. System actions do not accept afrequency, so Kibana rejected the action on import and dropped it — removing the attached Workflow. This is the same style of bug previously fixed for.casesin [Bug] CLI adds frequency field to system actions (.cases), causing import failure #5690.Changes:
.workflowstoActionTypeIdso workflow actions validate..workflowstoSYSTEM_ACTION_TYPE_IDSso_add_known_nullsskips thefrequency.throttleinjection for it (mirroring the existing.caseshandling)..slack) still receives the throttle null while.casesand.workflowsdo not.How To Test
This can be verified entirely locally with
export-rules-from-repoorkibana import.workflowssystem action:Inspect the exported action in
exports/out.ndjson.Previously, a
frequency.throttle: nullwas injected, which Kibana rejects on import for a system action (the action, and thus the attached Workflow, is dropped):{ "action_type_id": ".workflows", "frequency": { "throttle": null }, "group": "default", "id": "system-connector-.workflows", "params": { "subAction": "run", "subActionParams": { "workflowId": "34ea9729-e7a9-4a48-aac4-6c67d0bed2de" } } }Now, the system action is left untouched (no
frequency), so the Workflow is preserved:{ "action_type_id": ".workflows", "group": "default", "id": "system-connector-.workflows", "params": { "subAction": "run", "subActionParams": { "workflowId": "34ea9729-e7a9-4a48-aac4-6c67d0bed2de" } } }Checklist
bug,enhancement,schema,maintenance,Rule: New,Rule: Deprecation,Rule: Tuning,Hunt: New, orHunt: Tuningso guidelines can be generatedmeta:rapid-mergelabel if planning to merge within 24 hoursContributor checklist