Skip to content

Fix NPE in auditing authenticationSuccess for non-existing run-as user (#91171)#91240

Merged
elasticsearchmachine merged 1 commit intoelastic:8.5from
ywangd:pki-realm-delegatee-realm-8.5
Nov 2, 2022
Merged

Fix NPE in auditing authenticationSuccess for non-existing run-as user (#91171)#91240
elasticsearchmachine merged 1 commit intoelastic:8.5from
ywangd:pki-realm-delegatee-realm-8.5

Conversation

@ywangd
Copy link
Copy Markdown
Member

@ywangd ywangd commented Nov 2, 2022

When run-as fails because the target user does not exist, the authentication is created with a null lookup realm. It is then rejected at authorization time. But for authentication, it is treated as success. This can lead to NPE when auditing the authenticationSuccess event.

This PR fixes the NPE by checking whether lookup realm is null before using it.

Relates: #91126 (comment)

Backport: #91171

elastic#91171)

When run-as fails because the target user does not exist, the
authentication is created with a null lookup realm. It is then rejected
at authorization time. But for authentication, it is treated as success.
This can lead to NPE when auditing the authenticationSuccess event.

This PR fixes the NPE by checking whether lookup realm is null before
using it.

Relates: elastic#91126 (comment)
@ywangd ywangd added backport auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) labels Nov 2, 2022
@elasticsearchmachine elasticsearchmachine merged commit 3f24a51 into elastic:8.5 Nov 2, 2022
@ywangd ywangd deleted the pki-realm-delegatee-realm-8.5 branch November 2, 2022 00:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) backport v8.5.1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants