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

Commits on Nov 22, 2024

  1. WIP: Implement client-disconnection on authenticated user DROP or ALT…

    …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.
    aratno committed Nov 22, 2024
    Configuration menu
    Copy the full SHA
    337604d View commit details
    Browse the repository at this point in the history
  2. Disconnect invalid roles on a cadence, on every node

    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
    aratno committed Nov 22, 2024
    Configuration menu
    Copy the full SHA
    7f88b2b View commit details
    Browse the repository at this point in the history
  3. Test improvements

    aratno committed Nov 22, 2024
    Configuration menu
    Copy the full SHA
    565bf81 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    a0f2387 View commit details
    Browse the repository at this point in the history
  5. Add review notes

    aratno committed Nov 22, 2024
    Configuration menu
    Copy the full SHA
    856ccdd View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    be6597f View commit details
    Browse the repository at this point in the history

Commits on Nov 23, 2024

  1. Don't eagerly disconnect from ALTER coordinator, support config to di…

    …sable invalid role disconnect, null handling
    aratno committed Nov 23, 2024
    Configuration menu
    Copy the full SHA
    dee959c View commit details
    Browse the repository at this point in the history