What you will be able to do
- Trace how a privilege granted to one role reaches users through a chain of role grants
- Apply the best practices for ACCOUNTADMIN, SECURITYADMIN, USERADMIN, SYSADMIN, PUBLIC and ORGADMIN
- Build an access-role and functional-role hierarchy under SYSADMIN
- Choose between account roles and database roles, and explain how secondary roles change session authorization
- Give Snowflake access to cloud storage through a storage integration instead of stored credentials
- Restrict where files holding PII or PHI can be loaded from or unloaded to, cut off a storage integration in one step, and keep regulated values out of metadata
Key concept
Privilege inheritance up the role hierarchy — When one role is granted to another, the receiving role gets every privilege of the granted role and of all roles below it. Users get privileges by holding a role near the top of that tree.
1.How Snowflake decides who can use an object
Snowflake denies access to every securable object unless a grant allows it. It combines three models. Under discretionary access control, each object has an owner, and that owner can grant access to it. Under role-based access control, privileges are granted to roles and roles are granted to users. User-based access control grants privileges directly to users, but those direct grants only count when a session runs USE SECONDARY ROLES ALL.
Ownership is a privilege like any other. Exactly one role holds OWNERSHIP on an object. By default that is the role that created it, and every user who holds that role shares control of the object. GRANT OWNERSHIP moves it to another role, including a database role. In a regular schema the owner can grant and revoke privileges on its own objects. A managed access schema takes that right away from object owners. Only the schema owner or a role with MANAGE GRANTS can grant privileges there, including future grants, so all grant decisions for a sensitive schema go through one place.
A privilege on an object is never enough by itself, because every object sits inside containers. To query mytable in mydb.myschema, a role needs at least USAGE on mydb, USAGE on myschema and SELECT on mytable. If either USAGE grant is missing, the query fails even though the SELECT grant exists.
Checkpoint 1 of 10· Match them up
Match each access-control mechanism to how it decides who can use an object in Snowflake.
Tap a term, then the definition that fits it.
Snowflake combines DAC (owners grant), RBAC (privileges flow through roles) and UBAC (direct grants to users, which take effect only with all secondary roles active). A managed access schema moves all grant decisions to the schema owner or a MANAGE GRANTS role.
“Access control considers privileges assigned directly to users only when USE SECONDARY ROLE is set to ALL.”Source: docs.snowflake.com
2.Role hierarchies and privilege inheritance
Granting one role to another builds a hierarchy, and privileges flow upward through it. A role inherits everything granted to the roles below it, however many levels down. Take this chain: Role 3 holds Privilege C and is granted to Role 2. Role 2 holds B and is granted to Role 1. Role 1 holds A and is granted to User 1. Role 2 inherits C, Role 1 inherits B and C, and User 1 can use all three.
Inheritance works the same whichever way the role is active. The session's primary role and every active secondary role each inherit from all roles lower in their own hierarchies. Suppose a user's only role sits at the top of a three-hop chain and the SELECT was granted at the bottom. That user can run the query with no extra grant, no USAGE on the intermediate roles and no secondary role.
Owning a role is not the same as inheriting from it. The role that holds OWNERSHIP on another role does not get that role's privileges. Privileges only pass from a role when it is granted into the hierarchy.
Checkpoint 2 of 10· Check yourself
Role R_LOW holds SELECT on a table, plus the USAGE grants on its database and schema. R_LOW is granted to R_MID, and R_MID is granted to R_TOP. A fourth role, R_ADMIN, holds OWNERSHIP on R_LOW, but R_LOW has never been granted to R_ADMIN. Which roles can query the table?
Privileges pass upward through every level of the hierarchy, so R_MID and R_TOP both inherit SELECT from R_LOW. Owning R_LOW does not give R_ADMIN its privileges, because privileges pass only when a role is granted into the hierarchy.
“A role owner (the role that has the OWNERSHIP privilege on the role) does not inherit the privileges of the owned role.”Source: docs.snowflake.com
Checkpoint 3 of 10· Exam question
A design team grants SELECT on a schema to role ANALYST_ACCESS, grants ANALYST_ACCESS to role ANALYST_FUNCTIONAL, and grants ANALYST_FUNCTIONAL to role BI_TEAM. A user whose only granted role is BI_TEAM runs a query against the schema. What determines whether the query succeeds?
Correct answer: A — BI_TEAM inherits the SELECT privilege through the chain of granted roles, so the query succeeds without further grants because privileges flow upward through every hop in the hierarchy.
- A. Snowflake privilege inheritance flows upward through the entire chain of granted roles, so any role that has been granted a role, directly or transitively, inherits every privilege held by that role. Since BI_TEAM sits above ANALYST_FUNCTIONAL and ANALYST_ACCESS in the chain, the SELECT privilege reaches it without extra grants.
- B. This is incorrect because role grants are not scoped to which role is currently active as primary; a granted role contributes its privileges to every role above it in the hierarchy regardless of session state.
- C. This is incorrect because Snowflake's role hierarchy propagates privileges through unlimited hops, not just one level, so an extra direct grant is unnecessary when the roles are already chained.
- D. This is incorrect because primary-role inheritance already covers the full upward chain of granted roles; secondary roles add privileges from unrelated role trees, not from grandparents of the primary role.
Sources1
3.System-defined roles and how to use them
Every account comes with a small set of system-defined roles. They cannot be dropped, and the privileges Snowflake gives them cannot be revoked. Each one covers a different part of administration, and in the default hierarchy USERADMIN sits under SECURITYADMIN, which sits under ACCOUNTADMIN, along with SYSADMIN.
| Role | Holds | Use it for |
|---|---|---|
| ACCOUNTADMIN | Account-level parameters, billing and credit data, and the ability to stop any running SQL statement | Initial setup and account-level administration only |
| SECURITYADMIN | The global MANAGE GRANTS privilege; USERADMIN is its child | Granting and revoking privileges across the account |
| USERADMIN | Privileges to create and manage users and roles | Creating users and custom roles |
| SYSADMIN | Privileges to create warehouses, databases and all database objects | Parent of the custom role hierarchy and day-to-day object work |
Two more system roles sit outside that table. PUBLIC is the fallback: a session that names no role, for a user with no default role, runs as PUBLIC. ORGADMIN manages organization-level operations and is not part of the account's role hierarchy.
Grant the top of every custom role hierarchy to SYSADMIN. System administrators can then manage every warehouse and database object, while managing users and roles stays with USERADMIN. A custom role left outside SYSADMIN's tree can only be seen and re-granted by roles with MANAGE GRANTS, which by default means only SECURITYADMIN. If a system role needs extra privileges, grant them to a custom role and grant that custom role to the system role. That keeps account-management privileges and object privileges in separate roles.
Snowflake recommends these precautions for ACCOUNTADMIN. They are recommendations, not limits the system enforces:
- Grant it to only a limited number of people, and require MFA for each of them.
- Grant it to at least two users. Resetting a lost ACCOUNTADMIN password can take up to two business days, and a second administrator can reset the first one's password.
- Never make it anyone's default role. Snowflake allows it, but administrators should have to switch to it on purpose.
- Don't create objects with it or run automated scripts under it. SYSADMIN and the roles below it can do all warehouse and database work.
Checkpoint 4 of 10· Check yourself
Your platform team works as SYSADMIN and now also needs SELECT on a set of audit tables. Which approach follows Snowflake's recommended practice for system-defined roles?
System roles carry account-management privileges, so extra object privileges should go to a custom role that is then granted to the system role. That keeps the two kinds of privileges in separate roles. Only the privileges Snowflake itself gives system roles are fixed. You can still add privileges, and ACCOUNTADMIN shouldn't be used for routine object work.
“Snowflake recommends granting the additional privileges to a custom role and assigning the custom role to the system-defined role.”Source: docs.snowflake.com
Checkpoint 5 of 10· Exam question
During a security review, an auditor asks why the ACCOUNTADMIN role is assigned to only two named users and neither uses it as their default role. Which practice does this configuration reflect?
Correct answer: A — ACCOUNTADMIN should be limited to a small number of trusted users and should not be a default role, so daily object-creation work happens under lower-privileged roles like SYSADMIN.
- A. Snowflake's guidance is to grant ACCOUNTADMIN sparingly, require multi-factor authentication for it, and avoid making it a default role so routine object creation and querying happen under SYSADMIN or custom roles instead.
- B. This is incorrect because Snowflake does not technically prevent ACCOUNTADMIN from being set as a default role; the restriction described is an operational best practice, not a platform limitation.
- C. This is incorrect because PCI DSS does not mandate a specific headcount for ACCOUNTADMIN grants; certification depends on broader control evidence, not a fixed number of admins.
- D. This is incorrect because SECURITYADMIN and ACCOUNTADMIN are independent system roles with no such activation dependency between them.
4.Access roles and functional roles
Two layers of roles keep grants manageable as teams grow. Access roles hold privileges on database objects, or on account objects such as warehouses. Functional roles stand for a job, such as accountant or analyst. They receive access roles as grants, and the highest functional roles are granted to SYSADMIN. Snowflake treats the two kinds identically; the difference is only in how you use them.
Take two databases: fin holds payroll data and hr holds employee data. Three access roles cover them: db_hr_r reads hr, db_fin_r reads fin, and db_fin_rw reads and writes fin. Each holds USAGE on its database and schemas plus SELECT, or SELECT, INSERT, UPDATE and DELETE, on the tables. USERADMIN creates all five roles. SECURITYADMIN grants the object privileges, wires access roles into functional roles, and grants accountant and analyst to SYSADMIN. If a new team needs read access to fin later, that is one grant of db_fin_r to the team's functional role, not a long list of object grants.
GRANT ROLE db_fin_rw TO ROLE accountant; GRANT ROLE db_hr_r TO ROLE analyst; GRANT ROLE db_fin_r TO ROLE analyst;Checkpoint 6 of 10· Fill the gap
Analysts need read-only access to both the hr and fin databases. Accountants need read-write access to fin. Which role completes the last grant so analysts get exactly the access they need?
GRANT ROLE db_fin_rw TO ROLE accountant; GRANT ROLE db_hr_r TO ROLE analyst; GRANT ROLE ? TO ROLE analyst;The analyst functional role gets read-only access to fin by receiving the db_fin_r access role. Granting db_fin_rw, or the accountant role that holds it, would give analysts write access they don't need. db_hr_r is already granted and covers only hr.
Source: docs.snowflake.comSources2
5.Database roles for database-scoped access
A database role works like an account role, but it is limited to one database. You can only grant it privileges on objects inside that database: a table in another database cannot be granted to it. Any privilege on those objects can be granted, including OWNERSHIP. OWNERSHIP of the database itself, though, can only belong to an account role.
A database role can never be activated in a session, as either the primary or a secondary role. To use its privileges, grant it to an account role, and that grant also gives the account role USAGE on the database automatically. Database roles can be granted to other database roles in the same database, but account roles cannot be granted to database roles.
Database roles let a database owner manage access inside their own database without touching account-level roles. Data sharing is the clearest case. A provider can create several database roles, each covering a subset of the objects, and share them. The consumer then grants each one to a different account role. Without database roles, the consumer grants IMPORTED PRIVILEGES, and every user who gets it sees every object in the share.
Checkpoint 7 of 10· Match them up
An administrator is setting up database role d1.r1 in database d1. For each action they try, pick the outcome Snowflake produces.
Tap a term, then the definition that fits it.
Database roles reach users only through account roles. Granting a database role to an account role also grants USAGE on the database automatically. Database roles can be nested inside the same database, but an account role can never be granted to a database role, and a database role can never be activated in a session.
“Note that database roles cannot be activated directly in a session. Grant database roles to account roles, which can be activated in a session.”Source: docs.snowflake.com
Checkpoint 8 of 10· Exam question
An architect is deciding between an account role and a database role to grant privileges scoped entirely within one database. Which statement correctly distinguishes the two role types?
Correct answer: A — A database role is confined to the database in which it is created and cannot be activated directly in a session, so it must be granted to an account role before a user can use it.
- A. Database roles are scoped to the database that owns them and hold privileges on objects inside it, but a session can only activate account-level roles, so a database role reaches a user by being granted to an account role in the chain.
- B. This is incorrect and reverses the relationship: account roles activate directly in a session, while database roles are the ones that require a grant to an account role before their privileges apply.
- C. This is incorrect because database roles cannot be activated at all, and warehouses are account-level objects, so only an account role can hold USAGE on a warehouse.
- D. This is incorrect because account roles are not confined to a single database; they can hold privileges across any database, schema, or account-level object depending on what has been granted to them.
6.Primary and secondary roles in a session
Every session has exactly one primary role. Snowflake uses the role named in the connection if the user holds it, otherwise the user's default role, otherwise PUBLIC. USE SECONDARY ROLES adds any number of the user's other granted roles. For most statements, Snowflake then checks the combined privileges of the primary and all secondary roles, so a secondary role that owns an object even authorizes DDL on it.
Creating objects is the exception. Only the primary role can authorize CREATE <object>, and the new object is owned by the primary role. An engineer with every role active can read tables in four databases, but can only create a table if the primary role, or a role it inherits, holds the CREATE privilege on the schema.
Secondary roles are most useful for cross-database joins. Without them, you would create a parent role over the roles that can read each database. With them, the user activates all their granted roles at once. CURRENT_SECONDARY_ROLES lists the secondary roles active in the current session.
Checkpoint 9 of 10· Check yourself
A user's primary role is ANALYST, which has no privileges on schema sales.s. The user runs USE SECONDARY ROLES ALL, which activates ETL_ROLE. ETL_ROLE holds USAGE on the database and schema, CREATE TABLE on the schema, and OWNERSHIP of table sales.s.orders. What happens when the user runs CREATE TABLE sales.s.new_t and then ALTER TABLE sales.s.orders?
CREATE statements are authorized only by the primary role and the roles it inherits. ANALYST has no CREATE privilege, so the CREATE fails. Every other statement draws on the combined privileges of all active roles, so ETL_ROLE's ownership of orders authorizes the ALTER.
“Authorization to execute CREATE <object> statements comes from the primary role only.”Source: docs.snowflake.com
Sources1
7.Storage integrations and where PII and PHI files can go
External stages need permission to read buckets or containers. Putting keys in stage definitions or COPY statements leaves secrets in scripts and worksheets. A storage integration removes them. It is an object that stores an IAM entity Snowflake generates, along with a list of allowed and, optionally, blocked storage locations. Cloud administrators grant that entity permissions on the storage, and stages refer to the integration instead of holding credentials.
One integration can serve many external stages, as long as each stage URL falls within its STORAGE_ALLOWED_LOCATIONS. Snowflake recommends storage integrations, and giving an S3 stage access through an AWS IAM role directly is deprecated. There is one regional limit. For cloud storage in a government region or a China region, an integration only works from a Snowflake account hosted in that same region. Otherwise the stage has to supply credentials through the CREDENTIALS parameter.
Files that hold Personal Identifiable Information (PII) or Personal Health Information (PHI) should only move between Snowflake and buckets the compliance team has approved, and the allowed-locations list enforces that. It limits every stage built on the integration to the listed buckets or containers, and an optional case-sensitive path narrows access to one set of files, such as s3://claims-bucket/phi/. STORAGE_BLOCKED_LOCATIONS names locations the integration must not reach. The list also accepts the * wildcard, which allows every bucket and path. That is convenient for a sandbox and wrong for an integration that carries patient or customer records. Holding PHI in the account at all also takes Business Critical Edition or higher.
ENABLED = FALSE is the kill switch. With it set, no new stage can reference the integration, and the stages that already do lose access to their storage locations. When an approved bucket is decommissioned or found to be exposed, one change stops every load and unload through that integration. Nobody has to hunt down each stage.
Regulated values also stay out of metadata. Snowflake asks customers not to put personal data (other than in a User object), sensitive data, export-controlled data or other regulated data into metadata. A comment or a tag value is metadata, so a patient name in a policy comment or an email address used as a tag value breaks the rule even when the column itself is masked.
Checkpoint 10 of 10· Check yourself
Three external stages unload claim files through the storage integration phi_export. An audit finds the target bucket is no longer under the hospital's control, so an administrator sets ENABLED = FALSE on phi_export. What happens to the three stages?
Disabling an integration blocks new stages from using it and also cuts off existing stages from their storage locations. One setting therefore stops all data movement through that integration.
“Existing stages that reference this integration cannot access the storage location in the stage definition.”Source: docs.snowflake.com
Sources
(6)
Every claim above is drawn from one of these pages, quoted as it was written on the date shown.
- 1.
“Discretionary Access Control (DAC): Each object has an owner, who can in turn grant access to that object.”
↩︎ How Snowflake decides who can use an object“Access control considers privileges assigned directly to users only when USE SECONDARY ROLE is set to ALL.”
↩︎ How Snowflake decides who can use an object“Each securable object is owned by a single role, which by default is the role used to create the object.”
↩︎ How Snowflake decides who can use an object“in a managed access schema, object owners lose the ability to make grant decisions.”
↩︎ How Snowflake decides who can use an object“All access requires appropriate access privileges.”
↩︎ How Snowflake decides who can use an object“Role 2 inherits Privilege C. Role 1 inherits Privileges B and C. User 1 has all three privileges.”
↩︎ Role hierarchies and privilege inheritance“Both the primary role and all secondary roles inherit privileges from any roles lower in their role hierarchies.”
↩︎ Role hierarchies and privilege inheritance“A role owner (the role that has the OWNERSHIP privilege on the role) does not inherit the privileges of the owned role.”
↩︎ Role hierarchies and privilege inheritance“System-defined roles cannot be dropped.”
↩︎ System-defined roles and how to use them“If no role was specified and a default role has not been set for the connecting user, the system role PUBLIC is used.”
↩︎ System-defined roles and how to use them“ORGADMIN is a separate system role that manages operations at the organization level.”
↩︎ System-defined roles and how to use them“it is not recommended to mix account-management privileges and entity-specific privileges in the same role.”
↩︎ System-defined roles and how to use them“Account roles cannot be granted to database roles in a role hierarchy.”
↩︎ Database roles for database-scoped access“a session can activate any number of secondary roles at the same time.”
↩︎ Primary and secondary roles in a session“Secondary roles are particularly useful for SQL operations such as cross-database joins”
↩︎ Primary and secondary roles in a session“The privileges associated with a role are inherited by any roles above that role in the hierarchy.”
↩︎ Key concept“A database role can be neither a primary nor a secondary role.”
↩︎ Exam trap 2“Authorization to execute CREATE <object> statements comes from the primary role only.”
↩︎ Exam trap 3“Snowflake recommends granting the additional privileges to a custom role and assigning the custom role to the system-defined role.”
↩︎ Checkpoint“Authorization to execute CREATE <object> statements comes from the primary role only.”
↩︎ Checkpoint - 2.
“users must be granted USAGE or any other privilege on the container database and schema.”
↩︎ How Snowflake decides who can use an object“The security administrator (SECURITYADMIN system-defined) role includes the global MANAGE GRANTS privilege to grant or revoke privileges on objects in the account.”
↩︎ System-defined roles and how to use them“Assign this role to at least two users.”
↩︎ System-defined roles and how to use them“These procedures can take up to two business days.”
↩︎ System-defined roles and how to use them“do not make ACCOUNTADMIN the default role for any users in the system”
↩︎ System-defined roles and how to use them“Snowflake recommends using a role other than ACCOUNTADMIN for automated scripts.”
↩︎ System-defined roles and how to use them“Grant permissions on database objects or account objects (such as warehouses) to access roles.”
↩︎ Access roles and functional roles“There is no technical difference between an object access role and a functional role in Snowflake.”
↩︎ Access roles and functional roles“Privileges on objects in one database (such as tables or views) cannot be granted to database roles in another database.”
↩︎ Database roles for database-scoped access“only an account role can hold the OWNERSHIP privilege on the database itself.”
↩︎ Database roles for database-scoped access“granting a database role to an account role implicitly grants the USAGE privilege on the database”
↩︎ Database roles for database-scoped access“Note that ACCOUNTADMIN is not a superuser role.”
↩︎ Exam trap 1“By default, not even the ACCOUNTADMIN role can modify or drop objects created by a custom role.”
↩︎ Prediction“Note that database roles cannot be activated directly in a session. Grant database roles to account roles, which can be activated in a session.”
↩︎ Checkpoint - 3.
“This option allows users to avoid supplying credentials when creating stages or when loading or unloading data.”
↩︎ Storage integrations and where PII and PHI files can go“A single storage integration can support multiple external stages.”
↩︎ Storage integrations and where PII and PHI files can go“Accessing cloud storage in a government region using a storage integration is limited to Snowflake accounts hosted in the same government region.”
↩︎ Storage integrations and where PII and PHI files can go“Explicitly limits external stages that use the integration to reference one or more storage locations”
↩︎ Storage integrations and where PII and PHI files can go“Alternatively supports the * wildcard, meaning “allow access to all buckets and/or paths”.”
↩︎ Storage integrations and where PII and PHI files can go“Existing stages that reference this integration cannot access the storage location in the stage definition.”
↩︎ Storage integrations and where PII and PHI files can go“FALSE prevents users from creating new stages that reference this integration.”
↩︎ Exam trap 4 - 4.
“The ability to use an AWS IAM role to access a private S3 bucket to load or unload data is now deprecated”
↩︎ Storage integrations and where PII and PHI files can go - 5.
“Support for PHI data (in accordance with HIPAA and HITRUST CSF regulations).”
↩︎ Storage integrations and where PII and PHI files can go - 6.
“no personal data (other than for a User object), sensitive data, export-controlled data, or other regulated data is entered as metadata”
↩︎ Storage integrations and where PII and PHI files can go