[AlertZero] Adding managed action workflows for issuing isolate-host, kill-process, suspend-process response actions - #291168
Conversation
…ocess response actions
Selected for Libra reviewThis PR was selected for Libra review as part of the temporary 50% trial. To opt out permanently, remove the |
isolate-host, kill-process, suspend-process response actions
kibanamachine
left a comment
There was a problem hiding this comment.
Libra found 2 issues.
Generated by Libra
kibanamachine
left a comment
There was a problem hiding this comment.
Libra found 1 issue.
Generated by Libra
There was a problem hiding this comment.
Could we create all the defend action workfows inside one directory (I used managed/definitions/alertzero/actions/defend/* in my PR) and so we can assign the defend-workflows team ownership to the whole directory instead of each workflow individually?
kibanamachine
left a comment
There was a problem hiding this comment.
Libra found 1 issue.
Generated by Libra
| ); | ||
|
|
||
| it.each(CASES.map((c) => [c.id, c.workflow.yaml] as const))( | ||
| '%s passes strict workflow schema validation', | ||
| (_id, yaml) => { | ||
| const result = WorkflowSchema.safeParse(parse(yaml)); |
There was a problem hiding this comment.
The new test suite never executes any of the three workflows; it only schema-validates and inspects parsed YAML, so regressions in runtime expression rendering, on-failure handling, loop behavior, or failure propagation can still pass while these destructive actions dispatch or report outcomes incorrectly. Add a workflow-engine/integration test with a mocked kibana.request that covers the preflight denial, pending-to-success polling, and wasSuccessful: false paths.
WorkflowSchema.safeParse(parse(yaml)) proves structural validity only. The remaining cases similarly search parsed step objects and compare strings rather than running the workflow control flow.
|
Thanks for putting this together @ymao1 / @semd 🙇 Mostly questions here, since you two know the engine far better than I do. Context for where I'm coming from: I did a PoC of osquery in workflows a while back (#267972, still draft) and we spent a while on the "dispatch, then wait for completion" problem in the Would
|
|
@tomsonpl Thanks for reviewing!
The workflows added in this PR perform all the steps of dispatching the response action and polling for completion using built-in workflow steps. I have also prototyped creating a custom workflow step for these actions in #290370 that uses
Yes, loop body outputs are addressable from the outside after the loop completes. Eviction does not occur between the last poll iteration and the emit_result because they occur in the same task execution.
I will look into whether we can simplify this against a status code
If it's not required for kill/suspend process, I'm happy to remove this extra step. |
|
@tomsonpl Followups:
Here is the output of the
It looks like isolate host, process operations and response actions history are separate subfeature privileges underneath security so it seems possible there are custom roles that allow access to process operations without access to response actions history, regardless of license level, so keeping the pre-flight probe seems like the safer option. Please let me know if I've misunderstood this
|
💛 Build succeeded, but was flaky
Failed CI Steps
Metrics [docs]
Test Failures
History
cc @ymao1 |
| type: integer | ||
| minimum: 1 | ||
| description: Process ID (PID) of the process to kill. | ||
| kill_descendants: |
There was a problem hiding this comment.
Just FYI: kill-descendants is a 9.6 feature.

Summary
Adding AlertZero managed system workflows for running 3 response actions:
isolate-host,kill-process,suspend-process. The workflows dispatch the response action via akibana.requeststep and retrieves the action ID from the API response, then polls for completion and returns a final status. Action metadata should conform to the specs merged in #290705. No error handling in these workflows as errors should bubble up and be handled in a common manner by the AlertZero proposal framework (#291038)To Verify
node x-pack/solutions/security/plugins/security_solution/scripts/endpoint/run_endpoint_agent.js. This requires you to have Docker and Multipass