AWS kms: Add kms:RecipientAttestation:PCR8:ServiceName condition key docs
Summary
Documents a new AWS KMS condition key, kms:RecipientAttestation:PCR8:ServiceName, that gates Decrypt/DeriveSharedSecret/GenerateDataKey/GenerateDataKeyPair/GenerateRandom on the AWS service (Amazon ECS or Amazon EKS) that signed the enclave image file, and updates existing Nitro Enclaves attestation condition key text to also cover Nitro Sandboxes.
Security assessment
The added section documents a new attestation-based authorization condition key that restricts KMS cryptographic operations to requests whose attestation document PCR8 maps to a trusted AWS service (ecs.amazonaws.com / eks.amazonaws.com), and advises using it instead of raw PCR8 to avoid breakage on certificate rotation. This is security best-practice/access-control documentation rather than a fix for a specific vulnerability, so it is not security_issue_related but does add security documentation.
Evidence
+The `kms:RecipientAttestation:PCR8:ServiceName` condition key controls access to `Decrypt`, `DeriveSharedSecret`, `GenerateDataKey`, `GenerateDataKeyPair`, and `GenerateRandom` with a KMS key when the AWS service that signed the enclave image file (EIF) in the signed attestation document matches the service name in the condition key.
Diff
diff --git a/kms/latest/developerguide/conditions-nitro-enclave.md b/kms/latest/developerguide/conditions-nitro-enclave.md index 775c8e5..ceec7d9 100644 --- a//kms/latest/developerguide/conditions-nitro-enclave.md +++ b//kms/latest/developerguide/conditions-nitro-enclave.md @@ -7 +7 @@ -kms:RecipientAttestation:ImageSha384kms:RecipientAttestation:PCR<PCR_ID> +kms:RecipientAttestation:ImageSha384kms:RecipientAttestation:PCR<PCR_ID>kms:RecipientAttestation:PCR8:ServiceName @@ -9 +9 @@ kms:RecipientAttestation:ImageSha384kms:RecipientAttestation:PCR<PCR_ID> -# Condition keys for Nitro Enclaves +# Condition keys for Nitro Enclaves and Nitro Sandboxes @@ -11 +11 @@ kms:RecipientAttestation:ImageSha384kms:RecipientAttestation:PCR<PCR_ID> -The following condition keys are specific to Nitro Enclaves attestation: +The following condition keys are specific to Nitro Enclaves and Nitro Sandboxes attestation: @@ -19 +19 @@ AWS KMS Condition Keys | Condition Type | Value type | API Operations | Policy T -The `kms:RecipientAttestation:ImageSha384` condition key controls access to `Decrypt`, `DeriveSharedSecret`, `GenerateDataKey`, `GenerateDataKeyPair`, and `GenerateRandom` with a KMS key when the image digest from the signed attestation document in the request matches the value in the condition key. The `ImageSha384` value corresponds to PCR0 in the attestation document. This condition key is effective only when the `Recipient` parameter in the request specifies a signed attestation document for an AWS Nitro enclave. +The `kms:RecipientAttestation:ImageSha384` condition key controls access to `Decrypt`, `DeriveSharedSecret`, `GenerateDataKey`, `GenerateDataKeyPair`, and `GenerateRandom` with a KMS key when the image digest from the signed attestation document in the request matches the value in the condition key. The `ImageSha384` value corresponds to PCR0 in the attestation document. This condition key is effective only when the `Recipient` parameter in the request specifies a signed attestation document for an AWS Nitro Enclave or Nitro Sandbox. @@ -21 +21 @@ The `kms:RecipientAttestation:ImageSha384` condition key controls access to `Dec -This value is also included in [CloudTrail events](./ct-nitro-enclave.html) for requests to AWS KMS for Nitro enclaves. +This value is also included in [CloudTrail events](./ct-nitro-enclave.html) for requests to AWS KMS for Nitro Enclaves and Nitro Sandboxes. @@ -23 +23 @@ This value is also included in [CloudTrail events](./ct-nitro-enclave.html) for -For example, the following key policy statement allows the `data-processing` role to use the KMS key for [Decrypt](https://docs.aws.amazon.com/kms/latest/APIReference/API_Decrypt.html), [DeriveSharedSecret](https://docs.aws.amazon.com/kms/latest/APIReference/API_DeriveSharedSecret), [GenerateDataKey](https://docs.aws.amazon.com/kms/latest/APIReference/API_GenerateDataKey.html), [GenerateDataKeyPair](https://docs.aws.amazon.com/kms/latest/APIReference/API_GenerateDataKeyPair.html), and [GenerateRandom](https://docs.aws.amazon.com/kms/latest/APIReference/API_GenerateRandom.html) operations. The `kms:RecipientAttestation:ImageSha384` condition key allows the operations only when the image digest value (PCR0) of the attestation document in the request matches the image digest value in the condition. This condition key is effective only when the `Recipient` parameter in the request specifies a signed attestation document for an AWS Nitro enclave. +For example, the following key policy statement allows the `data-processing` role to use the KMS key for [Decrypt](https://docs.aws.amazon.com/kms/latest/APIReference/API_Decrypt.html), [DeriveSharedSecret](https://docs.aws.amazon.com/kms/latest/APIReference/API_DeriveSharedSecret), [GenerateDataKey](https://docs.aws.amazon.com/kms/latest/APIReference/API_GenerateDataKey.html), [GenerateDataKeyPair](https://docs.aws.amazon.com/kms/latest/APIReference/API_GenerateDataKeyPair.html), and [GenerateRandom](https://docs.aws.amazon.com/kms/latest/APIReference/API_GenerateRandom.html) operations. The `kms:RecipientAttestation:ImageSha384` condition key allows the operations only when the image digest value (PCR0) of the attestation document in the request matches the image digest value in the condition. This condition key is effective only when the `Recipient` parameter in the request specifies a signed attestation document for an AWS Nitro Enclave or Nitro Sandbox. @@ -25 +25 @@ For example, the following key policy statement allows the `data-processing` rol -If the request does not include a valid attestation document from an AWS Nitro enclave, permission is denied because this condition is not satisfied. +If the request does not include a valid attestation document from an AWS Nitro Enclave or Nitro Sandbox, permission is denied because this condition is not satisfied. @@ -29 +29 @@ If the request does not include a valid attestation document from an AWS Nitro e - "Sid" : "Enable enclave data processing", + "Sid" : "Enable Enclave data processing", @@ -55 +55 @@ AWS KMS Condition Keys | Condition Type | Value type | API Operations | Policy T -The `kms:RecipientAttestation:PCR<PCR_ID>` condition key controls access to `Decrypt`, `DeriveSharedSecret`, `GenerateDataKey`, `GenerateDataKeyPair`, and `GenerateRandom` with a KMS key only when the platform configuration registers (PCRs) from the signed attestation document in the request match the PCRs in the condition key. This condition key is effective only when the `Recipient` parameter in the request specifies a signed attestation document from an AWS Nitro enclave. +The `kms:RecipientAttestation:PCR<PCR_ID>` condition key controls access to `Decrypt`, `DeriveSharedSecret`, `GenerateDataKey`, `GenerateDataKeyPair`, and `GenerateRandom` with a KMS key only when the platform configuration registers (PCRs) from the signed attestation document in the request match the PCRs in the condition key. This condition key is effective only when the `Recipient` parameter in the request specifies a signed attestation document from an AWS Nitro Enclave or Nitro Sandbox. @@ -57 +57 @@ The `kms:RecipientAttestation:PCR<PCR_ID>` condition key controls access to `Dec -This value is also included in [CloudTrail events](./ct-nitro-enclave.html) that represent requests to AWS KMS for Nitro enclaves. +This value is also included in [CloudTrail events](./ct-nitro-enclave.html) that represent requests to AWS KMS for Nitro Enclaves and Nitro Sandboxes. @@ -59 +59 @@ This value is also included in [CloudTrail events](./ct-nitro-enclave.html) that -To specify a PCR value, use the following format. Concatenate the PCR ID to the condition key name. You can specify a PCR ID that identifies one of the [six enclave measurements](https://docs.aws.amazon.com/enclaves/latest/user/set-up-attestation.html#where) or a custom PCR ID that you defined for a specific use case. The PCR value must be a lower-case hexadecimal string of up to 96 bytes. +To specify a PCR value, use the following format. Concatenate the PCR ID to the condition key name. You can specify a PCR ID that identifies one of the [six Enclave measurements](https://docs.aws.amazon.com/enclaves/latest/user/set-up-attestation.html#where) or a custom PCR ID that you defined for a specific use case. The PCR value must be a lower-case hexadecimal string of up to 96 bytes. @@ -64 +64 @@ To specify a PCR value, use the following format. Concatenate the PCR ID to the -For example, the following condition key specifies a particular value for PCR1, which corresponds to the hash of the kernel used for the enclave and the bootstrap process. +For example, the following condition key specifies a particular value for PCR1, which corresponds to the hash of the kernel used for the Enclave and the bootstrap process. @@ -77 +77 @@ If the request does not include an attestation document, permission is denied be - "Sid" : "Enable enclave data processing", + "Sid" : "Enable Enclave data processing", @@ -90,0 +91,41 @@ If the request does not include an attestation document, permission is denied be +## kms:RecipientAttestation:PCR8:ServiceName + +AWS KMS Condition Keys | Condition Type | Value type | API Operations | Policy Type +---|---|---|---|--- +`kms:RecipientAttestation:PCR8:ServiceName` | String | Single-valued | `Decrypt` `DeriveSharedSecret` `GenerateDataKey` `GenerateDataKeyPair` `GenerateRandom` | Key policies and IAM policies + +The `kms:RecipientAttestation:PCR8:ServiceName` condition key controls access to `Decrypt`, `DeriveSharedSecret`, `GenerateDataKey`, `GenerateDataKeyPair`, and `GenerateRandom` with a KMS key when the AWS service that signed the enclave image file (EIF) in the signed attestation document matches the service name in the condition key. + +PCR8 of the attestation document records the hash of the EIF signing certificate. AWS KMS maintains a mapping of PCR8 values to AWS service names and populates this condition key with the matching service name. The possible values are: + + * `ecs.amazonaws.com` for EIFs signed by Amazon ECS + + * `eks.amazonaws.com` for EIFs signed by Amazon EKS + + + + +This condition key is effective only when the `Recipient` parameter in the request specifies a signed attestation document from an AWS Nitro Enclave or Nitro Sandbox, and PCR8 in that attestation document matches a registered value. Otherwise, AWS KMS does not populate this condition key. + +When the EIF is signed by an AWS service, use this condition key instead of `kms:RecipientAttestation:PCR8` to avoid breakage when the service rotates its signing certificate. + +This value is also included in [CloudTrail events](./ct-nitro-enclave.html) for requests to AWS KMS for Nitro Enclaves and Nitro Sandboxes. + +For example, the following key policy statement allows the `data-processing` role to use the KMS key for the [Decrypt](https://docs.aws.amazon.com/kms/latest/APIReference/API_Decrypt.html) operation. The `kms:RecipientAttestation:PCR8:ServiceName` condition key allows the operation only when the EIF signing certificate in the attestation document is registered to Amazon ECS. Use the `StringEquals` policy operator for an exact match on the service name. If the request does not include a valid attestation document from an AWS Nitro Enclave or Nitro Sandbox, or if PCR8 is not registered to the specified service name, permission is denied because this condition is not satisfied. + + + { + "Sid" : "Enable attested data processing for an Enclave signed by Amazon ECS", + "Effect" : "Allow", + "Principal" : { + "AWS" : "arn:aws:iam::111122223333:role/data-processing" + }, + "Action": "kms:Decrypt", + "Resource" : "*", + "Condition": { + "StringEquals": { + **"kms:RecipientAttestation:PCR8:ServiceName": "ecs.amazonaws.com"** + } + } + } +