-
Notifications
You must be signed in to change notification settings - Fork 25.3k
App permissions with action patterns do not retrieve privileges #85455
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
App permissions with action patterns do not retrieve privileges #85455
Conversation
Pinging @elastic/es-security (Team:Security) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would need more information to be able to complete a review, but I did have a feedback point.
...rc/main/java/org/elasticsearch/xpack/core/security/authz/privilege/ApplicationPrivilege.java
Show resolved
Hide resolved
try { | ||
ApplicationPrivilege.validatePrivilegeOrActionName(action); | ||
ApplicationPrivilege.validateActionName(action); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found it confusing to have a method called validateActionName
which does validation on action name, but then also calls through to validatePrivilegeOrActionName
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you also have proposals to improve it?
Also keeping in mind this is a bug-fix PR.
I only slightly changed code in this part to make sure the action names I generate IN TESTS are valid.
This PR fixes the bug from #85312 by making any file-based role that contains application permissions that do not refer to named application privileges (which only mention inlined action patterns, like the Another option to fix the same bug would be to always return the statically built I think both approaches have pros-cons, but I don't think we have to choose between them. EDIT: The above has been partly discussed over Slack, and the other option has been suggested by @tvernum . |
Hi @albertzaharovits, I've created a changelog YAML for you. |
Hey @albertzaharovits - this approach looks like a good direction to me. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Hi @albertzaharovits, I've updated the changelog YAML for you. |
Yes, please review. I have adapted the PR description and label to reflect that this is now |
Given this is now an enhancement, I don't think we should backport to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@elasticmachine update branch |
In order for file realm users, with application privileges, to continue
to work (authenticate) when the
.security
index is unavailable,Security must avoid loading the application privileges from the .security index
(which is unavailable, hence error out).
Roles (defined inside the
roles.yml
file, not in the index) that must workwhen the
.security
index is unavailable must use inlined action patternsfor application permisions, rather than privilege names.
Related #85312