RBAC in Amazon Redshift lets you create roles, grant them object or role privileges, and assign those roles to users for granular, auditable access control.
RBAC centralizes permissions in reusable roles. You grant privileges once to a role and attach that role to as many users or groups as needed. This avoids repetitive GRANT statements, keeps audits simple, and enables least-privilege by mixing read-only, writer, or admin roles instead of giving blanket rights.
Amazon Redshift supports CREATE ROLE
, DROP ROLE
, GRANT <role|privilege> TO <role|user>
, and REVOKE
. You can also set default object privileges with ALTER DEFAULT PRIVILEGES
. The next section lists every option.
First, create the role, then grant object privileges, and finally attach the role to analysts. Example below shows the full workflow.
Redshift supports role chaining. Use GRANT role_a, role_b TO analyst1
. The user inherits the union of all granted privileges.
Query SVV_ROLE_GRANTS
and PG_USER
views. These catalog tables list which users own which roles and which roles own other roles.
Create small, task-oriented roles (reader, writer, loader). Grant roles instead of direct privileges. Use default privileges so new tables inherit correct permissions. Review SVV_ROLE_GRANTS
monthly.
Common pitfalls include granting privileges directly to users and forgetting default privileges. More details appear in the Mistakes section below.
If you grant SELECT only on existing tables, newly created tables remain inaccessible. Fix by running ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO ecommerce_read
.
Using ALL PRIVILEGES
on the database level gives users DDL power they may not need. Grant table-level rights instead and reserve ALL
for trusted ops roles.
Yes. Use GRANT role_child TO role_parent
to build role hierarchies. A user assigned role_parent
inherits child privileges.
No. Role lookups happen at login and are cached for the session. They do not add noticeable query overhead.
First revoke the role from users and other roles, then revoke object privileges, and finally call DROP ROLE role_name
.
Yes. Script a query against the catalog to capture current object privileges, create matching roles, grant privileges to those roles, then assign roles to users and revoke direct GRANTs.
Roles live within a Redshift database but affect all schemas unless you scope privileges to a specific schema.
Not natively. Implement row-level filters using views and grant SELECT on the view to the role instead of the base table.