Use Security Center in StarRocks Manager to manage users and roles, and grant fine-grained access control to your EMR Serverless StarRocks resources.
Prerequisites
Before you begin, ensure that you have:
A StarRocks instance. See Create an instance
Key concepts
EMR Serverless StarRocks uses a role-based access control model: permissions are granted to roles, and roles are assigned to users. This lets you manage access at scale by updating a role's permissions once rather than updating each user individually.
Built-in roles
EMR Serverless StarRocks provides three built-in roles.
| Role | Description | Notes |
|---|---|---|
db_admin | Manages database objects, such as creating and modifying databases. | Grant this role to users responsible for schema management. |
public | A global role automatically assigned to all users. Provides basic access to public resources. | All users inherit this role. |
user_admin | Manages user accounts, including creating and modifying users, and granting permissions. | A user with user_admin, or both user_admin and db_admin, is a super administrator. |
Built-in roles cannot be deleted or have their permissions modified.
User types
| User type | Definition |
|---|---|
| Super administrator | A user assigned the user_admin role, or both user_admin and db_admin. The default super administrator account is named admin. |
| Regular user | A user with only the default public role, or with db_admin attached. |
Manage users
Add a user
Go to the StarRocks Manager page.
Log on to the E-MapReduce console.
In the left navigation pane, choose EMR Serverless > StarRocks.
In the top menu bar, select the region.
Click StarRocks Manager, or click Connect in the Actions column for the target instance. For details, see Connect to a StarRocks instance using EMR StarRocks Manager.
In the left navigation pane, choose Security Center > User Management.
On the User Management page, click Create User.
Configure the following parameters and click OK.
Grant permissions to a user
After creating a user, grant permissions to specific resources.
On the User Management page, click Add Permission in the Actions column for the target user.
On the Permissions tab, click Add Permission.
In the Add Permission panel, configure the following parameters and click OK.
Edit or delete a user
Edit: In the Actions column for the target user, click Modify user to update the description, Change Password to reset the password, or Add Permission to update roles and permissions.
Delete:
The built-in
adminuser cannot be deleted.For custom users, click Delete in the Actions column.
Manage roles
If the built-in roles do not meet your needs, create custom roles with more granular permissions.
Create a role
On the StarRocks Manager page, choose Security Center > Roles.
On the Roles page, click Create Role.
In the Create Role dialog box, enter a description and click OK.
Grant permissions to a role
On the Roles page, click Add Permission in the Actions column for the target role.
On the Permissions tab, click Add Permission.
In the Add Permission panel, select the resource and permissions, and click OK. For available resources and permissions, see the table in Grant permissions to a user.
Edit or delete a role
Edit:
Built-in roles cannot be edited or have their permissions modified.
Custom roles: click Modify or Add Permission in the Actions column to update the description, assigned users, and permissions.
Delete:
Built-in roles cannot be deleted.
For custom roles, click Delete in the Actions column.
Common scenarios
Create a user and grant permissions
On the EMR StarRocks Manager page, choose Security Center > User Management.
Create a user.
On the User Management page, click Create User.
In the dialog box that appears, configure the parameters and click OK. For more information about the parameters, see the table in the Add a user section.
Grant permissions to the new user.
On the User Management page, click Add Permission in the Actions column for the new user.
On the Permissions tab, click Add Permission.
In the Add Permission panel, select a resource and its corresponding permissions, and then click OK.
Create a new role and assign it to an existing user
If the built-in roles do not meet your needs, you can create a custom role. Custom roles provide more fine-grained access control. This helps you meet security requirements or handle complex scenarios, such as dynamic permission adjustments.
On the EMR StarRocks Manager page, choose Security Center > Roles.
Create a role.
On the Roles page, click Create Role.
In the Create Role dialog box, enter a description and click OK.
Add permissions to the new role.
On the Roles page, click Add Permission in the Actions column for the new role.
On the Permissions tab, click Add Permission.
In the Add Permission panel, select a resource and its corresponding permissions, and then click OK.
Assign the role to an existing user.
Click the User List tab.
On the Users tab, click Create User.
In the Create User panel, select the target user and click OK.
What's next
To view SQL query information, analyze execution plans, and troubleshoot SQL issues for an instance, see Diagnosis and analysis.