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

Reload of FileUserPasswdStore does not invalidate lastSuccessfulAuthCache #87368

Open
slobodanadamovic opened this issue Jun 3, 2022 · 3 comments
Assignees
Labels
>enhancement :Security/Authentication Logging in, Usernames/passwords, Realms (Native/LDAP/AD/SAML/PKI/etc) Team:Security Meta label for security team

Comments

@slobodanadamovic
Copy link
Contributor

slobodanadamovic commented Jun 3, 2022

Reloading users and passwords in the file realm could potentially introduce new users or update existing.
This means that lastSuccessfulAuthCache may not be up to date anymore and would provide suboptimal order of authentication in RealmsAuthenticator. This is not a big problem since users still have a possibility to use clear cache API which would now clear lastSuccessfulAuthCache as well.

Suggestion: We could improve this by registering a listener which would invoke expireAll in AuthenticationService, when the file realm store gets updated.

Note: Compared to the native realm, we only need to clear the lastSuccessfulAuthCache on the local node.

@slobodanadamovic slobodanadamovic added >enhancement :Security/Authentication Logging in, Usernames/passwords, Realms (Native/LDAP/AD/SAML/PKI/etc) Team:Security Meta label for security team labels Jun 3, 2022
@slobodanadamovic slobodanadamovic self-assigned this Jun 3, 2022
@elasticmachine
Copy link
Collaborator

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

@ywangd
Copy link
Member

ywangd commented Jun 6, 2022

We could improve this by registering a listener which would invoke expireAll in AuthenticationService, when the file realm store gets updated.

I think we should explore the possibility to expire individual users instead of expireAll. File realm is usually considered as under control of the infrastructure owner which is not necessary the end-users (e.g. ESS). As such, we would want to minimize the impact of infrastructure owner's operations on end-users.

@slobodanadamovic
Copy link
Contributor Author

This is a good point. I think it should be possible to expire individual users. At the moment I don't see any reason why not.
We could allow both expireAll and expire individual users to be called and leave it to the implementor to chose which method makes more sense to be called.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>enhancement :Security/Authentication Logging in, Usernames/passwords, Realms (Native/LDAP/AD/SAML/PKI/etc) Team:Security Meta label for security team
Projects
None yet
Development

No branches or pull requests

3 participants