

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# Mail Manager 的許可政策
<a name="eb-policies"></a>

本章中的政策是做為使用 Mail Manager 所有不同功能所需政策的單一參考點。

在郵件管理員功能頁面中，會提供連結，讓您前往此頁面的個別區段，其中包含使用功能所需的政策。選取您需要的政策的複製圖示，並依照個別功能敘述中的指示貼上。

下列政策可讓您透過資源許可政策和 AWS Secrets Manager 政策，使用 Amazon SES Mail Manager 中包含的不同功能。如果您是初次使用許可政策，請參閱 [Amazon SES 政策結構](policy-anatomy.md)和 的許可政策。 [AWS Secrets Manager](https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_examples.html)

## 傳入端點的許可政策
<a name="eb-policies-ingress"></a>

本節中的兩個政策都需要建立輸入端點。若要了解如何建立輸入端點以及在何處使用這些政策，請參閱 [在 SES 主控台中建立輸入端點](eb-ingress.md#eb-ingress-create-console)。

### 輸入端點的 Secrets Manager 秘密資源許可政策
<a name="eb-policies-ingress-secrets"></a>

需要下列 Secrets Manager 秘密資源許可政策，才能允許 SES 使用輸入端點資源存取秘密。

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Id": "Id",
    "Statement": [
        {
            "Effect": "Allow",
            "Principal": {
                "Service": "ses.amazonaws.com"
            },
            "Action": "secretsmanager:GetSecretValue",
            "Resource": "*",
            "Condition": {
                "StringEquals": {
                    "aws:SourceAccount": "{{000000000000}}"
                },
                "ArnLike": {
                    "aws:SourceArn": "arn:aws:ses:{{us-east-1}}:{{000000000000}}:mailmanager-ingress-point/*"
                }
            }
        }
    ]
}
```

------

### 輸入端點的 KMS 客戶受管金鑰 (CMK) 金鑰政策
<a name="eb-policies-ingress-cmk"></a>

秘密必須使用客戶受管金鑰 (CMK)。在 KMS 金鑰政策中需要下列陳述式，以允許 SES 使用您的金鑰做為秘密。

```
{
    "Effect": "Allow",
    "Principal": {
        "Service": "ses.amazonaws.com"
    },
    "Action": "kms:Decrypt",
    "Resource": "*",
    "Condition": {
        "StringEquals": {
            "kms:ViaService": "secretsmanager.{{us-east-1}}.amazonaws.com",
            "aws:SourceAccount": "{{000000000000}}"
        },
        "ArnLike": {
            "aws:SourceArn": "arn:{{aws}}:ses:{{us-east-1}}:{{000000000000}}:mailmanager-ingress-point/*"
        }
    }
}
```

### mTLS 信任存放區的 KMS 客戶受管金鑰 (CMK) 金鑰政策
<a name="eb-policies-ingress-mtls-cmk"></a>

如果您使用客戶受管金鑰 (CMK) 來加密 mTLS 信任存放區，則需要 KMS 金鑰政策中的下列陳述式，以允許 SES 使用您的金鑰。

```
{
    "Effect": "Allow",
    "Principal": {
        "Service": "ses.amazonaws.com"
    },
    "Action": [
        "kms:Decrypt",
        "kms:DescribeKey"
    ],
    "Resource": "*",
    "Condition": {
        "StringEquals": {
            "aws:SourceAccount": "{{000000000000}}"
        },
        "ArnLike": {
            "aws:SourceArn": "arn:{{aws}}:ses:{{us-east-1}}:{{000000000000}}:mailmanager-ingress-point/*"
        }
    }
}
```

## SMTP 轉送的許可政策
<a name="eb-policies-relay"></a>

本節中的兩個政策都需要建立 SMTP 轉送。若要了解如何建立 SMTP 轉送以及使用這些政策的位置，請參閱 [在 SES 主控台中建立 SMTP 轉送](eb-relay.md#eb-relay-create-console)。

### Secrets Manager 適用於 SMTP 轉送的資源許可政策
<a name="eb-policies-relay-secrets"></a>

需要下列 Secrets Manager 秘密資源許可政策，才能允許 SES 使用 SMTP 轉送資源存取秘密。

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "secretsmanager:GetSecretValue",
                "secretsmanager:DescribeSecret"
            ],
            "Principal": {
                "Service": [
                    "ses.amazonaws.com"
                ]
            },
            "Resource": "*",
            "Condition": {
               "StringEquals": {
                   "aws:SourceAccount": "{{888888888888}}"
                },
               "ArnLike": {
                   "aws:SourceArn": "arn:aws:ses:{{us-east-1}}:{{888888888888}}:mailmanager-smtp-relay/*"
               }
           }
        }
    ]
}
```

------

### 適用於 SMTP 轉送的 KMS 客戶受管金鑰 (CMK) 金鑰政策
<a name="eb-policies-relay-cmk"></a>

在 KMS 金鑰政策中需要下列陳述式，以允許 SES 使用您的金鑰做為秘密。

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "kms:Decrypt",
                "kms:DescribeKey"
            ],
            "Principal": {
                "Service": "ses.amazonaws.com"
            },
            "Resource": "*",
            "Condition": {
                "StringEquals": {
                    "kms:ViaService": "secretsmanager.{{us-east-1}}.amazonaws.com",
                    "aws:SourceAccount": "{{000000000000}}"
                },
                "ArnLike": {
                    "aws:SourceArn": "arn:aws:ses:{{us-east-1}}:{{000000000000}}:mailmanager-smtp-relay/*"
                }
            }
        }
    ]
}
```

------

## 電子郵件封存的許可政策
<a name="eb-policies-archiving"></a>

**封存匯出**  
IAM 身分呼叫`StartArchiveExport`必須能夠存取由下列 IAM 政策設定的目的地 S3 儲存貯體：

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "s3:ListBucket",
                "s3:GetBucketLocation"
            ],
            "Resource": "arn:aws:s3:::{{MyDestinationBucketName}}"
        },
        {
            "Effect": "Allow",
            "Action": [
                "s3:PutObject",
                "s3:PutObjectAcl",
                "s3:PutObjectTagging",
                "s3:GetObject"
            ],
            "Resource": "arn:aws:s3:::{{MyDestinationBucketName}}/*"
        }
    ]
}
```

------

這是目的地儲存貯體的 S3 儲存貯體政策：

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Effect": "Allow",
            "Principal": {
                "Service": "ses.amazonaws.com"
            },
            "Action": [
                "s3:ListBucket",
                "s3:GetBucketLocation"
            ],
            "Resource": "arn:aws:s3:::{{MyDestinationBucketName}}"
        },
        {
            "Effect": "Allow",
            "Principal": {
                "Service": "ses.amazonaws.com"
            },
            "Action": [
                "s3:PutObject",
                "s3:PutObjectAcl",
                "s3:PutObjectTagging",
                "s3:GetObject"
            ],
            "Resource": "arn:aws:s3:::{{MyDestinationBucketName}}/*"
        }
    ]
}
```

------

**注意**  
封存不支援[混淆代理人條件金鑰](https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-reference-policy-checks.html#access-analyzer-reference-policy-checks-security-warning-restrict-access-to-service-principal) (aws：SourceArn、aws：SourceAccount、aws：SourceOrgID 或 aws：SourceOrgPaths)。這是因為 Mail Manager 的電子郵件封存會在開始實際匯出之前，先測試呼叫身分是否具有對匯出目的地儲存貯體[的](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_forward_access_sessions.html)寫入許可，以避免混淆代理人問題。

**使用 KMS CMK 封存靜態加密**  
IAM 身分呼叫 `CreateArchive`和 `UpdateArchive` 必須能夠透過下列政策存取 KMS 金鑰 ARN：

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": {
        "Effect": "Allow",
        "Action": [
            "kms:DescribeKey",
            "kms:Decrypt",
            "kms:GenerateDataKey"
        ],
        "Resource": "arn:aws:kms:{{us-east-1}}:{{111122223333}}:key/{{MyKmsKeyArnID}}"
    }
}
```

------

您的 KMS 金鑰政策需要下列陳述式：

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Effect": "Allow",
            "Principal": {
                "AWS": "arn:aws:iam::{{111122223333}}:user/{{MyUserRoleOrGroupName}}"
            },
            "Action": [
                "kms:Decrypt",
                "kms:GenerateDataKey*",
                "kms:DescribeKey"
            ],
            "Resource": "*",
            "Condition": {
                "StringEquals": {
                    "kms:ViaService": [
                        "ses.{{us-east-1}}.amazonaws.com"
                    ]
                }
            }
        },
        {
            "Effect": "Allow",
            "Principal": {
                "Service": "ses.amazonaws.com"
            },
            "Action": [
                "kms:Decrypt",
                "kms:GenerateDataKey*",
                "kms:DescribeKey"
            ],
            "Resource": "*"
        }
    ]
}
```

------

## 執行規則動作的許可和信任政策
<a name="eb-policies-rule-action"></a>

SES 規則執行角色是 AWS Identity and Access Management (IAM) 角色，授予規則執行存取 AWS 服務和資源的許可。在規則集中建立規則之前，您必須使用允許存取所需 AWS 資源的政策來建立 IAM 角色。SES 在執行規則動作時擔任此角色。例如，您可以建立規則執行角色，其具有將電子郵件訊息寫入 S3 儲存貯體的許可，做為符合規則條件時要採取的規則動作。

因此，除了本節中執行每個特定規則動作所需的個別許可政策*之外*，還需要下列信任政策。

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
      {
        "Effect": "Allow",
        "Principal": {
          "Service": "ses.amazonaws.com"
        },
        "Action": "sts:AssumeRole",
        "Condition": {
          "StringEquals": {
                   "aws:SourceAccount": "{{888888888888}}"
          },
          "ArnLike": {
             "aws:SourceArn": "arn:aws:ses:{{us-east-1}}:{{888888888888}}:mailmanager-rule-set/*"
          }
        }
      }
    ]
  }
```

------

**Topics**
+ [寫入 S3 政策](#eb-policies-s3)
+ [傳遞至信箱政策](#eb-policies-workmail)
+ [傳送至網際網路政策](#eb-policies-internet)
+ [交付至 Q Business 政策](#eb-policies-q)
+ [發佈至 SNS 政策](#eb-policies-sns)
+ [退信政策](#eb-policies-bounce)
+ [叫用 Lambda 函數政策](#eb-policies-lambda)

### *寫入 S3* 規則動作的許可政策
<a name="eb-policies-s3"></a>

您的 IAM 角色必須使用下列政策，才能使用**寫入 S3** 規則動作，將收到的電子郵件傳送到 S3 儲存貯體。

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Sid": "AllowPutObject",
            "Effect": "Allow",
            "Action": [
                "s3:PutObject"
            ],
            "Resource": [
                "arn:aws:s3:::{{MyDestinationBucketName}}/*"
            ]
        },
        {
            "Sid": "AllowListBucket",
            "Effect": "Allow",
            "Action": [
                "s3:ListBucket"
            ],
            "Resource": [
                "arn:aws:s3:::{{MyDestinationBucketName}}"
            ]
        }
    ]
}
```

------

如果您針對已啟用伺服器端加密的 S3 儲存貯體使用 AWS KMS 客戶受管金鑰，則需要新增 IAM 角色政策動作 `"kms:GenerateDataKey*"`。使用上述範例，將此動作新增至您的角色政策會顯示如下：

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Sid": "AllowKMSKeyAccess",
            "Effect": "Allow",
            "Action": "kms:GenerateDataKey*",
            "Resource": "arn:aws:kms:{{us-east-1}}:{{888888888888}}:key/*",
            "Condition": {
                "ForAnyValue:StringEquals": {
                    "kms:ResourceAliases": [
                        "alias/{{MyKeyAlias}}"
                    ]
                }
            }
        }
    ]
}
```

------

如需將政策連接至 AWS KMS 金鑰的詳細資訊，請參閱《 *AWS Key Management Service 開發人員指南*》中的[在 中使用金鑰政策 AWS KMS](https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html)。

### *傳遞至信箱*規則動作的許可政策
<a name="eb-policies-workmail"></a>

您的 IAM 角色必須使用下列政策，才能使用**交付至信箱**規則動作，將收到的電子郵件交付至 Amazon WorkMail 帳戶。

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
      {
        "Effect": "Allow",
        "Action": ["workmail:DeliverToMailbox"],
        "Resource": "arn:aws:workmail:{{us-east-1}}:{{888888888888}}:organization/{{MyWorkMailOrganizationID}}>"
      }
    ]
  }
```

------

### *傳送至網際網路*規則動作的許可政策
<a name="eb-policies-internet"></a>

您的 IAM 角色必須使用下列政策，才能使用**傳送至網際網路**規則動作，將收到的電子郵件傳送至外部網域。

**注意**  
如果您的 SES 身分使用預設組態集，您也需要新增組態集資源，如下列範例所示。

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
      {
        "Effect": "Allow",
        "Action": ["ses:SendEmail", "ses:SendRawEmail"],
        "Resource":[
        "arn:aws:ses:{{us-east-1}}:{{888888888888}}:identity/{{example.com}}",
        "arn:aws:ses:{{us-east-1}}:{{888888888888}}:configuration-set/{{my-configuration-set}}"
        ]        
      }
    ]
  }
```

------

### *交付至 Q Business* 規則動作的許可政策
<a name="eb-policies-q"></a>

需要下列政策才能使用**交付至 Q Business** 規則動作，將收到的電子郵件交付至 Amazon Q Business 索引。

您的角色所需的 IAM 政策：

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Sid": "AllowAccessToQBusiness",
            "Effect": "Allow",
            "Action": [
                "qbusiness:BatchPutDocument"
            ],
            "Resource": [
                "arn:aws:qbusiness:{{us-east-1}}:{{888888888888}}:application/{{ApplicationID}}/index/{{IndexID}}"
            ]
        }
    ]
}
```

------

KMS 金鑰政策中所需的陳述式：

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Sid": "AllowAccessToKMSKeyForQbusiness",
            "Effect": "Allow",
            "Action": [
                "kms:GenerateDataKey*",
                "kms:Encrypt",
                "kms:DescribeKey"
            ],
            "Resource": [
                "arn:aws:kms:{{us-east-1}}:{{888888888888}}:key/*"
            ],
            "Condition": {
                "StringEquals": {
                    "kms:ViaService": "qbusiness.{{us-east-1}}.amazonaws.com",
                    "kms:CallerAccount": "{{888888888888}}"
                 },
                 "ForAnyValue:StringEquals": {
                    "kms:ResourceAliases": [
                        "alias/{{MyKeyAlias}}"
                    ]
                }
            }
        }
    ]
}
```

------

如需將政策連接至 AWS KMS 金鑰的詳細資訊，請參閱《 *AWS Key Management Service 開發人員指南*》中的[在 中使用金鑰政策 AWS KMS](https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html)。

### *發佈至 SNS* 規則動作的許可政策
<a name="eb-policies-sns"></a>

需要下列政策才能使用**發佈至 SNS** 規則動作，此動作會將收到的電子郵件傳送到 Amazon SNS 主題。

您的角色所需的 IAM 政策：

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Sid": "AllowAccessToSNSTopic",
            "Effect": "Allow",
            "Action": [
                "sns:Publish"
            ],
            "Resource": [
                "arn:aws:sns:{{us-east-1}}:{{888888888888}}:{{MySnsTopic}}"
            ]
        }
    ]
}
```

------

KMS 金鑰政策中所需的陳述式：

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Sid": "AllowAccessToKMSKeyForSNS",
            "Effect": "Allow",
            "Action": [
                "kms:GenerateDataKey*",
                "kms:Encrypt",
                "kms:DescribeKey"
            ],
            "Resource": [
                "arn:aws:kms:{{us-east-1}}:{{888888888888}}:key/*"
            ],
            "Condition": {
                "StringEquals": {
                    "kms:ViaService": "qbusiness.{{us-east-1}}.amazonaws.com",
                    "kms:CallerAccount": "{{888888888888}}"
                 },
                 "ForAnyValue:StringEquals": {
                    "kms:ResourceAliases": [
                        "alias/{{MyKeyAlias}}"
                    ]
                }
            }
        }
    ]
}
```

------

如需將政策連接至 AWS KMS 金鑰的詳細資訊，請參閱《 *AWS Key Management Service 開發人員指南*》中的[在 中使用金鑰政策 AWS KMS](https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html)。

### *退信*規則動作的許可政策
<a name="eb-policies-bounce"></a>

您的 IAM 角色需要下列政策，才能使用**退信**規則動作，透過將退信回應傳回給寄件者來退信電子郵件。

```
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "AllowSendBounce",
            "Effect": "Allow",
            "Action": [
                "ses:SendBounce"
            ],
            "Resource": [
                "arn:aws:ses:{{us-east-1}}:{{123456789012}}:identity/*"
            ],
            "Condition": {
                "StringEquals": {
                    "ses:FromAddress": "{{sender@example.com}}"
                }
            }
        }
    ]
}
```

### *叫用 Lambda 函數*規則動作的許可政策
<a name="eb-policies-lambda"></a>

您的 IAM 角色需要下列政策，才能使用**叫用 Lambda 函數**規則動作來叫用 AWS Lambda 函數來處理電子郵件。

```
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "AllowInvokeLambdaFunction",
            "Effect": "Allow",
            "Action": [
                "lambda:InvokeFunction"
            ],
            "Resource": [
                "arn:aws:lambda:{{us-east-1}}:{{123456789012}}:function:{{MyFunction}}"
            ]
        }
    ]
}
```