I have a AWS S3 bucket use to share file (with anyone, public access). So my bucket is set as public. Normally to access at this file you need the url but when you GET my bucket root you got a xml with index all my file. So I want to disable this xml and make my file private without the exact url, do you have a solution ?
This bucket policy from the Bucket Policy Examples documentation page shows how to Grant Read-Only Permission to an Anonymous User:
{
"Version":"2012-10-17",
"Statement":[
{
"Sid":"AddPerm",
"Effect":"Allow",
"Principal": "*",
"Action":["s3:GetObject"],
"Resource":["arn:aws:s3:::examplebucket/*"]
}
]
}
They will be able to access files, but will not be able to list, delete or upload objects.
The permissions interface allows to to control this directly.
If you try to look at your root, you should now see Access Denied Access denied
Just head over to the AWS S3 console and select the file. You can change this files permission so that it suits your needs.
You could try it the other way around as well. Disable public bucket access and only make the files you want to share public. This should work as well.