Public Access to Web Objects in Existing Bucket

0

I have several folders in my bucket uploaded between 2021 and 2022. The bucket is set to have public read access and everything works great. I went to add another folder this week to the same bucket for the first time in two years, but when I try to test a specific object URL link in the new folder, the page loads with the following message.

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>5ZFHMHGTCCDNY0DA</RequestId> <HostId>yKoKzV87UtxsEhr849x57Ch/xDSib9McEgNJQ775PW8LfLi+c8Xrid6J7tXZeTIq8oR+SGoHjJ7LxKBSWZ4UlB91QMeM6/HHYv4zXOjkIec=</HostId> </Error>

Considering everything else in the bucket works as expected, I presume there's something wrong with the way I uploaded this particular folder. For context, all objects in the bucket are the same structure, but only the latest one is giving me an issue. The objects in the bucket are folders, each with a few subfolders and a unique .html file. The .html file is what I share, and that file references everything else in the folder it needs to. The other object URLs of the .html files all work except for the newest one. What did I do wrong? Thanks!

----------------------------UPDATE-------------------------------------

I've adjusted permissions, and although I no longer get the error message, I just get a blank page when I try to open the Object URL.Enter image description here

2 Answers
0

Based on the information provided, it seems that the issue you're experiencing with the newly uploaded folder is likely related to the object permissions rather than the bucket settings. Even though your bucket is set to have public read access, individual objects within the bucket can have their own access settings.

Here are a few things to check and potential solutions:

  1. Object ACL (Access Control List): When you uploaded the new folder and its contents, the objects might have been uploaded with default private permissions. You need to ensure that the individual objects, especially the .html file, have public read access.

  2. Bucket Policy vs. Object Permissions: While your bucket may have a policy allowing public read access, individual objects can still be restricted. Make sure that your bucket policy is correctly applied and that it covers all objects, including newly added ones.

  3. Block Public Access Settings: Check if there have been any changes to the block public access settings at the bucket or account level. These settings can override other permissions.

  4. Upload Process: If you used a different method to upload this new folder compared to your previous uploads, it might have affected the default permissions applied to the objects.

To resolve this issue:

  1. In the S3 console, navigate to the specific object (your .html file) that's not accessible.
  2. Check its permissions and ensure it's set to "Public (read-only)" or grant public read access.
  3. If the option to make the object public is disabled, review your bucket's settings to ensure that individual objects can be made public.
  4. If necessary, you can modify the bucket policy to explicitly allow public read access to all objects, including future uploads.

Remember, when dealing with public access, always consider security implications and ensure you're only making public the content that absolutely needs to be publicly accessible.
Sources
Grant public access to individual bucket objects in Amazon Lightsail - Amazon Lightsail
How to make bucket or objects public? | AWS re:Post
I get Access Denied while load images from buckets | AWS re:Post

profile picture
answered 3 months ago
profile picture
EXPERT
reviewed 3 months ago
0

You only have list on objects for everyone not read. Without read no one can download the objects.

profile picture
EXPERT
answered 3 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions