Crawler Error: User does not have access to target s3://test-bucket-mis6389/evdata/

0

When other AWS users are trying to access my bucket with their crawler, they are getting the below error. "Crawler Error: User does not have access to target s3://test-bucket-mis6389/evdata/"

My s3 bucket contains a data file. So, other AWS users while running the crawler, the get the above error. This is my bucket policy. { "Version": "2012-10-17", "Statement": [ { "Sid": "AllowAccessFromMultipleAccounts", "Effect": "Allow", "Principal": { "AWS": "" }, "Action": "s3:GetObject", "Resource": "arn:aws:s3:::test-bucket-mis6389/" } ] }

The crawler is attached the role containing with below custom policy and aws managed policy: { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "s3:GetObject", "s3:PutObject", "kms:Decrypt" ], "Resource": [ "arn:aws:s3:::test-bucket-mis6389/evdata/*" ] } ] } and aws managed policy: AWSGlueServiceRole

  • Are AWS users belong to same or different account?

5개 답변
1

Hi, Assuming your crawler and s3 bucket are in the same region!

Your crawler attached role has some issues i believe.

The crawler attached role should contain with below custom policy and aws managed policy:

{ "Version": "2012-10-17", "Statement": [ { "Effect": "AllowS3Actions", "Action": [ "s3:GetObject", "s3:PutObject" ], "Resource": [ "arn:aws:s3:::test-bucket-mis6389/evdata/*" ] } ,  { "Effect": "AllowKMSAction", "Action": [ "kms:Decrypt" ], "Resource": [ "<KMSKeyARN>" ] ] } 

and aws managed policy: AWSGlueServiceRole

You have given s3 actions and KMS action in single statement but in resources section you have only mentioned s3 bucket ARN. You need to also specify KMS Decrypt action on particular KMS key. As a security best practise, i have segregated them into 2 separate statement blocks.

Also, make sure that if users belonging to other account, the KMS key trust policy should trust the other account.

You may also refer this for additional checks https://repost.aws/knowledge-center/s3-cross-account-access-denied

AWS
답변함 2달 전
0

Hello,

Modify your bucket policy to explicitly grant access also to the evdata folder and its contents. arn:aws:s3:::test-bucket-mis6389/evdata/*

Paul
답변함 2달 전
0

Thank you for the response Paul. But, It's not working.

답변함 2달 전
0

Would you able to check the CloudTrail logs? You can filter them by the resource and the name of the S3 bucket. This would provide us with detailed information about the API calls made to S3 and any associated error messages

Paul
답변함 2달 전
0

Hi,

Are the AWS users belong to the same account or different account? If the bucket is owned by a different AWS account than the one where the crawler is running, you may need to update the bucket policy to grant cross-account access. Check also if there are any other policies attached to the IAM role or the AWS account that might be denying access to the S3 bucket.

profile pictureAWS
BezuW
답변함 2달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠