在 Amazon S3 上强制使用 SSL [英] Force SSL on Amazon S3

查看:50
本文介绍了在 Amazon S3 上强制使用 SSL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以(通过 IAM、存储桶策略或其他方式)强制 Amazon S3通过 HTTPS/SSL 提供内容并拒绝所有常规的、未加密的 HTTP 访问?

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?

推荐答案

我相信这可以使用存储桶策略来实现.使用条件 aws:SecureTransport: false 拒绝对相关存储桶的所有 HTTP 请求.
以下内容未经测试,但应该能让您了解如何为您的案例进行设置.

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

这篇关于在 Amazon S3 上强制使用 SSL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆