Skip to content

Commit 0fbc587

Browse files
author
awstools
committed
docs(client-kms): Add HMAC best practice tip, annual rotation of AWS managed keys.
1 parent 61ab9ac commit 0fbc587

18 files changed

+308
-143
lines changed

Diff for: clients/client-kms/README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ Services</a>.</p>
3030
<p>If you need to use FIPS 140-2 validated cryptographic modules when communicating with
3131
Amazon Web Services, use the FIPS endpoint in your preferred Amazon Web Services Region. For more information about the
3232
available FIPS endpoints, see <a href="https://docs.aws.amazon.com/general/latest/gr/kms.html#kms_region">Service endpoints</a> in the Key Management Service topic of the <i>Amazon Web Services General Reference</i>.</p>
33-
<p>Clients must support TLS (Transport Layer Security) 1.0. We recommend TLS 1.2. Clients
33+
<p>All KMS API calls must be signed and be transmitted using Transport Layer Security (TLS).
34+
KMS recommends you always use the latest supported TLS version. Clients
3435
must also support cipher suites with Perfect Forward Secrecy (PFS) such as Ephemeral
3536
Diffie-Hellman (DHE) or Elliptic Curve Ephemeral Diffie-Hellman (ECDHE). Most modern systems
3637
such as Java 7 and later support these modes.</p>

Diff for: clients/client-kms/src/KMS.ts

+98-38
Large diffs are not rendered by default.

Diff for: clients/client-kms/src/KMSClient.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,8 @@ export interface KMSClientResolvedConfig extends KMSClientResolvedConfigType {}
430430
* <p>If you need to use FIPS 140-2 validated cryptographic modules when communicating with
431431
* Amazon Web Services, use the FIPS endpoint in your preferred Amazon Web Services Region. For more information about the
432432
* available FIPS endpoints, see <a href="https://docs.aws.amazon.com/general/latest/gr/kms.html#kms_region">Service endpoints</a> in the Key Management Service topic of the <i>Amazon Web Services General Reference</i>.</p>
433-
* <p>Clients must support TLS (Transport Layer Security) 1.0. We recommend TLS 1.2. Clients
433+
* <p>All KMS API calls must be signed and be transmitted using Transport Layer Security (TLS).
434+
* KMS recommends you always use the latest supported TLS version. Clients
434435
* must also support cipher suites with Perfect Forward Secrecy (PFS) such as Ephemeral
435436
* Diffie-Hellman (DHE) or Elliptic Curve Ephemeral Diffie-Hellman (ECDHE). Most modern systems
436437
* such as Java 7 and later support these modes.</p>

Diff for: clients/client-kms/src/commands/CreateKeyCommand.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,12 @@ export interface CreateKeyCommandOutput extends CreateKeyResponse, __MetadataBea
2121

2222
/**
2323
* <p>Creates a unique customer managed <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#kms-keys">KMS key</a> in your Amazon Web Services account and
24-
* Region. </p>
24+
* Region.</p>
2525
* <p>In addition to the required parameters, you can use the optional parameters to specify a key policy, description, tags, and other useful elements for any key type.</p>
2626
* <note>
2727
* <p>KMS is replacing the term <i>customer master key (CMK)</i> with <i>KMS key</i> and <i>KMS key</i>. The concept has not changed. To prevent breaking changes, KMS is keeping some variations of this term.</p>
2828
* </note>
2929
*
30-
*
3130
* <p>To create different types of KMS keys, use the following guidance:</p>
3231
*
3332
* <dl>
@@ -47,8 +46,8 @@ export interface CreateKeyCommandOutput extends CreateKeyResponse, __MetadataBea
4746
* to determine whether the KMS key will be used to encrypt and decrypt or sign and verify.
4847
* You can't change these properties after the KMS key is created.</p>
4948
* <p>Asymmetric KMS keys contain an RSA key pair or an Elliptic Curve (ECC) key pair. The private key in an asymmetric
50-
* KMS key never leaves AWS KMS unencrypted. However, you can use the <a>GetPublicKey</a> operation to download the public key
51-
* so it can be used outside of AWS KMS. KMS keys with RSA key pairs can be used to encrypt or decrypt data or sign and verify messages (but not both).
49+
* KMS key never leaves KMS unencrypted. However, you can use the <a>GetPublicKey</a> operation to download the public key
50+
* so it can be used outside of KMS. KMS keys with RSA key pairs can be used to encrypt or decrypt data or sign and verify messages (but not both).
5251
* KMS keys with ECC key pairs can be used only to sign and verify messages.
5352
* For information about asymmetric KMS keys, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html">Asymmetric KMS keys</a> in the <i>Key Management Service Developer Guide</i>.</p>
5453
* <p> </p>

Diff for: clients/client-kms/src/commands/DecryptCommand.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export interface DecryptCommandOutput extends DecryptResponse, __MetadataBearer
5353
* asymmetric encryption KMS key. When the KMS key is asymmetric, you must specify the KMS key and the
5454
* encryption algorithm that was used to encrypt the ciphertext. For information about asymmetric KMS keys, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html">Asymmetric KMS keys</a> in the <i>Key Management Service Developer Guide</i>.</p>
5555
* <p>The <code>Decrypt</code> operation also decrypts ciphertext that was encrypted outside of KMS by the
56-
* public key in an KMS asymmetric KMS key. However, it cannot decrypt symmetric ciphertext produced by
56+
* public key in an KMS asymmetric KMS key. However, it cannot decrypt ciphertext produced by
5757
* other libraries, such as the <a href="https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/">Amazon Web Services
5858
* Encryption SDK</a> or <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingClientSideEncryption.html">Amazon S3 client-side encryption</a>.
5959
* These libraries return a ciphertext format that is incompatible with KMS.</p>

Diff for: clients/client-kms/src/commands/DisableKeyRotationCommand.ts

+12-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,18 @@ export interface DisableKeyRotationCommandOutput extends __MetadataBearer {}
2424

2525
/**
2626
* <p>Disables <a href="https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html">automatic
27-
* rotation of the key material</a> for the specified symmetric encryption KMS key.</p>
28-
* <p> You cannot enable automatic rotation of <a href="https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html">asymmetric KMS keys</a>, <a href="https://docs.aws.amazon.com/kms/latest/developerguide/hmac.html">HMAC KMS keys</a>, KMS keys with <a href="https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html">imported key material</a>, or KMS keys in a <a href="https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html">custom key store</a>. To enable or disable automatic rotation of a set of related <a href="https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-manage.html#multi-region-rotate">multi-Region keys</a>, set the property on the primary key. </p>
27+
* rotation of the key material</a> of the specified symmetric encryption KMS key.</p>
28+
* <p>Automatic key rotation is supported only on symmetric encryption KMS keys.
29+
* You cannot enable or disable automatic rotation of <a href="https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html">asymmetric KMS keys</a>, <a href="https://docs.aws.amazon.com/kms/latest/developerguide/hmac.html">HMAC KMS keys</a>, KMS keys with <a href="https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html">imported key material</a>, or KMS keys in a <a href="https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html">custom key store</a>. The key rotation status of these KMS keys is always <code>false</code>.
30+
* To enable or disable automatic rotation of a set of related <a href="https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-manage.html#multi-region-rotate">multi-Region keys</a>, set the property on the primary key.</p>
31+
* <p>You can enable (<a>EnableKeyRotation</a>) and disable automatic rotation of the
32+
* key material in <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk">customer managed KMS keys</a>. Key material rotation of <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk">Amazon Web Services managed KMS keys</a> is not
33+
* configurable. KMS always rotates the key material for every year. Rotation of <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-owned-cmk">Amazon Web Services owned KMS
34+
* keys</a> varies.</p>
35+
* <note>
36+
* <p>In May 2022, KMS changed the rotation schedule for Amazon Web Services managed keys from every
37+
* three years to every year. For details, see <a>EnableKeyRotation</a>.</p>
38+
* </note>
2939
* <p>The KMS key that you use for this operation must be in a compatible key state. For
3040
* details, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html">Key states of KMS keys</a> in the <i>Key Management Service Developer Guide</i>.</p>
3141
* <p>

Diff for: clients/client-kms/src/commands/EnableKeyRotationCommand.ts

+20-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,26 @@ export interface EnableKeyRotationCommandOutput extends __MetadataBearer {}
2424

2525
/**
2626
* <p>Enables <a href="https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html">automatic rotation
27-
* of the key material</a> for the specified symmetric encryption KMS key.</p>
28-
* <p>You cannot enable automatic rotation of <a href="https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html">asymmetric KMS keys</a>, <a href="https://docs.aws.amazon.com/kms/latest/developerguide/hmac.html">HMAC KMS keys</a>, KMS keys with <a href="https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html">imported key material</a>, or KMS keys in a <a href="https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html">custom key store</a>. To enable or disable automatic rotation of a set of related <a href="https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-manage.html#multi-region-rotate">multi-Region keys</a>, set the property on the primary key.</p>
27+
* of the key material</a> of the specified symmetric encryption KMS key. </p>
28+
* <p>When you enable automatic rotation of a<a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk">customer managed KMS key</a>, KMS
29+
* rotates the key material of the KMS key one year (approximately 365 days) from the enable date
30+
* and every year thereafter. You can monitor rotation of the key material for your KMS keys in
31+
* CloudTrail and Amazon CloudWatch. To disable rotation of the key material in a customer
32+
* managed KMS key, use the <a>DisableKeyRotation</a> operation.</p>
33+
* <p>Automatic key rotation is supported only on <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#symmetric-cmks">symmetric encryption KMS keys</a>.
34+
* You cannot enable or disable automatic rotation of <a href="https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html">asymmetric KMS keys</a>, <a href="https://docs.aws.amazon.com/kms/latest/developerguide/hmac.html">HMAC KMS keys</a>, KMS keys with <a href="https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html">imported key material</a>, or KMS keys in a <a href="https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html">custom key store</a>. The key rotation status of these KMS keys is always <code>false</code>.
35+
* To enable or disable automatic rotation of a set of related <a href="https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-manage.html#multi-region-rotate">multi-Region keys</a>, set the property on the primary key. </p>
36+
* <p>You cannot enable or disable automatic rotation <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk">Amazon Web Services managed KMS keys</a>. KMS
37+
* always rotates the key material of Amazon Web Services managed keys every year. Rotation of <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-owned-cmk">Amazon Web Services owned KMS
38+
* keys</a> varies.</p>
39+
* <note>
40+
* <p>In May 2022, KMS changed the rotation schedule for Amazon Web Services managed keys from every three
41+
* years (approximately 1,095 days) to every year (approximately 365 days).</p>
42+
* <p>New Amazon Web Services managed keys are automatically rotated one year after they
43+
* are created, and approximately every year thereafter. </p>
44+
* <p>Existing Amazon Web Services managed keys are automatically rotated one year after
45+
* their most recent rotation, and every year thereafter.</p>
46+
* </note>
2947
* <p>The KMS key that you use for this operation must be in a compatible key state. For
3048
* details, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html">Key states of KMS keys</a> in the <i>Key Management Service Developer Guide</i>.</p>
3149
* <p>

Diff for: clients/client-kms/src/commands/GenerateDataKeyCommand.ts

+5-6
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,14 @@ export interface GenerateDataKeyCommandOutput extends GenerateDataKeyResponse, _
2626
* <p>Returns a unique symmetric data key for use outside of KMS. This operation returns a
2727
* plaintext copy of the data key and a copy that is encrypted under a symmetric encryption KMS
2828
* key that you specify. The bytes in the plaintext key are random; they are not related to the caller or the KMS
29-
* key. You can use the plaintext key to encrypt your data outside of KMS and store the
30-
* encrypted data key with the encrypted data.</p>
29+
* key. You can use the plaintext key to encrypt your data outside of KMS and store the encrypted
30+
* data key with the encrypted data.</p>
3131
*
3232
* <p>To generate a data key, specify the symmetric encryption KMS key that will be used to
3333
* encrypt the data key. You cannot use an asymmetric KMS key to encrypt data keys. To get the
34-
* type of your KMS key, use the <a>DescribeKey</a> operation. You must also specify
35-
* the length of the data key. Use either the <code>KeySpec</code> or <code>NumberOfBytes</code>
36-
* parameters (but not both). For 128-bit and 256-bit data keys, use the <code>KeySpec</code>
37-
* parameter. </p>
34+
* type of your KMS key, use the <a>DescribeKey</a> operation. You must also specify the length of
35+
* the data key. Use either the <code>KeySpec</code> or <code>NumberOfBytes</code> parameters
36+
* (but not both). For 128-bit and 256-bit data keys, use the <code>KeySpec</code> parameter. </p>
3837
*
3938
* <p>To get only an encrypted copy of the data key, use <a>GenerateDataKeyWithoutPlaintext</a>. To generate an asymmetric data key pair, use
4039
* the <a>GenerateDataKeyPair</a> or <a>GenerateDataKeyPairWithoutPlaintext</a> operation. To get a cryptographically secure

Diff for: clients/client-kms/src/commands/GenerateDataKeyPairCommand.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ export interface GenerateDataKeyPairCommandOutput extends GenerateDataKeyPairRes
3636
*
3737
* <p>To generate a data key pair, you must specify a symmetric encryption KMS key to encrypt
3838
* the private key in a data key pair. You cannot use an asymmetric KMS key or a KMS key in a
39-
* custom key store. To get the type and origin of your KMS key, use the <a>DescribeKey</a> operation. </p>
39+
* custom key store. To get the type and origin of your KMS key, use the <a>DescribeKey</a>
40+
* operation. </p>
4041
* <p>Use the <code>KeyPairSpec</code> parameter to choose an RSA or Elliptic Curve (ECC) data
4142
* key pair. KMS recommends that your use ECC key pairs for signing, and use RSA key pairs for
4243
* either encryption or signing, but not both. However, KMS cannot enforce any restrictions on

Diff for: clients/client-kms/src/commands/GenerateDataKeyPairWithoutPlaintextCommand.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ export interface GenerateDataKeyPairWithoutPlaintextCommandOutput
3838
* with the data. When you are ready to decrypt data or sign a message, you can use the <a>Decrypt</a> operation to decrypt the encrypted private key.</p>
3939
* <p>To generate a data key pair, you must specify a symmetric encryption KMS key to encrypt
4040
* the private key in a data key pair. You cannot use an asymmetric KMS key or a KMS key in a
41-
* custom key store. To get the type and origin of your KMS key, use the <a>DescribeKey</a> operation. </p>
41+
* custom key store. To get the type and origin of your KMS key, use the <a>DescribeKey</a>
42+
* operation. </p>
4243
* <p>Use the <code>KeyPairSpec</code> parameter to choose an RSA or Elliptic Curve (ECC) data
4344
* key pair. KMS recommends that your use ECC key pairs for signing, and use RSA key pairs for
4445
* either encryption or signing, but not both. However, KMS cannot enforce any restrictions on

Diff for: clients/client-kms/src/commands/GenerateDataKeyWithoutPlaintextCommand.ts

+9-7
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,21 @@ export interface GenerateDataKeyWithoutPlaintextCommandOutput
3333
* data key. </p>
3434
* <p>This operation is useful for systems that need to encrypt data at some point, but not
3535
* immediately. When you need to encrypt the data, you call the <a>Decrypt</a>
36-
* operation on the encrypted copy of the key. It's also useful in distributed systems with
37-
* different levels of trust. For example, you might store encrypted data in containers. One
38-
* component of your system creates new containers and stores an encrypted data key with each
39-
* container. Then, a different component puts the data into the containers. That component first
40-
* decrypts the data key, uses the plaintext data key to encrypt data, puts the encrypted data
41-
* into the container, and then destroys the plaintext data key. In this system, the component
42-
* that creates the containers never sees the plaintext data key.</p>
36+
* operation on the encrypted copy of the key.</p>
37+
* <p>It's also useful in distributed systems with different levels of trust. For example, you
38+
* might store encrypted data in containers. One component of your system creates new containers
39+
* and stores an encrypted data key with each container. Then, a different component puts the
40+
* data into the containers. That component first decrypts the data key, uses the plaintext data
41+
* key to encrypt data, puts the encrypted data into the container, and then destroys the
42+
* plaintext data key. In this system, the component that creates the containers never sees the
43+
* plaintext data key.</p>
4344
* <p>To request an asymmetric data key pair, use the <a>GenerateDataKeyPair</a> or
4445
* <a>GenerateDataKeyPairWithoutPlaintext</a> operations.</p>
4546
*
4647
* <p>To generate a data key, you must specify the symmetric encryption KMS key that is used to
4748
* encrypt the data key. You cannot use an asymmetric KMS key or a key in a custom key store to generate a data key. To get the
4849
* type of your KMS key, use the <a>DescribeKey</a> operation.</p>
50+
*
4951
* <p>If the operation succeeds, you will find the encrypted copy of the data key in the
5052
* <code>CiphertextBlob</code> field.</p>
5153
*

Diff for: clients/client-kms/src/commands/GenerateMacCommand.ts

+7
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,13 @@ export interface GenerateMacCommandOutput extends GenerateMacResponse, __Metadat
3333
* For details, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/hmac.html">HMAC keys in KMS</a> in the <i>
3434
* <i>Key Management Service Developer Guide</i>
3535
* </i>.</p>
36+
* <note>
37+
* <p>Best practices recommend that you limit the time during which any signing mechanism,
38+
* including an HMAC, is effective. This deters an attack where the actor uses a signed
39+
* message to establish validity repeatedly or long after the message is superseded. HMAC
40+
* tags do not include a timestamp, but you can include a timestamp in the token or message
41+
* to help you detect when its time to refresh the HMAC. </p>
42+
* </note>
3643
* <p>The KMS key that you use for this operation must be in a compatible key state. For
3744
* details, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html">Key states of KMS keys</a> in the <i>Key Management Service Developer Guide</i>.</p>
3845
* <p>

0 commit comments

Comments
 (0)