• 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/*"
    }
    ]
    }

  • 相关阅读:
    今天过节提前下班
    作控件也挺郁闷啊!
    使用Windows XP的主题
    这几天关心加密的人很多
    多普达515,好爽啊!
    515看电影
    我要定计划
    龙芯II发布了,好事儿!
    转:关于星际与XP的结对编程
    昨天参加了一个微软的会
  • 原文地址:https://www.cnblogs.com/cloudrivers/p/11422581.html
Copyright © 2020-2023  润新知