DataStax Enterprise 3.1 Documentation

Authenticating a DataStax Enterprise cluster with Kerberos

This documentation corresponds to an earlier product version. Make sure this document corresponds to your version.

Latest DSE documentation | Earlier DSE documentation

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.

Kerberos Recommendations

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).

AES-256 support

Because JCE-based products are restricted for export to certain countries by the U.S. Export Administration Regulations, DataStax Enterprise does not ship with the Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy. DataStax recommends installing the JCE Unlimited Strength Jurisdiction Policy Files:

  1. Go to the Oracle Java SE download page.
    • For Java 6, click Previous Releases > Java Platform Technologies > Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files 6.
    • For Java 7, under Additional Resources, download the Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files.
  2. Unzip the downloaded file.
  3. Copy local_policy.jar and US_export_policy.jar to the $JAVA_HOME/jre/lib/security directory overwriting the existing JARS.

If you choose not to use AES-256, you must remove the AES-256 settings as an allowed cypher for each principal and regenerate the keys for the krbtgt principal. Remove AES-256 settings in one of the following ways:

  • If you have not created the principles, 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.

  • If you have already created the principles, 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.

    Alternately, you can 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. Then change the keys for the krbtgt principal.


    If the KDC is used by other applications, changing the krbtgt principal's keys invalidates any existing tickets. To prevent this, use the -keepold option when executing the change_password command. For example: 'cpw -randkey krbtgt/krbtgt/REALM@REALM'

Securing DataStax Enterprise nodes

Do not upgrade DataStax Enterprise and set up Kerberos at the same time; see Security.

To set up Kerberos on your DSE nodes, do the following on every node:

  1. Install the Kerberos client software.

  2. 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.
  3. In the cassandra.yaml configuration file, set the authenticator:

    authenticator: com.datastax.bdp.cassandra.auth.KerberosAuthenticator
  4. Change the replication strategy and default replication factor for the system_auth keyspace. See Configuring system_auth keyspace replication.

    DataStax recommends configuring system_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 system_auth keyspace precludes logging into any secured node.

  5. Set the DSE service principals, keytab location, and qop (Quality of Protection) in the dse.yaml configuration file:

       keytab: resources/dse/conf/dse.keytab
       service_principal: <dse_user>/_HOST@<REALM>
       http_principal: HTTP/_HOST@<REALM>
       qop: auth
    • 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 in the cqlshrc file (where it is separated into the <service>/<hostname>). In DataStax Enterprise 3.1.3 and later, the cqlshrc file is in your ~/.cassandra directory. In earlier releases, the file named .cqlshrc is in your home directory.
    • Set <REALM> to the name of your Kerberos realm.
    • Leave _HOST as is. 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, see Running the demo on a secure cluster in the Getting started guide.
    • The keytab file must contain the credentials for both of the fully resolved principal names, which replace _HOST with the FQDN of the host in the service_principal and http_principal settings. The UNIX user running DSE must also have read permissions on the keytab.
    • 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 ~/.cassandra or directory. See Installing the cqlsh security packages.