Configuring OpsCenter role-based security
OpsCenter allows enabling user authentication, defining custom roles, managing users, and designating permissions.
By default, access control is disabled. Any user that knows the OpsCenter URL can view all objects and perform all tasks.
OpsCenter access roles overview
DataStax Enterprise (DSE) customers have the ability to define custom, fine-grained access roles for their users. OpsCenter can be configured to require users to log in using OpsCenter authentication. Permissions to perform certain operations can be granted to each role, and a role can be assigned to users. A user can only be assigned one role, and each role applies to all clusters.
Authenticating with LDAP in OpsCenter requires defining roles for LDAP users. If using LDAP authentication, users can have multiple roles. Upon logging in, all permissions for each role a user is assigned to are merged. |
Admin role privileges
The admin role is built-in to OpsCenter and cannot be edited or removed. By default, the admin role is the only role created automatically when authentication is enabled. Only users with the admin role can manage users and roles, add new clusters, or manually update definition files.
Changing the default admin password is strongly recommended the first time you log in. |
Custom user role privileges
Only those assigned an admin role can manage roles. Each role represents permissions for all clusters managed by OpsCenter. Any functionality in OpsCenter that a user does not have permission for appears as gray and unavailable to that logged in user.
If using the OpsCenter API, users without sufficient permissions will receive an HTTP 401, Unauthorized
response from the API.
Adding a cluster does not automatically add permissions for any existing roles. After adding a cluster, apply the permissions to the cluster for each role as appropriate for your organization. |
In OpsCenter 6.5.3 and later, you must update custom scripts and applications that use the OpsCenter API if you want to use multiple user roles with LDAP authentication.
If a custom script or application that uses the OpsCenter API did not account for multiple user roles, and a user has multiple roles, the script or application will fail because the |
Role permissions
When defining custom roles, each role can have specific permissions enabled for that role. Each user can only be assigned a single role, which contains permissions for all clusters managed by OpsCenter. If using LDAP authentication, users can have multiple roles. Use the Cluster menu to view permissions for each cluster for a selected role. To hide a cluster for users within a selected role, uncheck all permissions.
Permission | Description |
---|---|
Core functionality |
|
View Cluster |
Allows users to view a cluster in the Clusters area of the OpsCenter Monitoring UI. |
Allows users to install or upgrade agents automatically or manually. |
|
Edit Connection Settings |
Allows users to edit the cluster connection settings for a DSE cluster monitored in OpsCenter. |
Manage Alerts |
Allows users to add alerts for monitoring conditions in DSE clusters. |
Cluster Configuration |
Allows users to configure the Performance Service. |
Services |
|
Allows users to perform backups and restores. |
|
Allows users to configure and schedule Best Practice Service rules for managing DSE clusters. |
|
Allows users to start, stop, and configure the Repair Service for running repairs on DSE clusters. |
|
Allows authorized users to access status and configure settings for the NodeSync Service. |
|
Performance Service Configuration |
Allows users to configure the Performance Service. |
Performance Service CQL Tracing |
Allows users to trace slow CQL queries when troubleshooting query issues. |
Node Operations |
|
Allows users to start and stop DSE nodes. Start and stop nodes from the Other Actions menu options available in the List view, or from the Actions menu in the Node Details view. |
|
Allows users to run a cleanup on one or more keyspaces. |
|
Allows users to run compaction on a keyspaces and their tables. Major compactions are not recommended unless there is a compelling reason to do so. |
|
Allows users to drain a node. The Drain option is available from the Actions menu in the Node Details dialog view, and also available when restarting DSE on a node. |
|
Allows users to flush a keyspace and its tables. Flushing a keyspace might affect system performance when there are many live, large memtables. |
|
Allows users to perform garbage collection on nodes. Running GC causes a spike in latency. |
|
Allows users to manually run an ad hoc repair operation on selected nodes in the List view. |
|
Data |
|
Allows users to view the CQL statements for the schema in the Data workspace of OpsCenter Monitoring. Users must have the View Schema permission to view Tables, View UDT, View UDF, and View UDA. Those users without view schema permission are shown a message explaining they must have the role permission for viewing anything in the Data workspace, and to contact their OpsCenter administrator to obtain access privileges. |
|
Modify Schema |
Allows users to edit keyspace settings, delete keyspaces, or delete tables in the Data workspace of OpsCenter. |
Allows users to truncate data from a table. The Truncate link appears as gray and unavailable for users who do not have this permission granted for their role. |
|
Cluster Topology |
|
Add Nodes |
Deprecated. Now users add nodes to an existing DSE cluster using Lifecycle Manager. Anyone assigned an admin role can use any feature of LCM. |
Rebalance Cluster (non-vnode) |
Allows users to rebalance a non-vnode cluster. Not applicable to vnodes. |
Allows users to move a node, enter a new token, and assign the new token to the node. During a move node operation, the node is unavailable and cluster performance might be affected. Not applicable to vnodes. Access the Move option from the Other Actions menu available in the List view, or from the Actions menu in the Node Details dialog view. |
|
Decommission |
Allows users to decommission a node from the Actions menu in the Node Details dialog view. |
Remove Tokens |
Allows removing tokens using the APIs. |
Enabling authentication in OpsCenter
About this task
OpsCenter offers granular, role-based permission control for user and role management.
By default, authentication is disabled.
The first time authentication is enabled, a default admin account is created with username admin
and password admin
.
If you enable OpsCenter authentication, DataStax strongly recommends enabling SSL communication between OpsCenter and the agents.
Changing the default admin password is strongly recommended the first time you log in. |
OpsCenter allows you to build your own authentication connectors to third-party authentication systems. Use the resources in the auth directory of your OpsCenter server installation:
|
The location of the auth directory depends on the type of installation:
-
Package installations: /usr/share/opscenter/auth
-
Tarball installations: installation_location/opscenter/auth
Procedure
-
Locate the opscenterd.conf file. The location of this file depends on the type of installation:
-
Package installations: /etc/opscenter/opscenterd.conf
-
Tarball installations: install_location/conf/opscenterd.conf
-
-
Edit the opscenterd.conf file and enable authentication.
Set
enabled=True
in the[authentication]
section.[authentication] enabled=True
-
Open the OpsCenter user interface in a browser.
http://localhost:8888
-
Enter the default username of
admin
and the passwordadmin
.If pluggable authentication is enabled, the default username and password will vary based on the information used when pluggable authentication was enabled.
Setting up pluggable authentication for OpsCenter
Procedure
-
Locate the opscenterd.conf file. The location of this file depends on the type of installation:
-
Package installations: /etc/opscenter/opscenterd.conf
-
Tarball installations: install_location/conf/opscenterd.conf
-
-
Edit the opscenterd.conf file and enable authentication.
You can also bring your own pluggable authentication class and define it in the
authentication_method
.File authentication strategy
Create the auth_file with
user:password:role
:user:$2a$10$LvCn7Qm8SjkIUfRN3ZBWSuhH6KqmQPomnjcSkh2imkPVvwrzmYhmO:superuser
The
password
must use a bcrypt 2a variation hash.You must first create the superuser role before creating the auth_file.
The authentication file should contain one user per line in this format.
passwd_db = ./passwd.db enabled = True authentication_method = com.datastax.opscenter.auth.http.impl.FileAuthenticationStrategyProvider [authentication_provider] # auth file configuration auth_file = /apps/test/auth.txt
LDAP authentication strategy
passwd_db = ./passwd.db enabled = True authentication_method = com.datastax.opscenter.auth.http.impl.LDAPAuthenticationStrategyProvider [authentication_provider] # ldap configuration server_host = dev-ldap.datastax.lan # use 389 if you set ldap_security = None server_port = 636 search_dn = cn=admin,dc=devldap,dc=datastax,dc=lan search_password = dseng user_search_base = ou=users,dc=devldap,dc=datastax,dc=lan user_search_filter = (uid={0}) group_search_base = ou=groups,dc=devldap,dc=datastax,dc=lan group_search_filter = (member=cn={0},ou=users,dc=devldap,dc=datastax,dc=lan) group_name_attribute = cn admin_group_name = superusers, superusers2 truststore = ./tests/resources/truststore.ts truststore_pass = secret ldap_security = SSL_TLS truststore_type = jks
Multiple authentication strategy
passwd_db = ./passwd.db enabled = True authentication_method = com.datastax.opscenter.auth.http.impl.MultipleAuthenticationStrategyProvider [authentication_provider] # List of authentication strategies in the order each strategy will be used strategy_chain = com.datastax.opscenter.auth.http.impl.FileAuthenticationStrategyProvider, com.datastax.opscenter.auth.http.impl.LDAPAuthenticationStrategyProvider # auth file configuration auth_file = /apps/test/auth.txt # ldap configuration, formerly in [ldap_section] server_host = dev-ldap.datastax.lan # use 389 if you set ldap_security = None server_port = 636 search_dn = cn=admin,dc=devldap,dc=datastax,dc=lan search_password = dseng user_search_base = ou=users,dc=devldap,dc=datastax,dc=lan user_search_filter = (uid={0}) group_search_base = ou=groups,dc=devldap,dc=datastax,dc=lan group_search_filter = (member=cn={0},ou=users,dc=devldap,dc=datastax,dc=lan) group_name_attribute = cn admin_group_name = superusers, superusers2 truststore = ./tests/resources/truststore.ts truststore_pass = secret ldap_security = SSL_TLS truststore_type = jks
-
Open the OpsCenter user interface in a browser.
http://localhost:8888
Granting permission when role-based access control is enabled
About this task
When Cassandra role-based access control (RBAC) is enabled, a default account is created with username cassandra
and password cassandra
.
Create additional roles with permissions for the OpsCenter cluster and the monitored DataStax Enterprise (DSE) cluster.
The Cassandra role used for the agent should have ALL
permissions for the OpsCenter keyspace and DESCRIBE
and SELECT
for the monitored DSE cluster.
Procedure
-
Create
opscenter
role withSELECT
permissions for the monitored DSE cluster:CREATE ROLE opscenter WITH PASSWORD = 'opscenter' AND SUPERUSER = false AND LOGIN = true; GRANT SELECT ON TABLE system.local TO opscenter; GRANT SELECT ON TABLE system.peers TO opscenter;
-
Create
agent
role withSELECT
permissions for the monitored DSE cluster:CREATE ROLE agent WITH PASSWORD = agent AND SUPERUSER = false AND LOGIN = true; GRANT SELECT ON TABLE system.local TO agent; GRANT SELECT ON TABLE system.peers TO agent; GRANT SELECT ON TABLE dse_perf.node_slow_log TO agent;
-
Create
opscenter
role withALL
permissions.-
For an OpsCenter keyspace in the monitored DSE cluster:
CREATE ROLE opscenter WITH PASSWORD = 'opscenter' AND SUPERUSER = false AND LOGIN = true; GRANT ALL ON KEYSPACE opscenter_keyspace TO opscenter;
-
For a separate OpsCenter storage cluster:
CREATE ROLE agent WITH PASSWORD = agent AND SUPERUSER = false AND LOGIN = true; GRANT ALL ON KEYSPACE opscenter_keyspace TO agent;
-
-
If you plan to enable or disable NodeSync for specific tables using OpsCenter NodeSync Service, grant the
opscenter
role withALTER
permissions for those tables:GRANT ALTER ON TABLE keyspace_name.table_name TO opscenter;
-
To allow OpsCenter to restore DataStax Graphs for DSE 6.7 and earlier, grant the
opscenter
role withMODIFY
,SELECT
, andALTER
permissions fordse_system.shared_data
:GRANT MODIFY, SELECT, ALTER ON TABLE dse_system.shared_data TO opscenter;
-
To allow OpsCenter to restore DataStax Graphs for DSE 6.8, grant the
opscenter
role withUPDATE
,SELECT
, andALTER
permissions fordse_system.shared_data
:GRANT UPDATE, SELECT, ALTER ON TABLE dse_system.shared_data TO opscenter;
-
For DSE 6.7 and earlier Search clusters, grant the
agent
role withSELECT
andMODIFY
permissions forsolr_admin.solr_resources
:GRANT SELECT, MODIFY ON TABLE solr_admin.solr_resources TO agent;
-
For DSE 6.8 Search clusters, grant the
agent
role withSELECT
andUPDATE
permissions forsolr_admin.solr_resources
:GRANT SELECT, UPDATE ON TABLE solr_admin.solr_resources TO agent;
Logging in and out using OpsCenter authentication
About this task
If OpsCenter authentication is enabled, follow these instructions to log in and out of OpsCenter and change the default admin password.
After changing the hash algorithm for the |
Procedure
-
Go to the main OpsCenter URL in a web browser.
http://localhost:8888
-
A login dialog appears. Enter your username and password. The default admin username is
admin
and the default admin password isadmin
. -
To change the default admin password:
-
Click the admin username on the upper right and select Change Password.
-
Enter the current password, enter the new password, confirm the new password, and click Save.
-
The Password Updated dialog indicates the password has been updated. Click Close.
-
-
Log out by clicking your username in the top navigation bar and clicking Log Out.
Managing users and roles
About this task
Follow these steps to manage users and roles permissions in OpsCenter.
When LDAP authentication is enabled, adding and editing users is disabled. Only role editing is available when LDAP is enabled. |
-
Log in to OpsCenter as an admin.
-
Click Settings > Users & Roles. The Users and Roles dialog appears.
Add a user
-
Click Add User. The Add User dialog appears.
-
Enter the username and password, and select a role for the user.
-
Click Save. Edit a user
-
Click the Edit icon for the user you want to edit.
-
To change the user’s password, enter and confirm the new password, then click Save.
-
To change the user’s role, select the new role from the Roles list and click Save. Delete a user
-
Click the Delete icon for the user you want to delete and click Delete to confirm. Edit a role
-
Click Manage Roles. The Manage Roles dialog appears.
-
To edit an existing role, click the Edit icon. The Edit Role dialog appears.
-
Select the cluster to apply role permissions to. The first cluster that a role has permissions for is automatically selected in the Cluster list of the Edit Role dialog.
-
Select the options the user role has permissions for. To hide a cluster for users within a selected role, uncheck all permissions.
Click Select All or Unselect All to quickly enable all or no permissions.
-
Click Save.
All changes to roles and permissions are logged for security auditing purposes.
-
To apply role permissions for each cluster, repeat 2.a through 2.e. Add a role and assign it to users
-
Click Add Role. The Add Role dialog appears.
-
Enter the name of the role in Role Name, select the permissions from the appropriate feature check boxes, and click Save.
By default, new roles do not have any permissions.
Click Select All or Unselect All to quickly enable all or no permissions.
-
Repeat as appropriate for each cluster.
-
In the Users dialog, click the Edit icon for the user you want to add to the role.
-
In the Role list, select the role, and click Save.
-
Edit the role to apply its permissions to each cluster as appropriate. Delete a role
-
Select the role you want to delete in the Manage Roles dialog.
-
Click the Delete icon.
-
Changing the location of the password database
About this task
Change the default location of the password database passwd.db used for OpsCenter authentication if you prefer another location. The password database is created when authentication is enabled.
Change the location of the password database in the opscenterd.conf
file.
The default location of passwd.db depends on the type of installation:
-
Package installations: /etc/opscenter/passwd.db
-
Tarball installations: install_location/passwd.db
Procedure
-
Locate the
opscenterd.conf
file. The location of this file depends on the type of installation:-
Package installations: /etc/opscenter/opscenterd.conf
-
Tarball installations: install_location/conf/opscenterd.conf
-
-
Edit the
opscenterd.conf
file and change the location of the password database.Set passwd_db to the new location in the
[authentication]
section.[authentication] passwd_db = path to new password database
-
If you have already enabled authentication, copy the existing passwd.db file to the new location. If you do not copy the password database to the new location, OpsCenter creates a new password database in the specified location when it is started. Existing users and roles are lost.
-
Your organization is responsible for backing up the passwd_db database. You must also configure failover to mirror the passwd_db if your organization has failover enabled.
-
Configuring the user password hash algorithm
About this task
Configure the algorithm to hash user passwords OpsCenter authentication.
The default algorithm is bcrypt+blake2b-512
.
Available password_hash_type
options include:
-
bcrypt+blake2b-512
-
pbkdf2+blake2b-512
-
pbkdf2+sha512
-
pbkdf2+sha3-256
-
bcrypt+sha512
Procedure
-
Locate the opscenterd.conf file. The location of this file depends on the type of installation:
-
Package installations: /etc/opscenter/opscenterd.conf
-
Tarball installations: install_location/conf/opscenterd.conf
-
-
Open the opscenterd.conf file for editing.
Set
password_hash_type
to the desired hashing option in the[authentication]
section.[authentication] password_hash_type = pbkdf2+sha3-256
-
Instruct users to log in again so that OpsCenter can rehash and restore the user passwords. Because password hash algorithms are one-way functions that cannot be reversed, logging in again is necessary to update previously hashed user passwords.