Study FAQ
How do I design a least-privilege Snowflake role for an analytics team?
Also asked as 2
- How can analysts query approved Snowflake views without owning the data?
- How should Snowflake database roles and account roles work together for read-only access?
Answer
Grant approved data privileges to a database role and grant that role to a functional account role assigned to the analysts. Give the account role USAGE on the query warehouse. Keep ownership with a separate role so analysts can query the approved data with a limited set of privileges.
- In the curated database, create a database role that has
USAGEon the required schema andSELECTon the approved views. A database role is scoped to one database and hasUSAGEon its containing database. - Grant that database role to an account role such as
ANALYST_READ. The account role carries the warehouse grant and is the one that users activate in a session. - Assign
ANALYST_READto the intended users. Test a fully qualified approved view with that role and the intended warehouse. Confirm the role lacks access to objects outside the intended grant path.
Snowflake privileges are action-specific. A grant to use a warehouse covers query compute. Querying an object additionally requires the database, schema and object privilege path. A business role can inherit other roles without acquiring the ownership privileges of the administrator who manages the data.
Access control overview · Access control privileges · Configure access control
Full explanation
Managing Snowflake Accounts, Organizations, Roles, and Access
Study guide · COF-C03
Read the full explanation