Amazon SNS データ保護ポリシーの例 - Amazon Simple Notification Service

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

Amazon SNS データ保護ポリシーの例

以下は、機密データの監査および拒否に使用できるデータ保護ポリシーの例です。サンプルアプリケーションを含む完全なチュートリアルについては、「Amazon のメッセージデータ保護の紹介SNS」ブログ記事を参照してください。

監査ポリシーの例

監査ポリシーを使用すると、最大 99% のインバウンドメッセージを監査し、Amazon CloudWatchAmazon Data Firehose 、および Amazon S3に結果を送信できます。

例えば、監査ポリシーを作成して、システムのいずれかが誤って機密データを送受信していないかを評価できます。監査結果から、システムがクレジットカード情報を必要としないシステムにその情報を送信していることが明らかになった場合は、データ保護ポリシーを実装してデータの配信を防止できます。

次の例では、クレジットカード番号を探し、結果を CloudWatch Logs、Firehose、Amazon S3 に送信することで、トピックを通過するメッセージの 99% を監査します。

データ保護ポリシー:

{ "Name": "__example_data_protection_policy", "Description": "Example data protection policy", "Version": "2021-06-01", "Statement": [ { "DataDirection": "Inbound", "Principal": ["*"], "DataIdentifier": [ "arn:aws:dataprotection::aws:data-identifier/CreditCardNumber" ], "Operation": { "Audit": { "SampleRate": "99", "FindingsDestination": { "CloudWatchLogs": { "LogGroup": "<example log name>" }, "Firehose": { "DeliveryStream": "<example stream name>" }, "S3": { "Bucket": "<example bucket name>" } } } } } ] }

監査結果の形式の例:

{ "messageId": "...", "callerPrincipal": "arn:aws:sts::123456789012:assumed-role/ExampleRole", "resourceArn": "arn:aws:sns:us-east-1:123456789012:ExampleArn", "dataIdentifiers": [ { "name": "CreditCardNumber", "count": 1, "detections": [ { "start": 1, "end": 2 } ] } ], "timestamp": "2021-04-20T00:33:40.241Z" }

インバウンド識別解除マスキングステートメントを含むポリシーの例

次の例では、メッセージの内容から機密データをマスキングして、ユーザーがメッセージ内の CreditCardNumber をトピックに発行できないようにします。

{ "Name": "__example_data_protection_policy", "Description": "Example data protection policy", "Version": "2021-06-01", "Statement": [ { "DataDirection": "Inbound", "Principal": [ "arn:aws:iam::123456789012:user/ExampleUser" ], "DataIdentifier": [ "arn:aws:dataprotection::aws:data-identifier/CreditCardNumber" ], "Operation": { "Deidentify": { "MaskConfig": { "MaskWithCharacter": "#" } } } } ] }

インバウンド識別解除マスキング結果の例:

// original message My credit card number is 4539894458086459 // delivered message My credit card number is ################

インバウンド識別解除の削除ステートメントを使用したポリシーの例

次の例では、メッセージ内の機密データを削除して、ユーザーがメッセージ内の CreditCardNumber をトピックに発行できないようにします。

{ "Name": "__example_data_protection_policy", "Description": "Example data protection policy", "Version": "2021-06-01", "Statement": [ { "DataDirection": "Inbound", "Principal": [ "arn:aws:iam::123456789012:user/ExampleUser" ], "DataIdentifier": [ "arn:aws:dataprotection::aws:data-identifier/CreditCardNumber" ], "Operation": { "Deidentify": { "RedactConfig": {} } } } ] }

インバウンド識別解除の削除結果の例:

// original message My credit card number is 4539894458086459 // delivered message My credit card number is

アウトバウンド識別解除マスキングステートメントを使用したポリシーの例

次の例では、メッセージ内の機密データをマスキングして、ユーザーがメッセージ内の CreditCardNumber を受信できないようにします。

{ "Name": "__example_data_protection_policy", "Description": "Example data protection policy", "Version": "2021-06-01", "Statement": [ { "DataDirection": "Outbound", "Principal": [ "arn:aws:iam::123456789012:user/ExampleUser" ], "DataIdentifier": [ "arn:aws:dataprotection::aws:data-identifier/CreditCardNumber" ], "Operation": { "Deidentify": { "MaskConfig": { "MaskWithCharacter": "-" } } } } ] }

アウトバウンド識別解除マスキング結果の例:

// original message My credit card number is 4539894458086459 // delivered message My credit card number is ----------------

アウトバウンド識別解除の削除ステートメントを使用したポリシーの例

次の例では、メッセージ内の機密データを削除して、ユーザーがメッセージ内の CreditCardNumber を受信できないようにします。

{ "Name": "__example_data_protection_policy", "Description": "Example data protection policy", "Version": "2021-06-01", "Statement": [ { "DataDirection": "Outbound", "Principal": [ "arn:aws:iam::123456789012:user/ExampleUser" ], "DataIdentifier": [ "arn:aws:dataprotection::aws:data-identifier/CreditCardNumber" ], "Operation": { "Deidentify": { "RedactConfig": {} } } } ] }

アウトバウンド識別解除の削除結果の例:

// original message My credit card number is 4539894458086459 // delivered message My credit card number is

インバウンド拒否ステートメントを使用するポリシーの例

次の例では、メッセージの内容に CreditCardNumber が含まれている場合、ユーザーがメッセージをトピックに発行するのをブロックします。API レスポンスで拒否されたペイロードのステータスコードは403 AuthorizationError「」です。

{ "Name": "__example_data_protection_policy", "Description": "Example data protection policy", "Version": "2021-06-01", "Statement": [ { "DataDirection": "Inbound", "Principal": [ "arn:aws:iam::123456789012:user/ExampleUser" ], "DataIdentifier": [ "arn:aws:dataprotection::aws:data-identifier/CreditCardNumber" ], "Operation": { "Deny": {} } } ] }

アウトバウンド拒否ステートメントを使用するポリシーの例

次の例では、 AWS アカウントが を含むメッセージを受信しないようにブロックしますCreditCardNumber

{ "Name": "__example_data_protection_policy", "Description": "Example data protection policy", "Version": "2021-06-01", "Statement": [ { "DataDirection": "Outbound", "Principal": [ "arn:aws:iam::123456789012:user/ExampleUser" ], "DataIdentifier": [ "arn:aws:dataprotection::aws:data-identifier/CreditCardNumber" ], "Operation": { "Deny": {} } } ] }

Amazon に記録されたアウトバウンド拒否結果の例 CloudWatch:

{ "notification": { "messageMD5Sum": "2e8f58ff2eeed723b56b15493fbfb5a5", "messageId": "8747a956-ebf1-59da-b291-f2c2e4b87c9c", "topicArn": "arn:aws:sns:us-east-2:664555388960:test1", "timestamp": "2022-09-08 15:40:57.144" }, "delivery": { "deliveryId": "6a422437-78cc-5171-ad64-7fa3778507aa", "destination": "arn:aws:sqs:us-east-2:664555388960:test", "providerResponse": "The topic's data protection policy prohibits this message from being delivered to <subscription arn>", "dwellTimeMs": 22, "attempts": 1, "statusCode": 403 }, "status": "FAILURE" }