Skip to content

[AlertZero] Add isolate host action workflow - #291205

Closed
semd wants to merge 5 commits into
elastic:mainfrom
semd:alertzero/action-isolate-host
Closed

semd wants to merge 5 commits into
elastic:mainfrom
semd:alertzero/action-isolate-host

Conversation

@semd

@semd semd commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Summary

part of: https://github.com/elastic/security-team/issues/19292

  • Adds a managed AlertZero action workflow (system-alertzero-action-isolate-host) as the example contain action for Defend to copy: isolate via POST /api/endpoint/action/isolate, then poll GET /api/endpoint/action/{id} until complete (or ~30 minutes).
  • Catalog metadata matches elastic/security-team#19292: category: contain, impact: high, approvalPolicy: always-gate. Input is actionInput.endpoint_ids only (agent ids, not hostnames).
  • Probes GET action details before isolating so a missing Actions log privilege fails closed instead of isolating a host we cannot wait on.
  • Lives under alertzero/actions/defend/ so future Defend response actions inherit CODEOWNERS @elastic/security-defend-workflows + @elastic/workflows-eng (create-detection-rule stays in actions/).
  • Moves the generic action-workflow contract test next to action_workflow.ts (managed/action_workflows.test.ts).

Test plan

  • Confirm GET /internal/alertzero/actions lists Isolate host after Kibana start (tag action).
  • Create a proposal with actionWorkflowId: system-alertzero-action-isolate-host and actionInput.endpoint_ids: [<agent id>]; approve it.
  • Approver with Host isolation and Actions log: isolate is sent, poll completes, proposal succeeds.
  • Approver with Host isolation without Actions log: workflow fails on the privilege probe; host is not isolated.
  • CODEOWNERS for managed/definitions/alertzero/actions/defend lists @elastic/security-defend-workflows and @elastic/workflows-eng.
  • Jest: node scripts/jest src/platform/packages/shared/kbn-workflows/managed/action_workflows.test.ts src/platform/packages/shared/kbn-workflows/managed/managed_workflow_definitions.test.ts

Made with Cursor

Give the action catalog a contain example that calls the isolate API and polls for completion, so Defend can copy the same shape for the rest of the response actions.

Co-authored-by: Cursor <cursoragent@cursor.com>
@semd
semd requested review from a team as code owners September 15, 2026 16:21
@botelastic botelastic Bot added the Team:One Workflow Team label for One Workflow (Workflow automation) label Sep 15, 2026
@ymao1

ymao1 commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

👋 Hey! I opened this PR as well #291168 but I can close in favor of yours if that makes sense

@semd semd added release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting v9.6.0 labels Sep 16, 2026
@kibanamachine

Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

✅ unchanged

Test Failures

  • [job] [logs] Scout Lane #114 - serverless-observability_complete / default / local-serverless-observability_complete - Synthetics manage rules privilege - lets a read user with can_manage_rules enable default alerting
  • [job] [logs] Scout Lane #24 - stateful-classic / default / local-stateful-classic - Synthetics manage rules privilege - lets a read user with can_manage_rules enable default alerting

History

@semd

semd commented Sep 16, 2026

Copy link
Copy Markdown
Contributor Author

Closing in favor of #291168

@semd semd closed this Sep 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:One Workflow Team label for One Workflow (Workflow automation) v9.6.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants