本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
使用 Amazon Rekognition 作為 FedRAMP 授權服務
AWS FedRAMP 合規計劃包含 Amazon Rekognition 做為 FedRAMP 授權的服務。如果您是聯邦或商業客戶,您可以使用 服務,處理和存放 AWS 美國東部和美國西部區域的敏感工作負載,並將資料達到中度影響層級。您可以針對 AWS GovCloud (US) 區域授權界限中的敏感工作負載,使用 服務,資料可達到高影響層級。如需 FedRAMP 合規的詳細資訊,請參閱 AWS FedRAMP 合規。
若要符合 FedRAMP 規範,您可以使用聯邦資訊處理標準 (FIPS) 端點。當您使用敏感資訊時,這可讓您存取 FIPS 140-2 驗證的密碼編譯模組。如需 FIPS 端點的相關詳細資訊,請參閱 FIPS 140-2 概觀。
您可以使用 AWS Command Line Interface (AWS CLI) 或其中一個 AWS SDKs來指定 Amazon Rekognition 所使用的端點。
如需可以與 Amazon Rekognition 搭配使用的端點,請參閱 Amazon Rekognition 區域和端點。
以下是《Amazon Rekognition 開發人員指南》中的列出系列主題的範例。其經過修改,以指定用來存取 Amazon Rekognition 的區域和 FIPS 端點。
- Java
-
對於 Java,在建構 Amazon Rekognition 使用者端時使用 withEndpointConfiguration
方法。此範例顯示您在美國東部 (維吉尼亞北部) 區域使用 FIPS 端點的集合:
//Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
//PDX-License-Identifier: MIT-0 (For details, see https://github.com/awsdocs/amazon-rekognition-developer-guide/blob/master/LICENSE-SAMPLECODE.)
package aws.example.rekognition.image;
import java.util.List;
import com.amazonaws.services.rekognition.AmazonRekognition;
import com.amazonaws.services.rekognition.AmazonRekognitionClientBuilder;
import com.amazonaws.services.rekognition.model.ListCollectionsRequest;
import com.amazonaws.services.rekognition.model.ListCollectionsResult;
public class ListCollections {
public static void main(String[] args) throws Exception {
AmazonRekognition amazonRekognition = AmazonRekognitionClientBuilder.standard()
.withEndpointConfiguration(new AwsClientBuilder.EndpointConfiguration("https://rekognition-fips.us-east-1.amazonaws.com","us-east-1"))
.build();
System.out.println("Listing collections");
int limit = 10;
ListCollectionsResult listCollectionsResult = null;
String paginationToken = null;
do {
if (listCollectionsResult != null) {
paginationToken = listCollectionsResult.getNextToken();
}
ListCollectionsRequest listCollectionsRequest = new ListCollectionsRequest()
.withMaxResults(limit)
.withNextToken(paginationToken);
listCollectionsResult=amazonRekognition.listCollections(listCollectionsRequest);
List < String > collectionIds = listCollectionsResult.getCollectionIds();
for (String resultId: collectionIds) {
System.out.println(resultId);
}
} while (listCollectionsResult != null && listCollectionsResult.getNextToken() !=
null);
}
}
- AWS CLI
-
針對 AWS CLI,使用 --endpoint-url
引數指定 Amazon Rekognition 存取的端點。下列範例顯示您在美國東部 (俄亥俄) 區域使用 FIPS 端點的集合:
aws rekognition list-collections --endpoint-url https://rekognition-fips.us-east-2.amazonaws.com --region us-east-2
- Python
-
對於 Python,在 boto3.client 函數中使用 endpoint_url
引數。將其設定為您要指定的端點。此範例顯示您在美國西部 (奧勒岡) 區域使用 FIPS 端點的集合:
#Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#PDX-License-Identifier: MIT-0 (For details, see https://github.com/awsdocs/amazon-rekognition-developer-guide/blob/master/LICENSE-SAMPLECODE.)
import boto3
def list_collections():
max_results=2
client=boto3.client('rekognition', endpoint_url='https://rekognition-fips.us-west-2.amazonaws.com', region_name='us-west-2')
#Display all the collections
print('Displaying collections...')
response=client.list_collections(MaxResults=max_results)
collection_count=0
done=False
while done==False:
collections=response['CollectionIds']
for collection in collections:
print (collection)
collection_count+=1
if 'NextToken' in response:
nextToken=response['NextToken']
response=client.list_collections(NextToken=nextToken,MaxResults=max_results)
else:
done=True
return collection_count
def main():
collection_count=list_collections()
print("collections: " + str(collection_count))
if __name__ == "__main__":
main()