使用伺服器端加密的 Amazon S3 儲存貯體 - FSx為了光澤

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

使用伺服器端加密的 Amazon S3 儲存貯體

FSx為 Lustre 支援 Amazon S3 儲存貯體,這些儲存貯體使用伺服器端加密搭配 S3 受管金鑰 (SSE-S3),並 AWS KMS keys 存放於 (-)。 AWS Key Management Service SSE KMS

如果您希FSx望 Amazon 在寫入 S3 儲存貯體時加密資料,則需要將 S3 儲存貯體上的預設加密設定為 SSE-S3 或 SSE-KMS。如需詳細資訊,請參Amazon S3 使用者指南中的設定預設加密。將檔案寫入 S3 儲存貯體時,Amazon 會FSx遵循 S3 儲存貯體的預設加密政策。

根據預設,Amazon FSx 支援使用 SSE-S3 加密的 S3 儲存貯體。如果您想要將 Amazon FSx 檔案系統連結到使用 SSE-KMS 加密加密的 S3 儲存貯體,則需要在客戶受管金鑰政策中新增一份聲明,以允許 Amazon FSx 使用您的金KMS鑰加密和解密 S3 儲存貯體中的物件。

下列陳述式允許特定 Amazon FSx 檔案系統加密和解密特定 S3 儲存貯體的物件:bucket_name.

{ "Sid": "Allow access through S3 for the FSx SLR to use the KMS key on the objects in the given S3 bucket", "Effect": "Allow", "Principal": { "AWS": "arn:aws:iam::aws_account_id:role/aws-service-role/s3.data-source.lustre.fsx.amazonaws.com/AWSServiceRoleForFSxS3Access_fsx_file_system_id" }, "Action": [ "kms:Encrypt", "kms:Decrypt", "kms:ReEncrypt*", "kms:GenerateDataKey*", "kms:DescribeKey" ], "Resource": "*", "Condition": { "StringEquals": { "kms:CallerAccount": "aws_account_id", "kms:ViaService": "s3.bucket-region.amazonaws.com" }, "StringLike": { "kms:EncryptionContext:aws:s3:arn": "arn:aws:s3:::bucket_name/*" } } }
注意

如果您使用KMS與 a CMK 在啟用 S3 儲存貯體金鑰的情況下加密 S3 儲存貯體,請設定EncryptionContext為儲存貯ARN體而不是物件ARN,如下列範例所示:

"StringLike": { "kms:EncryptionContext:aws:s3:arn": "arn:aws:s3:::bucket_name" }

以下政策聲明允許您帳戶中的所有 Amazon FSx 檔案系統連結到特定的 S3 儲存貯體。

{ "Sid": "Allow access through S3 for the FSx SLR to use the KMS key on the objects in the given S3 bucket", "Effect": "Allow", "Principal": { "AWS": "*" }, "Action": [ "kms:Encrypt", "kms:Decrypt", "kms:ReEncrypt*", "kms:GenerateDataKey*", "kms:DescribeKey" ], "Resource": "*", "Condition": { "StringEquals": { "kms:CallerAccount": "aws_account_id", "kms:ViaService": "s3.bucket-region.amazonaws.com" }, "StringLike": { "aws:userid": "*:FSx", "kms:EncryptionContext:aws:s3:arn": "arn:aws:s3:::bucket_name/*" } } }

存取不同 AWS 帳戶 或共用的伺服器端加密 Amazon S3 儲存貯體 VPC

建立連結至加密 Amazon S3 儲存貯體的 FSx for Lustre 檔案系統後,您必須先授與AWSServiceRoleForFSxS3Access_fs-01234567890服務連結角色 (SLR) 存取權限,才能從連結的 S3 儲存貯體讀取或寫入資料。KMS您可以使用已經擁有KMS金鑰權限的IAM角色。

注意

此IAM角色必須在建立 Lustre 檔案系統所在的帳戶中 (與 S3 相同的帳戶SLR),而不是 KMS KEY/S3 儲存貯體所屬的帳戶中。FSx

您可以使用此IAM角色呼叫下列項目 AWS KMS API來建立 S3 授權,SLR以便取SLR得 S3 物件的權限。若要尋找與您相ARN關聯的SLR,請使用檔案系統 ID 作為搜尋字串來搜尋您的IAM角色。

$ aws kms create-grant --region fs_account_region \ --key-id arn:aws:kms:s3_bucket_account_region:s3_bucket_account:key/key_id \ --grantee-principal arn:aws:iam::fs_account_id:role/aws-service-role/s3.data-source.lustre.fsx.amazonaws.com/AWSServiceRoleForFSxS3Access_file-system-id \ --operations "Decrypt" "Encrypt" "GenerateDataKey" "GenerateDataKeyWithoutPlaintext" "CreateGrant" "DescribeKey" "ReEncryptFrom" "ReEncryptTo"

如需服務連結角色的詳細資訊,請參閱使用 Amazon FSx 的服務連結角色