Learning and Sharing
  • Home
  • Blog
  • Linux
  • macOS
  • Virtualization
    • VMware
    • VirtualBox
  • Windows
    • Windows 11
    • Windows 10
    • Windows Server
  • Series
    • Symantec
    • Intune
    • Microsoft Azure
    • Powershell
    • VirtualBox
    • VMware
    • PowerShell Learning
    • Microsoft Graph
  • More
    • Auto Installation
    • AEC Installation
  • Contact
No Result
View All Result
  • Home
  • Blog
  • Linux
  • macOS
  • Virtualization
    • VMware
    • VirtualBox
  • Windows
    • Windows 11
    • Windows 10
    • Windows Server
  • Series
    • Symantec
    • Intune
    • Microsoft Azure
    • Powershell
    • VirtualBox
    • VMware
    • PowerShell Learning
    • Microsoft Graph
  • More
    • Auto Installation
    • AEC Installation
  • Contact
No Result
View All Result
No Result
View All Result

This XML File Does not Appear Access Denied in Amazon S3

November 13, 2022
in AWS, Blog
0
ADVERTISEMENT

Table of Contents

After created a bucket in Amazon S3 storage, when you access a file through the direct link. You got the following 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>0DH4CB73NG7Z3YC0</RequestId>
<HostId>gv2vZnwRy96lzKvbX57f397EH8/QUVIZGY5JwWjIA8qgkC1axJ25yN6JEOwBoPXZIirhUwLbh28=</HostId>
</Error>

The object link: https://media2660.s3.amazonaws.com/images/bg2555.png

You are getting this error because the file is set to private, and you don’t have the permission to download it. As you can see in the below image, everyone (public access) has no access right for this object.

To fix it, you need to enable public access on the object itself or on the entire bucket.

Note Note: If the entire bucket is public, that error will go away but everyone would be able to see all objects in your S3 bucket.

Grant access on the object level

1. Login into your Amazon S3 bucket then select the tab.

2. Scroll down then click on button under Bucket policy section.

For example, we’ll create a bucket policy to allow public access for the file named bg2555.png. The location of this file is /mybucket/images/bg2555.png.

{"Version":"2012-10-17","Id":"Policy1668051262888","Statement":[{"Sid":"Stmt1668051260943","Effect":"Allow","Principal":"*","Action":"s3:GetObject","Resource":"arn:aws:s3:::media2660\/images\/bg2555.png"}]}

The bucket policy written in JSON, provides access to the objects stored in the bucket. You can visit Policy examples and Policy generator to learn how to create a bucket policy.

Don’t forget save the changes then try to access the object. As you can see, the object now available for public access. You can attach it to a website or using it as direct download link.

Because the bucket policy allows public access for the file named bg2555.png only. So, when you access another file in the same folder in your bucket, you would get the access denied error.

Grant access on a folder or entire bucket

If you’re planning to use S3 to host upload files for a website. You must create a bucket policy to allows public access on the upload folder instead of creating policies for individual files.

For example, I need create a bucket policy to allows public access for images folder.

{"Version":"2012-10-17","Id":"Policy1668051262888","Statement":[{"Sid":"Stmt1668051260943","Effect":"Allow","Principal":"*","Action":"s3:GetObject","Resource":"arn:aws:s3:::media2660\/images\/*"}]}

As you can see, now all files in images folder in my S3 bucket can be access by everyone.

Note Note: If the entire bucket is public, everyone would be able to see all objects in your S3 bucket.

Bucket policy to publish everything in your S3 bucket:

{"Version":"2012-10-17","Id":"Policy1668051262888","Statement":[{"Sid":"Stmt1668051260943","Effect":"Allow","Principal":"*","Action":"s3:GetObject","Resource":"arn:aws:s3:::media2660\/*"}]}
ADVERTISEMENT
5/5 - (1 vote)
Previous Post

How to Keep Your MacBook Running with the Lid Closed

Next Post

How to Move a Block of Code to the Left in Visual Studio Code

Related Posts

Running Hyper-V and VMware Workstation on The Same Machine

August 15, 2024

How to Uninstall All Autodesk Products At Once Silently

July 29, 2024
Ftr5

How to Uninstall the Autodesk Genuine Service on Windows

July 29, 2024
Ftr19

How to Fix Windows Cannot Read the ProductKey From the Unattend Answer File in VirtualBox

July 26, 2024
Ftr25

How to Update Windows Terminal in Windows 10/11

July 26, 2024

How to Disable The Beep Sound in WSL Terminal on Windows

July 26, 2024

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • How To Turn On uBlock Origin Extension in Chrome (2025)
  • Images Hidden Due To Mature Content Settings In CivitAI
  • Azure OpenAI vs Azure AI Hub, How to Choose the Right One for Your Needs

Categories

Stay in Touch

Discord Server

Join the Discord server with the site members for all questions and discussions.

Telegram Community

Jump in Telegram server. Ask questions and discuss everything with the site members.

Youtube Channel

Watch more videos, learning and sharing with Leo ❤❤❤. Sharing to be better.

Newsletter

Join the movement and receive our weekly Tech related newsletter. It’s Free.

General

Microsoft Windows

Microsoft Office

VMware

VirtualBox

Technology

PowerShell

Microsoft 365

Microsoft Teams

Email Servers

Copyright 2025 © All rights Reserved. Design by Leo with ❤

No Result
View All Result
  • Home
  • Linux
  • Intune
  • macOS
  • VMware
  • VirtualBox
  • Powershell
  • Windows 10
  • Windows 11
  • Microsoft 365
  • Microsoft Azure
  • Microsoft Office
  • Active Directory

No Result
View All Result
  • Home
  • Linux
  • Intune
  • macOS
  • VMware
  • VirtualBox
  • Powershell
  • Windows 10
  • Windows 11
  • Microsoft 365
  • Microsoft Azure
  • Microsoft Office
  • Active Directory