-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Role mappings do not warn about invalid role_template entries #48773
Labels
:Security/Authentication
Logging in, Usernames/passwords, Realms (Native/LDAP/AD/SAML/PKI/etc)
Comments
Pinging @elastic/es-security (:Security/Authorization) |
legrego
added
:Security/Authentication
Logging in, Usernames/passwords, Realms (Native/LDAP/AD/SAML/PKI/etc)
and removed
:Security/Authorization
Roles, Privileges, DLS/FLS, RBAC/ABAC
labels
Oct 31, 2019
ywangd
added a commit
that referenced
this issue
Mar 24, 2020
Role names are now compiled from role templates before role mapping is saved. This serves as validation for role templates to prevent malformed and invalid scripts to be persisted, which could later break authentication. Resolves: #48773
ywangd
added a commit
to ywangd/elasticsearch
that referenced
this issue
Mar 24, 2020
Role names are now compiled from role templates before role mapping is saved. This serves as validation for role templates to prevent malformed and invalid scripts to be persisted, which could later break authentication. Resolves: elastic#48773
ywangd
added a commit
that referenced
this issue
Mar 24, 2020
Role names are now compiled from role templates before role mapping is saved. This serves as validation for role templates to prevent malformed and invalid scripts to be persisted, which could later break authentication. Resolves: #48773
Thanks for the fix! ❤️ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
:Security/Authentication
Logging in, Usernames/passwords, Realms (Native/LDAP/AD/SAML/PKI/etc)
Role mappings can specify either an array of
roles
, or an array ofrole_templates
. Whenrole_templates
are specified, they are expected to be in one of these two formats (based on my limited understanding of the code):{ "template": { "source": "some_{{mustache}}_template_string" } }
{ "template": { "id": "stored_script_id" } }
The API allows users to submit invalid templates, such as:
But once this role mapping is created, no users who rely on role mappings will be able to authenticate:
I think the API should ideally prevent these invalid templates from being stored in the first place, but I'm not sure how feasible that is.
Further, format 1 above requires
inline
scripts to be enabled, and format 2 above requiresstored
scripts to be enabled. If the required script type is disabled in Elasticsearch, then users will be unable to authenticate:I don't know how much can be done here, since node settings like
scripts.allowed_types
can be changed at any point after role mappings are created.The text was updated successfully, but these errors were encountered: