Create SCP exemptions

0

Hi I am trying to create a policy that restrict uploading objects without encryption, also want to create an exemption for certain buckets tagged with reserved tag exempted this doesn't seem to work, i think the reason probably is that tags at the bucket level are not checked when object resource is being added.

Is there an alternative to create SCP exemptions at bucket level?

    {
      "Sid": "DenyNoEncryption",
      "Effect": "Deny",
      "Action": "s3:PutObject",
      "Resource": "*",
      "Condition": {
        "StringNotEquals": {
          "s3:x-amz-server-side-encryption": "AES256",
          "aws:ResourceTag/exempted": "yes"
        }
      }
    }
1回答
0

Try this, let me know if this resolves your issue.

Curated SCPs and Config Rules

SCP: Restrict S3 uploads

Prevent uploads of unencrypted S3 objects.

{
            "Sid": "DenyUnencryptedS3Uploads",
            "Effect": "Deny",
            "Action": "s3:PutObject",
            "Resource": "*",
            "Condition": {
                "StringNotLike": {
                    "s3:x-amz-server-side-encryption": ["aws:kms", "AES256"]
                },
                "Null": {
                    "s3:x-amz-server-side-encryption": "false"
                }
            }
        }
    ]
}
AWS
abemusa
回答済み 1年前
  • No this is not what i asked, i want to add an exemption when a bucket has a tag "exempted": "yes". When the tag is added to bucket i would like to NOT enforce this SCP

  • Yes the policy itself is working and preventing any non-encrypted uploads, but now i am trying to see if i can add an exemption

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ