Hello
That's correct. preflight (OPTIONS) does not require authentication and will work the same whether or not the S3 bucket is Public or Private.
Amazon S3 supports cross-origin resource sharing (CORS) by enabling you to add a cors subresource on a bucket. When a browser sends this preflight request, Amazon S3 responds by evaluating the rules that are defined in the cors configuration. If cors is not enabled on the bucket, then Amazon S3 returns a 403 Forbidden response. https://docs.aws.amazon.com/AmazonS3/latest/API/RESTOPTIONSobject.html
If you put CORS policy in the S3 bucket even the bucket is a private, using the example here https://docs.aws.amazon.com/AmazonS3/latest/userguide/ManageCorsUsing.html A browser can send this preflight request to Amazon S3 to determine if it can send an actual request with the specific origin, HTTP method, and headers.
S3 bucket name: mybucket
[ { "AllowedHeaders": [ "*" ], "AllowedMethods": [ "PUT", "POST", "DELETE", "GET" ], "AllowedOrigins": [ "http://www.example.com" ], "ExposeHeaders": [ "x-amz-server-side-encryption", "x-amz-request-id", "x-amz-id-2" ], "MaxAgeSeconds": 3000 } ]
curl -v https://mybucket.region.amazonaws.com/example.txt -X OPTIONS -H "Access-Control-Request-Method:GET" -H "Origin:http://www.example.com"
one will get the < HTTP/1.1 200 OK < Access-Control-Allow-Origin: * < Access-Control-Allow-Methods: PUT, POST, DELETE, GET < Access-Control-Expose-Headers: x-amz-server-side-encryption, x-amz-request-id, x-amz-id-2 < Access-Control-Max-Age: 3000 < Vary: Origin, Access-Control-Request-Headers, Access-Control-Request-Method < Server: AmazonS3
Regards!
Relevant questions
Use of OpenVPN 3 client with split tunnelling to access S3 buckets
asked 2 months agoS3 Preflight and IAM
asked a month agoSimplest and tightest way to secure S3 buckets for static websites
asked 3 years agoHow to find all public objects of any of my owned S3 buckets?
Accepted Answerasked 8 months agoOld buckets reappear
asked 3 years agoList contents of buckets
asked a year agoOur users are receiving multiple copies of the same email that we just sent once
asked 2 months agoS3 Bucket Public Access Settings
asked 3 years agoCan I keep existing IAM users and add SSO to our accounts
asked 2 years agoSet the access permission of objects in S3 buckets
asked 5 months ago