|
3 | 3 | """
|
4 | 4 | Example demonstrating DynamoDb Encryption using a Hierarchical Keyring with EncryptedTable.
|
5 | 5 |
|
6 |
| -This example sets up DynamoDb Encryption for the AWS SDK table |
| 6 | +This example sets up DynamoDb Encryption for the AWS SDK client |
7 | 7 | using the Hierarchical Keyring, which establishes a key hierarchy
|
8 | 8 | where "branch" keys are persisted in DynamoDb.
|
9 | 9 | These branch keys are used to protect your data keys,
|
10 | 10 | and these branch keys are themselves protected by a root KMS Key.
|
11 | 11 |
|
| 12 | +Establishing a key hierarchy like this has two benefits: |
| 13 | +
|
| 14 | +First, by caching the branch key material, and only calling back |
| 15 | +to KMS to re-establish authentication regularly according to your configured TTL, |
| 16 | +you limit how often you need to call back to KMS to protect your data. |
| 17 | +This is a performance/security tradeoff, where your authentication, audit, and |
| 18 | +logging from KMS is no longer one-to-one with every encrypt or decrypt call. |
| 19 | +However, the benefit is that you no longer have to make a |
| 20 | +network call to KMS for every encrypt or decrypt. |
| 21 | +
|
| 22 | +Second, this key hierarchy makes it easy to hold multi-tenant data |
| 23 | +that is isolated per branch key in a single DynamoDb table. |
| 24 | +You can create a branch key for each tenant in your table, |
| 25 | +and encrypt all that tenant's data under that distinct branch key. |
| 26 | +On decrypt, you can either statically configure a single branch key |
| 27 | +to ensure you are restricting decryption to a single tenant, |
| 28 | +or you can implement an interface that lets you map the primary key on your items |
| 29 | +to the branch key that should be responsible for decrypting that data. |
| 30 | +
|
| 31 | +This example then demonstrates configuring a Hierarchical Keyring |
| 32 | +with a Branch Key ID Supplier to encrypt and decrypt data for |
| 33 | +two separate tenants. |
| 34 | +
|
12 | 35 | Running this example requires access to the DDB Table whose name
|
13 | 36 | is provided in CLI arguments.
|
14 | 37 | This table must be configured with the following
|
|
0 commit comments