What you will be able to do
- Choose between SSO and password with MFA for people, and between OAuth and key-pair for applications
- Build a network policy from network rules and work out which policy wins at the account, user and integration levels
- Write an account identifier in the preferred format and know when the legacy locator still appears
- Use log levels to control what UDFs and procedures write to an event table
1.How people sign in: SSO, federated authentication and MFA
Authentication proves who is connecting, before any role or grant is checked. For people signing in to Snowsight there are two routes. With single sign-on (SSO), the user signs in to a third-party identity provider (IdP) and never gives Snowflake a password. This works through federated authentication: the IdP sends Snowflake proof of identity, either a SAML assertion or an OIDC ID token, and Snowflake accepts it because the two already trust each other. SSO is the preferred option because authentication is managed centrally, in the same IdP the organization uses for its other applications.
The other route is a password with multi-factor authentication (MFA). The user types a password and then confirms with a second factor. Snowflake requires MFA for all password users. The allowed second factors are a passkey, an authenticator app that generates time-based one-time passcodes (TOTP), and Duo. Passkeys are the recommended choice, and Duo is the only method that is not replicated. MFA is for human users only, so service users must authenticate another way.
SSO users do not get Snowflake MFA by default. Snowflake trusts the IdP to enforce strong authentication. If you also want Snowflake's own MFA after the IdP sign-in, for example for ACCOUNTADMIN users, set an authentication policy. That policy refers to security integrations. A security integration is an account-level Snowflake object, created with CREATE SECURITY INTEGRATION, that sets up the connection to an outside identity service. There are separate forms for SAML2, OIDC, SCIM, Snowflake OAuth and External OAuth. In the policy below, the SECURITY_INTEGRATIONS setting is where the SAML or OIDC integrations are named.
CREATE AUTHENTICATION POLICY ACCOUNTADMIN_DOUBLE_MFA
AUTHENTICATION_METHODS = ('PASSWORD', 'SAML', 'OIDC')
SECURITY_INTEGRATIONS = ('<SAML OR OIDC SECURITY INTEGRATIONS>')
MFA_ENROLLMENT = 'REQUIRED'
MFA_POLICY=(ENFORCE_MFA_ON_EXTERNAL_AUTHENTICATION='ALL');Checkpoint 1 of 5· Fill the gap
Your ACCOUNTADMIN users sign in through SSO. By default, Snowflake trusts the IdP and does not ask them for Snowflake MFA. You want them to complete Snowflake MFA after the IdP sign-in as well. Which setting completes this authentication policy?
CREATE AUTHENTICATION POLICY ACCOUNTADMIN_DOUBLE_MFA
AUTHENTICATION_METHODS = ('PASSWORD', 'SAML', 'OIDC')
SECURITY_INTEGRATIONS = ('<SAML OR OIDC SECURITY INTEGRATIONS>')
MFA_ENROLLMENT = 'REQUIRED'
MFA_POLICY=( ? ='ALL');SSO users authenticate externally, through a SAML or OIDC IdP. Snowflake asks them for its own MFA only when the policy enforces MFA on external authentication. Password users already must use MFA, so a password setting would not change anything for SSO users.
Source: docs.snowflake.com2.How applications sign in: OAuth and key-pair
Applications connect without the Snowsight sign-in page, so they need their own methods. The deciding question is whether the application acts for a person, like a BI tool, or for itself, like a CI/CD pipeline. With Snowflake OAuth, Snowflake is both the authorization server and the resource server. The person signs in through Snowflake, using SSO or a password, and the application receives an access token. With External OAuth, a third-party IdP issues the token, and Snowflake only accepts it. Key-pair authentication keeps a private key with the application and stores the matching public key on the Snowflake user. Because no password is sent or stored, there is less risk of credential theft.
| Method | Authorization server | Suitable for | Note |
|---|---|---|---|
| Snowflake OAuth | Snowflake | Interactive applications | Uses the authorization code grant type; user can authorize with SSO |
| External OAuth | Third-party IdP | Interactive and service-to-service applications | Service-to-service apps can use the client credentials grant type |
| Key-pair | None; private key proves identity | Interactive and service-to-service applications | Passwordless and not exposed in a request; not usually used for interactive apps |
Key-pair credentials last a long time, so they need protection. A stolen private key works until someone rotates it. Pair key-pair users with network policies and a clear plan for storing and rotating keys.
Checkpoint 2 of 5· Check yourself
A CI/CD pipeline loads data into Snowflake every night. No person is present when it runs, and it authenticates as its own service. Which authentication method does NOT fit this pipeline?
Snowflake OAuth only works for interactive applications. A person has to sign in through Snowflake, using SSO or a password, before the application gets a token, and a pipeline that runs on its own has nobody to sign in. External OAuth using client credentials and key-pair authentication both work for service-to-service applications.
“Because Snowflake is the authorization server, the user who is interacting with the application uses the Snowflake user interface to authenticate.”Source: docs.snowflake.com
Sources1
3.Network rules and network policies
Out of the box, Snowflake accepts connections from any computer or device. Network policies limit inbound traffic by where a request comes from. The work is split across two objects. A network rule is a schema-level object that groups identifiers of one type, such as IPv4 ranges or private endpoint IDs. A rule does not say whether it allows or blocks anything. A network policy puts rules on its allowed list or its blocked list. For inbound access to the service, give the rule MODE = INGRESS.
The allowed list blocks everything it does not name. Put a single IPv4 address on the allowed list and every other IPv4 address is refused, without any blocked-list entry. The blocked list is for exceptions inside an allowed range, and the blocked list wins when the two overlap. A new policy does nothing until you activate it on the account, a user or a security integration.
CREATE NETWORK RULE allow_access_rule
MODE = INGRESS
TYPE = IPV4
VALUE_LIST = ('192.168.1.0/24');
CREATE NETWORK RULE block_access_rule
MODE = INGRESS
TYPE = IPV4
VALUE_LIST = ('192.168.1.99');
CREATE NETWORK POLICY public_network_policy
ALLOWED_NETWORK_RULE_LIST = ('allow_access_rule')
BLOCKED_NETWORK_RULE_LIST=('block_access_rule');A policy activated on a security integration, the object that connects Snowflake to an outside identity service, applies to traffic that goes through that integration. Snowflake OAuth shows how this works: for client-to-Snowflake traffic such as token requests, only the integration-level and account-level policies are checked, and the user-level policy is skipped. The built-in SNOWFLAKE$LOCAL_APPLICATION integration is the exception, because it also enforces the user-level policy on token requests.
When policies exist at several levels, the most specific one wins. A user's policy overrides the account policy, and a security integration's policy overrides both. Snowflake recommends keeping policies narrow: attach them to a group of users or an integration rather than the whole account. Use many small rules with comments, for example one rule for client IP addresses in North America and another for privileged service users.
Checkpoint 3 of 5· Check yourself
A security administrator creates an IPv4 network rule with MODE = INGRESS and VALUE_LIST = ('192.168.1.0/24'). They add it to a network policy's allowed list, leave the blocked list empty and activate the policy on the account. A user then connects from 10.20.30.40. What happens?
Once a rule is on the allowed list, only the identifiers it names can connect. Every other IPv4 address is refused without any blocked-list entry. The blocked list is only for exceptions inside an allowed range.
“you do not have to use the blocked list to explicitly block other identifiers of the same type; only the allowed identifiers have access.”Source: docs.snowflake.com
Sources4
4.Account identifiers
An account identifier names one account, both within your organization and across every cloud and region Snowflake runs in. You use it in Snowsight URLs, drivers and connectors, Snowflake CLI and SnowSQL, third-party tools, and global features such as data sharing and replication. The preferred format is the organization name, a hyphen, then the account name, for example myorg-account123. The older account locator, assigned by Snowflake, still works as an identifier, but it is a legacy format and not recommended.
Account names follow DNS-safe rules. A name must be unique in the organization regardless of region, must start with a letter, and may use no special characters except underscores. The full identifier should stay under 63 characters. Okta SSO and SCIM do not accept underscores in account names, so they use a form of the identifier with a hyphen in place of each underscore.
Checkpoint 4 of 5· Check yourself
In the organization acme, a team is setting up a JDBC driver to connect to the account sales_eu. Which account identifier should they use to follow Snowflake's recommendation?
The preferred identifier is the organization name, a hyphen, then the account name. The account locator still works, but it is a legacy format and not recommended. An account name is unique only within its organization, so it is not enough on its own. Underscores are allowed in account names. The form with a hyphen in place of each underscore is only for features such as Okta SSO and SCIM.
“The preferred account identifier consists of the name of the account prefixed by its organization; for example, myorg-account123.”Source: docs.snowflake.com
Sources5
5.Logging and tracing with event tables
Stored procedures and UDFs can emit log messages and trace events, and Snowflake writes them to an event table. A role needs INGEST TELEMETRY to write telemetry into an event table, and MODIFY EVENT TABLE to set the EVENT_TABLE parameter that decides where it goes. You can set telemetry levels for the account, for an object, or for the current session's calls to functions and procedures.
Levels work as severity thresholds. With LOG_LEVEL = WARN, WARN, ERROR and FATAL messages are recorded and anything less severe is dropped. LOG_EVENT_LEVEL does the same for log events from features such as Snowpipe, tasks and dynamic tables. METRIC_LEVEL captures either all metrics or none. TRACE_LEVEL sets how much trace data is stored, but tracing only works if LOG_LEVEL is also set to a supported value.
| Parameter | Controls | Account-level privilege |
|---|---|---|
| LOG_LEVEL | Log messages from logging APIs at this level and above | MODIFY LOG LEVEL |
| LOG_EVENT_LEVEL | Log events (record type EVENT) | MODIFY LOG EVENT LEVEL |
| TRACE_LEVEL | Scope of trace events; also needs LOG_LEVEL set | MODIFY TRACE LEVEL |
| METRIC_LEVEL | Metrics data, all or none | MODIFY METRIC LEVEL |
Checkpoint 5 of 5· Match them up
A team is setting up telemetry for its stored procedures and UDFs. Match each parameter to what it controls.
Tap a term, then the definition that fits it.
Each telemetry parameter controls one kind of data. TRACE_LEVEL is the one that depends on another parameter: tracing captures nothing unless LOG_LEVEL is also set to a supported value, so setting TRACE_LEVEL alone is not enough.
“When tracing events, you must also set the LOG_LEVEL parameter to one of its supported values.”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.
“users authenticate with a third-party identity provider (IdP) rather than authenticating with Snowflake directly.”
↩︎ How people sign in: SSO, federated authentication and MFA“this proof is either a Security Assertion Markup Language (SAML) assertion or an OpenID Connect (OIDC) ID token.”
↩︎ How people sign in: SSO, federated authentication and MFA“Lets an organization centrally manage authentication.”
↩︎ How people sign in: SSO, federated authentication and MFA“To strengthen the security of this authentication method, Snowflake requires MFA for all password users.”
↩︎ How people sign in: SSO, federated authentication and MFA“With Snowflake OAuth, Snowflake is both the authorization server that authenticates a Snowflake user and the resource server”
↩︎ How applications sign in: OAuth and key-pair“External OAuth also provides the security of OAuth 2.0, but a third-party IdP, not Snowflake, acts as the authorization server.”
↩︎ How applications sign in: OAuth and key-pair“The private key is a secret kept by the application, while the public key is associated with a Snowflake user object.”
↩︎ How applications sign in: OAuth and key-pair“This authentication method eliminates the need to transmit or store passwords, reducing the risk of credential theft.”
↩︎ How applications sign in: OAuth and key-pair“Passwordless credential that isn’t exposed in a request.”
↩︎ How applications sign in: OAuth and key-pair“Because Snowflake is the authorization server, the user who is interacting with the application uses the Snowflake user interface to authenticate.”
↩︎ Checkpoint - 2.
“MFA is intended for human users who authenticate with a password. Service users must use another form of authentication.”
↩︎ How people sign in: SSO, federated authentication and MFA“Passkeys are recommended due to their security and usability.”
↩︎ How people sign in: SSO, federated authentication and MFA“Duo is not replicated like the other MFA methods.”
↩︎ How people sign in: SSO, federated authentication and MFA“By default, Snowflake doesn’t require MFA for users who authenticate with single sign-on (SSO).”
↩︎ How people sign in: SSO, federated authentication and MFA“Snowflake relies on the identity provider (IdP) to enforce MFA or some other strong authentication method.”
↩︎ Exam trap 2 - 3.https://docs.snowflake.com/en/sql-reference/sql-allOfficial docs
“Creates a new SAML2 security integration in the account or replaces an existing integration.”
↩︎ How people sign in: SSO, federated authentication and MFA - 4.
“By default, Snowflake allows users to connect to the service and internal stage from any computer or device.”
↩︎ Network rules and network policies“A network rule, however, does not specify whether it is allowing or blocking the origin of a request.”
↩︎ Network rules and network policies“the administrator can organize these restrictions using network rules, which are schema-level objects.”
↩︎ Network rules and network policies“To restrict access to the Snowflake service, set the MODE property of the network rule to INGRESS.”
↩︎ Network rules and network policies“Snowflake applies the values in the BLOCKED_IP_LIST parameter first.”
↩︎ Network rules and network policies“A network policy doesn’t restrict network traffic until it is activated.”
↩︎ Network rules and network policies“the most specific network policy overrides more general network policies.”
↩︎ Network rules and network policies“Only the integration-level and account-level policies apply.”
↩︎ Network rules and network policies“Whenever possible, narrowly scope a network policy to a group of users or a security integration rather than an entire account.”
↩︎ Network rules and network policies“only the allowed identifiers have access”
↩︎ Exam trap 1“Network policies applied to a security integration are the most specific network policies. They override both accounts and users.”
↩︎ Prediction“you do not have to use the blocked list to explicitly block other identifiers of the same type; only the allowed identifiers have access.”
↩︎ Checkpoint - 5.
“The preferred account identifier consists of the name of the account prefixed by its organization; for example, myorg-account123.”
↩︎ Account identifiers“You can also use the Snowflake-assigned locator as the account identifier; however, the use of this legacy format is not recommended.”
↩︎ Account identifiers“Must be unique within an organization, regardless of which Snowflake region the account is in.”
↩︎ Account identifiers“such as Okta SSO or SCIM, can reference a version of the account identifier that substitutes a hyphen (-) for each _ character.”
↩︎ Account identifiers - 6.
“setting the LOG_LEVEL parameter to WARN means that log messages at the WARN, ERROR, and FATAL levels are captured in the event table.”
↩︎ Logging and tracing with event tables“You can set the telemetry level for calls to functions and procedures made in the current session.”
↩︎ Logging and tracing with event tables“You can currently have all metrics data captured or none.”
↩︎ Logging and tracing with event tables - 7.
“Grants the ability to ingest telemetry data into an event table.”
↩︎ Logging and tracing with event tables“Grants the ability to set the EVENT_TABLE parameter on any object in the account.”
↩︎ Logging and tracing with event tables“When tracing events, you must also set the LOG_LEVEL parameter to one of its supported values.”
↩︎ Logging and tracing with event tables“When tracing events, you must also set the LOG_LEVEL parameter to one of its supported values.”
↩︎ Exam trap 3