Do Shared Objects in Snowflake Need to Be Secure Views?
Short Answer:
No, the objects being shared in Snowflake do not always need to be secure views. However, by default, only secure objects (such as secure views, secure materialized views, tables, etc.) can be shared. If you want to share non-secure views, you must explicitly configure the share to allow non-secure objects.
Details
Default Behavior: Secure Objects Only
When you create a share in Snowflake, by default, only secure objects can be added to the share. This includes:
Tables
External tables
Secure views
Secure materialized views
Secure user-defined functions (UDFs)[1][3][7]
If you attempt to add a standard (non-secure) view to a share that is not configured to allow non-secure objects, Snowflake will return an error[7].
Sharing Non-Secure Views
Snowflake does allow sharing of non-secure views, but only if the share is explicitly created with the SECURE_OBJECTS_ONLY=FALSE property[8].
Example:
sql
CREATE OR REPLACE SHARE allow_non_secure_views
SECURE_OBJECTS_ONLY=FALSE
COMMENT='Share views that require query optimization';
Once this property is set to FALSE, you can grant non-secure views to the share. Note that this setting is permanent for the share—you cannot later change it to only allow secure objects[8].
Best Practice
Snowflake recommends using secure views when sharing data to enforce security and prevent exposure of underlying table structures or sensitive logic[8][6].
Secure views also provide better control over what is visible to consumers and help protect sensitive metadata and query details[6].
Summary Table
Object Type
Default Share Allowed?
Special Configuration Needed?
Table
Yes
No
Secure View
Yes
No
Non-Secure View
No
Yes (SECURE_OBJECTS_ONLY=FALSE)
Secure Materialized View
Yes
No
Non-Secure UDF
No
Not supported
Key Takeaways
Secure views are not strictly required for sharing, but are the default and recommended option for security.
Non-secure views can be shared only if the share is configured to allow them by setting SECURE_OBJECTS_ONLY=FALSE when creating the share[8].
Other non-secure objects (like non-secure UDFs) cannot be shared, even with this setting[8].
For most use cases, especially those involving sensitive or regulated data, secure views are the preferred and default method for sharing in Snowflake.
User
what are the use cases of a snowflake secure view
Assistant
Snowflake secure views are specialized views designed to enhance data privacy and security by restricting access to sensitive data and hiding the view's definition from unauthorized users. Their use cases revolve around scenarios where protecting sensitive information and controlling data access are critical. Here are the primary use cases of Snowflake secure views:
Use Cases of Snowflake Secure Views
Data Privacy and Sensitive Data Protection
Secure views are ideal when you need to limit access to sensitive data such as personally identifiable information (PII), financial records, or health data. They prevent unauthorized users from seeing sensitive columns or rows by applying column-level and row-level security[1][3].
Role-Based Access Control (RBAC)
Secure views allow implementing fine-grained access control based on user roles. Different users or roles can be granted access to different subsets of data through secure views, ensuring users only see data they are authorized to access[2][3].
Hiding View Definitions
The SQL definition of a secure view is only visible to authorized users (typically the owner or specific roles). This protects proprietary logic, business rules, or sensitive query details from being exposed to all users[1][5][6].
Data Sharing Across Accounts
When sharing data with external Snowflake accounts, secure views help ensure that consumers only see authorized data and cannot access the underlying base tables. Secure views can filter or mask data dynamically based on the consumer account or role[1][4][7].
Compliance with Regulations
Organizations subject to regulations like GDPR, HIPAA, or SOC use secure views to enforce data governance policies by controlling who can access sensitive data and ensuring auditability of access[2][3].
Dynamic Data Masking
Secure views can incorporate masking policies to redact or obfuscate sensitive data dynamically, showing full data only to authorized roles while masking it for others[2][3].
Multi-Tenant Applications
In applications serving multiple clients or tenants, secure views can enforce tenant isolation by filtering data so each tenant only accesses their own data without exposing others’ information[3].
Preventing Exposure of Underlying Table Structures
Secure views prevent users from querying or seeing the underlying tables directly, reducing the risk of data leaks or unauthorized data exploration[2][3].
Protecting Query Metadata and Data Volume Information
Queries on secure views do not expose details like the amount of data scanned or query plan details to unauthorized users, which can be important in high-security environments[1].
Summary
Use Case
Description
Data Privacy
Limit access to sensitive columns/rows
Role-Based Access Control
Control data visibility based on user roles
Hide View Definition
Protect proprietary SQL logic and business rules
Secure Data Sharing
Share filtered data safely with external accounts
Regulatory Compliance
Enforce data governance and audit requirements
Dynamic Data Masking
Mask sensitive data dynamically based on roles
Multi-Tenant Data Isolation
Ensure tenants see only their own data
Protect Underlying Tables
Prevent direct access to base tables
Conceal Query Metadata
Hide data volume and query plan details from unauthorized users
Secure views trade off some query performance for enhanced security and privacy, so they should be used when data protection is a priority over raw query speed[1][2][6][8].
In essence, Snowflake secure views are a powerful tool for organizations needing to enforce strict data access controls, protect sensitive information, and comply with data privacy regulations while enabling flexible data sharing and role-based access.