Back to Utils
Snowflake · View
privilege_changes
All GRANT and REVOKE statements, regardless of the role used. Includes failed attempts. Provides a complete audit trail of changes to privileges and access.
Source: SNOWFLAKE.ACCOUNT_USAGE.QUERY_HISTORY · Latency: ~45min
| Column | Description |
|---|---|
| date | Date |
| user_name | User |
| role_name | Role used |
| query_type | GRANT or REVOKE |
| execution_status | SUCCESS, FAIL or INCIDENT |
| statement | Full query text |
Source code
create_admin_views.sql
create or replace view privilege_changes
comment = 'GRANT and REVOKE statements with the user and role that executed them (source: SNOWFLAKE.ACCOUNT_USAGE)'
as
select start_time::date as date
, user_name
, role_name
, query_type
, execution_status
, query_text as statement
from snowflake.account_usage.query_history
where query_type in ('GRANT', 'REVOKE')
order by start_time desc;