-
Notifications
You must be signed in to change notification settings - Fork 25.1k
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
Require that all app privileges have actions #32272
Conversation
The javadoc and validation for ApplicationPrivileges supports the idea that a privilege could have no actions. However, in that case every privilege that had no actions grants every other action-less privilege within the same action, including the NONE privilege. This commit makes the following changes: - It is not possible to PUT a privilege without any actions - A permission with no actions, never grants another privilege even if that privilege is also a zero-action privilege (which, ideally would never exist, but can occur through missing privileges or index manipulation).
Pinging @elastic/es-security |
This change was triggered by conversation here: |
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
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
import java.util.Collections; | ||
import java.util.List; | ||
|
||
import static java.util.Collections.singletonList; | ||
import static org.hamcrest.Matchers.equalTo; | ||
|
||
@TestLogging("org.elasticsearch.xpack.core.security.authz.permission:TRACE") |
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 we still need this test logging?
@elasticmachine run gradle build tests |
The javadoc and validation for ApplicationPrivileges supports the idea
that a privilege could have no actions. However, in that case every
privilege that had no actions grants every other action-less privilege
within the same action, including the NONE privilege.
This commit makes the following changes:
that privilege is also a zero-action privilege (which, ideally would
never exist, but can occur through missing privileges or index
manipulation).