I've created a unique bucket for my private files on S3. This bucket is configured to block all public access. My application is configured to upload files to this s3 bucket with no public read access and I can confirm that the permissions on the objects reflect that this is working (i.e. there are no permissions given to the public on the objects that are uploaded).
Despite all of these measures to restrict public access to these files, these files are still visible to the public. I think that my IAM settings may be overriding the ACL setting as well as the bucket settings. I'm not sure which IAM setting to change or if changes may negatively impact other parts of my application, so I'd like to restrict access to this 'private bucket' with a bucket policy if possible.
This is what I've started with for a bucket policy:
{
"Version": "2012-10-17",
"Id": "My Special Bucket Policy",
"Statement": [
{
"Sid": "DenyAccesstoAllFiles",
"Effect": "Deny",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::my_private_bucket/*"
}
]
}
Unfortunately, this blocks access to objects in this 'private bucket' even with a signed url.
Please note that I've been able to generate signed urls successfully. They expire in 60 seconds just as I've configured them.
Thanks for your help!
Edit: All my files are being uploaded like this:
