Using authentication and authorization requires configuration changes in
cassandra.yaml and two additional files: one for assigning users and their permissions to keyspaces and column families, and the other for assigning
passwords to those users. These files are named access.properties and
passwd.properties, respectively, and are located in the conf directory.
To set up simple authentication and authorization
Edit cassandra.yaml, setting org.apache.cassandra.auth.SimpleAuthenticator as the authenticator value. The default value of AllowAllAuthenticator is equivalent to disabling authentication.
Edit access.properties, adding entries for users and their permissions to read and write to specified keyspaces and column families. See access.properties below for details on the correct format.
Make sure that users specified in access.properties have corresponding entries in passwd.properties. See passwd.properties below for details and examples.
After making the required configuration changes, you must specify the properties files when starting Cassandra with the flags -Dpasswd.properties and -Daccess.properties. For example:
sh bin/cassandra -f -Dpasswd.properties=conf/passwd.properties -Daccess.properties=conf/access.properties
This file contains entries in the format KEYSPACE[.COLUMNFAMILY].PERMISSION=USERS where
KEYSPACE is the keyspace name.
COLUMNFAMILY is the column family name.
PERMISSION is one of <ro> or <rw> for read-only or read-write respectively.
USERS is a comma delimited list of users from passwd.properties.
For example, to control access to Keyspace1 and give jsmith and Elvis read-only permissions while allowing dilbert full read-write access to add and remove column families, you would create the following entries:
This file contains name/value pairs in which the names match
users defined in access.properties and the values are user passwords.
Passwords are in clear text unless the
passwd.mode=MD5 system property is provided.