Skip to content

Added warning when deleting alerting rule API keys #243353

Merged
elena-shostak merged 14 commits intoelastic:mainfrom
elena-shostak:160303-api-key-warning
Nov 27, 2025
Merged

Added warning when deleting alerting rule API keys #243353
elena-shostak merged 14 commits intoelastic:mainfrom
elena-shostak:160303-api-key-warning

Conversation

@elena-shostak
Copy link
Contributor

@elena-shostak elena-shostak commented Nov 18, 2025

Summary

Added warning when deleting API keys currently in use by alerting rules.
Screenshot 2025-11-20 at 15 32 38
Screenshot 2025-11-20 at 15 32 26

How to test

  • Create a couple of API keys with metadata: { managed: true, kibana: { type: 'alerting_rule' } }
  • Go to Stack Management -> API keys
  • Delete single/multiple keys and verify that warning is correctly displayed

Checklist

Closes: #160303

Release notes

Added a warning when deleting API keys currently in use by alerting rules.

@elena-shostak elena-shostak added Feature:Users/Roles/API Keys release_note:enhancement Team:Security Platform Security: Auth, Users, Roles, Spaces, Audit Logging, etc t// labels Nov 18, 2025
@elena-shostak elena-shostak changed the title [Api Keys] Added warning when deleting API keys currently in use by a… Nov 18, 2025
@elena-shostak elena-shostak changed the title [Api Keys] Added warning when deleting alerting rule API keys Nov 18, 2025
@elena-shostak elena-shostak marked this pull request as ready for review November 19, 2025 09:23
@elena-shostak elena-shostak requested review from a team as code owners November 19, 2025 09:23
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-security (Team:Security)

@elena-shostak elena-shostak marked this pull request as draft November 19, 2025 13:08
Copy link
Contributor

@pmuellr pmuellr left a comment

Choose a reason for hiding this comment

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

LGTM

For alerting rules, the API Key name will be of the form

Alerting: ${ruleTypeId}/${ruleName}

for example

Alerting: .index-threshold/My Flavorite Index threshold rule

Ideally, we could also include:

  • the Kibana space
  • a link right to the rule

I think this would require changes from both security and responseOps. I opened #243564 to track this.

@elena-shostak
Copy link
Contributor Author

@pmuellr FYI after a discussion with @legrego we ended up refining popup a bit (updated screenshot in the PR accordingly):

  • show warning for not only alerting keys, but for all managed keys
  • show the label next to api key name (agreed to add alerting badge for alerting api key)
@elena-shostak elena-shostak marked this pull request as ready for review November 20, 2025 16:00
@sophiec20
Copy link
Contributor

Thanks for making this change. This aligns API keys to follow the pattern where, in general, we warn about making changes to managed objects.

@jeramysoucy jeramysoucy self-requested a review November 24, 2025 12:08
Copy link
Contributor

@jeramysoucy jeramysoucy left a comment

Choose a reason for hiding this comment

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

LGTM! Just noticed one small issue.

@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-ux-management-team (Team:obs-ux-management)

@jloleysens jloleysens removed the request for review from a team November 26, 2025 13:09
@elena-shostak elena-shostak merged commit fe9f869 into elastic:main Nov 27, 2025
12 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.19, 9.1, 9.2

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

@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
security 487.2KB 488.5KB +1.3KB

History

kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Nov 27, 2025
## Summary

Added warning when deleting API keys currently in use by alerting rules.
<img width="772" height="278" alt="Screenshot 2025-11-20 at 15 32 38"
src="https://github.com/user-attachments/assets/930e0c28-1d55-4002-aed6-1a0c33b6fd3e"
/>
<img width="775" height="408" alt="Screenshot 2025-11-20 at 15 32 26"
src="https://github.com/user-attachments/assets/9201b91d-9d0c-420c-b1ff-602c6b8855d1"
/>

### How to test

- Create a couple of API keys with `metadata: { managed: true, kibana: {
type: 'alerting_rule' } }`
-  Go to Stack Management -> API keys
- Delete single/multiple keys and verify that warning is correctly
displayed

### Checklist

- [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)
- [ ] [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.

__Closes: https://github.com/elastic/kibana/issues/160303__

### Release notes

Added a warning when deleting API keys currently in use by alerting
rules.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit fe9f869)
kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Nov 27, 2025
## Summary

Added warning when deleting API keys currently in use by alerting rules.
<img width="772" height="278" alt="Screenshot 2025-11-20 at 15 32 38"
src="https://github.com/user-attachments/assets/930e0c28-1d55-4002-aed6-1a0c33b6fd3e"
/>
<img width="775" height="408" alt="Screenshot 2025-11-20 at 15 32 26"
src="https://github.com/user-attachments/assets/9201b91d-9d0c-420c-b1ff-602c6b8855d1"
/>

### How to test

- Create a couple of API keys with `metadata: { managed: true, kibana: {
type: 'alerting_rule' } }`
-  Go to Stack Management -> API keys
- Delete single/multiple keys and verify that warning is correctly
displayed

### Checklist

- [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)
- [ ] [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.

__Closes: https://github.com/elastic/kibana/issues/160303__

### Release notes

Added a warning when deleting API keys currently in use by alerting
rules.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit fe9f869)
@kibanamachine
Copy link
Contributor

💔 Some backports could not be created

Status Branch Result
8.19 Backport failed because of merge conflicts
9.1
9.2

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

Manual backport

To create the backport manually run:

node scripts/backport --pr 243353

Questions ?

Please refer to the Backport tool documentation

elena-shostak added a commit to elena-shostak/kibana that referenced this pull request Nov 27, 2025
## Summary

Added warning when deleting API keys currently in use by alerting rules.
<img width="772" height="278" alt="Screenshot 2025-11-20 at 15 32 38"
src="https://github.com/user-attachments/assets/930e0c28-1d55-4002-aed6-1a0c33b6fd3e"
/>
<img width="775" height="408" alt="Screenshot 2025-11-20 at 15 32 26"
src="https://github.com/user-attachments/assets/9201b91d-9d0c-420c-b1ff-602c6b8855d1"
/>

### How to test

- Create a couple of API keys with `metadata: { managed: true, kibana: {
type: 'alerting_rule' } }`
-  Go to Stack Management -> API keys
- Delete single/multiple keys and verify that warning is correctly
displayed

### Checklist

- [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)
- [ ] [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.

__Closes: https://github.com/elastic/kibana/issues/160303__

### Release notes

Added a warning when deleting API keys currently in use by alerting
rules.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit fe9f869)

# Conflicts:
#	x-pack/platform/plugins/shared/security/public/management/api_keys/api_keys_grid/invalidate_provider/invalidate_provider.tsx
kibanamachine added a commit that referenced this pull request Nov 27, 2025
…244499)

# Backport

This will backport the following commits from `main` to `9.1`:
- [Added warning when deleting alerting rule API keys
(#243353)](#243353)

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

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

<!--BACKPORT [{"author":{"name":"Elena
Shostak","email":"165678770+elena-shostak@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-11-27T12:37:10Z","message":"Added
warning when deleting alerting rule API keys (#243353)\n\n##
Summary\n\nAdded warning when deleting API keys currently in use by
alerting rules.\n<img width=\"772\" height=\"278\" alt=\"Screenshot
2025-11-20 at 15 32
38\"\nsrc=\"https://github.com/user-attachments/assets/930e0c28-1d55-4002-aed6-1a0c33b6fd3e\"\n/>\n<img
width=\"775\" height=\"408\" alt=\"Screenshot 2025-11-20 at 15 32
26\"\nsrc=\"https://github.com/user-attachments/assets/9201b91d-9d0c-420c-b1ff-602c6b8855d1\"\n/>\n\n\n\n###
How to test\n\n- Create a couple of API keys with `metadata: { managed:
true, kibana: {\ntype: 'alerting_rule' } }`\n- Go to Stack Management ->
API keys\n- Delete single/multiple keys and verify that warning is
correctly\ndisplayed\n\n### Checklist\n\n- [x] Any text added follows
[EUI's
writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\nsentence case text and includes
[i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n-
[ ] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [x] The PR
description includes the appropriate Release Notes section,\nand the
correct `release_note:*` label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n-
[x] Review the
[backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand
apply applicable `backport:*` labels.\n\n__Closes:
https://github.com/elastic/kibana/issues/160303__\n\n\n### Release
notes\n\nAdded a warning when deleting API keys currently in use by
alerting\nrules.\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"fe9f869ed56b9474150614bcf6bb33d898388453","branchLabelMapping":{"^v9.3.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:enhancement","Team:Security","Feature:Users/Roles/API
Keys","backport:version","v9.3.0","v8.19.8","v9.2.2","v9.1.8","Team:obs-ux-management"],"title":"Added
warning when deleting alerting rule API keys
","number":243353,"url":"https://github.com/elastic/kibana/pull/243353","mergeCommit":{"message":"Added
warning when deleting alerting rule API keys (#243353)\n\n##
Summary\n\nAdded warning when deleting API keys currently in use by
alerting rules.\n<img width=\"772\" height=\"278\" alt=\"Screenshot
2025-11-20 at 15 32
38\"\nsrc=\"https://github.com/user-attachments/assets/930e0c28-1d55-4002-aed6-1a0c33b6fd3e\"\n/>\n<img
width=\"775\" height=\"408\" alt=\"Screenshot 2025-11-20 at 15 32
26\"\nsrc=\"https://github.com/user-attachments/assets/9201b91d-9d0c-420c-b1ff-602c6b8855d1\"\n/>\n\n\n\n###
How to test\n\n- Create a couple of API keys with `metadata: { managed:
true, kibana: {\ntype: 'alerting_rule' } }`\n- Go to Stack Management ->
API keys\n- Delete single/multiple keys and verify that warning is
correctly\ndisplayed\n\n### Checklist\n\n- [x] Any text added follows
[EUI's
writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\nsentence case text and includes
[i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n-
[ ] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [x] The PR
description includes the appropriate Release Notes section,\nand the
correct `release_note:*` label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n-
[x] Review the
[backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand
apply applicable `backport:*` labels.\n\n__Closes:
https://github.com/elastic/kibana/issues/160303__\n\n\n### Release
notes\n\nAdded a warning when deleting API keys currently in use by
alerting\nrules.\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"fe9f869ed56b9474150614bcf6bb33d898388453"}},"sourceBranch":"main","suggestedTargetBranches":["8.19","9.2","9.1"],"targetPullRequestStates":[{"branch":"main","label":"v9.3.0","branchLabelMappingKey":"^v9.3.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/243353","number":243353,"mergeCommit":{"message":"Added
warning when deleting alerting rule API keys (#243353)\n\n##
Summary\n\nAdded warning when deleting API keys currently in use by
alerting rules.\n<img width=\"772\" height=\"278\" alt=\"Screenshot
2025-11-20 at 15 32
38\"\nsrc=\"https://github.com/user-attachments/assets/930e0c28-1d55-4002-aed6-1a0c33b6fd3e\"\n/>\n<img
width=\"775\" height=\"408\" alt=\"Screenshot 2025-11-20 at 15 32
26\"\nsrc=\"https://github.com/user-attachments/assets/9201b91d-9d0c-420c-b1ff-602c6b8855d1\"\n/>\n\n\n\n###
How to test\n\n- Create a couple of API keys with `metadata: { managed:
true, kibana: {\ntype: 'alerting_rule' } }`\n- Go to Stack Management ->
API keys\n- Delete single/multiple keys and verify that warning is
correctly\ndisplayed\n\n### Checklist\n\n- [x] Any text added follows
[EUI's
writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\nsentence case text and includes
[i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n-
[ ] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [x] The PR
description includes the appropriate Release Notes section,\nand the
correct `release_note:*` label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n-
[x] Review the
[backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand
apply applicable `backport:*` labels.\n\n__Closes:
https://github.com/elastic/kibana/issues/160303__\n\n\n### Release
notes\n\nAdded a warning when deleting API keys currently in use by
alerting\nrules.\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"fe9f869ed56b9474150614bcf6bb33d898388453"}},{"branch":"8.19","label":"v8.19.8","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.2","label":"v9.2.2","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.1","label":"v9.1.8","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

---------

Co-authored-by: Elena Shostak <165678770+elena-shostak@users.noreply.github.com>
kibanamachine added a commit that referenced this pull request Nov 27, 2025
…244500)

# Backport

This will backport the following commits from `main` to `9.2`:
- [Added warning when deleting alerting rule API keys
(#243353)](#243353)

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

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

<!--BACKPORT [{"author":{"name":"Elena
Shostak","email":"165678770+elena-shostak@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-11-27T12:37:10Z","message":"Added
warning when deleting alerting rule API keys (#243353)\n\n##
Summary\n\nAdded warning when deleting API keys currently in use by
alerting rules.\n<img width=\"772\" height=\"278\" alt=\"Screenshot
2025-11-20 at 15 32
38\"\nsrc=\"https://github.com/user-attachments/assets/930e0c28-1d55-4002-aed6-1a0c33b6fd3e\"\n/>\n<img
width=\"775\" height=\"408\" alt=\"Screenshot 2025-11-20 at 15 32
26\"\nsrc=\"https://github.com/user-attachments/assets/9201b91d-9d0c-420c-b1ff-602c6b8855d1\"\n/>\n\n\n\n###
How to test\n\n- Create a couple of API keys with `metadata: { managed:
true, kibana: {\ntype: 'alerting_rule' } }`\n- Go to Stack Management ->
API keys\n- Delete single/multiple keys and verify that warning is
correctly\ndisplayed\n\n### Checklist\n\n- [x] Any text added follows
[EUI's
writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\nsentence case text and includes
[i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n-
[ ] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [x] The PR
description includes the appropriate Release Notes section,\nand the
correct `release_note:*` label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n-
[x] Review the
[backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand
apply applicable `backport:*` labels.\n\n__Closes:
https://github.com/elastic/kibana/issues/160303__\n\n\n### Release
notes\n\nAdded a warning when deleting API keys currently in use by
alerting\nrules.\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"fe9f869ed56b9474150614bcf6bb33d898388453","branchLabelMapping":{"^v9.3.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:enhancement","Team:Security","Feature:Users/Roles/API
Keys","backport:version","v9.3.0","v8.19.8","v9.2.2","v9.1.8","Team:obs-ux-management"],"title":"Added
warning when deleting alerting rule API keys
","number":243353,"url":"https://github.com/elastic/kibana/pull/243353","mergeCommit":{"message":"Added
warning when deleting alerting rule API keys (#243353)\n\n##
Summary\n\nAdded warning when deleting API keys currently in use by
alerting rules.\n<img width=\"772\" height=\"278\" alt=\"Screenshot
2025-11-20 at 15 32
38\"\nsrc=\"https://github.com/user-attachments/assets/930e0c28-1d55-4002-aed6-1a0c33b6fd3e\"\n/>\n<img
width=\"775\" height=\"408\" alt=\"Screenshot 2025-11-20 at 15 32
26\"\nsrc=\"https://github.com/user-attachments/assets/9201b91d-9d0c-420c-b1ff-602c6b8855d1\"\n/>\n\n\n\n###
How to test\n\n- Create a couple of API keys with `metadata: { managed:
true, kibana: {\ntype: 'alerting_rule' } }`\n- Go to Stack Management ->
API keys\n- Delete single/multiple keys and verify that warning is
correctly\ndisplayed\n\n### Checklist\n\n- [x] Any text added follows
[EUI's
writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\nsentence case text and includes
[i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n-
[ ] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [x] The PR
description includes the appropriate Release Notes section,\nand the
correct `release_note:*` label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n-
[x] Review the
[backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand
apply applicable `backport:*` labels.\n\n__Closes:
https://github.com/elastic/kibana/issues/160303__\n\n\n### Release
notes\n\nAdded a warning when deleting API keys currently in use by
alerting\nrules.\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"fe9f869ed56b9474150614bcf6bb33d898388453"}},"sourceBranch":"main","suggestedTargetBranches":["8.19","9.2","9.1"],"targetPullRequestStates":[{"branch":"main","label":"v9.3.0","branchLabelMappingKey":"^v9.3.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/243353","number":243353,"mergeCommit":{"message":"Added
warning when deleting alerting rule API keys (#243353)\n\n##
Summary\n\nAdded warning when deleting API keys currently in use by
alerting rules.\n<img width=\"772\" height=\"278\" alt=\"Screenshot
2025-11-20 at 15 32
38\"\nsrc=\"https://github.com/user-attachments/assets/930e0c28-1d55-4002-aed6-1a0c33b6fd3e\"\n/>\n<img
width=\"775\" height=\"408\" alt=\"Screenshot 2025-11-20 at 15 32
26\"\nsrc=\"https://github.com/user-attachments/assets/9201b91d-9d0c-420c-b1ff-602c6b8855d1\"\n/>\n\n\n\n###
How to test\n\n- Create a couple of API keys with `metadata: { managed:
true, kibana: {\ntype: 'alerting_rule' } }`\n- Go to Stack Management ->
API keys\n- Delete single/multiple keys and verify that warning is
correctly\ndisplayed\n\n### Checklist\n\n- [x] Any text added follows
[EUI's
writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\nsentence case text and includes
[i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n-
[ ] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [x] The PR
description includes the appropriate Release Notes section,\nand the
correct `release_note:*` label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n-
[x] Review the
[backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand
apply applicable `backport:*` labels.\n\n__Closes:
https://github.com/elastic/kibana/issues/160303__\n\n\n### Release
notes\n\nAdded a warning when deleting API keys currently in use by
alerting\nrules.\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"fe9f869ed56b9474150614bcf6bb33d898388453"}},{"branch":"8.19","label":"v8.19.8","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.2","label":"v9.2.2","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.1","label":"v9.1.8","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Elena Shostak <165678770+elena-shostak@users.noreply.github.com>
elena-shostak added a commit that referenced this pull request Nov 28, 2025
…244537)

# Backport

This will backport the following commits from `main` to `8.19`:
- [Added warning when deleting alerting rule API keys
(#243353)](#243353)

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

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

<!--BACKPORT [{"author":{"name":"Elena
Shostak","email":"165678770+elena-shostak@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-11-27T12:37:10Z","message":"Added
warning when deleting alerting rule API keys (#243353)\n\n##
Summary\n\nAdded warning when deleting API keys currently in use by
alerting rules.\n<img width=\"772\" height=\"278\" alt=\"Screenshot
2025-11-20 at 15 32
38\"\nsrc=\"https://github.com/user-attachments/assets/930e0c28-1d55-4002-aed6-1a0c33b6fd3e\"\n/>\n<img
width=\"775\" height=\"408\" alt=\"Screenshot 2025-11-20 at 15 32
26\"\nsrc=\"https://github.com/user-attachments/assets/9201b91d-9d0c-420c-b1ff-602c6b8855d1\"\n/>\n\n\n\n###
How to test\n\n- Create a couple of API keys with `metadata: { managed:
true, kibana: {\ntype: 'alerting_rule' } }`\n- Go to Stack Management ->
API keys\n- Delete single/multiple keys and verify that warning is
correctly\ndisplayed\n\n### Checklist\n\n- [x] Any text added follows
[EUI's
writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\nsentence case text and includes
[i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n-
[ ] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [x] The PR
description includes the appropriate Release Notes section,\nand the
correct `release_note:*` label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n-
[x] Review the
[backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand
apply applicable `backport:*` labels.\n\n__Closes:
https://github.com/elastic/kibana/issues/160303__\n\n\n### Release
notes\n\nAdded a warning when deleting API keys currently in use by
alerting\nrules.\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"fe9f869ed56b9474150614bcf6bb33d898388453","branchLabelMapping":{"^v9.3.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:enhancement","Team:Security","Feature:Users/Roles/API
Keys","backport:version","v9.3.0","v8.19.8","v9.2.2","v9.1.8","Team:obs-ux-management"],"title":"Added
warning when deleting alerting rule API keys
","number":243353,"url":"https://github.com/elastic/kibana/pull/243353","mergeCommit":{"message":"Added
warning when deleting alerting rule API keys (#243353)\n\n##
Summary\n\nAdded warning when deleting API keys currently in use by
alerting rules.\n<img width=\"772\" height=\"278\" alt=\"Screenshot
2025-11-20 at 15 32
38\"\nsrc=\"https://github.com/user-attachments/assets/930e0c28-1d55-4002-aed6-1a0c33b6fd3e\"\n/>\n<img
width=\"775\" height=\"408\" alt=\"Screenshot 2025-11-20 at 15 32
26\"\nsrc=\"https://github.com/user-attachments/assets/9201b91d-9d0c-420c-b1ff-602c6b8855d1\"\n/>\n\n\n\n###
How to test\n\n- Create a couple of API keys with `metadata: { managed:
true, kibana: {\ntype: 'alerting_rule' } }`\n- Go to Stack Management ->
API keys\n- Delete single/multiple keys and verify that warning is
correctly\ndisplayed\n\n### Checklist\n\n- [x] Any text added follows
[EUI's
writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\nsentence case text and includes
[i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n-
[ ] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [x] The PR
description includes the appropriate Release Notes section,\nand the
correct `release_note:*` label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n-
[x] Review the
[backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand
apply applicable `backport:*` labels.\n\n__Closes:
https://github.com/elastic/kibana/issues/160303__\n\n\n### Release
notes\n\nAdded a warning when deleting API keys currently in use by
alerting\nrules.\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"fe9f869ed56b9474150614bcf6bb33d898388453"}},"sourceBranch":"main","suggestedTargetBranches":["8.19","9.2","9.1"],"targetPullRequestStates":[{"branch":"main","label":"v9.3.0","branchLabelMappingKey":"^v9.3.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/243353","number":243353,"mergeCommit":{"message":"Added
warning when deleting alerting rule API keys (#243353)\n\n##
Summary\n\nAdded warning when deleting API keys currently in use by
alerting rules.\n<img width=\"772\" height=\"278\" alt=\"Screenshot
2025-11-20 at 15 32
38\"\nsrc=\"https://github.com/user-attachments/assets/930e0c28-1d55-4002-aed6-1a0c33b6fd3e\"\n/>\n<img
width=\"775\" height=\"408\" alt=\"Screenshot 2025-11-20 at 15 32
26\"\nsrc=\"https://github.com/user-attachments/assets/9201b91d-9d0c-420c-b1ff-602c6b8855d1\"\n/>\n\n\n\n###
How to test\n\n- Create a couple of API keys with `metadata: { managed:
true, kibana: {\ntype: 'alerting_rule' } }`\n- Go to Stack Management ->
API keys\n- Delete single/multiple keys and verify that warning is
correctly\ndisplayed\n\n### Checklist\n\n- [x] Any text added follows
[EUI's
writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\nsentence case text and includes
[i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n-
[ ] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [x] The PR
description includes the appropriate Release Notes section,\nand the
correct `release_note:*` label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n-
[x] Review the
[backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand
apply applicable `backport:*` labels.\n\n__Closes:
https://github.com/elastic/kibana/issues/160303__\n\n\n### Release
notes\n\nAdded a warning when deleting API keys currently in use by
alerting\nrules.\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"fe9f869ed56b9474150614bcf6bb33d898388453"}},{"branch":"8.19","label":"v8.19.8","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.2","label":"v9.2.2","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.1","label":"v9.1.8","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
tkajtoch pushed a commit to tkajtoch/kibana that referenced this pull request Dec 1, 2025
## Summary

Added warning when deleting API keys currently in use by alerting rules.
<img width="772" height="278" alt="Screenshot 2025-11-20 at 15 32 38"
src="https://github.com/user-attachments/assets/930e0c28-1d55-4002-aed6-1a0c33b6fd3e"
/>
<img width="775" height="408" alt="Screenshot 2025-11-20 at 15 32 26"
src="https://github.com/user-attachments/assets/9201b91d-9d0c-420c-b1ff-602c6b8855d1"
/>



### How to test

- Create a couple of API keys with `metadata: { managed: true, kibana: {
type: 'alerting_rule' } }`
-  Go to Stack Management -> API keys
- Delete single/multiple keys and verify that warning is correctly
displayed

### Checklist

- [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)
- [ ] [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.

__Closes: https://github.com/elastic/kibana/issues/160303__


### Release notes

Added a warning when deleting API keys currently in use by alerting
rules.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
JordanSh pushed a commit to JordanSh/kibana that referenced this pull request Dec 9, 2025
## Summary

Added warning when deleting API keys currently in use by alerting rules.
<img width="772" height="278" alt="Screenshot 2025-11-20 at 15 32 38"
src="https://github.com/user-attachments/assets/930e0c28-1d55-4002-aed6-1a0c33b6fd3e"
/>
<img width="775" height="408" alt="Screenshot 2025-11-20 at 15 32 26"
src="https://github.com/user-attachments/assets/9201b91d-9d0c-420c-b1ff-602c6b8855d1"
/>



### How to test

- Create a couple of API keys with `metadata: { managed: true, kibana: {
type: 'alerting_rule' } }`
-  Go to Stack Management -> API keys
- Delete single/multiple keys and verify that warning is correctly
displayed

### Checklist

- [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)
- [ ] [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.

__Closes: https://github.com/elastic/kibana/issues/160303__


### Release notes

Added a warning when deleting API keys currently in use by alerting
rules.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

8 participants