Skip to content

Commit 611b2e4

Browse files
authored
docs: Update Key IDs and generator sections to reference valid AWS KMS values, additional naming clarity (#123)
1 parent 62a9bd2 commit 611b2e4

File tree

1 file changed

+43
-45
lines changed

1 file changed

+43
-45
lines changed

framework/kms-keyring.md

Lines changed: 43 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,16 @@
55

66
## Version
77

8-
0.2.1
8+
0.2.2
99

1010
### Changelog
1111

12+
- 0.2.2
13+
14+
- Rename Key IDs to [Key Names](#key-names) for increased clarity
15+
- Update [Key Names](#key-names) and [Generator](#generator) sections to reinforce support for all AWS KMS key identifiers
16+
- [Pull request link for discussions](https://github.com/awslabs/aws-encryption-sdk-specification/pull/123)
17+
1218
- 0.2.1
1319

1420
- [Clarify naming of KMS to AWS KMS](https://github.com/awslabs/aws-encryption-sdk-specification/issues/67)
@@ -78,7 +84,7 @@ On keyring initialization, a keyring MUST define the following:
7884

7985
On keyring initialization, a keyring MAY define the following:
8086

81-
- [Key IDs](#key-ids)
87+
- [Key Names](#key-names)
8288
- [Generator](#generator)
8389
- [Grant Tokens](#grant-tokens)
8490

@@ -100,51 +106,42 @@ and MAY return an AWS KMS Client that can make the following API calls in the gi
100106
If the client supplier cannot supply a client for the requested region,
101107
it MUST communicate that fact to the AWS KMS keyring.
102108

103-
### Key IDs
104-
105-
Key IDs is a list of strings identifying AWS KMS CMKs, in ARN format.
106-
This list identifies the CMKs to be used for data key encryption and decryption with this keyring.
109+
### Key Names
107110

108-
Each Key ID MUST be one of the following:
111+
A list of strings identifying the [AWS KMS customer master keys (CMKs)](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id)
112+
that the AWS KMS keyring uses to encrypt and decrypt data keys.
109113

110-
- A CMK [alias](https://docs.aws.amazon.com/kms/latest/developerguide/programming-aliases.html) (e.g. "alias/MyCryptoKey")
111-
- A well-formed key ARN (e.g. arn:aws:kms:us-east-1:999999999999:key/01234567-89ab-cdef-fedc-ba9876543210)
112-
- A well-formed alias ARN (e.g. arn:aws:kms:us-east-1:999999999999:alias/MyCryptoKey)
114+
The AWS KMS keyring accepts any value for a key name that is [accepted by AWS KMS as a key identifer](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id).
115+
The AWS KMS keyring does not validate any value for a key name and passes this information to AWS KMS.
113116

114-
See [AWS Documentation](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-kms).
115-
116-
Note that only key IDs in the key ARN format will ever be used for decryption.
117-
This is because encrypted data keys constructed by the AWS KMS keyring will always store the ID of the
118-
CMK used to encrypt it in key ARN format, and [OnDecrypt](#ondecrypt) checks the key ID against that
117+
Note that only key names in the [key ARN format](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-kms) are used for decryption
118+
because encrypted data keys constructed by the AWS KMS keyring always store the ID of the CMK used to encrypt it in the key ARN format
119+
and [OnDecrypt](#ondecrypt) checks the key name against that
119120
value before attempting decryption.
120121

121-
The AWS KMS CMK specified by the Key ID MUST have
122-
[kms:Encrypt](https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html#AWS-KMS-API-Operations-and-Permissions)
123-
permissions.
122+
The AWS KMS caller
123+
MUST have [kms:Encrypt](https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html#AWS-KMS-API-Operations-and-Permissions) permission
124+
for each AWS KMS CMK specified in the key names.
124125

125126
### Generator
126127

127-
A string that identifies an AWS KMS CMK responsible for generating a data key, as well as encrypting and
128-
decrypting data keys.
129-
The string MUST be one of the following:
130-
131-
- A CMK [alias](https://docs.aws.amazon.com/kms/latest/developerguide/programming-aliases.html) (e.g. "alias/MyCryptoKey")
132-
- A well-formed key ARN (e.g. arn:aws:kms:us-east-1:999999999999:key/01234567-89ab-cdef-fedc-ba9876543210)
133-
- A well-formed alias ARN (e.g. arn:aws:kms:us-east-1:999999999999:alias/MyCryptoKey)
128+
A string that identifies an [AWS KMS customer master key (CMK)](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id)
129+
that the AWS KMS keyring uses to generate, encrypt, and decrypt data keys.
134130

135-
See [AWS Documentation](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-kms).
131+
The AWS KMS keyring accepts any value for a generator that is [accepted by AWS KMS as a key identifer](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id).
132+
The AWS KMS keyring does not validate any value for a generator and passes this information to AWS KMS.
136133

137-
Note that only key IDs in the key ARN format will ever be used for decryption.
138-
This is because encrypted data keys constructed by the AWS KMS keyring will always store the ID of the
139-
CMK used to encrypt it in key ARN format, and [OnDecrypt](#ondecrypt) checks the key ID against that
134+
Note that only generators in the [key ARN format](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-kms) are used for decryption
135+
because encrypted data keys constructed by the AWS KMS keyring always store the ID of the CMK used to encrypt it in the key ARN format
136+
and [OnDecrypt](#ondecrypt) checks the generator against that
140137
value before attempting decryption.
141138

142-
The generator SHOULD NOT be included in the [key IDs](#key-ids), otherwise this CMK will be used
143-
twice to encrypt the plaintext data key.
139+
The generator SHOULD NOT be included in the [key names](#key-names),
140+
otherwise this CMK is used to encrypt the plaintext data key twice.
144141

145-
The AWS KMS CMK specified by the generator MUST have
146-
[kms:GenerateDataKey](https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html#AWS-KMS-API-Operations-and-Permissions)
147-
permissions.
142+
The AWS KMS caller
143+
MUST have [kms:GenerateDataKey](https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html#AWS-KMS-API-Operations-and-Permissions) permission
144+
for the AWS KMS CMK specified by the generator.
148145

149146
### Grant Tokens
150147

@@ -162,10 +159,11 @@ The following is a derived property of the AWS KMS keyring:
162159
### Is Discovery
163160

164161
Indicates whether this keyring is a discovery keyring.
165-
Discovery keyrings do not perform encryption, and on decryption will attempt to decrypt every inputted
166-
[encrypted data key](structures.md#encrypted-data-key) if the client supplier return a client.
162+
Discovery keyrings do not perform encryption and on decryption attempt to decrypt
163+
any [encrypted data key](structures.md#encrypted-data-key) that was encrypted by the AWS KMS keyring,
164+
if the client supplier returns a client.
167165

168-
If this keyring has defined a [generator](#generator) or [key IDs](#key-ids), this value MUST be false.
166+
If this keyring has defined a [generator](#generator) or [key names](#key-names), this value MUST be false.
169167
Otherwise, this value MUST be true.
170168

171169
If this value is true, the keyring MUST only ever call [AWS KMS Decrypt](#aws-kms-decrypt).
@@ -220,17 +218,17 @@ If verified, OnEncrypt MUST do the following with the response from [AWS KMS Gen
220218
- the [key provider id](structures.md#key-provider-id) is "aws-kms".
221219
- the [key provider information](structures.md#key-provider-information) is the response `KeyId`.
222220
Given a plaintext data key in the [encryption materials](structures.md#encryption-materials),
223-
OnEncrypt MUST attempt to encrypt the plaintext data key using each CMK specified in it's [key IDs](#key-ids) list.
221+
OnEncrypt MUST attempt to encrypt the plaintext data key using each CMK specified in its [key names](#key-names) list.
224222

225223
If this keyring's [generator](#generator) is defined and was not used to [generate a data key](#aws-kms-generatedatakey)
226224
as described above, OnEncrypt MUST also attempt to encrypt the plaintext data key using the CMK specified by the [generator](#generator).
227225

228226
To attempt to encrypt the plaintext data key with a particular CMK, OnEncrypt MUST call [AWS KMS Encrypt](#aws-kms-encrypt).
229227

230-
For each [AWS KMS Encrypt](#aws-kms-encrypt) call, if an AWS region can be extracted from the [Key ID](#key-ids), then the
228+
For each [AWS KMS Encrypt](#aws-kms-encrypt) call, if an AWS region can be extracted from the [key name](#key-names), then the
231229
[AWS KMS client](#aws-kms-client) that calls [AWS KMS Encrypt](#aws-kms-encrypt) MUST be the client returned by the
232230
[client supplier](#client-supplier) when given that region as input.
233-
If an AWS region cannot be extracted from the Key ID then the AWS KMS Keyring MUST input a value denoting an unknown region.
231+
If an AWS region cannot be extracted from the key name then the AWS KMS Keyring MUST input a value denoting an unknown region.
234232
If the [client supplier](#client-supplier) does not provide any client
235233
for the given region for this [AWS KMS Encrypt](#aws-kms-encrypt) call,
236234
OnEncrypt MUST NOT modify the [encryption materials](structures.md#encryption-materials)
@@ -277,7 +275,7 @@ in the input encrypted data key list with the following conditions, until it suc
277275

278276
- the [key provider ID](structures.md#key-provider-id) field has the value "aws-kms"
279277
- the [key provider info](structures.md#key-provider-information) has a value equal to one of the
280-
ARNs in this keyring's [key IDs](#key-ids) or the [generator](#generator).
278+
ARNs in this keyring's [key names](#key-names) or the [generator](#generator).
281279

282280
To attempt to decrypt a particular [encrypted data key](structures.md#encrypted-data-key),
283281
OnDecrypt MUST call [AWS KMS Decrypt](#aws-kms-decrypt).
@@ -321,7 +319,7 @@ then OnDecrypt MUST output the unmodified input [decryption materials](structure
321319

322320
### OnEncrypt Goal
323321

324-
When a user configures an AWS KMS keyring with key IDs
322+
When a user configures an AWS KMS keyring with key names
325323
and uses that keyring to encrypt a message,
326324
they are stating their intent that they need each one of those CMKs to be able to
327325
independently decrypt the resulting encrypted message.
@@ -345,12 +343,12 @@ one from CMK A, one from CMK B, and one from CMK C.
345343

346344
When a user configures an AWS KMS keyring for use on decrypt,
347345
they are stating their intent for which CMKs
348-
the keyring will _attempt_ to use to decrypt encrypted data keys.
346+
the keyring _attempts_ to use to decrypt encrypted data keys.
349347

350348
For example, if a user configures an AWS KMS keyring with CMK C (using the CMK ARN)
351349
and uses it to decrypt an encrypted message
352350
that contains encrypted data keys for CMKs A, B, and C,
353-
then the keyring will attempt to decrypt using CMK C.
351+
then the keyring attempts to decrypt using CMK C.
354352

355353
However, if the keyring attempts to decrypt using CMK C and cannot,
356354
this failure still honors the configured intent and MUST NOT halt decryption.
@@ -377,7 +375,7 @@ If the keyring cannot satisfy those requirements it MUST NOT halt message decryp
377375
No keyring can know if it is the last keyring to attempt decryption.
378376
If all keyrings are exhausted and none of them were able to decrypt an encrypted data key
379377
then the cryptographic materials manager that managed those keyrings
380-
will halt message decryption.
378+
halts message decryption.
381379
(See [Default Cryptographic Materials Manager](./default-cmm.md))
382380

383381
### Requirements

0 commit comments

Comments
 (0)