Force SSL on Amazon S3

后端 未结 2 1029
广开言路
广开言路 2020-12-30 19:58

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?

2条回答
  •  情歌与酒
    2020-12-30 20:38

    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 }
                }
            }
        ]
    } 
    

提交回复
热议问题