question

igor.rmarinho_185445 avatar image
igor.rmarinho_185445 asked Erick Ramirez commented

How to import grants and roles from Source Cassandra DB?

Hi,

I did a copy of one Cassandra DB to a test environment using COPY, but I didn't find a way to transfer all roles and grants from the source.

What would be the way to go?

Where are the grants and roles stored?


I was study about this subject, but I didn't find much information.

Thank you!

cassandrasecurity
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

Erick Ramirez avatar image
Erick Ramirez answered Erick Ramirez commented

@igor.rmarinho_185445 The system_auth keyspace holds the data on roles and their associated permissions.

Run the following commands to get the complete list of roles and permissions on the source cluster:

cqlsh> LIST ALL ROLES;
cqlsh> LIST ALL PERMISSIONS;

NOTE: Only superusers can list all items.

You can then cherry-pick the roles and permissions you need on the target cluster and construct the necessary CREATE ROLE and GRANT commands from the list. Cheers!

2 comments Share
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

igor.rmarinho_185445 avatar image igor.rmarinho_185445 commented ·

Hi Erick,

So if I import the data from this keyspace I can “migrate” all the roles and grants, right?

Thank you again!

0 Likes 0 ·
Erick Ramirez avatar image Erick Ramirez ♦♦ igor.rmarinho_185445 commented ·

@igor.rmarinho_185445 I've never tried to do that specifically so I can't recommend it. Cheers!

0 Likes 0 ·