Skip to main content

πŸ” Security Access Control in Snowflake

Snowflake uses a multi-layered security model to control access to data. It combines Role-Based Access Control (RBAC) with object-level privileges and data-level policies for granular security.


βœ… Hierarchy and Checks​

  1. πŸ‘€ User

    • A user must authenticate first (e.g., via username/password, SSO, MFA).
  2. πŸ”‘ Role (RBAC)

    • RBAC (Role-Based Access Control) decides which roles the user has.
    • Roles determine object-level privileges (database, schema, table).
  3. πŸ“¦ Object Privileges

    • Example:

      GRANT SELECT ON TABLE sales TO ROLE analyst;
    • First Check: Does the role have SELECT privilege on the object?

  4. 🧩 Data-Level Policies

    • After object-level permissions are confirmed, Snowflake applies data policies:

      • Row Access Policy β†’ Row-Level Security (RLS)
      • Masking Policy β†’ Column-Level Security (CLS)

βœ… Where Row & Column-Level Security Come In​

  • They do NOT replace RBAC; they layer on top of it for finer control.

  • Order of evaluation after RBAC & object privilege check:

    • Row-Level Security (RLS) β†’ restricts which rows a user can see.
    • Column-Level Security (CLS) β†’ masks or hides sensitive columns.

βœ… Full Evaluation Flow​

  • Step 1 β†’ RBAC (Role assigned to the user)
  • Step 2 β†’ Object Privileges (e.g., SELECT on a table)
  • Step 3 β†’ Row-Level Security (Row Access Policy)
  • Step 4 β†’ Column-Level Security (Masking Policy)

βœ… Hierarchy Visual​

βœ… Where Row & Column-Level Security Come In​

  • They do NOT replace RBAC; they layer on top of RBAC for finer control.

  • Order of evaluation after RBAC & object privilege check:

    • Row-Level Security (RLS) β†’ restricts which rows a user can see.
    • Column-Level Security (CLS) β†’ masks or hides sensitive columns.

Full Flow​

  • First Check β†’ RBAC (Role access to objects)
  • Second Check β†’ Object Privileges (GRANT)
  • Third Check β†’ Row-Level Security (Row Access Policy)
  • Fourth Check β†’ Column-Level Security (Masking Policy)

βœ… Role-Level Access Control (RBAC)​

  • What it is: RBAC is a security framework where permissions are granted to roles, not directly to users. Users are assigned to roles β†’ roles have privileges on objects β†’ users inherit those privileges.

  • Hierarchy: Snowflake allows role hierarchy, so a parent role inherits privileges from its child roles.

  • Why it matters:

    • Centralized and scalable security.
    • Easier management (you manage roles, not users).
    • Supports least privilege principle.

🎯 Simply:

RBAC is a security model that uses roles to control access to resources. Instead of assigning privileges directly to users, you assign privileges to roles, and assign roles to users.


  • βœ… Purpose:

    • Enforce least privilege by giving users only the permissions they need.
    • Simplify privilege managementβ€”roles can be assigned and adjusted without touching individual users.
    • Enable scalability and consistency in managing access.

βœ… Relationship with Other Levels​

  • RBAC defines which role can access which objects β†’ this is the first check.
  • Then, object-level, row-level, and column-level policies add granular control.
  • So the hierarchy is: