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
전문가
검토됨 한 달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠