

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 安全性
<a name="sc-introduction"></a>

您可以安全地管理项目、模型以及客户用来检测自定义标签的 `DetectCustomLabels` 操作。

有关 Amazon Rekognition 的安全保护的更多信息，请参阅 [Amazon Rekognition 的安全性](https://docs.aws.amazon.com/rekognition/latest/dg/security.html)。

## 保护 Amazon Rekognition Custom Labels 项目
<a name="sc-resources"></a>

您可以通过指定基于身份的策略中指定的资源级权限来保护您的 Amazon Rekognition Custom Labels 项目。有关更多信息，请参阅[基于身份的策略和基于资源的策略](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_identity-vs-resource.html)。

您可以保护的 Amazon Rekognition Custom Labels 资源包括：


| 资源 | Amazon 资源名称格式 | 
| --- | --- | 
| Project | arn: aws: rekognition: \*: \*: project/ /datetime {{project\_name}} | 
| 模型 | arn: aws: rekognition: \*: \*: project/ /version/ /datetime {{project\_name}} {{name}} | 

以下示例策略显示如何向身份授予执行以下操作的权限：
+ 描述所有项目。
+ 创建、启动、停止和使用特定模型进行推理。
+ 创建项目。创建和描述特定模型。
+ 拒绝创建特定项目。

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

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Sid": "AllResources",
            "Effect": "Allow",
            "Action": "rekognition:DescribeProjects",
            "Resource": "*"
        },
        {
            "Sid": "SpecificProjectVersion",
            "Effect": "Allow",
            "Action": [
                "rekognition:StopProjectVersion",
                "rekognition:StartProjectVersion",
                "rekognition:DetectCustomLabels",
                "rekognition:CreateProjectVersion"
            ],
            "Resource": "arn:aws:rekognition:*:*:project/{{MyProject}}/version/{{MyVersion}}/*"
       },
        {
            "Sid": "SpecificProject",
            "Effect": "Allow",
            "Action": [
                "rekognition:CreateProject",
                "rekognition:DescribeProjectVersions",
                "rekognition:CreateProjectVersion"
            ],
            "Resource": "arn:aws:rekognition:*:*:project/{{MyProject}}/*"
        },
        {
            "Sid": "ExplicitDenyCreateProject",
            "Effect": "Deny",
            "Action": [
                "rekognition:CreateProject"
            ],
            "Resource": ["arn:aws:rekognition:*:*:project/{{SampleProject}}/*"]
        }
    ]
}
```

------

## 安全 DetectCustomLabels
<a name="sc-detect-custom-labels"></a>

用于检测自定义标签的身份可能与管理 Amazon Rekognition Custom Labels 模型的身份不同。

您可以通过对身份应用策略来保护身份对 `DetectCustomLabels` 的访问。以下示例限制只能访问 `DetectCustomLabels` 和特定模型。该身份无法访问任何其他 Amazon Rekognition 操作。

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

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "rekognition:DetectCustomLabels"


            ],
            "Resource": "arn:aws:rekognition:*:*:project/{{MyProject}}/version/{{MyVersion}}/*"
        }
    ]
}
```

------

## AWS 托管式策略
<a name="security-iam-awsmanpol"></a>

我们提供`AmazonRekognitionCustomLabelsFullAccess` AWS 托管政策，您可以使用它来控制对亚马逊 Rekognition 定制标签的访问权限。有关更多信息，请参阅 [AWS 托管策略： AmazonRekognitionCustomLabelsFullAccess](https://docs.aws.amazon.com/rekognition/latest/dg/security-iam-awsmanpol.html#security-iam-awsmanpol-custom-labels-full-access)。