I get Access Denied while load images from buckets

0

Hello I get my images from my Bucket but I face this error

This XML file does not appear to have any style information associated with it. The document tree is shown below. <Error> <Code>AccessDenied</Code> <Message>Access Denied</Message> <RequestId>JJ93V4KF04RY0T7A</RequestId> <HostId>fT2qnhHyF6q9HUDK+NaSieEZKfk69CvY/zASYDMd2s19GsogHrRQCs4TnPjeDey+pEXuDpQsPCU=</HostId> </Error>

even when I set the object public I get it.

Is it possible to help me?

Maryam
질문됨 9달 전246회 조회
2개 답변
0

Hello. have you set the bucket policy? you need to specify the principal and effect of that ie s3:getobject and the resources e.g yourbucket/* meaning you can see and get the object. that's what i think is missing. Here is an example of a bucket policy using a policy generator from your s3 bucket console in the permissions tab ->edit policy and then click on the policy generator, make sure u copy the ARN as well which you will use to paste in the generator.

{ "Id": "Policy1692788816796", "Version": "2012-10-17", "Statement": [ { "Sid": "Stmt1692788810811", "Action": [ "s3:GetObject" ], "Effect": "Allow", "Resource": "arn:aws:s3:::animals/", "Principal": "" } ] }

Kazman
답변함 9달 전
0

There are few things, that you need to make sure of and are as below:

  1. Your IAM role/user has access to that s3 bucket and it's objects through identity based policies
  2. There should not be explicit deny at bucket policy, if there is any explicit deny at bucket level, then also you'll not be able to access the bucket object.
  3. If s3 bucket is SSE-KMS CMK encrypted, make sure your IAM user/role has access to that KMS key
  4. There is no explicit deny at KMS key policy

Once you make sure of all the above points, you should be good.

profile pictureAWS
전문가
답변함 9달 전
profile pictureAWS
전문가
검토됨 9달 전

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

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

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

관련 콘텐츠