ALTER ACCOUNT SET INGRESS POLICY
statementnot supportedIntegrations, network & secretspreviewAttaches an ingress policy to the current account, or removes that attachment. You can attach the policy to the entire account, to all human (person) users, or to all service users. The account-level policy is the baseline for users who do not have a user-level or user-type ingress policy. This syntax is the ingress-policy clause of ALTER ACCOUNT. The rest of ALTER ACCOUNT is unchanged.
Syntax
ALTER ACCOUNT SET INGRESS POLICY <policy_name>
[ { FOR ACCOUNT | FOR ALL PERSON USERS | FOR ALL SERVICE USERS } ]
[ FORCE ]
ALTER ACCOUNT UNSET INGRESS POLICY
[ { FOR ACCOUNT | FOR ALL PERSON USERS | FOR ALL SERVICE USERS } ]
Parameters
| Name | Required | Description |
|---|---|---|
policy_name | Identifier for the ingress policy to attach. Use a fully qualified name when the policy is outside the current schema. | |
FOR ACCOUNT | FOR ALL PERSON USERS | FOR ALL SERVICE USERS | Specifies the account-level attachment scope. These scopes match the user-type clauses for authentication policies and session policies. Omitting the clause, or specifying FOR ACCOUNT, attaches the policy as the account-level baseline. FOR ALL PERSON USERS attaches the policy to users whose TYPE property is PERSON or unset (NULL). See Types of users. FOR ALL SERVICE USERS attaches the policy to users whose TYPE property is SERVICE, LEGACY_SERVICE, or SERVICE_AGENT. Each scope holds at most one ingress policy. Setting a policy in one scope does not replace a policy in another scope. | |
FORCE | Replaces an ingress policy that is already set on the same account-level scope without unsetting it first. FORCE does not remove user-level attachments or policies on other account scopes. |
Usage notes
- An ingress policy does not replace the account network policy. Snowflake evaluates the network policy and the ingress policy independently. A request is admitted only when both allow it. An allow request decision from the ingress policy does not override a denial from the network policy.
- At login, Snowflake evaluates the network policy before the ingress policy, and evaluates the ingress policy before the session is created. On each subsequent authenticated request, Snowflake evaluates the network policy and the ingress policy again.
- Snowflake resolves one effective ingress policy for a user in this order: the user-level policy, then a matching user-type account attachment (FOR ALL PERSON USERS or FOR ALL SERVICE USERS), then the account-level attachment. The policies are not combined. Set a user-level policy with ALTER USER SET INGRESS POLICY.
- As a protective guardrail against misconfiguration and accidental lockouts, Snowflake declines the statement when the policy would block the current request of the user who runs it, and the attachment would become that user’s effective policy. The check uses the current request only.
- Test the policy on a user before you attach it to the account.
- UNSET INGRESS POLICY without a scope removes the account-level ingress policy. Specifying FOR ALL PERSON USERS or FOR ALL SERVICE USERS removes only that user-type attachment. Unset does not change the account network policy.
Access control requirements
A role used to execute this operation must have the following privileges at a minimum: Privilege | Object | Notes APPLY INGRESS POLICY | Account | Required on the account to attach or detach the policy. OWNERSHIP | Ingress policy | OWNERSHIP is a special privilege on an object that is automatically granted to the role that created the object, but can also be transferred using the GRANT OWNERSHIP command to a different role by the owning role (or any role with the MANAGE GRANTS privilege).. Either this privilege or APPLY is required. APPLY | Ingress policy | Required when the role does not own the policy. For instructions on creating a custom role with a specified set of privileges, see Creating custom roles. For general information about roles and privilege grants for performing SQL actions on securable objects, see Overview of Access Control.