Skip to content

[AlertZero] Action catalog - #290705

Draft
patrykkopycinski wants to merge 6 commits into
mainfrom
alertzero/action-catalog
Draft

[AlertZero] Action catalog#290705
patrykkopycinski wants to merge 6 commits into
mainfrom
alertzero/action-catalog

Conversation

@patrykkopycinski

Copy link
Copy Markdown
Contributor

Summary

Implements the AlertZero action catalog (security-team#19288): category-scoped discovery of installed action workflows, exposed both as an internal HTTP API and as an Agent Builder builtin tool so workers can discover actions at runtime instead of hard-coding workflow ids.

Builds on #289683 (action proposals common layer).

API

  • GET /internal/alertzero/actions?categories=contain,escalate in the alertzero plugin
  • Tag-driven discovery: workflows tagged action with consts.actionMetadata are projected to lightweight catalog entries (workflowId, name, description, category, impact, approvalPolicy)
  • categories is an OR-set: repeated param (?categories=a&categories=b) or comma-joined (?categories=a,b), at most 20 values, >20 → 400
  • Category vocabulary is solution-owned (alertzero, nightshift, …) — no enum validation; unknown categories match nothing
  • alertzero_read privilege required

Agent Builder tool

  • security.alertzero.actions.list_by_category — builtin, read-only, registered from the alertzero plugin setup() following the Cases-plugin pattern
  • Handler calls ActionsService in-process (same service as the API) so the tool and API can never drift
  • Allow-listed in AGENT_BUILDER_BUILTIN_TOOLS

Worker wiring

  • floor_alert_triage managed workflow grants the tool via configuration_overrides.tools; managed version 1 → 2 with the fingerprint guard test updated

Design notes

  • Query passes managedFilter: 'managed' — action workflows are managed installs in the global space; the search service's unmanaged default would filter them all out (caught live in e2e; guarded by a dedicated test)
  • Invalid consts.actionMetadata on one workflow is skipped with a warning, never fails the catalog
  • The service pages through results (size 100) until all tagged workflows are read

Testing

  • Unit: actions_service (9 incl. managed-filter + paging guards), list_actions route (4), read_categories_query_param (8), list_actions_by_category_tool (4), plugin registration mock — alertzero 219/219
  • kbn-workflows 2036/2036 (incl. updated fingerprint guard), kbn-alertzero-common 17/17
  • tsc 0 errors, ESLint clean
  • E2E on a dedicated dev stack (own ES + Kibana, security on): API returns the installed Create detection rule action with category tune; filtering verified single/repeated/comma; unknown category → empty not error; 403 without privilege; tool visible in the live Agent Builder registry

…coped discovery

Implements elastic/security-team#19288.

- GET /internal/alertzero/actions — lists installed action workflows
  (tag: action) with optional categories filter; category is a
  solution-owned keyword, never validated against an enum
- ActionsService: tag-driven discovery, consts.actionMetadata projection,
  skips invalid metadata with a warning
- security.alertzero.actions.listByCategory builtin Agent Builder tool
  wrapping the same service (tool and API cannot drift)
- floor_alert_triage worker: configuration_overrides.tools wiring +
  managed version bump (fingerprint guard updated)

Unit-tested at every layer: service, route param parsing, route handler,
tool handler.
…l-id doc comment

- readActionCategoriesQueryParam now throws InvalidCategoriesError; the route maps it to 400 badRequest with the param message instead of a generic 500
- doc comment on list_actions_by_category_tool referenced the pre-rename camelCase id; corrected to list_by_category
- adds route test for the 400 path
@infra-vault-gh-plugin-prod

Copy link
Copy Markdown
🤖 Jobs for this PR can be triggered through checkboxes. 🚧

ℹ️ To trigger the CI, please tick the checkbox below 👇

  • Click to trigger kibana-pull-request for this PR!
  • Click to trigger kibana-deploy-project-from-pr for this PR!
  • Click to trigger kibana-deploy-cloud-from-pr for this PR!
  • Click to trigger kibana-entity-store-performance-from-pr for this PR!
  • Click to trigger kibana-storybooks-from-pr for this PR!

@patrykkopycinski

Copy link
Copy Markdown
Contributor Author

/ci

1 similar comment
@patrykkopycinski

Copy link
Copy Markdown
Contributor Author

/ci

@patrykkopycinski

Copy link
Copy Markdown
Contributor Author

/ci

@patrykkopycinski

Copy link
Copy Markdown
Contributor Author

/ci

1 similar comment
@patrykkopycinski

Copy link
Copy Markdown
Contributor Author

/ci

# Conflicts:
#	x-pack/solutions/security/plugins/alertzero/moon.yml
#	x-pack/solutions/security/plugins/alertzero/tsconfig.json
@patrykkopycinski

Copy link
Copy Markdown
Contributor Author

/ci

1 similar comment
@patrykkopycinski

Copy link
Copy Markdown
Contributor Author

/ci

@kibanamachine

kibanamachine commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

⏳ Build in-progress, with failures

Failed CI Steps

History

@patrykkopycinski

Copy link
Copy Markdown
Contributor Author

/ci

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants