Authenticating a DataStax Enterprise cluster with Kerberos
This section provides information about configuring security for a DataStax Enterprise (DSE) cluster using Kerberos.
Kerberos is a computer network authentication protocol that allows nodes communicating over a non-secure network to prove their identity to one another in a secure manner using tickets. This section does not provide detailed information on installing and setting up Kerberos. For this information, see the MIT Kerberos Consortium.
When using Kerberos security, you need to be aware of the scope of Kerberos tickets. Using the su or sudo command leaves any existing credentials behind and requires you to re-authenticate as that new user. If you encounter authentication issues, please ensure that you have a proper Kerberos ticket.
For information about using Kerberos with SSL, see Using Kerberos and SSL at the same time.
The following are general guidelines for setting up Kerberos:
- Before installing DSE, set up your Kerberos servers.
- Set up several machines as authentication servers (Key Distribution Center [KDC]). One will be the primary or administration KDC, the others will be secondary.
- Do not install the KDC servers on DSE nodes.
- Set up firewalls on each KDC server.
- Physically protect the KDC machines.
- Secure the keytab files owned by the user running DSE. The file should be readable and writeable only by the owner without permissions for any other user (chmod 0600).
Currently, DataStax Enterprise does not support AES-256 because of security issues. You must remove it as an allowed cypher for each principal in one of the following ways:
- Before creating the principals, use the -e flag to specify encryption:salt type pairs. For example: -e "arcfour-hmac:normal des3-hmac-sha1:normal". This method requires Kerberos 5-1.2 on the KDC.
- After creating the principals, modify the Kerberos principals using the -e flag as described above and then recreate the keytab file. This method requires Kerberos 5-1.2 on the KDC.
- Modify the /etc/krb5kdc/kdc.conf file by removing any entries containing aes256 from the supported_enctypes variable for the realm in which the DSE nodes are members.
Securing DataStax Enterprise nodes
Do not upgrade DataStax Enterprise and set up Kerberos at the same time; see Limitations on use during the upgrade.
To set up Kerberos on your DSE nodes, do the following on every node:
Install the Kerberos client software.
Use Kerberos to generate one keytab file for each node:
kadmin -p <username>/admin
addprinc -randkey dse/<FQDN>
addprinc -randkey HTTP/<FQDN>
ktadd -k dse.keytab dse/<FQDN>
ktadd -k dse.keytab HTTP/<FQDN>
- -randkey creates a random password.
- ktadd -k creates a keytab for the dse and HTTP principals; -k specifies the keytab file name. In this example, the keytab entry is added to the dse.keytab file in the current directory.
In the cassandra.yaml configuration file, set the authenticator:
Change the replication strategy and default replication factor for the dse_auth keyspace. See Configuring dse_auth keyspace replication.
DataStax recommends configuring dse_auth keyspaces for fault tolerance (in case of failure). In a multi-node cluster, if the node storing the user data goes down, using the default replication factor of 1 for the dse_auth keyspace precludes logging into any secured node.
Set the DSE service principals, keytab location, and qop (Quality of Protection) in the dse.yaml configuration file:
- Set the service_principal that the Cassandra and Hadoop processes run under. It must use the form <dse_user>/_HOST@REALM, where <dse_user> is cassandra in package installs (the name of the user running the service) and the name of the UNIX user that starts the service in binary installs. It must be consistent everywhere: in the dse.yaml, present in the keytab, and the in the .cqlshrc file (where it is separated into the <service>/<hostname>).
- Leave _HOST as is. The name before the "/" must match the name in the service principal. DSE automatically substitutes the FQDN (Fully Qualified Domain Name) of the host where it runs. There must be credentials for this principal in the keytab file and readable by the user that Cassandra runs as, usually cassandra.
- The http_principal is used by the application container, which is tomcat and used to run Solr. The web server uses GSS-API mechanism (SPNEGO) to negotiate the GSSAPI security mechanism (Kerberos). To set up password authentication for a DSE Search/Solr node, follow instructions in Running the demo on a secure cluster.
- The qop is a comma delimited list of Quality of Protection values that clients and servers can use for each connection. The client can have multiple QOP values, while the server can have only a single QOP value. The available settings are:
- auth: authentication only [default].
- auth-int: authentication plus integrity protection for all transmitted data.
- auth-conf: authentication plus integrity protection and encryption of all transmitted data.
Enabling and disabling Kerberos security
After setting up Kerberos as described above, you can turn it on and off by changing the authenticator in the cassandra.yaml file:
- On: com.datastax.bdp.cassandra.auth.KerberosAuthenticator
- Off: any other authenticator
Using cqlsh with Kerberos security
To use cqlsh with Kerberos, you must install the python-kerberos and python-pure-sasl packages, and create a .cqlshrc file in your home or client program directory. See Installing the cqlsh security packages.