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

CASSANDRA-19385: ALTER ROLE WITH LOGIN=FALSE and REVOKE ROLE do not disconnect existing users #3706

Open
wants to merge 7 commits into
base: trunk
Choose a base branch
from

Conversation

aratno
Copy link
Contributor

@aratno aratno commented Nov 22, 2024

No description provided.

…ER LOGIN = false

It's straightforward to have the coordinator of the DROP / ALTER
disconnect the impacted client, but non-coordinators don't have a direct
path of finding out that a user has been impacted. The role update
causes a write to system_auth.roles, and non-coordinators will pick up
that change async when they refresh their RolesCache.

It's important for this patch that non-coordinators also disconnect the
impacted user, because we could be revoking the role due to account
takeover or other risk.

One approach to solve this is having all instances periodically check
all their active connections, and disconnect impacted users. The active
connection count default maximum is 10k, and the list of active
connections is scanned for various metrics collection anyway.

Another approach is to limit the maximum duration that any connection
can be established, so users are required to re-authenticate
periodically, like every 24h. This improves our security posture in
other ways, and makes it easier to detect nodes that are added to the
cluster but cannot be accessed by clients.

For either approach, it would be helpful to have a JMX call that allows
operators to disconnect users by name, particularly for handling account
takeover scenarios.
Periodic disconnection would be useful for a few other reasons:
- When using mTLS, clients with short-lived certificates that don't
  support live certificate reloading would be required to
  re-authenticate periodically
- Security requirements that clients re-authenticate periodically,
  rather that depending on bounce schedules to enforce that
@@ -301,6 +306,7 @@ public void dropRole(AuthenticatedUser performer, RoleResource role) throws Requ
consistencyForRoleWrite(role.getRoleName()));
removeAllMembers(role.getRoleName());
removeAllIdentitiesOfRole(role.getRoleName());
disconnect(role);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think I'll remove ALTER-coordinator disconnects here, seems better to have all disconnects happen on the jitter schedule (particularly for smaller clusters)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant