fbpx

In AWS Clean Rooms, share and question encrypted data.

We’d prefer to introduce you to AWS Clean Rooms‘ crypto technology feature in this post. Customers can conduct creative data-query sessions on sensitive data sets that are stored in various AWS accounts with the help of AWS Clean Rooms without having to discuss, index, or replicate the data. Customers’ data is blockchain protected even when it is being processed by an AWS Clean Rooms partnership when they also use the crypto technology feature.

 <p>Where would AWS Clean Rooms be useful? Consider a scenario where two different insurance companies want to identify duplicate claims so they can identify potential fraud. This would be simple if they could compare their claims with each other, but they might not be able to do so due to privacy constraints.</p> <p>Alternately, consider an advertising network and a client that want to measure the effectiveness of an advertising campaign. To that end, they would like to know how many of the people who saw the campaign (<em>exposures</em>) went on to make a purchase from the client (<em>purchasers</em>). However, confidentiality concerns might prevent the advertising network from sharing their list of exposures with the client or prevent the client from sharing their list of purchasers with the advertising network.</p> <p>As these examples show, there can be many situations in which different organizations want to collaborate on a joint analysis of their pooled data, but cannot share their individual datasets directly. One solution to this problem is a <em>data clean room</em>, which is a service trusted by a collaboration’s participants to do the following:</p> <ul> <li>Hold the data of individual parties</li> <li>Enforce access-control rules that collaborators specify regarding their data</li> <li>Perform analyses over the pooled data</li> </ul> <p>To serve customers with these needs, AWS recently launched a new data clean-room service called <a href="https://aws.amazon.com/clean-rooms/" target="_blank" rel="noopener">AWS Clean Rooms</a>. This service provides AWS customers with a way to collaboratively analyze data (stored in other AWS services as SQL tables) without having to replicate the data, move the data outside of the AWS Cloud, or allow their collaborators to see the data itself.</p> <p>Additionally, AWS Clean Rooms provides a feature that gives customers even more control over their data: <a href="https://aws.amazon.com/security/cryptographic-computing/" target="_blank" rel="noopener">cryptographic computing</a>. This feature allows AWS Clean Rooms to operate over data that customers encrypt themselves and that the service cannot actually read. Specifically, customers can use this feature to select which portions of their data should be encrypted and to encrypt that data themselves. Collaborators can continue to analyze that data as if it were in the clear, however, even though the data in question remains encrypted while it is being processed in AWS Clean Rooms collaborations. In this way, customers can use AWS Clean Rooms to securely collaborate on data they may not have been able to share due to internal policies or regulations.</p> <h2>Cryptographic computing</h2> <p>Using the cryptographic computing feature of AWS Clean Rooms involves these steps:</p> <ul> <li>Users create AWS Clean Rooms collaborations and set collaboration-wide encryption settings. They then invite collaborators to support the analysis process.</li> <li>Outside of AWS Clean Rooms, those collaborators agree on a shared secret: a common, secret, cryptographic key.</li> <li>Collaborators individually encrypt their tables outside of the AWS Cloud (typically on their own premises) using the shared secret, the collaboration ID of the intended collaboration, and the Cryptographic Computing for Clean Rooms (C3R) encryption client (which AWS provides as an open-source package). Collaborators then provide the encrypted tables to AWS Clean Rooms, just as they would have provided plaintext tables.</li> <li>Collaborators continue to use AWS Clean Rooms for their data analysis. They impose access-control rules on their tables, submit SQL queries over the tables in the collaboration, and retrieve results.</li> <li>These results might contain encrypted columns, and so collaborators decrypt the results by using the shared secret and the C3R encryption client.</li> </ul> <p>As a result, data that enters AWS Clean Rooms in encrypted format will remain encrypted from input tables to intermediate values to result sets. AWS Clean Rooms will be unable to decrypt or read the data even while performing the queries.</p> <blockquote> <p><strong>Note:</strong> For those interested in the academic aspects of this process, the cryptographic computing feature of AWS Clean Rooms is based on <em>server-aided private set intersection (PSI)</em>. Server-aided PSI allows two or more participants to submit sets of values to a server and learn which elements are found in all sets, but without (1) allowing the participants to learn anything about the other (non-shared) elements, or (2) allowing the server to learn anything about the underlying data (aside from the degrees to which the sets overlap). PSI is just one example of the field of cryptographic computing, which provides a variety of new methods by which encrypted data can be processed for various purposes and without decryption. These techniques allow our customers to use the scale and power of AWS systems on data that AWS will not be able to read. See our <a href="https://aws.amazon.com/security/cryptographic-computing/" target="_blank" rel="noopener">Cryptographic Computing</a> webpage for more about our work in this area.</p> </blockquote> <p>Let’s dive deeper into each new step in the process for using cryptographic computing in AWS Clean Rooms.</p> <p><strong>Key agreement.</strong> Each collaboration needs its own shared secret: a secure cryptographic secret (of at least 256 bits). Customers sometimes have a regulatory need to maintain ownership of their encryption keys. Therefore, the cryptographic computing feature supports the case where customers generate, distribute, and store their collaboration’s secret themselves. In this way, customers’ encryption keys are never stored on an AWS system.</p> <p><strong>Encryption.</strong> AWS Clean Rooms allows table owners to control how tables are encrypted on a column-by-column basis. In particular, each column in an encrypted table will be one of three types: cleartext, sealed, or fingerprint. These types map directly to both how columns are used in queries and how they are protected with cryptography, described as follows:</p> <ul> <li>Cleartext columns are not cryptographically processed at all. They are copied to encrypted tables verbatim, and can be used anywhere in a SQL query.</li> <li>Sealed columns are encrypted. The encryption scheme used (AES-GCM) is randomized, meaning that encrypting the same value multiple times yields different ciphertexts each time. This helps prevent the statistical analysis of these columns, but also means that these columns cannot be used in <span>JOIN</span> clauses. They can be used in <span>SELECT</span> clauses, however, which allows them to appear in query results.</li> <li>Fingerprint columns are hashed using the Hash-based Message Authentication Code (HMAC) algorithm. There is no way to decrypt these values, and therefore no reason for them to appear in the <span>SELECT</span> clause of a query. They can, however, be used in <span>JOIN</span> clauses: HMAC will map a given value to the same fingerprint every time, meaning that <span>JOINs</span> will be able to unify common values across different fingerprint columns.</li> </ul> <p><strong>Encryption settings.</strong> This last point—that fingerprint values will always map a given plaintext value to the same fingerprint—might give pause to some readers. If this is true, won’t the encrypted table be vulnerable to statistical analysis? That is absolutely correct: it will. For this reason, users might wish to set collaboration-wide encryption settings to control these forms of analysis.</p> <p>To see how statistical analysis might be a concern, imagine a table where one fingerprint column is named <span>US_State</span>. In this case, a simple frequency analysis will reverse-engineer the plaintext values relatively quickly: the most common fingerprint is almost certain to be “California”, followed by “Texas”, “Florida”, and so on. Also, imagine that the same table has another fingerprint column called <span>US_City</span>, and that a given fingerprint appears in both columns. In that case, the fingerprint in question is almost certain to be “New York”. If a row has a fingerprint in the <span>US_City</span> column but a <span>NULL</span> in the <span>US_State</span> column, furthermore, it’s very likely that the fingerprint is for “District of Columbia”. And finally, imagine that the table has a cleartext column called <span>Time_Zone</span>. In this case, values of “HST” (Hawaii standard time) or “AKST” (Alaska standard time) reveal the value in the <span>US_State</span> column regardless of the cryptography.</p> <p>Not all datasets will be vulnerable to these kinds of statistical analysis, but some will. Only customers can determine which types of analysis may reveal their data and which may not. Because of this, the cryptographic computing feature allows the customer to decide which protections will be needed. At the time of collaboration creation, that is, the creator of the AWS Clean Rooms collaboration can configure the following collaboration-wide encryption settings:</p> <ul> <li>Whether or not fingerprint columns can contain duplicate plaintext values (addressing the “California” example)</li> <li>Whether or not fingerprint columns with different names should fingerprint values in the same way (addressing the “New York” example)</li> <li>Whether or not <span>NULL</span> values in the plaintext table should be left as <span>NULL</span> in the encrypted table (addressing the “District of Columbia” example)</li> <li>Whether or not encrypted tables should be allowed to have cleartext columns at all (addressing the time zone example)</li> </ul> <p>Security is maximized when all of these options are set to “no,” but each “no” will limit the queries that C3R will be able to support. For example, the choice of whether or not encrypted tables should be allowed to have cleartext columns will determine which <span>WHERE</span> clauses will be supported: If cleartext columns are not supported, then the <span>Time_Zone</span> column must be cryptographically processed — meaning that the clause <span>WHERE Time_Zone=”EST”</span> will not act as intended. There might be reasons to set these options to “yes” in order to enable a wider variety of queries, which we discuss in the Query behavior section later in this post.</p> <p><strong>Decryption.</strong> AWS Clean Rooms will write query results to an <a href="https://aws.amazon.com/s3/" target="_blank" rel="noopener">Amazon Simple Storage Service (Amazon S3)</a> bucket. The recipient copies these results from the bucket to some on-premises storage and then runs the C3R encryption client. The client will find encrypted elements of the output and decrypt them. Note that the client can only decrypt elements from sealed columns. If the output contains elements from a fingerprint column, the client will warn you, but will also leave these elements untouched, as cryptographic fingerprints can’t be decrypted.</p> <p>Having finished our overview, let’s return to the discussion regarding how encryption can affect the behavior of queries.</p> <h2>Query behavior</h2> <p>Implicit in the discussion so far is something worth calling out explicitly: AWS Clean Rooms runs queries over the data that is provided to it. If the data given to AWS Clean Rooms is encrypted, therefore, queries will be run on the ciphertexts and not the plaintexts. This will not affect the results returned, so long as the columns are used for their intended purposes:</p> <ul> <li>Fingerprint columns are used in <span>JOIN</span> clauses</li> <li>Sealed columns are used in <span>SELECT</span> clauses</li> </ul> <p>(Cleartext columns can be used anywhere.) Queries might produce unexpected results, however, if the columns are used outside of their intended purposes:</p> <ul> <li>Sometimes queries will fail when they would have succeeded on the plaintext. For example, ciphertexts and fingerprints will be string values, even if the original plaintext values were another type. Therefore, <span>SUM()</span> or <span>AVG()</span> calls on fingerprint or sealed columns will yield errors even if the corresponding plaintext columns were numeric.</li> <li>Sometimes queries will omit results that would have been found by querying the plaintext. For example, attempting to <span>JOIN</span> on sealed columns will yield empty result sets: no two ciphertexts will be the same, even if they encrypt the same plaintext value. (Also, performing a <span>JOIN</span> on fingerprint columns with different names will exhibit the same behavior, if the collaboration-wide encryption settings specified that fingerprint columns of different names should fingerprint values differently.)</li> <li>Sometimes results will include rows that would not be found by querying the plaintext. As mentioned, ciphertexts and fingerprints will be string values—base64 encodings of random-looking bytes, specifically. This means that a clause such as <span>WHERE ‘US_State’ CONTAINS ‘CA’</span> will match some ciphertexts or fingerprints even when they would not match the plaintext.</li> </ul> <p>To avoid these issues, fingerprint and sealed columns should only be used for their intended purposes (<span>JOIN</span> and <span>SELECT</span> clauses, respectively).</p> <h2>Conclusion</h2> <p>In this blog post, you have learned how <a href="https://aws.amazon.com/clean-rooms/" target="_blank" rel="noopener">AWS Clean Rooms</a> can help you harness the power of AWS services to query and analyze your most-sensitive data. By using cryptographic computing, you can work with collaborators to perform joint analyses over pooled data without sharing your “raw” data with each other—or with AWS. If you believe that you can benefit from cryptographic computing (in AWS Clean Rooms or elsewhere), we’d like to hear from you. Please <a href="https://aws.amazon.com/contact-us/" target="_blank" rel="noopener">contact us</a> with any questions or feedback. Also, we invite you to learn more about <a href="https://aws.amazon.com/clean-rooms/" target="_blank" rel="noopener">AWS Clean Rooms</a> (including its use of cryptographic computing). Finally, the C3R client is open source, and can be downloaded from its <a href="https://github.com/aws/c3r" target="_blank" rel="noopener">GitHub page</a>.</p> <p> <br>If you have feedback about this post, submit comments in the<strong> Comments</strong> section below. If you have questions about this post, <a href="https://console.aws.amazon.com/support/home" target="_blank" rel="noopener noreferrer">contact AWS Support</a>.</p> <p><strong>Want more AWS Security news? Follow us on <a title="Twitter" href="https://twitter.com/AWSsecurityinfo" target="_blank" rel="noopener noreferrer">Twitter</a>.</strong></p> <!-- '"` -->