SES Authorization Policy not working

0

Hello, within SES sending mails is possible and working, but i would like to restrict the FROM address which is not working. Even with a limiting(aws@example.com) sending authorization policy I can send with any FROM address. Here is my Sending authorization policies:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "XXX",
      "Effect": "Allow",
      "Principal": {
        "AWS": "arn:aws:iam::XXX:user/ses-smtp-userXXX"
      },
      "Action": "ses:SendRawEmail",
      "Resource": "arn:XXX:identity/XXX",
      "Condition": {
        "StringLike": {
          "ses:FromAddress": "aws@example.com"
        }
      }
    }
  ]
}

IAM policy:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": "ses:SendRawEmail",
            "Resource": "*"
        }
    ]
}

Do i have to set the condition also for the IAM policy? What is the better/right way for which use-case: IAM or sending authorization policy

1 個回答
0
已接受的答案

Hi.

The default policy is allowed.
You can allow only specific addresses by denying other than specific From addresses as shown below.

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "XXX",
      "Effect": "Deny",
      "Principal": {
        "AWS": "arn:aws:iam::XXX:user/ses-smtp-userXXX"
      },
      "Action": "ses:SendRawEmail",
      "Resource": "arn:XXX:identity/XXX",
      "Condition": {
        "StringNotLike": {
          "ses:FromAddress": "aws@example.com"
        }
      }
    }
  ]
}
profile picture
專家
iwasa
已回答 2 年前
profile picture
專家
已審閱 1 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南