Implementing Role-Based Access Control in Snowflake
Instruction: Describe how you would implement RBAC in Snowflake to ensure data security and compliance.
Updated
Official answer
Map job responsibilities to narrow access roles, then compose them into business roles through an intentional hierarchy. Separate privileged administration from everyday analysis, and review inherited privileges rather than relying on role names.
For example, assume the warehouse, database, schema, view and user below already exist. An authorized administrator can create a role that reads one approved view:
CREATE ROLE reporting_reader;
GRANT USAGE ON WAREHOUSE bi_wh TO ROLE reporting_reader;
GRANT USAGE ON DATABASE analytics TO ROLE reporting_reader;
GRANT USAGE ON SCHEMA analytics.curated TO ROLE reporting_reader;
GRANT SELECT ON VIEW analytics.curated.daily_sales
TO ROLE reporting_reader;
GRANT ROLE reporting_reader TO USER analyst_example;
The administrator must possess the required authority to create/grant the role and each object privilege. The user must activate an appropriate granted role when querying. Warehouse USAGE permits use; it does not grant control over every warehouse setting or access to every table.
Decide how future objects receive grants and review database/schema-level future-grant precedence. Use managed access schemas when centralized grant control is appropriate. Treat database roles and account roles according to their supported scope.
Add row access or masking policies when object-level grants are too broad, and test with real role combinations and secondary roles. Check denied reads/writes, sensitive columns, exports and service-account sessions. Revoke obsolete access promptly and verify the effective result.
Monitor grants and access with documented telemetry coverage/latency, and periodically recertify ownership and need. RBAC supports a control framework; it does not by itself establish regulatory compliance.
Access control, configuring access, GRANT privileges, GRANT ROLE