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

Reject OpenID Connect authentication attempt initiated by a Third Party if configured and used realms don't match #94542

Open
azasypkin opened this issue Mar 15, 2021 · 1 comment
Labels
enhancement New value added to drive a business result Feature:Security/Authentication Platform Security - Authentication Team:Security Team focused on: Auth, Users, Roles, Spaces, Audit Logging, and more!

Comments

@azasypkin
Copy link
Member

Currently to handle an OpenID Connect authentication attempt initiated by a Third Party, Kibana passes only iss and login_hint parameters to the Elasticsearch. Elasticsearch explicitly forbids passing both iss and realm in the same request. That means that technically user can be authenticated by any suitable Elasticsearch OpenID Connect realm even if it doesn't match the realm configured in Kibana.

This may lead to a weird state when users are authenticated by one Elasticsearch OpenID Conect realm during a Third Party initiated login and by a different one when they initiate login from Kibana (we pass realm to Elasticsearch in this case). This issue is exacerbated in case we have multiple OpenID Connect authentication providers with potentially different settings (session timeouts, access agreement etc.).

Previously we didn't have an easy way to figure out which realm was actually used for a Third Party initiated authentication, but now Elasticsearch response includes both realm and authentication object. Using this information we can easily detect a realm mismatch and reject authentication attempt (and invalidate "mistakenly" created tokens) that will either give a chance to the next OpenID Connect provider to perform authentication or forbid login completely.

@azasypkin azasypkin added Team:Security Team focused on: Auth, Users, Roles, Spaces, Audit Logging, and more! enhancement New value added to drive a business result Feature:Security/Authentication Platform Security - Authentication labels Mar 15, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-security (Team:Security)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New value added to drive a business result Feature:Security/Authentication Platform Security - Authentication Team:Security Team focused on: Auth, Users, Roles, Spaces, Audit Logging, and more!
Projects
None yet
Development

No branches or pull requests

3 participants