Skip to content

[One Workflow] fix: prevent alert rule actions from triggering disabled workflows#252673

Merged
talboren merged 2 commits into
elastic:mainfrom
talboren:15684-bug-alert-rule-actions-trigger-disabled-workflows
Feb 11, 2026
Merged

[One Workflow] fix: prevent alert rule actions from triggering disabled workflows#252673
talboren merged 2 commits into
elastic:mainfrom
talboren:15684-bug-alert-rule-actions-trigger-disabled-workflows

Conversation

@talboren
Copy link
Copy Markdown
Contributor

@talboren talboren commented Feb 11, 2026

Summary

  • Alert rule actions with a "Run Workflow" connector were executing workflows even when the workflow was disabled (enabled: false). The backend connector path checked for workflow existence, definition, and validity — but skipped the enabled check.
  • Extracted the shared validation logic into a reusable validateWorkflowForExecution assertion function that guards against not-found, missing-definition, invalid, and disabled workflows before execution.
  • Added comprehensive unit tests covering all validation scenarios including the disabled workflow case.

References

Closes elastic/security-team#15684

Made with Cursor

The workflows connector execution path did not check the workflow's
enabled state before running it. This meant alert rule actions with a
"Run Workflow" action would still execute disabled workflows.

Extract shared workflow validation into `validateWorkflowForExecution`
(assertion function) and add the missing `enabled` check alongside the
existing not-found / no-definition / not-valid guards.

Closes elastic/security-team#15684

Co-authored-by: Cursor <cursoragent@cursor.com>
@talboren talboren requested a review from a team as a code owner February 11, 2026 09:28
@talboren talboren added release_note:skip Skip the PR/issue when compiling release notes backport:version Backport to applied version labels Team:One Workflow Team label for One Workflow (Workflow automation) v9.3.0 v9.4.0 labels Feb 11, 2026
@talboren talboren changed the title fix: prevent alert rule actions from triggering disabled workflows [One Workflow] fix: prevent alert rule actions from triggering disabled workflows Feb 11, 2026
Copy link
Copy Markdown
Contributor

@semd semd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@talboren talboren enabled auto-merge (squash) February 11, 2026 09:45
@talboren
Copy link
Copy Markdown
Contributor Author

@semd FYI also asked @Kiryous to cover that in the e2e tests he's adding now

@talboren talboren merged commit 6b7b6f3 into elastic:main Feb 11, 2026
16 checks passed
@kibanamachine
Copy link
Copy Markdown
Contributor

Starting backport for target branches: 9.3

https://github.com/elastic/kibana/actions/runs/21902428998

@elasticmachine
Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

✅ unchanged

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Feb 11, 2026
…ed workflows (elastic#252673)

## Summary

- Alert rule actions with a "Run Workflow" connector were executing
workflows even when the workflow was disabled (`enabled: false`). The
backend connector path checked for workflow existence, definition, and
validity — but skipped the `enabled` check.
- Extracted the shared validation logic into a reusable
`validateWorkflowForExecution` assertion function that guards against
not-found, missing-definition, invalid, and **disabled** workflows
before execution.
- Added comprehensive unit tests covering all validation scenarios
including the disabled workflow case.

## References

Closes elastic/security-team#15684

Made with [Cursor](https://cursor.com)

Co-authored-by: Cursor <cursoragent@cursor.com>
(cherry picked from commit 6b7b6f3)
@kibanamachine
Copy link
Copy Markdown
Contributor

💚 All backports created successfully

Status Branch Result
9.3

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Feb 11, 2026
…disabled workflows (#252673) (#252682)

# Backport

This will backport the following commits from `main` to `9.3`:
- [[One Workflow] fix: prevent alert rule actions from triggering
disabled workflows
(#252673)](#252673)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT
[{"author":{"name":"Tal","email":"tal.borenstein@elastic.co"},"sourceCommit":{"committedDate":"2026-02-11T10:59:34Z","message":"[One
Workflow] fix: prevent alert rule actions from triggering disabled
workflows (#252673)\n\n## Summary\n\n- Alert rule actions with a \"Run
Workflow\" connector were executing\nworkflows even when the workflow
was disabled (`enabled: false`). The\nbackend connector path checked for
workflow existence, definition, and\nvalidity — but skipped the
`enabled` check.\n- Extracted the shared validation logic into a
reusable\n`validateWorkflowForExecution` assertion function that guards
against\nnot-found, missing-definition, invalid, and **disabled**
workflows\nbefore execution.\n- Added comprehensive unit tests covering
all validation scenarios\nincluding the disabled workflow case.\n\n##
References\n\nCloses elastic/security-team#15684\n\n\nMade with
[Cursor](https://cursor.com)\n\nCo-authored-by: Cursor
<cursoragent@cursor.com>","sha":"6b7b6f35672e10108689dd1cb1acc81b18e13913","branchLabelMapping":{"^v9.4.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:version","Team:One
Workflow","v9.3.0","v9.4.0"],"title":"[One Workflow] fix: prevent alert
rule actions from triggering disabled
workflows","number":252673,"url":"https://github.com/elastic/kibana/pull/252673","mergeCommit":{"message":"[One
Workflow] fix: prevent alert rule actions from triggering disabled
workflows (#252673)\n\n## Summary\n\n- Alert rule actions with a \"Run
Workflow\" connector were executing\nworkflows even when the workflow
was disabled (`enabled: false`). The\nbackend connector path checked for
workflow existence, definition, and\nvalidity — but skipped the
`enabled` check.\n- Extracted the shared validation logic into a
reusable\n`validateWorkflowForExecution` assertion function that guards
against\nnot-found, missing-definition, invalid, and **disabled**
workflows\nbefore execution.\n- Added comprehensive unit tests covering
all validation scenarios\nincluding the disabled workflow case.\n\n##
References\n\nCloses elastic/security-team#15684\n\n\nMade with
[Cursor](https://cursor.com)\n\nCo-authored-by: Cursor
<cursoragent@cursor.com>","sha":"6b7b6f35672e10108689dd1cb1acc81b18e13913"}},"sourceBranch":"main","suggestedTargetBranches":["9.3"],"targetPullRequestStates":[{"branch":"9.3","label":"v9.3.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.4.0","branchLabelMappingKey":"^v9.4.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/252673","number":252673,"mergeCommit":{"message":"[One
Workflow] fix: prevent alert rule actions from triggering disabled
workflows (#252673)\n\n## Summary\n\n- Alert rule actions with a \"Run
Workflow\" connector were executing\nworkflows even when the workflow
was disabled (`enabled: false`). The\nbackend connector path checked for
workflow existence, definition, and\nvalidity — but skipped the
`enabled` check.\n- Extracted the shared validation logic into a
reusable\n`validateWorkflowForExecution` assertion function that guards
against\nnot-found, missing-definition, invalid, and **disabled**
workflows\nbefore execution.\n- Added comprehensive unit tests covering
all validation scenarios\nincluding the disabled workflow case.\n\n##
References\n\nCloses elastic/security-team#15684\n\n\nMade with
[Cursor](https://cursor.com)\n\nCo-authored-by: Cursor
<cursoragent@cursor.com>","sha":"6b7b6f35672e10108689dd1cb1acc81b18e13913"}}]}]
BACKPORT-->

Co-authored-by: Tal <tal.borenstein@elastic.co>
Co-authored-by: Cursor <cursoragent@cursor.com>
@talboren talboren deleted the 15684-bug-alert-rule-actions-trigger-disabled-workflows branch February 26, 2026 08:34
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) v9.3.0 v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants