Cassandra RBAC and External Identity Providers: Credential Expiration Interoperability
0 reputation · 18 Jul 2023, 03:02 UTC
0 reputation · 18 Jul 2023, 03:02 UTC
Implementing a least-privilege security model in Apache Cassandra typically involves configuring the PasswordAuthenticator and utilizing GRANT/REVOKE commands to restrict access to specific keyspaces and tables.
While Cassandra supports granular Role-Based Access Control (RBAC), the internal authentication provider does not natively support automated credential expiration or time-based password rotation. Organizations requiring strict compliance for credential lifecycles often integrate Cassandra with external identity providers via plugins to handle authentication centrally.
There is uncertainty regarding how the internal RBAC system synchronizes with external providers when a credential expires at the identity provider level but the corresponding role permissions remain active within the system_auth keyspace.
PasswordAuthenticator interface allow for a callback mechanism to trigger the invalidation of internal session tokens upon external credential expiration?32275 reputation · 18 Jul 2023, 12:44 UTC
The PasswordAuthenticator interface in Apache Cassandra does not provide a native callback mechanism to trigger the invalidation of active session tokens upon external credential expiration. Authentication is a point-in-time event; once a user is authenticated via an external provider (such as LDAP or Kerberos), the resulting session is maintained by Cassandra independently of the external provider's state.
When credentials are revoked or expire in an external identity provider, the behavior for existing active sessions is as follows:
system_auth keyspace remain active. The RBAC system only checks if the authenticated role has the required permissions; it does not verify if the external identity that granted that role is still valid in real-time.To achieve stricter interoperability between an external provider and Cassandra's internal RBAC, consider these scoped approaches:
IAuthenticator that incorporates a time-to-live (TTL) for authenticated sessions, forcing a re-check against the external provider at defined intervals.REVOKE or DROP ROLE commands in Cassandra when a user is deactivated in the identity provider.To verify the persistence of sessions in your specific environment, you can use the following test pattern:
# 1. Establish a session via cqlsh
cqlsh -u username -p password
# 2. Expire or disable the user in the external LDAP/Kerberos provider
# (Perform this action in your IDP management console)
# 3. Execute a query in the existing cqlsh session
SELECT * FROM system.local;
# 4. Attempt to open a second, new cqlsh session
cqlsh -u username -p password
If Step 3 succeeds while Step 4 fails, your environment is exhibiting standard session persistence behavior.
Diagnostic Detail Needed: Are you using a third-party commercial distribution of Cassandra (e.g., DataStax) or the open-source Apache Cassandra project? Commercial versions often include proprietary authenticators with different session management capabilities.
Use comments to ask for clarification. Post a solution as an answer.
32,275 reputation · 18 Jul 2023, 05:12 UTC
To build on the previous point regarding session persistence, it is important to clarify that the disconnection between the external identity provider and the system_auth keyspace creates a persistent security gap. Even if a user is disabled in LDAP, their roles and permissions remain intact in Cassandra's internal metadata.
For environments requiring strict compliance, relying solely on connection timeouts may be insufficient. A more robust approach involves a two-pronged verification strategy:
REVOKE commands against the system_auth.role_permissions table to ensure that even if a session persists, the user's ability to execute queries is stripped.When testing this behavior in a staging environment, verify if the IAuthenticator implementation in your specific version (e.g., 4.x) caches authentication results, as this can further extend the window of unauthorized access.