Commit 48ba5d0
[Security Solution] Register Workflows with Inbox (elastic#266256)
## Summary
Introduces **Inbox ↔ Workflows** as a first-class integration so that
any `waitForInput` step in a Workflow surfaces as a schema-driven,
schema-validated action in the shared **Inbox** plugin, with a
responsive flyout for human resolution. Lays the platform rails
(registry, common contracts, privilege model, space scoping, demo
fixtures) so future providers can plug in with zero additional Inbox
work.
Plugin introduced in elastic#265634, and
with this changeset data now comes from real workflows!
Plugin is disabled by default, so enable via:
```
xpack.inbox.enabled: true
```
And populate sample workflows exercising each schema variation with:
```
KIBANA_URL=http://localhost:5601 \
KIBANA_USERNAME=elastic \
KIBANA_PASSWORD=changeme \
KIBANA_SPACE_ID=default \
node --import tsx x-pack/platform/plugins/shared/inbox/scripts/demo/seed_inbox_demo.ts
```
(or using [this
branch](https://github.com/spong/example-mcp-app-security/tree/inbox) of
the `example-mcp-app-security`. All setup details in
[`/inbox/scripts/demo/README.md`](https://github.com/spong/kibana/blob/12e3c1b50762f4f7979327007ac652ee89378bc8/x-pack/platform/plugins/shared/inbox/scripts/demo/README.md))
<p align="center">
<img width="700"
src="https://github.com/user-attachments/assets/14c76d17-4319-46d1-8b39-298418398f58"
/>
</p>
Complete with support for dynamic response actions:
<p align="center">
<img width="700"
src="https://github.com/user-attachments/assets/67d9c867-dee6-454c-8a16-3dfcedc3285d"
/>
</p>
## What's in this PR
### Inbox plugin — provider platform
- **`InboxActionProvider` contract**
(`x-pack/platform/plugins/shared/inbox/server/services/inbox_action_provider.ts`)
— the registration shape plugins implement to contribute items to the
Inbox.
- **`InboxActionRegistry`** — fan-out / merge-sort / pagination across
providers, with a clamped `total` so a provider truncating its response
can never desync the UI's pager. Logs a warning on truncation.
- **Routes**
- `GET /internal/inbox/actions` — list + filter (status, source_app,
pagination)
- `POST /internal/inbox/actions/{source_app}/{source_id}/respond` —
schema-validated respond path
- **Security**
- Split API privileges `inbox_read` / `inbox_respond` so the `read`
feature role cannot invoke the respond route (previously collapsed under
a single `api: [PLUGIN_ID]`).
- Dynamic space resolution via the `spaces` plugin — no more hardcoded
`'default'` leaking rows across spaces. Falls back to `'default'` only
when `spaces` is absent (single-space installs).
- **Public app hardening**
- Lazy detail-renderer loader catches chunk-load / module-init failures
and falls back to the default form instead of crashing the tree.
- `TimeoutChip` guards against malformed `timeout_at` so it can't render
`NaNh NaNm`.
- `SchemaForm` accessibility pass: label fallbacks to field name, visual
`*` required marker, `hasChildLabel={false}` for `EuiSwitch` rows,
localized select placeholder.
- **React-Query tuning** (`public/application.tsx`):
`refetchOnWindowFocus: 'always'` + `refetchOnMount: 'always'` with a 30s
`staleTime` dedupe window so the list is always current when the tab/app
regains focus, plus locked-in `invalidateQueries` on the respond
mutation so responded items drop off the list without a manual refresh.
### Workflows-management — Inbox provider
- New `WorkflowsInboxProvider`
(`src/platform/plugins/shared/workflows_management/server/inbox/`)
converts paused `waitForInput` steps into `InboxAction`s
(`to_inbox_action.ts`) and registers with the Inbox plugin at setup.
- New `WorkflowExecutionQueryService#listWaitingForInputSteps` to
fan-out across the executions index for paused steps (filtered by
`spaceId` + `status: waiting_for_input`); `WorkflowsManagementService`
exposes it via the same-name delegating method consistent with the rest
of the facade. Wire-level regression tests live in
`workflow_execution_query_service.test.ts` (term-only query / pagination
math / `index_not_found_exception` swallowed / log+rethrow), with a
delegation test in the facade suite.
### Common contracts (`@kbn/inbox-common`)
- OpenAPI / Zod schemas for the list and respond routes, including
`status`, `source_app`, `input_schema`, `submission_channel`, and
`timeout_at`.
- Helper `buildRespondToActionUrl(sourceApp, sourceId)` with proper
URL-encoding for composite source IDs.
- Privilege constants `INBOX_API_PRIVILEGE_READ` /
`INBOX_API_PRIVILEGE_RESPOND`.
### Demo fixtures
- `x-pack/platform/plugins/shared/inbox/scripts/demo/`:
- Six minimal workflow YAMLs covering the field-type matrix (string /
number / boolean / single-enum / array-of-enum / required+defaults).
- `seed_inbox_demo.ts` — dependency-light `fetch` script that imports +
triggers each workflow against a running Kibana so the Inbox populates
immediately.
- `README.md` with run instructions and the matching MCP-app
`generate-inbox-data` flow.
### FTR wiring
- New stateful FTR config
`x-pack/platform/test/inbox_api_integration/config.ts` opt-in via
`--xpack.inbox.enabled=true`.
- `inbox_flow.ts` — contract-level coverage (empty-registry list, query
validation, 404 on unknown source, 400 on missing `input`).
Live-workflow lifecycle assertions are stubbed as `describe.skip` with
TODOs pointing at the Workflows execution-engine harness work.
- Registered in `.buildkite/ftr_platform_stateful_configs.yml` and
`.github/CODEOWNERS`.
### Checklist
Check the PR satisfies following conditions.
Reviewers should verify this PR satisfies this list as well.
- [X] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [X] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [X] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [X] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.
---
_PR developed with Cursor + Claude Opus 4.7 Super Duper xHigh
Thinking++_
---------
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>1 parent cf6203b commit 48ba5d0
76 files changed
Lines changed: 4326 additions & 203 deletions
File tree
- .buildkite
- .github
- x-pack/platform
- test
- inbox_api_integration
- tests
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
483 | 483 | | |
484 | 484 | | |
485 | 485 | | |
| 486 | + | |
486 | 487 | | |
487 | 488 | | |
488 | 489 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1032 | 1032 | | |
1033 | 1033 | | |
1034 | 1034 | | |
1035 | | - | |
| 1035 | + | |
1036 | 1036 | | |
1037 | 1037 | | |
1038 | 1038 | | |
| |||
1165 | 1165 | | |
1166 | 1166 | | |
1167 | 1167 | | |
1168 | | - | |
| 1168 | + | |
1169 | 1169 | | |
1170 | 1170 | | |
1171 | 1171 | | |
| |||
3435 | 3435 | | |
3436 | 3436 | | |
3437 | 3437 | | |
| 3438 | + | |
| 3439 | + | |
| 3440 | + | |
3438 | 3441 | | |
3439 | 3442 | | |
3440 | 3443 | | |
Lines changed: 69 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
237 | 237 | | |
238 | 238 | | |
239 | 239 | | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
240 | 309 | | |
Lines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1235 | 1235 | | |
1236 | 1236 | | |
1237 | 1237 | | |
| 1238 | + | |
| 1239 | + | |
| 1240 | + | |
| 1241 | + | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
1238 | 1252 | | |
1239 | 1253 | | |
1240 | 1254 | | |
| |||
Lines changed: 35 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
| |||
222 | 223 | | |
223 | 224 | | |
224 | 225 | | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
225 | 260 | | |
226 | 261 | | |
227 | 262 | | |
| |||
Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
26 | 42 | | |
27 | 43 | | |
28 | 44 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
36 | | - | |
| 35 | + | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | | - | |
| 100 | + | |
| 101 | + | |
101 | 102 | | |
102 | 103 | | |
103 | 104 | | |
| |||
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
606 | 606 | | |
607 | 607 | | |
608 | 608 | | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
609 | 620 | | |
610 | 621 | | |
611 | 622 | | |
| |||
Lines changed: 18 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
291 | 291 | | |
292 | 292 | | |
293 | 293 | | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
294 | 312 | | |
0 commit comments