Cassandra is one of the supported plugins for the database secrets engine. This
plugin generates database credentials dynamically based on configured roles for
the Cassandra database.
See the database secrets engine docs for
more information about setting up the database secrets engine.
Vault will need a Cassandra user with the following permissions:
GRANT CREATE ON ALL ROLES to '<YOUR USER>';
GRANT ALTER ON ALL ROLES to '<YOUR USER>';
GRANT DROP ON ALL ROLES to '<YOUR USER>';
GRANT AUTHORIZE ON ALL ROLES to '<YOUR USER>';
GRANT CREATE ON ALL ROLES to '<YOUR USER>';GRANT ALTER ON ALL ROLES to '<YOUR USER>';GRANT DROP ON ALL ROLES to '<YOUR USER>';GRANT AUTHORIZE ON ALL ROLES to '<YOUR USER>';
Enable the database secrets engine if it is not already enabled:
Configure a role that maps a name in Vault to an SQL statement to execute to
create the database credential:
$ vault write database/roles/my-role \
db_name=my-cassandra-database \
creation_statements="CREATE USER '{{username}}' WITH PASSWORD '{{password}}' NOSUPERUSER; \
GRANT SELECT ON ALL KEYSPACES TO {{username}};" \
default_ttl="1h" \
max_ttl="24h"
Success! Data written to: database/roles/my-role
$ vault write database/roles/my-role \ db_name=my-cassandra-database \ creation_statements="CREATE USER '{{username}}' WITH PASSWORD '{{password}}' NOSUPERUSER; \ GRANT SELECT ON ALL KEYSPACES TO {{username}};" \ default_ttl="1h" \ max_ttl="24h"Success! Data written to: database/roles/my-role