Skip to content

Changing from manage_api_key to manage_own_api_key can cause an error and non-deleted key #54525

@FrankHassanabad

Description

@FrankHassanabad

If you create an alert with a role that has permissions of manage_api_key or manage_security and then later change that role to have the permissions of manage_own_api_key when you next update an alert by enabling/disabling it you get this error message in your console:

server    log   [15:25:03.213] [error][api-key][plugins][security] Failed to invalidate API key: [security_exception] action [cluster:admin/xpack/security/api_key/invalidate] is unauthorized for user [ReadOnlyUser]
server    log   [15:25:03.214] [error][alerting][plugins] Failed to invalidate API Key: [security_exception] action [cluster:admin/xpack/security/api_key/invalidate] is unauthorized for user [ReadOnlyUser]
server    log   [15:25:04.462] [error][api-key][plugins][security] Failed to invalidate API key: [security_exception] action [cluster:admin/xpack/security/api_key/invalidate] is unauthorized for user [ReadOnlyUser]
server    log   [15:25:04.463] [error][alerting][plugins] Failed to invalidate API Key: [security_exception] action [cluster:admin/xpack/security/api_key/invalidate] is unauthorized for user [ReadOnlyUser]

Everything still runs as expected as the new key is replaced but the existing/old key is not deleted from the console logs and you are left with a dangling key.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Feature:AlertingTeam:ResponseOpsPlatform ResponseOps team (formerly the Cases and Alerting teams) t//

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions