What you will be able to do
- Remediate an account where ACCOUNTADMIN is held by one person or used as a default role
- Add administrators through SYSADMIN, SECURITYADMIN or custom roles instead of handing out ACCOUNTADMIN
- Design access roles and functional roles, and choose database roles when privileges should stay inside one database
- Predict which actions primary and secondary roles authorize in a session
- Split account-level and warehouse privileges between the roles that use resources and the roles that run them
- Grant access to machine learning models at the right depth, and pick the role that will own them
Key concept
Least privilege through layered roles — Privileges go to narrow roles: access roles or database roles. Those roles are granted to functional roles that match business jobs, and the hierarchy is anchored under SYSADMIN. ACCOUNTADMIN stays reserved for account-level work by a few protected users.
1.Securing ACCOUNTADMIN and adding administrators
ACCOUNTADMIN is the most powerful role in a Snowflake account. It alone configures account-level parameters, it can view and manage billing and credit data, and it can stop any running SQL statement. It is not a superuser, though. ACCOUNTADMIN can only reach objects that it, or a role below it in the hierarchy, holds privileges on. That is why a role-hierarchy design matters even at the top.
A secure ACCOUNTADMIN setup has four parts. Grant the role to a small number of named people, and to at least two of them. Require MFA for every one of them. Give each one an email address, which MFA requires. Never make ACCOUNTADMIN anyone's default role. The two-person rule exists for recovery: Snowflake's procedure for resetting a lost ACCOUNTADMIN password can take up to two business days, while two administrators can reset each other's passwords. Email addresses of current employees also tell Snowflake Support who to contact in an emergency.
GRANT ROLE ACCOUNTADMIN, SYSADMIN TO USER user2; ALTER USER user2 SET EMAIL='user2@domain.com', DEFAULT_ROLE=SYSADMIN;A lower default role does not stop an administrator from switching to ACCOUNTADMIN. It does force them to switch on purpose every time they log in. This prevents a common accident: objects created while ACCOUNTADMIN happens to be active are owned by ACCOUNTADMIN, and nobody else can use them until someone grants privileges on each one explicitly. ACCOUNTADMIN is meant for setup and account-level tasks, not for creating databases and warehouses. Automated scripts should also run under a role other than ACCOUNTADMIN. If the role hierarchy sits under SYSADMIN, every warehouse and database operation can run as SYSADMIN or a lower role. Creating users and roles is the only exception, and SECURITYADMIN covers it.
So most extra administrators should not get ACCOUNTADMIN at all. When the account is provisioned, its first user holds ACCOUNTADMIN and should create one or more USERADMIN users. Those users, or any role with the global CREATE USER privilege, then create everyone else. People who build objects get SYSADMIN or a custom role under it. People who manage grants get SECURITYADMIN, which holds the global MANAGE GRANTS privilege. Shared logins and single-holder setups do not meet any of the precautions above.
Checkpoint 1 of 8· Fill the gap
You are making user2 a second account administrator. You also want to stop them from accidentally creating objects that ACCOUNTADMIN would own. Which value completes the statement?
GRANT ROLE ACCOUNTADMIN, SYSADMIN TO USER user2; ALTER USER user2 SET EMAIL='user2@domain.com', DEFAULT_ROLE= ? ;Additional account administrators get ACCOUNTADMIN, but it should never be their default role. A lower role they also hold, such as SYSADMIN, should be the default. They then have to switch to ACCOUNTADMIN on purpose, so objects they create are not owned by ACCOUNTADMIN by accident. USERADMIN is wrong because it was never granted to user2.
Source: docs.snowflake.comCheckpoint 2 of 8· Exam question
A security audit of a production Snowflake account finds one person holding ACCOUNTADMIN, who also uses it as the default role for daily development work. Which remediation best secures the ACCOUNTADMIN role?
Correct answer: A — Grant ACCOUNTADMIN to at least two named users, require MFA and a verified email for each, and set a lower role such as SYSADMIN as their default.
- A. Correct. Having at least two MFA-protected, email-verified users avoids a single point of failure, and a non-ACCOUNTADMIN default role keeps the powerful role to deliberate, short sessions.
- B. Incorrect. A single holder is a recovery risk, and ACCOUNTADMIN should never run automated pipelines or be bound to service users; scheduled work belongs on lower-privilege custom roles.
- C. Incorrect. Objects should not be owned by ACCOUNTADMIN; create them with SYSADMIN or custom roles so ownership follows the role hierarchy. A network policy does not fix this misuse.
- D. Incorrect. Shared logins destroy accountability, and making ACCOUNTADMIN the default role exposes the highest privilege on every session instead of limiting it to when it is needed.
2.Access roles, functional roles and business alignment
Access should follow business jobs, not individual people. A custom role is created by USERADMIN or any role with CREATE ROLE. In this pattern, custom roles play one of two parts. Access roles hold privileges on database objects or account objects, such as SELECT on the tables of one database or USAGE on a warehouse. Functional roles stand for jobs like accountant or analyst, and they get their privileges by being granted the access roles that job needs.
Take two databases: fin holds payroll data and hr holds employee data. Accountants need read-write access to fin and read-only access to hr. Analysts need read-only access to both. You build three or four access roles once (fin read-write, fin read-only, hr read-only) and grant different combinations of them to the ACCOUNTANT and ANALYST functional roles. When a new hire joins, they get one functional role. When a new table appears, it goes into one access role.
The two kinds of role are identical inside Snowflake. The split is a naming and usage convention, not a feature. Finish the hierarchy by granting the top functional roles to SYSADMIN. Without that step, not even ACCOUNTADMIN can modify or drop objects that a custom role created, because a new custom role starts out isolated.
Checkpoint 3 of 8· Check yourself
Accountants need read-write access to the fin database and read-only access to hr. Analysts need read-only access to both. Which design follows Snowflake's recommended approach for aligning access with business functions?
Privileges on objects go to access roles. Access roles are combined into functional roles that match business jobs. A new hire then needs one functional role, and a new table needs one access role. Granting to users ties access to individuals. Using SYSADMIN or one combined role breaks least privilege.
“Grant permissions on database objects or account objects (such as warehouses) to access roles.”Source: docs.snowflake.com
Checkpoint 4 of 8· Check yourself
A new custom role, DE_ENGINEER, created several tables. An administrator using ACCOUNTADMIN tries to drop one of them, and the statement fails. What is the recommended fix?
A new custom role starts out isolated. ACCOUNTADMIN is not a superuser, so it cannot reach objects owned by a role outside its hierarchy. Granting the top functional role to SYSADMIN closes that gap. Making ACCOUNTADMIN a default role goes against the earlier recommendation, and USAGE on the containers does not allow dropping a table.
“The custom role must be granted to the ACCOUNTADMIN role directly or, preferably, to another role in a hierarchy with the SYSADMIN”Source: docs.snowflake.com
Sources1
3.Database roles: privileges that live inside one database
A database role is a role that exists inside a single database, and its privileges can only cover that database and the objects in it. The database owner creates it, and it becomes part of the database rather than the account. That makes database roles a good fit for the access-role layer whenever the grants should belong to the database itself. Account roles are the better choice when one role needs objects in several databases, or account objects such as warehouses.
A database role can never be activated directly. It cannot be the primary role, a secondary role, or a user's DEFAULT_ROLE, and granting it straight to users does not make it usable in a session. You grant the database role to an account role, and users activate that account role. Grants in the other direction are not allowed: an account role cannot be granted to a database role. For a finance team that logs in as FINANCE_ANALYST, the setup is to create a database role in the analytics database, grant it SELECT, and grant it to FINANCE_ANALYST.
Checkpoint 5 of 8· Check yourself
The finance team logs in with the FINANCE_ANALYST account role. They need to query tables in the analytics database, and the grants should belong to that database. Which setup gives them working access?
A database role can't be activated in a session, whether as the primary role, a secondary role or a default role. It reaches users only through an account role that it has been granted to. The grant can't go the other way: an account role can't be granted to a database role.
“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 6 of 8· Exam question
The finance department needs read access to the tables in the database ANALYTICS_DB, and the privileges should be defined inside that database so they travel with it. Analysts log in with the account role FINANCE_ANALYST. What is the MOST appropriate approach?
Correct answer: A — Create a database role in ANALYTICS_DB, grant SELECT privileges to it, and grant that database role to the FINANCE_ANALYST account role.
- A. Correct. Database roles are granted to account roles (or other database roles in the same database), and users then activate the account role, which carries the database role's privileges.
- B. Incorrect. A database role cannot be granted directly to a user; the grant must go to an account role or to another database role in the same database.
- C. Incorrect. A database role cannot be activated as a session's primary role with USE ROLE; it only takes effect through an account role that has been granted it.
- D. Incorrect. DEFAULT_ROLE must be an account role granted to the user. Database roles are not assignable as a user's default or primary role.
4.Primary and secondary roles in a session
A session always has exactly one primary role. It can also activate any number of secondary roles at the same time. At login, the user's default role becomes the primary role and their default secondary roles are activated as well. USE ROLE and USE SECONDARY ROLES change either set later in the session.
For anything other than CREATE, Snowflake checks the combined privileges of the primary role, every secondary role, and all roles beneath them. A secondary role that owns a table can even authorize DDL on that table. Object creation is the one exception. Only the primary role's hierarchy is checked, and the new object belongs to the primary role. This rule is deliberate: ownership never ends up with whichever secondary role happened to be active.
USE SECONDARY ROLES ALL;
USE SECONDARY ROLES test_role_1, test_role_2;The main use is cross-database work. An analyst whose access to two databases sits in two separate roles can join across them without anyone building a parent role just for that query. With ALL, Snowflake re-evaluates the set of roles at every statement, so roles granted or revoked mid-session take effect immediately. The user property DEFAULT_SECONDARY_ROLES accepts ('ALL') or () and defaults to ALL. ALL also controls direct user grants: privileges granted straight to a user count only when secondary roles are set to ALL. USE SECONDARY ROLES NONE turns this off, and every action is then authorized by the primary role alone.
Machine learning models are securable objects, so access to them is granted to roles like any other privilege. What matters is how much a grant exposes. USAGE on a model lets a role run its inference methods and nothing more, while READ adds read-only access to the model's underlying artifacts and metadata. Give scoring pipelines and analysts USAGE, and keep READ for the people who must inspect what is inside the model.
Ownership works differently here than for tables. GRANT OWNERSHIP cannot move a model, a model version or a model monitor to another role. The primary role active at creation becomes the owner, so decide which role registers models before the first one exists. A transfer cannot repair the choice afterwards.
Checkpoint 7 of 8· Check yourself
SELECT on a reporting table was granted directly to user u1, not to any role. u1's primary role, REPORTING, has USAGE on the warehouse, database and schema. Earlier in the session u1 ran USE SECONDARY ROLES NONE, and now the query on that table fails. What restores access in this session?
Snowflake considers direct user grants only when secondary roles are set to ALL. With NONE, the primary role alone authorizes every action, and REPORTING has no SELECT on the table. Switching back to ALL brings the direct grant back into authorization.
“Access control considers privileges assigned directly to users only when USE SECONDARY ROLE is set to ALL.”Source: docs.snowflake.com
5.Account-level privileges and warehouse grants
Global privileges are granted on the account itself. Examples are CREATE DATABASE, CREATE WAREHOUSE, MONITOR USAGE and EXECUTE TASK. Many of them, including those four, must be granted by ACCOUNTADMIN. A role that owns tasks still cannot run them until it has EXECUTE TASK. Serverless tasks also need EXECUTE MANAGED TASK. Don't add global privileges to system-defined roles. Mixing account-management and entity-specific privileges in one role is discouraged, so grant extra privileges to a custom role and grant that role to the system role.
Warehouse privileges split cleanly between using a warehouse and running it. Analysts get USAGE. An operations role gets OPERATE so it can suspend a runaway warehouse and abort queries. A platform role gets MODIFY to resize it. FinOps reviewers get MONITOR to see what ran on it.
| Privilege | What it allows | Typical holder |
|---|---|---|
| USAGE | Use the warehouse to run queries; auto-resume fires if configured | Functional roles that query data |
| OPERATE | Start, stop, suspend, resume; view current and past queries; abort running queries | Operations or on-call role |
| MODIFY | Alter any property, including size; required to assign to a resource monitor | Platform administrator role |
| MONITOR | View current and past queries and usage statistics | Cost or performance reviewers |
| MANAGE WAREHOUSES (global) | MODIFY, MONITOR and OPERATE on every warehouse in the account | Central warehouse administration role |
MONITOR and OPERATE overlap in one place: both show query history. Only OPERATE can change the warehouse's state or kill a query. MANAGE WAREHOUSES is a convenience for administrators and does not include USAGE. Assigning a warehouse to a resource monitor needs MODIFY, and even then only ACCOUNTADMIN can make that assignment.
Checkpoint 8 of 8· Match them up
Match each warehouse privilege to the job it supports. Watch for the two privileges whose permissions overlap.
Tap a term, then the definition that fits it.
USAGE is about using the warehouse, and the other privileges are about running it. OPERATE and MONITOR both show query history, but only OPERATE can change the warehouse's state or kill a query. The global MANAGE WAREHOUSES privilege bundles MODIFY, MONITOR and OPERATE but not USAGE, so a role that holds it still cannot run queries.
“The granting of the global MANAGE WAREHOUSES privilege is equivalent to granting the MODIFY, MONITOR, and OPERATE privileges on all warehouses in an account.”Source: docs.snowflake.com
Sources
(7)
Every claim above is drawn from one of these pages, quoted as it was written on the date shown.
- 1.
“Assign this role to at least two users.”
↩︎ Securing ACCOUNTADMIN and adding administrators“All users assigned the ACCOUNTADMIN role should also be required to use multi-factor authentication (MFA) for login”
↩︎ Securing ACCOUNTADMIN and adding administrators“These procedures can take up to two business days.”
↩︎ Securing ACCOUNTADMIN and adding administrators“Snowflake recommends using a role other than ACCOUNTADMIN for automated scripts.”
↩︎ Securing ACCOUNTADMIN and adding administrators“it should not be used to create objects in your account”
↩︎ Securing ACCOUNTADMIN and adding administrators“Note that ACCOUNTADMIN is not a superuser role.”
↩︎ Securing ACCOUNTADMIN and adding administrators“This user should then create one or more additional users who are assigned the USERADMIN role.”
↩︎ Securing ACCOUNTADMIN and adding administrators“Grant permissions on database objects or account objects (such as warehouses) to access roles.”
↩︎ Access roles, functional roles and business alignment“There is no technical difference between an object access role and a functional role in Snowflake.”
↩︎ Access roles, functional roles and business alignment“By default, not even the ACCOUNTADMIN role can modify or drop objects created by a custom role.”
↩︎ Access roles, functional roles and business alignment“The custom role must be granted to the ACCOUNTADMIN role directly or, preferably, to another role in a hierarchy with the SYSADMIN”
↩︎ Checkpoint - 2.
“Grant the ACCOUNTADMIN role to the user(s), but do not set this role as their default.”
↩︎ Securing ACCOUNTADMIN and adding administrators“Ensure an email address is specified for each user (required for multi-factor authentication).”
↩︎ Securing ACCOUNTADMIN and adding administrators“we recommend creating custom roles that align with the business functions in your organization to permit SQL actions on a narrow set of securable objects.”
↩︎ Key concept - 3.
“grant privileges on the object to a database role in the same database”
↩︎ Database roles: privileges that live inside one database“Note that database roles cannot be activated directly in a session.”
↩︎ Database roles: privileges that live inside one database“A database role can be neither a primary nor a secondary role.”
↩︎ Database roles: privileges that live inside one database“Account roles cannot be granted to database roles in a role hierarchy.”
↩︎ Database roles: privileges that live inside one database“Custom database roles can be created by the database owner”
↩︎ Database roles: privileges that live inside one database“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“Access control considers privileges assigned directly to users only when USE SECONDARY ROLE is set to ALL.”
↩︎ Primary and secondary roles in a session“it is not recommended to mix account-management privileges and entity-specific privileges in the same role.”
↩︎ Account-level privileges and warehouse grants“When an object is created, its ownership is set to the currently active primary role.”
↩︎ Exam trap 1“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“Authorization to execute CREATE <object> statements comes from the primary role only.”
↩︎ Prediction - 4.
“The primary role is a single role that authorizes the execution of CREATE <object> statements or any other SQL action.”
↩︎ Database roles: privileges that live inside one database - 5.
“Disables secondary roles. The authorization for all SQL actions is provided via the primary role.”
↩︎ Primary and secondary roles in a session“Note that the set of roles is reevaluated when each SQL statement executes.”
↩︎ Primary and secondary roles in a session - 6.
“For models, USAGE grants the ability to run inference methods. It doesn’t grant access to the model’s underlying artifacts.”
↩︎ Primary and secondary roles in a session“For models, READ grants the ability to run inference methods along with read-only access to the model’s underlying artifacts and metadata.”
↩︎ Primary and secondary roles in a session“Grants the ability to run tasks owned by the role.”
↩︎ Account-level privileges and warehouse grants“Must be granted by the ACCOUNTADMIN role.”
↩︎ Account-level privileges and warehouse grants“Enables changing the state of a warehouse (stop, start, suspend, resume).”
↩︎ Account-level privileges and warehouse grants“Note that only the ACCOUNTADMIN role can assign warehouses to resource monitors.”
↩︎ Account-level privileges and warehouse grants“For models, USAGE grants the ability to run inference methods. It doesn’t grant access to the model’s underlying artifacts.”
↩︎ Exam trap 2“The granting of the global MANAGE WAREHOUSES privilege is equivalent to granting the MODIFY, MONITOR, and OPERATE privileges on all warehouses in an account.”
↩︎ Exam trap 3“The granting of the global MANAGE WAREHOUSES privilege is equivalent to granting the MODIFY, MONITOR, and OPERATE privileges on all warehouses in an account.”
↩︎ Checkpoint - 7.
“Machine learning objects (that is, models, model versions, and model monitors).”
↩︎ Primary and secondary roles in a session