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

  • 相关阅读:
    无重复字符的最长子串
    最长公共前缀
    项目开发的 工程化
    包管理 import debug 模块管理 module
    Third Party Browser Drivers NOT DEVELOPED by seleniumhq
    任何不看源码的代码引入都是存在定时爆炸的可能
    博客数计数
    lineage 世系 血缘 容错机制 DAG
    查源码分析 游标 写 需要 cursors 一切不看源码的代码引入都是定时炸弹的启动
    8核 16g 及时释放内存空间
  • 原文地址:https://www.cnblogs.com/cloudrivers/p/11422581.html
Copyright © 2020-2023  润新知