Cross-account S3 Bucket access in AWS Glue Crawler

0

Hi Team, I have setup Cross-account IAM roles to access a s3 bucket in an extremal AWS Account following this https://repost.aws/knowledge-center/cross-account-access-s3. Not following a bucket policy here. I am assigning this IAM role to AWSGlueServiceRole along with other roles for Glue. However, I am still getting an AccessDenied exception on S3. Am I missing any permission ? Attached is the existing Policies attached to AWSGlueServiceRole Enter image description here Enter image description here

已提問 8 個月前檢視次數 1274 次
1 個回答
3
已接受的答案

Hi,

For glue crawler, you should not be following the same way as mentioned in that knowledge center article, assumerole may not work for glue crawler case.

There are few things you need to keep in mind for cross account s3 access:

  1. Crawler role in Account A should have access to Account B s3 bucket(Get*, List*)
  2. Account B s3 bucket must allow required permissions(Get, List etc) to account A crawler role in it's bucket policy.
  3. Account B s3 bucket must not be using SSE-KMS(aws/s3) key, if bucket is encrypted with aws/s3 AWS Managed KMS key then cross account s3 access won't work
  4. If Account B s3 bucket is SSE-KMS CMK(custom key) encrypted then, KMS key policy in Account B must allow Account A glue crawler role.

Hope this helps.

Comment here if you have additional questions, happy to help.

Abhishek

profile pictureAWS
專家
已回答 8 個月前
profile pictureAWS
專家
iBehr
已審閱 8 個月前
  • Thanks Abhishek. For my use case, the Customer's s3 bucket is not enabled with any SSE-KMS(aws/s3) key nor any Customer managed key. Do you think bucket policy is the only option ? Customer's s3 bucket hosts all the AWS Billing Cost and Usage (CUR) data and I am afraid, they can alter the bucket policy for that bucket. This is because AWS suggests not to alter the bucket policy holding the billing data. Hence I setup a Cross Account data access using assume role. Kindly suggest. Thanks!

  • For cross account s3 bucket access, target account bucket policy must allow source account role. From your description it seems that you are trying to achieve role chaining where glue crawler can assume target account role, but to best of my knowledge you may not be able to do that. You can do role chaining with proper permissions setup as mentioned in the article which you highlighted but for that you need to make an sts:assumerole api call explicitly, in case of glue crawler that would not be possible.

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南