Clean up pre-migraton database roles
- Dominant language
- JavaScript
- Stars
- 23
- Forks
- 62
- Avg merge
- 24m
- Merged PRs (30d)
- 1
Description
There may exist in prod databases roles named readonly that have privileges different from the standardized definition established in https://github.com/bcgov/bcregistry-sre/tree/main/gcp/terraform/modules/db_roles/scripts
e.g. Namex Prod DB has readonly roles that grants more access than simple 'select'. When the db is loaded in the datawarehouse these roles are propagated.
Can run this query to check all the grants:
SELECT grantor, grantee, table_schema, table_name, privilege_type
FROM information_schema.table_privileges
WHERE grantee = 'readonly';
-- For schema privileges
SELECT nspname, grantee, privilege_type
FROM pg_namespace
JOIN aclexplode(nspacl) ON true
WHERE grantee = (SELECT oid FROM pg_roles WHERE rolname = 'readonly');

There may be other dbs where similar issue exists.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.