Managing permissions and access control in Babelfish for Aurora PostgreSQL
In Babelfish for Aurora PostgreSQL, you can manage permissions and access control for databases, schemas, and objects. The following tables will outline the specific SQL commands for granting permissions in Babelfish to achieve various access control scenarios. It will cover supported use cases that can be implemented as well as workarounds for currently unsupported cases. This will allow you to configure appropriate permissions to meet your security and compliance requirements when working with Babelfish databases.
Supported use cases
The following table explains the use cases that are supported in Babelfish. For each use case, the table shows the action needed to achieve it and sample SQL commands.
Use case | Action | SQL commands | Comments |
---|---|---|---|
Allow login to do SELECTs/DMLs/DDLs in any database |
Add login to sysadmin server role |
ALTER SERVER ROLE sysadmin ADD MEMBER |
None |
Allow login to do SELECTs/DMLs/DDLs in a database |
Make login the owner of the database |
ALTER AUTHORIZATION ON DATABASE:: |
A database can have only one owner |
Allow database user to do SELECTs/DMLs on a schema |
Grant permission to database user on schema |
GRANT SELECT/EXECUTE/INSERT/UPDATE/DELETE ON SCHEMA:: |
None |
Allow database user to do SELECTs/DMLs on a schema |
Make database user owner of schema at schema creation time |
CREATE SCHEMA |
Changing schema ownership after creation isn't currently supported |
Allow database user to do SELECTs/DMLs on an object |
Grant permission to database user on object |
GRANT SELECT/EXECUTE/INSERT/UPDATE/DELETE ON SCHEMA:: |
None |
Unsupported use cases with the workarounds
The following table explains the use cases that aren't supported in Babelfish, but which can be achieved using a workaround.
Use case | Action | SQL commands | Comments |
---|---|---|---|
Allow database user to do SELECTs/DMLs/DDLs in a database including dropping database |
Make login owner of database |
ALTER AUTHORIZATION ON DATABASE |
Adding database users/roles to db_owner role isn't currently supported |
Allow database user to do only SELECTs in a database |
Grant SELECT to database user on all schemas in database |
GRANT SELECT ON SCHEMA:: |
Database role |
Allow database user to do DML on all objects in a database |
Grant INSERT, UPDATE, DELETE to database user on all schemas in database |
GRANT INSERT, UPDATE, DELETE ON SCHEMA:: |
Database role |
Unsupported use cases
The following table explains the use cases that aren't supported in Babelfish.
Use case | Comments |
---|---|
Allow database user to do only DDLs in a database |
Database role |
Allow database user to only CREATE/ALTER/DROP any database role |
Database role |
Allow database user to only GRANT/REVOKE permissions on objects in a database |
Database role |
Allow database user to only CREATE/ALTER/DROP any user |
Database role |
Allow database user to only grant and revoke database access and alias user accounts to logins |
Database role |
Allow login to only CREATE/DROP any database |
Server role |
Allow login to only ALTER any login |
Server role |