Skip to content

Commit f52bd61

Browse files
committed
fix comments/docstring
1 parent 0cde002 commit f52bd61

File tree

2 files changed

+47
-1
lines changed

2 files changed

+47
-1
lines changed

Examples/runtimes/python/DynamoDBEncryption/src/keyring/hierarchical_keyring_example/with_encrypted_client.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,29 @@
99
These branch keys are used to protect your data keys,
1010
and these branch keys are themselves protected by a root KMS Key.
1111
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+
1235
Running this example requires access to the DDB Table whose name
1336
is provided in CLI arguments.
1437
This table must be configured with the following

Examples/runtimes/python/DynamoDBEncryption/src/keyring/hierarchical_keyring_example/with_encrypted_table.py

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,35 @@
33
"""
44
Example demonstrating DynamoDb Encryption using a Hierarchical Keyring with EncryptedTable.
55
6-
This example sets up DynamoDb Encryption for the AWS SDK table
6+
This example sets up DynamoDb Encryption for the AWS SDK client
77
using the Hierarchical Keyring, which establishes a key hierarchy
88
where "branch" keys are persisted in DynamoDb.
99
These branch keys are used to protect your data keys,
1010
and these branch keys are themselves protected by a root KMS Key.
1111
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+
1235
Running this example requires access to the DDB Table whose name
1336
is provided in CLI arguments.
1437
This table must be configured with the following

0 commit comments

Comments
 (0)