Skip to content
Back to skills

Snowflake Governance

ASecurity

Audit data access, inspect masking and row access policies, review tags and classification, and analyze role hierarchies and grants in Snowflake.

  • 50 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 9, 2026
developmentgosqldatabasesecurity

Works with

  • cli

Security analysis

A100/100

Scanned November 9, 2026

npx -y skills add Snowflake-Labs/snowflake-ai-kit --skill snowflake-governance --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Snowflake Governance?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Snowflake Governance
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/snowflake-labs-snowflake-governance/badge)](https://www.skillsdirectory.com/skills/snowflake-labs-snowflake-governance)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: snowflake-governance
description: >-
  Audit data access, inspect masking and row access policies, review
  tags and classification, and analyze role hierarchies and grants
  in Snowflake.
---

# Snowflake Governance

Audit access, inspect policies, and review security configuration.

## When to use

- User asks "who can access this table", "what policies are applied"
- User wants to audit access history or login activity
- User asks about tags, data classification, or PII
- User wants to understand the role hierarchy or grant structure

## Access control and grants

**Grants on a specific object:**
```sql
SHOW GRANTS ON TABLE my_db.my_schema.customers;
```

**What a role can access:**
```sql
SHOW GRANTS TO ROLE analyst_role;
```

**Who has a role:**
```sql
SHOW GRANTS OF ROLE analyst_role;
```

**Role hierarchy (what roles does a role inherit):**
```sql
SHOW GRANTS TO ROLE analyst_role;
-- Look for USAGE grants on other roles
```

## Masking policies

```sql
-- List masking policies
SHOW MASKING POLICIES IN ACCOUNT;

-- See where a policy is applied
SELECT *
FROM TABLE(INFORMATION_SCHEMA.POLICY_REFERENCES(
  POLICY_NAME => 'my_db.my_schema.mask_pii'
));
```

If data appears as `***` or `NULL` unexpectedly, a masking policy is likely applied. Tell the user which policy is active and what role would see unmasked data.

## Row access policies

```sql
-- List row access policies
SHOW ROW ACCESS POLICIES IN ACCOUNT;

-- See where applied
SELECT *
FROM TABLE(INFORMATION_SCHEMA.POLICY_REFERENCES(
  POLICY_NAME => 'my_db.my_schema.row_filter'
));
```

Row access policies filter rows based on the querying role. Different users may see different result sets from the same table.

## Tags and classification

```sql
-- List tags
SHOW TAGS IN ACCOUNT;

-- See what's tagged
SELECT *
FROM TABLE(INFORMATION_SCHEMA.TAG_REFERENCES(
  'my_db.my_schema.customers', 'TABLE'
));

-- Find all objects with a specific tag
SELECT *
FROM SNOWFLAKE.ACCOUNT_USAGE.TAG_REFERENCES
WHERE TAG_NAME = 'PII'
  AND TAG_VALUE = 'true';
```

## Access history (who accessed what)

```sql
SELECT user_name, query_start_time, direct_objects_accessed
FROM SNOWFLAKE.ACCOUNT_USAGE.ACCESS_HISTORY
WHERE query_start_time >= DATEADD(day, -7, CURRENT_TIMESTAMP())
ORDER BY query_start_time DESC
LIMIT 50;
```

## Login history

```sql
SELECT user_name, client_ip, first_authentication_factor, is_success, error_message
FROM SNOWFLAKE.ACCOUNT_USAGE.LOGIN_HISTORY
WHERE event_timestamp >= DATEADD(day, -7, CURRENT_TIMESTAMP())
ORDER BY event_timestamp DESC
LIMIT 50;
```

## Network policies

```sql
SHOW NETWORK POLICIES;
DESCRIBE NETWORK POLICY my_policy;
```

## Important

- ACCOUNT_USAGE views have up to 45-minute latency. They are not real-time.
- Some views require ACCOUNTADMIN or specific grants on the SNOWFLAKE database.
- Never attempt to bypass governance — if data is masked or filtered, explain that to the user.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.