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

PKIRealm delegation unsupported without a truststore #45011

Conversation

albertzaharovits
Copy link
Contributor

@albertzaharovits albertzaharovits commented Jul 30, 2019

In the usual scenario, where the PKIRealm works without delegation, a trust configuration is not required at the realm settings scope. In this case the client's certificate chain has been validated by the TLS channel (HTTP), and the realm does not enforce any other extra chain validations. In this case the client's certificate is considered authenticated by the realm.

This no-op validation, without a trust configuration at the realm level, is incompatible with the delegation use-case. This commit adds a constructor check to the PKIRealm that will forbid toggling delegation.enabled without also setting a truststore. Otherwise, the delegation feature would not work at run-time (all API calls will be un-authorized).

Thanks Tim for pointing out this problem to me!

Relates #34396

@albertzaharovits albertzaharovits added the :Security/Authentication Logging in, Usernames/passwords, Realms (Native/LDAP/AD/SAML/PKI/etc) label Jul 30, 2019
@albertzaharovits albertzaharovits self-assigned this Jul 30, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-security

Copy link
Contributor

@bizybot bizybot left a comment

Choose a reason for hiding this comment

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

LGTM, Thank you.

Copy link
Contributor

@tvernum tvernum left a comment

Choose a reason for hiding this comment

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

LGTM

…ecurity/authc/pki/PkiRealm.java

Co-Authored-By: Yogesh Gaikwad <902768+bizybot@users.noreply.github.com>
@albertzaharovits
Copy link
Contributor Author

@elasticmachine run elasticsearch-ci/default-distro

@albertzaharovits
Copy link
Contributor Author

@elasticmachine run elasticsearch-ci/bwc

@albertzaharovits
Copy link
Contributor Author

@elasticmachine run elasticsearch-ci/default-distro

@albertzaharovits
Copy link
Contributor Author

@elasticmachine run elasticsearch-ci/bwc

@albertzaharovits
Copy link
Contributor Author

@elasticmachine run elasticsearch-ci/default-distro

@albertzaharovits albertzaharovits merged commit 16496d6 into elastic:proxied-pki Aug 1, 2019
@albertzaharovits albertzaharovits deleted the security-pki-delegation-forbid-delegation-without-trustore branch August 1, 2019 05:40
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)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants