Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Force SSL on Amazon S3

Is it possible (via IAM, bucket policy, or otherwise) to force Amazon S3 to only serve content over HTTPS/SSL and deny all regular, unencrypted HTTP access?

like image 774
Alex Avatar asked Jan 13 '14 09:01

Alex


People also ask

Does S3 have SSL?

Amazon S3 allows both HTTP and HTTPS requests. By default, requests are made through the AWS Management Console, AWS Command Line Interface (AWS CLI), or HTTPS. To comply with the s3-bucket-ssl-requests-only rule, confirm that your bucket policies explicitly deny access to HTTP requests.

Does AWS S3 CLI use SSL?

By default, the AWS CLI uses SSL when communicating with AWS services.


Video Answer


1 Answers

I believe this can be achieved using a bucket policy. Deny all HTTP requests to the bucket in question using the condition aws:SecureTransport: false.
The following is not tested but it should give you an idea of how to set it up for your case.

{     "Statement":[         {             "Action": "s3:*",             "Effect":"Deny",             "Principal": "*",             "Resource":"arn:aws:s3:::bucketname/*",             "Condition":{                 "Bool":                 { "aws:SecureTransport": false }             }         }     ] }  
like image 119
OkezieE Avatar answered Oct 04 '22 07:10

OkezieE