简体   繁体   English

如何使用简单的 s3 存储桶策略授予对加密存储桶的跨账户访问权限?

[英]How do I grant cross account access to an encrypted bucket with a simple s3 bucket policy?

I have an encrypted s3 bucket我有一个加密的 s3 存储桶

I want to give another account access to this bucket我想授予另一个帐户访问此存储桶的权限

Normally I would just do this:通常我会这样做:

  {
     "Sid":"get",
     "Effect":"Allow",
     "Principal":{
        "AWS":"arn:aws:iam::99999999999:root"
     },
     "Action":[
        "s3:Get*",
     ],
     "Resource":[
        "arn:aws:s3:::my-bucket/*",
     ]
  },

But this bucket is encrypted and they get this error:但是这个桶是加密的,他们得到这个错误:

upload failed: ./test to s3://my-bucket/test An error occurred (KMS.NotFoundException) when calling the PutObject operation: Key 'arn:aws:kms:us-east-1:99999999999:key/blahbalbhablhalbhalbh' does not exist

Looks like they need KMS access?看起来他们需要 KMS 访问权限? I can give their account access to the kms key with the kms policy and that will fix it?我可以使用 kms 策略让他们的帐户访问 kms 密钥,这会解决问题吗? If so I need to create a custom key to edit the policy right?如果是这样,我需要创建一个自定义密钥来编辑策略吗? I want to assign their account ID access to the encrypted bucket directly我想直接将他们的帐户 ID 访问权限分配给加密的存储桶

You're on the right path!你走在正确的道路上! You need to create a customer managed KMS key (CMK) and update the KMS key policy to use the key for decryption.您需要创建客户管理的 KMS 密钥 (CMK) 并更新 KMS 密钥策略以使用该密钥进行解密。 Use that encryption key when you put items in the bucket.将项目放入存储桶时使用该加密密钥。 Make sure the KMS policy is least privilege!确保 KMS 策略是最小权限!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 为什么我的 S3 存储桶策略拒绝跨账户访问? - Why is my S3 bucket policy denying cross account access? 适用于跨账户访问的AWS S3存储桶控制策略 - AWS S3 bucket control policy for cross-account access 如何使用 IAM 策略 AWS 仅向根账户用户授予对 S3 存储桶的访问权限? - How to grant access only to the Root Account User for an S3 bucket with IAM Policy AWS? 如何授予我的 aws sftp 服务器访问另一个 AWS 账户中的 Amazon S3 存储桶的权限? - How can I grant my aws sftp server access to an Amazon S3 bucket in another AWS account? 跨账户访问特定 AWS 账户中的 S3 存储桶的 IAM 角色策略 - IAM Role policy for cross account access to S3 bucket in a specific AWS account 我如何授予具有此特定角色的 s3 存储桶访问权限? - how I grant s3 bucket access with this particular role? S3 存储桶策略授予/限制对特定联合用户的访问权限 - S3 bucket policy to grant/restrict access to a specific federated user 用于多个账户的跨账户访问的通用 S3 存储桶策略 - Generic S3 bucket policy for cross-account access for muliple acounts 使用存储桶策略限制 S3 存储桶访问 - S3 bucket access restriction with bucket policy 如何在S3存储桶策略中执行OR条件? - How do I do an OR condition in an S3 bucket policy?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM