Skip to content
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

[Backport] Validate query field when creating roles (#46275) #47094

Merged
merged 3 commits into from
Sep 26, 2019

Conversation

bizybot
Copy link
Contributor

@bizybot bizybot commented Sep 25, 2019

In the current implementation, the validation of the role query
occurs at runtime when the query is being executed.

This commit adds validation for the role query when creating a role
but not for the template query as we do not have the runtime
information required for evaluating the template query (eg. authenticated user's
information). This is similar to the scripts that we
store but do not evaluate or parse if they are valid queries or not.

For validation, the query is evaluated (if not a template), parsed to build the
QueryBuilder and verify if the query type is allowed.

Closes #34252

In the current implementation, the validation of the role query
occurs at runtime when the query is being executed.

This commit adds validation for the role query when creating a role
but not for the template query as we do not have the runtime
information required for evaluating the template query (eg. authenticated user's
information). This is similar to the scripts that we
store but do not evaluate or parse if they are valid queries or not.

For validation, the query is evaluated (if not a template), parsed to build the
QueryBuilder and verify if the query type is allowed.

Closes elastic#34252
@bizybot bizybot added :Security/Authorization Roles, Privileges, DLS/FLS, RBAC/ABAC backport labels Sep 25, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-security

@bizybot
Copy link
Contributor Author

bizybot commented Sep 25, 2019

@elasticmachine run elasticsearch-ci/default-distro

@bizybot bizybot merged commit 9a64b7a into elastic:7.x Sep 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport :Security/Authorization Roles, Privileges, DLS/FLS, RBAC/ABAC
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants