Data encryption at rest for Amazon DataZone - Amazon DataZone

Data encryption at rest for Amazon DataZone

Encryption of data at rest by default helps reduce the operational overhead and complexity involved in protecting sensitive data. At the same time, it enables you to build secure applications that meet strict encryption compliance and regulatory requirements.

Amazon DataZone uses default AWS-owned keys to automatically encrypt your data at rest. You can't view, manage, or audit the use of AWS owned keys. For more information, see AWS owned keys.

While you can't disable this layer of encryption or select an alternate encryption type, you can add a second layer of encryption over the existing AWS owned encryption keys by choosing a customer-managed key when you create your Amazon DataZone domains. Amazon DataZone supports the use of a symmetric customer managed keys that you can create, own, and manage to add a second layer of encryption over the existing AWS owned encryption. Because you have full control of this layer of encryption, in it you can perform the following tasks:

  • Establish and maintain key policies

  • Establish and maintain IAM policies and grants

  • Enable and disable key policies

  • Rotate key cryptographic material

  • Add tags

  • Create key aliases

  • Schedule keys for deletion

For more information, see Customer managed keys.

Note

Amazon DataZone automatically enables encryption at rest using AWS owned keys to protect customer data at no charge.

AWS KMS charges apply for using a customer managed keys. For more information about pricing, see AWS Key Management Service Pricing.

How Amazon DataZone uses grants in AWS KMS

Amazon DataZone requires three grants to use your customer managed key. When you create a Amazon DataZone domain encrypted with a customer managed key, Amazon DataZone creates grants and sub-grants on your behalf by sending CreateGrant requests to AWS KMS. Grants in AWS KMS are used to give Amazon DataZone access to a KMS key in your account. Amazon DataZone creates the following grants to use your customer managed key for the following internal operations:

One grant for encrypting your data at rest for the following operations:

  • Send DescribeKey requests to AWS KMS to verify that the symmetric customer managed KMS key ID entered when creating a Amazon DataZone domain collection is valid.

  • Send GenerateDataKeyrequests to AWS KMS to generate data keys encrypted by your customer managed key.

  • Send Decrypt requests to AWS KMS to decrypt the encrypted data keys so that they can be used to encrypt your data.

  • RetireGrant to retire the grant when domain is deleted.

Two grants for search and discovery of your data:

You can revoke access to the grant, or remove the service's access to the customer managed key at any time. If you do, Amazon DataZone won't be able to access any of the data encrypted by the customer managed key, which affects operations that are dependent on that data. For example, if you attempt to get Data Asset details that Amazon DataZone can't access, then the operation would return an AccessDeniedException error.

Create a customer managed key

You can create a symmetric customer managed key by using the AWS Management Console, or the AWS KMS APIs.

To create a symmetric customer managed key, follow the steps for Creating symmetric customer managed key in the AWS Key Management Service Developer Guide.

Key policy - key policies control access to your customer managed key. Every customer managed key must have exactly one key policy, which contains statements that determine who can use the key and how they can use it. When you create your customer managed key, you can specify a key policy. For more information, see Managing access to customer managed keys in the AWS Key Management Service Developer Guide.

To use your customer managed key with your Amazon DataZone resources, the following API operations must be permitted in the key policy:

  • kms:CreateGrant – adds a grant to a customer managed key. Grants control access to a specified KMS key, which allows access to grant operations Amazon DataZone requires. For more information about Using Grants, see the AWS Key Management Service Developer Guide.

  • kms:DescribeKey – provides the customer managed key details to allow Amazon DataZone to validate the key.

  • kms:GenerateDataKey – returns a unique symmetric data key for use outside of AWS KMS.

  • kms:Decrypt – decrypts ciphertext that was encrypted by a KMS key.

The following are policy statement examples you can add for Amazon DataZone:

"Statement" : [ { "Sid" : "Allow access to principals authorized to manage Amazon DataZone", "Effect" : "Allow", "Principal" : { "AWS" : "arn:aws:iam::<account_id>:root" }, "Action" : [ "kms:DescribeKey", "kms:CreateGrant", "kms:GenerateDataKey", "kms:Decrypt" ], "Resource" : "arn:aws:kms:region:<account_id>:key/key_ID", } ]
Note

Deny on the KMS policy is not applied for the resources accessed through the Amazon DataZone data portal.

For more information about specifying permissions in a policy, see the AWS Key Management Service Developer Guide.

For more information about troubleshooting key access, see the AWS Key Management Service Developer Guide.

Specifying a customer managed key for Amazon DataZone

Amazon DataZone encryption context

An encryption context is an optional set of key-value pairs that contain additional contextual information about the data.

AWS KMS uses the encryption context as additional authenticated data to support authenticated encryption. When you include an encryption context in a request to encrypt data, AWS KMS binds the encryption context to the encrypted data. To decrypt data, you include the same encryption context in the request.

Amazon DataZone uses following encryption context:

"encryptionContextSubset": { "aws:datazone:domainId": "{root-domain-uuid}" }

Using encryption context for monitoring - when you use a symmetric customer managed key to encrypt Amazon DataZone, you can also use the encryption context in audit records and logs to identify how the customer managed key is being used. The encryption context also appears in logs generated by AWS CloudTrail or Amazon CloudWatch Logs.

Using encryption context to control access to your customer managed key - you can use the encryption context in key policies and IAM policies as conditions to control access to your symmetric customer managed key. You can also use encryption context constraints in a grant.

Amazon DataZone uses an encryption context constraint in grants to control access to the customer managed key in your account or region. The grant constraint requires that the operations that the grant allows use the specified encryption context.

The following are example key policy statements to grant access to a customer managed key for a specific encryption context. The condition in this policy statement requires that the grants have an encryption context constraint that specifies the encryption context.

{ "Sid": "Enable DescribeKey", "Effect": "Allow", "Principal": { "AWS": "arn:aws:iam::111122223333:role/ExampleReadOnlyRole" }, "Action": "kms:DescribeKey", "Resource": "*" },{ "Sid": "Enable Decrypt, GenerateDataKey", "Effect": "Allow", "Principal": { "AWS": "arn:aws:iam::111122223333:role/ExampleReadOnlyRole" }, "Action": [ "kms:Decrypt", "kms:GenerateDataKey" ], "Resource": "*", "Condition": { "StringEquals": { "kms:EncryptionContext:aws:datazone:domainId": "{root-domain-uuid}" } } }

Monitoring your encryption keys for Amazon DataZone

When you use an AWS KMS customer managed key with your Amazon DataZone resources, you can use AWS CloudTrail to track requests that Amazon DataZone sends to AWS KMS. The following examples are AWS CloudTrail events for CreateGrant, GenerateDataKey, Decrypt, and DescribeKey to monitor KMS operations called by Amazon DataZone to access data encrypted by your customer managed key. When you use an AWS KMS customer managed key to encrypt your Amazon DataZone domain, Amazon DataZone sends a CreateGrant request on your behalf to access the KMS key in your AWS account. Grants that Amazon DataZone creates are specific to the resource associated with the AWS KMS customer managed key. In addition, Amazon DataZone uses the RetireGrant operation to remove a grant when you delete a domain. The following example event records the CreateGrant operation:

{ "eventVersion": "1.08", "userIdentity": { "type": "AssumedRole", "principalId": "AROAIGDTESTANDEXAMPLE:Sampleuser01", "arn": "arn:aws:sts::111122223333:assumed-role/Admin/Sampleuser01", "accountId": "111122223333", "accessKeyId": "AKIAIOSFODNN7EXAMPLE3", "sessionContext": { "sessionIssuer": { "type": "Role", "principalId": "AROAIGDTESTANDEXAMPLE:Sampleuser01", "arn": "arn:aws:sts::111122223333:assumed-role/Admin/Sampleuser01", "accountId": "111122223333", "userName": "Admin" }, "webIdFederationData": {}, "attributes": { "mfaAuthenticated": "false", "creationDate": "2021-04-22T17:02:00Z" } }, "invokedBy": "datazone.amazonaws.com" }, "eventTime": "2021-04-22T17:07:02Z", "eventSource": "kms.amazonaws.com", "eventName": "CreateGrant", "awsRegion": "us-west-2", "sourceIPAddress": "172.12.34.56", "userAgent": "ExampleDesktop/1.0 (V1; OS)", "requestParameters": { "constraints": { "encryptionContextSubset": { "aws:datazone:domainId": "SAMPLE-root-domain-uuid" } }, "keyId": "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-123456SAMPLE", "operations": [ "Decrypt", "GenerateDataKey", "RetireGrant", "DescribeKey" ], "granteePrincipal": "datazone.us-west-2.amazonaws.com" }, "responseElements": { "grantId": "0ab0ac0d0b000f00ea00cc0a0e00fc00bce000c000f0000000c0bc0a0000aaafSAMPLE", "keyId": "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-123456SAMPLE" }, "requestID": "ff000af-00eb-00ce-0e00-ea000fb0fba0SAMPLE", "eventID": "ff000af-00eb-00ce-0e00-ea000fb0fba0SAMPLE", "readOnly": false, "resources": [ { "accountId": "111122223333", "type": "AWS::KMS::Key", "ARN": "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-123456SAMPLE" } ], "eventType": "AwsApiCall", "managementEvent": true, "eventCategory": "Management", "recipientAccountId": "111122223333" }

Creating Data Lake environments that involve encrypted AWS Glue catalogs

In advanced use cases, when you are working with an AWS Glue catalog that is encrypted, you must grant access to the Amazon DataZone service to use your customer-managed KMS key. You can do this by updating your custom KMS policy and adding a tag to the key. To grant access to the Amazon DataZone service to work with data in an encrypted AWS Glue catalog, complete the following:

  • Add the following policy to your custom KMS key. For more information, see Changing a key policy.

    { "Sid": "Allow datazone environment roles to use the key", "Effect": "Allow", "Principal": { "AWS": "*" }, "Action": [ "kms:Decrypt", "kms:Describe*", "kms:Get*" ], "Resource": "*", "Condition": { "StringLike": { "aws:PrincipalArn": "arn:aws:iam::*:role/*datazone_usr*" } } }
  • Add the following tag to your custom KMS key. For more information, see Using tags to control access to KMS keys.

    key: AmazonDataZoneEnvironment value: all