zoukankan      html  css  js  c++  java
  • S3 授权

    限制对特定 HTTP 引用站点的访问

    {
    "Version":"2012-10-17",
    "Id":"http referer policy example",
    "Statement":[
    {
    "Sid":"Allow get requests originating from www.example.com and example.com.",
    "Effect":"Allow",
    "Principal":"*",
    "Action":"s3:GetObject",
    "Resource":"arn:aws:s3:::examplebucket/*",
    "Condition":{
    "StringLike":{"aws:Referer":["http://www.example.com/*","http://example.com/*"]}
    }
    }
    ]
    }

    添加存储桶策略以请求 MFA

    {
    "Version": "2012-10-17",
    "Id": "123",
    "Statement": [
    {
    "Sid": "",
    "Effect": "Deny",
    "Principal": "*",
    "Action": "s3:*",
    "Resource": "arn:aws:s3:::examplebucket/taxdocuments/*",
    "Condition": { "Null": { "aws:MultiFactorAuthAge": true }}
    }
    ]
    }

    向 Amazon CloudFront Origin Identity 授予权限

    {
    "Version":"2012-10-17",
    "Id":"PolicyForCloudFrontPrivateContent",
    "Statement":[
    {
    "Sid":" Grant a CloudFront Origin Identity access to support private content",
    "Effect":"Allow",
    "Principal":{"CanonicalUser":"CloudFront Origin Identity Canonical User ID"},
    "Action":"s3:GetObject",
    "Resource":"arn:aws:s3:::examplebucket/*"
    }
    ]
    }

    您可以选择使用数值条件限制 aws:MultiFactorAuthAge 密钥的有效期,该期限独立于对请求进行身份验证时使用的临时安全凭证的生存期。例如,除了要求 MFA 身份验证外,下面的存储桶策略还会查看临时会话是在多久以前创建的。如果 aws:MultiFactorAuthAge 键值指示临时会话是在一个小时 (3600 秒) 之前创建的,则策略将拒绝任何操作。

    {
    "Version": "2012-10-17",
    "Id": "123",
    "Statement": [
    {
    "Sid": "",
    "Effect": "Deny",
    "Principal": "*",
    "Action": "s3:*",
    "Resource": "arn:aws:s3:::examplebucket/taxdocuments/*",
    "Condition": {"Null": {"aws:MultiFactorAuthAge": true }}
    },
    {
    "Sid": "",
    "Effect": "Deny",
    "Principal": "*",
    "Action": "s3:*",
    "Resource": "arn:aws:s3:::examplebucket/taxdocuments/*",
    "Condition": {"NumericGreaterThan": {"aws:MultiFactorAuthAge": 3600 }}
    },
    {
    "Sid": "",
    "Effect": "Allow",
    "Principal": "*",
    "Action": ["s3:GetObject"],
    "Resource": "arn:aws:s3:::examplebucket/*"
    }
    ]
    }

  • 相关阅读:
    多Web服务器之间共享Session的解决方案
    在WinForm中使用CacheDependency来监视文件
    使用WCF的一些问题
    IIS6.0配置注意
    匿名委托注册事件的触发
    关于datawindow does not have update capability
    EF自关联建模详解
    NHiberante3.2版注意
    EF做数据绑定时一些神奇问题
    EF 中不同会话上下文的对象,不能互设为对方的导航属性值
  • 原文地址:https://www.cnblogs.com/cloudrivers/p/11422581.html
Copyright © 2011-2022 走看看