# US 2021/0286892 A1 · Data sharing using secure views

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2021/0286892 A1
- Document ID: US20210286892A1
- Status: Published application
- Kind: A1
- Application number: 17/332,793
- Filed: 2021-05-27
- Published: 2021-09-16
- Earliest claimed: 2018-08-06
- Assignees: Snowflake Inc.
- Applicants: Snowflake Inc.
- Inventors: Allison Waingold Lee; Peter Povinec; Martin Hentschel; Robert Muglia
- Web page: https://patentgrep.com/patent/US20210286892A1

## CPC

- G06F 21/6227: {where protection concerns the structure of data, e.g. records, types, queries}
- G06F 16/2282: {Tablespace storage structures; Management thereof}
- G06F 16/245: Query processing
- G06F 21/6218: {to a system of files or objects, e.g. local or distributed file system or database}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Systems, methods, and devices for secure view-based data sharing are disclosed. A method in accordance with embodiments disclosed herein comprises associating, by one or more processors, view privileges of a secure view with one or more of a plurality of underlying details of a share object of a first account such that each of the one or more underlying details of the share object comprises a definition of the secure view. The method further comprises: in response to receiving a request from a second account to access any underlying details of the share object, using a secure projection that does not match any rewrite rule preconditions to rewrite a query plan of the request to prevent expressions that do not originate from the secure view from being pushed down below a boundary of the secure view.

## Claims

### Claim 1

A method comprising:
associating, by one or more processors, view privileges of a secure view with one or more of a plurality of underlying details of a share object of a first account such that each of the one or more underlying details of the share object comprises a definition of the secure view; and
in response to receiving a request from a second account to access underlying details of the share object, using a secure projection that does not match any rewrite rule preconditions to rewrite a query plan of the request to prevent expressions that do not originate from the secure view from being pushed down below a boundary of the secure view.

### Claim 2 (depends on 1)

The method of claim 1, further comprising:
granting, to the second account, cross-account access rights to the share object in the first account.

### Claim 3 (depends on 1)

The method of claim 1, wherein rewriting the query plan of the request further comprises:
annotating expressions originating from the secure view to designate them as originating from the secure view, wherein expressions designated as originating from the secure view cannot be combined with expressions that do not originate from the secure view.

### Claim 4 (depends on 3)

The method of claim 3, wherein rewriting the query plan of the request further comprises:
implementing expressions that are not designated as originating from the secure view with the secure projection, wherein the secure projection behaves identically to a standard projection but does not match any rewrite rule preconditions such that relevant rewrites of an expression that do not originate from the secure view are not applied.

### Claim 5 (depends on 1)

The method of claim 1, wherein rewriting the query plan of the request further comprises:
implementing any filter expression by copying the filter expression on pullup through the secure projection such that an original predicate remains below the secure projection to ensure that all security-related filtering occurs before evaluation of any expression outside of the secure view.

### Claim 6 (depends on 3)

The method of claim 3, wherein rewriting the query plan of the request further comprises:
determining one or more expressions that are safe and annotating the one or more expressions with their safety properties; and
enabling transformations that allow an expression to be pushed through the boundary of the secure view if it is deemed safe

### Claim 7 (depends on 6)

The method of claim 6, wherein an expression may be deemed safe if the expression is known to produce no errors and the expression does not contain a user defined function (UDF).

### Claim 8 (depends on 1)

The method of claim 1, wherein an underlying detail of the share object comprises one or more of:
a data field of an underlying table of the share object;
a structural element of an underlying table of the share object; or
a quantity of data in an underlying table of the share object.

### Claim 9 (depends on 1)

The method of claim 1, further comprising:
generating, within the second account, an alias object that references the share object; and
linking the alias object to the underlying details, wherein the second account directs the request to access any underlying details of the share object to the alias object and accesses the underlying details using access rights of the share object.

### Claim 10 (depends on 1)

The method of claim 1, wherein granting the second account cross-account access rights to the share object comprises including the second account in a list of accounts having access rights to the share object in the first account.

### Claim 11

A system comprising:
a memory; and
one or more processors, operatively coupled to the memory, the one or more processors to:
associate view privileges of a secure view with one or more of a plurality of underlying details of a share object of a first account such that each of the one or more underlying details of the share object comprises a definition of the secure view; and
in response to receiving a request from a second account to access underlying details of the share object, use a secure projection that does not match any rewrite rule preconditions to rewrite a query plan of the request to prevent expressions that do not originate from the secure view from being pushed down below a boundary of the secure view.

### Claim 12 (depends on 11)

The system of claim 11, wherein the one or more processors are further to:
grant, to the second account, cross-account access rights to the share object in the first account.

### Claim 13 (depends on 11)

The system of claim 11, wherein to rewrite the query plan of the request, the one or more processors are further to:
annotate expressions originating from the secure view to designate them as originating from the secure view, wherein expressions designated as originating from the secure view cannot be combined with expressions that do not originate from the secure view.

### Claim 14 (depends on 13)

The system of claim 13, wherein to rewrite the query plan of the request, the one or more processors are further to:
implement expressions that are not designated as originating from the secure view with the secure projection, wherein the secure projection behaves identically to a standard projection but does not match any rewrite rule preconditions such that relevant rewrites of an expression that do not originate from the secure view are not applied.

### Claim 15 (depends on 11)

The system of claim 11, wherein to rewrite the query plan of the request, the one or more processors are further to:
implement any filter expression by copying the filter expression on pullup through the secure projection such that an original predicate remains below the secure projection to ensure that all security-related filtering occurs before evaluation of any expression outside of the secure view.

### Claim 16 (depends on 13)

The system of claim 13, wherein to rewrite the query plan of the request, the one or more processors are further to:
determine one or more expressions that are safe and annotate the one or more expressions with their safety properties; and
enable transformations that allow an expression to be pushed through the boundary of the secure view if it is deemed safe

### Claim 17 (depends on 16)

The system of claim 16, wherein the one or more processors may determine that an expression is safe if the expression is known to produce no errors and the expression does not contain a user defined function (UDF).

### Claim 18 (depends on 11)

The system of claim 11, wherein an underlying detail of the share object comprises one or more of:
a data field of an underlying table of the share object;
a structural element of an underlying table of the share object; or
a quantity of data in an underlying table of the share object.

### Claim 19 (depends on 11)

The system of claim 11, wherein the one or more processors are further to:
generate, within the second account, an alias object that references the share object; and
link the alias object to the underlying details, wherein the second account directs the request to access any underlying details of the share object to the alias object and accesses the underlying details using access rights of the share object.

### Claim 20 (depends on 11)

The system of claim 11, wherein to grant the second account cross-account access rights to the share object, the one or more processors are to include the second account in a list of accounts having access rights to the share object in the first account.

### Claim 21

A non-transitory computer readable medium having instructions stored thereon which, when executed by one or more processors, cause the one or more processors to:
associate, by the one or more processors, view privileges of a secure view with one or more of a plurality of underlying details of a share object of a first account such that each of the one or more underlying details of the share object comprises a definition of the secure view; and
in response to receiving a request from a second account to access underlying details of the share object, use a secure projection that does not match any rewrite rule preconditions to rewrite a query plan of the request to prevent expressions that do not originate from the secure view from being pushed down below a boundary of the secure view.

### Claim 22 (depends on 21)

The non-transitory computer readable medium of claim 21, wherein the one or more processors are further to:
grant, to the second account, cross-account access rights to the share object in the first account.

### Claim 23 (depends on 21)

The non-transitory computer readable medium of claim 21, wherein to rewrite the query plan of the request, the one or more processors are further to:
annotate expressions originating from the secure view to designate them as originating from the secure view, wherein expressions designated as originating from the secure view cannot be combined with expressions that do not originate from the secure view.

### Claim 24 (depends on 23)

The non-transitory computer readable medium of claim 23, wherein to rewrite the query plan of the request, the one or more processors are further to:
implement expressions that are not designated as originating from the secure view with the secure projection, wherein the secure projection behaves identically to a standard projection but does not match any rewrite rule preconditions such that relevant rewrites of an expression that do not originate from the secure view are not applied.

### Claim 25 (depends on 21)

The non-transitory computer readable medium of claim 21, wherein to rewrite the query plan of the request, the one or more processors are further to:
implement any filter expression by copying the filter expression on pullup through the secure projection such that an original predicate remains below the secure projection to ensure that all security-related filtering occurs before evaluation of any expression outside of the secure view.

### Claim 26 (depends on 23)

The non-transitory computer readable medium of claim 23, wherein to rewrite the query plan of the request, the one or more processors are further to:
determine one or more expressions that are safe and annotate the one or more expressions with their safety properties; and
enable transformations that allow an expression to be pushed through the boundary of the secure view if it is deemed safe

### Claim 27 (depends on 26)

The non-transitory computer readable medium of claim 26, wherein the one or more processors may determine that an expression is safe if the expression is known to produce no errors and the expression does not contain a user defined function (UDF).

### Claim 28 (depends on 21)

The non-transitory computer readable medium of claim 21, wherein an underlying detail of the share object comprises one or more of:
a data field of an underlying table of the share object;
a structural element of an underlying table of the share object; or
a quantity of data in an underlying table of the share object.

### Claim 29 (depends on 21)

The non-transitory computer readable medium of claim 21, wherein the one or more processors are further to:
generate, within the second account, an alias object that references the share object; and
link the alias object to the underlying details, wherein the second account directs the request to access any underlying details of the share object to the alias object and accesses the underlying details using access rights of the share object.

### Claim 30 (depends on 21)

The non-transitory computer readable medium of claim 21, wherein to grant the second account cross-account access rights to the share object, the one or more processors are to include the second account in a list of accounts having access rights to the share object in the first account.
