Skip to content

[AlertZero] Attack Discovery Worker: workflow skeleton and step wiring - #290732

Open
andrew-goldstein wants to merge 1 commit into
elastic:mainfrom
andrew-goldstein:ad-worker-skeleton
Open

[AlertZero] Attack Discovery Worker: workflow skeleton and step wiring#290732
andrew-goldstein wants to merge 1 commit into
elastic:mainfrom
andrew-goldstein:ad-worker-skeleton

Conversation

@andrew-goldstein

Copy link
Copy Markdown
Contributor

[AlertZero] Attack Discovery Worker: workflow skeleton and step wiring

This PR implements #19276 to replace the Attack Discovery worker's console stub with two new managed workflows:

  1. Attack Discovery Runner - Runs Attack Discovery generation, then fans out the generated discoveries to the review workflow

  2. Attack Discovery Review - Reviews one Attack Discovery: opens an Investigation, runs FP/TP analysis, and
    applies the resulting verdict

Both of the workflows above have stub implementations of their steps.

  1. This PR removes the Attack discovery run workflow step's 90s soft deadline. Sync mode now runs to completion instead of returning status: 'pending' at 90s, so a workflow calling this step needs a timeout above the pipeline's 30m budget (run_example.yaml is updated from 10m to 35m).

How it works

1) Users configure the Attack discovery worker's schedule in AlertZero

attack_discovery_worker_config

Above: The Attack Discovery worker's schedule config

2) The per-space Attack Discovery workflow is invoked by the schedule

It workflow.executes the Attack Discovery Runner workflow:

attack_discovery_worker

Above: The scheduled floor_attack_discovery.yaml workflow executes the Attack Discovery Runner workflow

3) The Attack Discovery Runner workflow generates discoveries and batches reviews

The Attack Discovery Runner workflow generates discoveries via the security.attack-discovery.run step.

After generating the discoveries, the Attack Discovery Runner workflow fans out each generated discovery to a separate invocation of the Attack Discovery Review workflow:

attack_discovery_runner

Above: The attack_discovery_runner.yaml workflow generates discoveries and invokes the Attack Discovery Review workflow for each generation, in batches of parallel runs

The following example shows the runner generated 8 discoveries, and invoked 8 review workflows:

run_result

Above: The runner invoked 8 review workflows in paralell

4) The Attack Discovery Review workflow reviews one Attack Discovery: opens an Investigation, runs FP/TP analysis, and applies the resulting verdict

attack_discovery_review

Above: The attack_discovery_review.yaml workflow opens an Investigation, runs FP/TP analysis, and applies the resulting verdict

An example of a single review result is shown below:

example_review_result

Above: An example review result

Feature flags

The following entries in config/kibana.dev.yml are required for desk testing:

xpack.alertzero.enabled: true
xpack.agenticInvestigations.enabled: true

uiSettings.overrides:
  securitySolution:enableAttackDiscoveryWorkflows: true
  workflows:ui:showManagedWorkflows: true

Out of scope

  • Alert batching for generation — #18967
  • The real FP/TP analysis workflow — #19211
  • Investigation creation logic — #19022
  • Outcome application — #19214

Created with Cursor, Opus 5, Grok 4.6

…ring

This PR implements [elastic#19276](elastic/security-team#19276) to replace the Attack Discovery worker's `console` stub with two new managed workflows:

1) `Attack Discovery Runner` - Runs Attack Discovery generation, then fans out the generated discoveries to the review workflow

2) `Attack Discovery Review` - Reviews one Attack Discovery: opens an Investigation, runs FP/TP analysis, and
  applies the resulting verdict

Both of the workflows above have stub implementations of their steps.

3) This PR removes the Attack discovery run workflow step's 90s soft deadline. Sync mode now runs to completion instead of returning status: 'pending' at 90s, so a workflow calling this step needs a timeout above the pipeline's 30m budget (`run_example.yaml` updated from 10m to 35m).

### How it works

#### 1) Users configure the Attack discovery worker's schedule in AlertZero

![attack_discovery_worker_config ](https://github.com/user-attachments/assets/fc03d155-b610-481b-8b56-5d3465b17f05)

_Above: The Attack Discovery worker's schedule config_

#### 2) The per-space `Attack Discovery` workflow is invoked by the schedule

It `workflow.execute`s the `Attack Discovery Runner` workflow:

![attack_discovery_worker](https://github.com/user-attachments/assets/b38ad96c-016b-4443-8c14-f87e425ad5ba)

_Above: The scheduled `floor_attack_discovery.yaml` workflow executes the `Attack Discovery Runner` workflow_

#### 3)  The `Attack Discovery Runner` workflow  generates discoveries and batches reviews

The `Attack Discovery Runner` workflow  generates discoveries via the `security.attack-discovery.run` step.

After generating the discoveries, the `Attack Discovery Runner` workflow fans out each generated discovery to a separate invocation of the `Attack Discovery Review` workflow:

![attack_discovery_runner](https://github.com/user-attachments/assets/a2961de9-19d0-476a-b8dc-77ec3ef1551d)

_Above: The `attack_discovery_runner.yaml` workflow generates discoveries and invokes the `Attack Discovery Review` workflow for each generation, in batches of parallel runs_

The following example shows the runner generated 8 discoveries, and invoked 8 review workflows:

![run_result](https://github.com/user-attachments/assets/722c11a3-8ae3-4194-9052-e66af39cf25d)

_Above: The runner invoked 8 review workflows in paralell_

#### 4) The `Attack Discovery Review` workflow reviews one Attack Discovery: opens an Investigation, runs FP/TP analysis, and applies the resulting verdict

![attack_discovery_review](https://github.com/user-attachments/assets/8fbc507f-74e0-4a4a-bd34-09f32d4ea5d2)

_Above: The `attack_discovery_review.yaml` workflow opens an Investigation, runs FP/TP analysis, and applies the resulting verdict_

An example of a single review result is shown below:

![example_review_result](https://github.com/user-attachments/assets/fb775a68-23e9-4443-9bb6-ecd8309ab6d1)

_Above: An example review result_

### Feature flags

The following entries in `config/kibana.dev.yml` are required for desk testing:

```yaml
xpack.alertzero.enabled: true
xpack.agenticInvestigations.enabled: true

uiSettings.overrides:
  securitySolution:enableAttackDiscoveryWorkflows: true
  workflows:ui:showManagedWorkflows: true
```

### Out of scope

- Alert batching for generation — `elastic#18967`
- The real FP/TP analysis workflow — `elastic#19211`
- Investigation creation logic — `elastic#19022`
- Outcome application — `elastic#19214`

_Created with Cursor, Opus 5, Grok 4.6_
@andrew-goldstein andrew-goldstein self-assigned this Sep 13, 2026
@andrew-goldstein
andrew-goldstein requested review from a team as code owners September 13, 2026 07:06
@andrew-goldstein andrew-goldstein added release_note:skip Skip the PR/issue when compiling release notes Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. backport:version Backport to applied version labels v9.6.0 labels Sep 13, 2026
@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

Pinging @elastic/security-solution (Team: SecuritySolution)

@botelastic botelastic Bot added the Team:One Workflow Team label for One Workflow (Workflow automation) label Sep 13, 2026
@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!

@andrew-goldstein

Copy link
Copy Markdown
Contributor Author

Files by Code Owner

elastic/security-solution, elastic/workflows-eng

  • src/platform/packages/shared/kbn-workflows/managed/definitions/alertzero/attack_discovery_review.yaml
  • src/platform/packages/shared/kbn-workflows/managed/definitions/alertzero/attack_discovery_runner.yaml
  • src/platform/packages/shared/kbn-workflows/managed/definitions/alertzero/attack_discovery_workflows.test.ts
  • src/platform/packages/shared/kbn-workflows/managed/definitions/alertzero/attack_discovery_workflows.ts
  • src/platform/packages/shared/kbn-workflows/managed/definitions/alertzero/floor_attack_discovery.ts
  • src/platform/packages/shared/kbn-workflows/managed/definitions/alertzero/floor_attack_discovery.yaml
  • src/platform/packages/shared/kbn-workflows/managed/definitions/alertzero/index.ts

elastic/workflows-eng

  • src/platform/packages/shared/kbn-workflows/managed/definitions/discoveries/index.ts
  • src/platform/packages/shared/kbn-workflows/managed/definitions/discoveries/run_example.yaml
  • src/platform/packages/shared/kbn-workflows/managed/definitions/index.ts
  • src/platform/packages/shared/kbn-workflows/managed/managed_workflow_definitions.test.ts

@kibanamachine

Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

✅ unchanged

Test Failures

  • [job] [logs] FTR Configs #80 / lens app - group 1 lens chart switching should create a heatmap chart and transition to barchart
  • [job] [logs] FTR Configs #52 / lens serverless - group 1 - subgroup 1 lens smokescreen tests should allow creation of a multi-axis chart and switching multiple times
  • [job] [logs] FTR Configs #52 / lens serverless - group 1 - subgroup 1 lens smokescreen tests should override axis title
  • [job] [logs] Scout Lane #25 - stateful-classic / default / local-stateful-classic - pingList query - returns a list of pings for the date range and given size
  • [job] [logs] FTR Configs #58 / serverless security UI Security ML Notifications page displays only notification types for security projects

cc @andrew-goldstein

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

Labels

backport:version Backport to applied version labels release_note:skip Skip the PR/issue when compiling release notes Team:One Workflow Team label for One Workflow (Workflow automation) Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. v9.6.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants