How to Configure Show Masking Policy Snowflake

Published
Length
3 min read

Luis Felipe Dias

All posts

A show masking policy snowflake command lists the column masking rules in your database account. You set it up by granting specific read permissions to your data security roles. Data teams use these rules to protect sensitive fields during query runs. Masking rewrites matched fields in results, such as emails, phone numbers, and card numbers. Before you change any table rules, you must list and inspect your active policies. This guide explains how policy listing works and how to keep your setup

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

A show masking policy snowflake command lists the column masking rules in your database account. You set it up by granting specific read permissions to your data security roles.

Data teams use these rules to protect sensitive fields during query runs. Masking rewrites matched fields in results, such as emails, phone numbers, and card numbers. Before you change any table rules, you must list and inspect your active policies. This guide explains how policy listing works and how to keep your setup safe.

How show masking policy snowflake works for roles

In Snowflake, a masking policy is a schema-level object that holds conditional formatting logic. When a user runs a query, the policy checks their active role. Based on that role, the rule either shows plain text or rewrites matched fields.

To run show masking policy snowflake, a user needs the right role permissions. By default, high-level admin roles can view all rules across the entire account. Regular developer roles cannot list these rules unless an admin grants them read permissions.

You can scope the listing command to a single schema, a database, or the whole account. Filtering by schema helps large teams find specific rules for emails or national IDs fast. Safe defaults mean you only grant policy viewing permissions to auditors and security engineers. You should not give policy edit permissions to standard app roles or analysts.

How to check policy details and references

Listing the policies is only the first step in a full security check. The show command returns basic metadata like the creation date, owner role, and schema name. It does not show the inner conditional logic or which columns use the rule.

To read the actual rule logic, you must run a describe operation on that policy. This lets your team check if the role conditions still match your security standards. You also need to query the account usage views to see where the rule applies. Checking policy references confirms that every sensitive phone number or card number column has protection.

Snowflake Access Control + Data Masking (Static): architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Make this check part of your regular audit workflow. Teams often create a dedicated audit role that can list and describe policies without changing them. This keeps your review process clean and prevents accidental edits to live rules.

What static role rules leave open in active sessions

Native database policies depend on the role active during a user session. Once a user logs in with a high-privilege role, the policy returns unmasked values. This setup works well for standard analysts who only use restricted roles.

Still, engineers and admins often need elevated roles to fix bugs or manage schemas. While they use those high-level roles, native rules do not rewrite sensitive fields in results. Static role assignments also cannot require peer approval for a single sensitive query. Also, native rules only work inside that one data warehouse. If your team queries Postgres or MySQL too, you must build separate rules for each system.

Check database and API queries on the wire

Identity tools, roles, and network rules decide who opens a session. Setup alone cannot check what each query does or mask sensitive values in a response once a session starts. When workflows touch Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, or internal HTTP APIs, hoop.dev runs beside those services as an open-source proxy, a sidecar for your Postgres or API. It inspects requests coming in and results going back on the wire.

Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run. On responses, hoop.dev data masking rewrites matched sensitive values in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and writes every query and decision to an audit trail that generates evidence for HIPAA, GDPR, and PCI DSS. See the source on GitHub.

Frequently asked questions

Which roles can list masking policies in Snowflake?

Account admins, security admins, and schema owners can list policies by default. Other roles need explicit monitor or apply permissions on the schema or policy object.

Does listing a policy show its masking logic?

No, the show command only returns metadata like the policy name, schema, and owner. You must run a separate describe command to read the conditional role logic.

How do I find which columns use a specific masking policy?

You can query the policy references table function in the information schema. That view lists every table and column bound to your masking rule.

The query runs. The emails stay hidden.