Skip to content

Conversation

richard-dennehy
Copy link
Contributor

Record security exception for resolved index expressions with CONCRETE_RESOURCE_UNAUTHORIZED results

@richard-dennehy richard-dennehy added >non-issue :Security/Security Security issues without another label Team:Security Meta label for security team labels Sep 29, 2025
@richard-dennehy richard-dennehy marked this pull request as ready for review September 29, 2025 16:15
@elasticsearchmachine
Copy link
Collaborator

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

if (e instanceof IndexNotFoundException) {
listener.onFailure(e);
} else {
listener.onFailure(actionDenied(authentication, authzInfo, action, request, e));
Copy link
Contributor

@n1v0lg n1v0lg Oct 7, 2025

Choose a reason for hiding this comment

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

We need to set security exceptions in the case where the action actually succeeded (due to ignore_unavailable=true) instead of when it failed. When it failed, the recorded expressions are irrelevant since we will throw directly. So we need to take the request post resolution and see if:

  1. it has resolved expressions recorded
  2. if any of those have CONCRETE_RESOURCE_UNAUTHORIZED set

If the above is true, we need to set an actionDenied exception as you do below

@n1v0lg n1v0lg requested review from ywangd and removed request for ywangd October 7, 2025 16:04
@n1v0lg
Copy link
Contributor

n1v0lg commented Oct 7, 2025

Sorry, only got to this late!

@richard-dennehy could you update the branch, address this bit, and the req a review from @ywangd when it's ready? If my comment doesn't make sense I hope Yang can provide guidance. The Jira, for reference is ES-13005.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>non-issue :Security/Security Security issues without another label Team:Security Meta label for security team v9.3.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants