Many teams think that giving a service account a single password is enough to keep Snowflake secure. In reality that approach collapses the idea of least privilege and leaves every downstream query exposed.
Typical practice is to create a shared service account, store its credentials in a CI/CD vault, and let dozens of pipelines use it directly against Snowflake. The account often has full read‑write rights on all warehouses and schemas. Engineers rarely see who actually ran a query, and there is no automated way to block a dangerous command before it reaches the database. The result is a blind spot: the organization cannot prove that a non‑human identity respected the principle of least privilege.
Why least privilege matters for non‑human identities
Non‑human identities include service accounts, CI runners, and AI agents that need programmatic access. They differ from human users because they cannot make judgment calls at runtime. If a service account is granted broad rights, a single bug or compromised token can exfiltrate an entire data lake. Applying least privilege means each identity receives only the permissions required for its specific job, and nothing more.
Even when permissions are trimmed, the request still travels straight to Snowflake. The gateway that sits between the identity and the database is missing, so there is no place to enforce real‑time checks, capture an audit trail, or mask sensitive columns before they leave the system. The setup fixes credential distribution but leaves the request path unguarded.
Setup: defining the non‑human identity
The first step is to provision a dedicated service account for each pipeline or AI workflow. The account is created in the identity provider (for example, Azure AD or Okta) and is granted a minimal role in Snowflake, such as SELECT on a single schema. The identity provider issues short‑lived OIDC tokens that the pipeline presents when it initiates a connection. This setup decides who the request is and whether it may start, but it does not enforce any policy on the data path.
The data path: inserting an identity‑aware gateway
Placing an identity‑aware gateway in the data path creates a single control surface. The gateway terminates the client connection, validates the OIDC token, and then proxies the traffic to Snowflake using its own service credentials. Because every packet passes through the gateway, it becomes the only place where enforcement can happen.
