

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

# を使用した Macie API コールのログ記録 AWS CloudTrail
<a name="macie-cloudtrail"></a>

Amazon Macie は、ユーザー、ロール、または AWS のサービスが実行したアクションの記録を提供するサービスである [AWS CloudTrail](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-user-guide.html) と統合されています。CloudTrail は、Macie のすべての API コールを管理イベントとしてキャプチャします。コールには、Amazon Macie コンソールからの呼び出しと、Amazon Macie API オペレーションに対するプログラムによる呼び出しが含まれます。CloudTrail で収集された情報を使用して、Macie に対するリクエスト、リクエスト元の IP アドレス、リクエストの作成日時、その他の詳細を確認できます。

各イベントまたはログエントリには、誰がリクエストを生成したかという情報が含まれます。アイデンティティ情報は、以下を判別するのに役立ちます。
+ ルートユーザーまたはユーザー認証情報のどちらを使用してリクエストが送信されたか。
+  AWS IAM アイデンティティセンター ユーザーに代わってリクエストが行われたかどうか。
+ リクエストがロールまたはフェデレーションユーザーのテンポラリなセキュリティ認証情報を使用して行われたかどうか。
+ リクエストが、別の AWS のサービスによって送信されたかどうか。

CloudTrail は、アカウントの作成 AWS アカウント 時に でアクティブになり、CloudTrail **イベント履歴**に自動的にアクセスできます。CloudTrail の **[イベント履歴]** では、 AWS リージョンで過去 90 日間に記録された管理イベントの表示、検索、およびダウンロードが可能で、変更不可能な記録を確認できます。詳細については、[「 ユーザーガイド」のCloudTrail イベント履歴の使用](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/view-cloudtrail-events.html)」を参照してください。 *AWS CloudTrail ***[イベント履歴]** の閲覧には CloudTrail の料金はかかりません。

 AWS アカウント 過去 90 日間の のイベントの継続的な記録については、証跡または CloudTrail Lake イベントデータストアを作成します。

**CloudTrail 証跡**  
*証跡*により、CloudTrail はログファイルを Amazon S3 バケットに配信できます。を使用して作成されたすべての証跡 AWS マネジメントコンソール はマルチリージョンです。 AWS CLIを使用する際は、単一リージョンまたは複数リージョンの証跡を作成できます。アカウント AWS リージョン 内のすべての でアクティビティをキャプチャするため、マルチリージョン証跡を作成することをお勧めします。単一リージョンの証跡を作成する場合、証跡の AWS リージョンに記録されたイベントのみを表示できます。証跡の詳細については、「*AWS CloudTrail ユーザーガイド*」の「[AWS アカウントの証跡の作成](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-create-and-update-a-trail.html)」および「[組織の証跡の作成](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-trail-organization.html)」を参照してください。  
証跡を作成すると、進行中の管理イベントのコピーを 1 つ無料で CloudTrail から Amazon S3 バケットに配信できますが、Amazon S3 ストレージには料金がかかります。CloudTrail の料金の詳細については、「[AWS CloudTrail の料金](https://aws.amazon.com/cloudtrail/pricing/)」を参照してください。Amazon S3 の料金に関する詳細については、「[Amazon S3 の料金](https://aws.amazon.com/s3/pricing/)」を参照してください。

**CloudTrail Lake イベントデータストア**  
*[CloudTrail Lake]* を使用すると、イベントに対して SQL ベースのクエリを実行できます。CloudTrail Lake は、行ベースの JSON 形式の既存のイベントを [Apache ORC](https://orc.apache.org/) 形式に変換します。ORC は、データを高速に取得するために最適化された単票ストレージ形式です。イベントは、*イベントデータストア*に集約されます。イベントデータストアは、[高度なイベントセレクタ](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-lake-concepts.html#adv-event-selectors)を適用することによって選択する条件に基づいた、イベントのイミュータブルなコレクションです。どのイベントが存続し、クエリに使用できるかは、イベントデータストアに適用するセレクタが制御します。CloudTrail Lake の詳細については、 *AWS CloudTrail ユーザーガイド*の[AWS CloudTrail 「Lake の使用](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-lake.html)」を参照してください。  
CloudTrail Lake のイベントデータストアとクエリにはコストがかかります。イベントデータストアを作成する際に、イベントデータストアに使用する[料金オプション](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-lake-manage-costs.html#cloudtrail-lake-manage-costs-pricing-option)を選択します。料金オプションによって、イベントの取り込みと保存にかかる料金、および、そのイベントデータストアのデフォルトと最長の保持期間が決まります。CloudTrail の料金の詳細については、「[AWS CloudTrail の料金](https://aws.amazon.com/cloudtrail/pricing/)」を参照してください。

## の Macie 管理イベント AWS CloudTrail
<a name="logging-ct-mgmt-events"></a>

[管理イベント](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-management-events-with-cloudtrail.html#logging-management-events)は、 のリソースで実行される管理オペレーションに関する情報を提供します AWS アカウント。これらのイベントは、コントロールプレーンオペレーションとも呼ばれます。CloudTrail は、デフォルトで管理イベントをログ記録します。

Amazon Macie は、すべての Macie コントロールプレーンオペレーションを CloudTrail の管理イベントとしてログに記録します。例えば `ListFindings`、`DescribeBuckets`、`CreateClassificationJob` の各オペレーションへのコールは、CloudTrail 内に管理イベントを生成します。各イベントには `eventSource` フィールドが含まれます。このフィールドは、リクエストが行われた AWS のサービス を示します。Macie イベントの場合、このフィールドの値は `macie2.amazonaws.com` です。

Macie が CloudTrail でログに記録するコントロールプレーンオペレーションのリストについては、**Amazon Macie API リファレンスの「[オペレーション](https://docs.aws.amazon.com/macie/latest/APIReference/operations.html)」を参照してください。

## での Macie イベントの例 AWS CloudTrail
<a name="logging-ct-events-examples"></a>

各イベントは任意の送信元からの単一のリクエストを表し、リクエストされた API オペレーション、オペレーションの日時、リクエストパラメータなどに関する情報を含みます。CloudTrail ログファイルは、パブリック API コールの順序付けられたスタックトレースではないため、イベントは特定の順序で表示されません。

以下の例では、Amazon Macie オペレーションを示す CloudTrail イベントを示しています。イベントに含まれる可能性のある情報の詳細については、「*AWS CloudTrail ユーザーガイド*」の「[CloudTrail レコードの内容](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-event-reference-record-contents.html)」を参照してください。

**Topics**
+ [検出結果の一覧表示](#logging-ct-events-example-listfindings)
+ [検出結果の機密データのサンプルを取得する](#logging-ct-events-example-getsdoccurrences)
+ [メンバーシップの招待の削除](#logging-ct-events-example-deleteinvitations)
+ [Macie を無効化する](#logging-ct-events-example-disablemacie)

### 例: 検出結果の一覧表示
<a name="logging-ct-events-example-listfindings"></a>

次の例は、Amazon Macie [https://docs.aws.amazon.com/macie/latest/APIReference/findings.html](https://docs.aws.amazon.com/macie/latest/APIReference/findings.html)オペレーションの CloudTrail イベントを示しています。この例では、 AWS Identity and Access Management (IAM) ユーザー (`Mary_Major`) は Amazon Macie コンソールを使用して、アカウントの現在のポリシー検出結果に関する情報のサブセットを取得しました。

```
{
    "eventVersion": "1.08",
    "userIdentity": {
        "type": "IAMUser",
        "principalId": "123456789012",
        "arn": "arn:aws:iam::123456789012:user/Mary_Major",
        "accountId": "123456789012",
        "accessKeyId": "AKIAIOSFODNN7EXAMPLE",
        "userName": "Mary_Major",
        "sessionContext":{
            "attributes": {
                "creationdate": "2024-11-14T15:49:57Z",
                "mfaAuthenticated": "false"
            }
        }
    },
    "eventTime": "2024-11-14T16:09:56Z",
    "eventSource": "macie2.amazonaws.com",
    "eventName": "ListFindings",
    "awsRegion": "us-east-1",
    "sourceIPAddress": "198.51.100.1",
    "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36",
    "requestParameters": {
        "sortCriteria": {
            "attributeName": "updatedAt",
            "orderBy": "DESC"
        },
        "findingCriteria": {
            "criterion": {
                "archived": {
                    "eq": [
                        "false"
                    ]
                },
                "category": {
                    "eq": [
                        "POLICY"
                    ]
                }
            }
        },
        "maxResults": 25,
        "nextToken": ""
    },
    "responseElements": null,
    "requestID": "d58af6be-1115-4a41-91f8-ace03example",
    "eventID": "ad97fac5-f7cf-4ff9-9cf2-d0676example",
    "readOnly": true,
    "eventType": "AwsApiCall",
    "managementEvent": true,
    "recipientAccountId": "123456789012",
    "eventCategory": "Management"
}
```

### 例: 検出結果についての機密データのサンプルの取得
<a name="logging-ct-events-example-getsdoccurrences"></a>

この例は、Amazon Macie が検出結果で報告した機密データのサンプルを取得して公開するための CloudTrail イベントを示しています。この例では、ある IAM ユーザー (`JohnDoe`) が Amazon Macie コンソールを使用して機密データのサンプルを取得して公開しました。ユーザーのアカウントは、IAM ロール (`MacieReveal`) を引き受け、影響を受ける Amazon Simple Storage Service (Amazon S3) オブジェクトから機密データサンプルを取得して公開するように設定されています。

次のイベントは、Amazon Macie [https://docs.aws.amazon.com/macie/latest/APIReference/findings-findingid-reveal.html](https://docs.aws.amazon.com/macie/latest/APIReference/findings-findingid-reveal.html)オペレーションを使用して機密データサンプルを取得して公開するユーザーのリクエストに関する詳細を示しています。

```
{
    "eventVersion": "1.08",
    "userIdentity": {
        "type": "AssumedRole",
        "principalId": "UU4MH7OYK5ZCOAEXAMPLE:JohnDoe",
        "arn": "arn:aws:sts::111122223333:assumed-role/Admin/JohnDoe",
        "accountId": "111122223333",
        "accessKeyId": "AKIAI44QH8DHBEXAMPLE",
        "sessionContext": {
            "sessionIssuer": {
                "type": "Role",
                "principalId": "UU4MH7OYK5ZCOAEXAMPLE",
                "arn": "arn:aws:iam::111122223333:role/Admin",
                "accountId": "111122223333",
                "userName": "Admin"
            },
            "webIdFederationData": {},
            "attributes": {
                "creationDate": "2024-12-12T14:40:23Z",
                "mfaAuthenticated": "false"
            }
        }
    },
    "eventTime": "2024-12-12T17:04:47Z",
    "eventSource": "macie2.amazonaws.com",
    "eventName": "GetSensitiveDataOccurrences",
    "awsRegion": "us-east-1",
    "sourceIPAddress": "198.51.100.252",
    "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36",
    "requestParameters": {
        "findingId": "3ad9d8cd61c5c390bede45cd2example"
    },
    "responseElements": null,
    "requestID": "c30cb760-5102-47e7-88d8-ff2e8example",
    "eventID": "baf52d92-f9c3-431a-bfe8-71c81example",
    "readOnly": true,
    "eventType": "AwsApiCall",
    "managementEvent": true,
    "recipientAccountId": "111122223333",
    "eventCategory": "Management"
}
```

次のイベントは、Macie の詳細を表示し、 AWS Security Token Service (`MacieReveal`) [https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html](https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html)オペレーションを使用して指定された IAM ロール (AWS STS) を引き受けます。

```
{
    "eventVersion": "1.08",
    "userIdentity": {
        "type": "AWSService",
        "invokedBy": "reveal-samples.macie.amazonaws.com"
    },
    "eventTime": "2024-12-12T17:04:47Z",
    "eventSource": "sts.amazonaws.com",
    "eventName": "AssumeRole",
    "awsRegion": "us-east-1",
    "sourceIPAddress": "reveal-samples.macie.amazonaws.com",
    "userAgent": "reveal-samples.macie.amazonaws.com",
    "requestParameters": {
        "roleArn": "arn:aws:iam::111122223333:role/MacieReveal",
        "roleSessionName": "RevealCrossAccount"
    },
    "responseElements": {
        "credentials": {
            "accessKeyId": "AKIAI44QH8DHBEXAMPLE",
            "sessionToken": "XXYYaz...
EXAMPLE_SESSION_TOKEN
XXyYaZAz",
            "expiration": "Dec 12, 2024, 6:04:47 PM"
        },
        "assumedRoleUser": {
            "assumedRoleId": "AROAXOTKAROCSNEXAMPLE:RevealCrossAccount",
            "arn": "arn:aws:sts::111122223333:assumed-role/MacieReveal/RevealCrossAccount"
        }
    },
    "requestID": "d905cea8-2dcb-44c1-948e-19419example",
    "eventID": "74ee4d0c-932d-3332-87aa-8bcf3example",
    "readOnly": true,
    "resources": [
        {
            "accountId": "111122223333",
            "type": "AWS::IAM::Role",
            "ARN": "arn:aws:iam::111122223333:role/MacieReveal"
        }
    ],
    "eventType": "AwsApiCall",
    "managementEvent": true,
    "recipientAccountId": "111122223333",
    "eventCategory": "Management"
}
```

### 例: メンバーシップの招待を削除する
<a name="logging-ct-events-example-deleteinvitations"></a>

次の例は、Amazon Macie [DeleteInvitations](https://docs.aws.amazon.com/macie/latest/APIReference/invitations-delete.html) オペレーションの CloudTrail イベントを示しています。この例では、メンバーがアカウントの管理者アカウントとの関連付けを解除し、管理者の組織への招待を削除したときに、Macie は組織の委任 Macie 管理者アカウントにイベントを記録しました。この例では、管理者の のアカウント ID は AWS アカウント です`777788889999`。メンバーアカウントのアカウント ID は です`111122223333`。

```
{
    "eventVersion": "1.11",
    "userIdentity": {
        "type": "AWSAccount",
        "accountId": "111122223333",
        "invokedBy": "macie2.amazonaws.com"
    },
    "eventTime": "2025-09-20T18:44:58Z",
    "eventSource": "macie2.amazonaws.com",
    "eventName": "MacieMemberUpdated",
    "awsRegion": "us-east-2",
    "sourceIPAddress": "macie2.amazonaws.com",
    "userAgent": "macie2.amazonaws.com",
    "requestParameters": null,
    "responseElements": null,
    "eventID": "2f08152c-66b9-35f8-8a10-6fe1bexample",
    "readOnly": false,
    "resources": [{
        "accountId": "777788889999",
        "type": "AWS::Macie::Member",
        "ARN": "arn:aws:macie2:us-east-2:777788889999:member/111122223333"
    }],
    "eventType": "AwsServiceEvent",
    "managementEvent": true,
    "recipientAccountId": "777788889999",
    "sharedEventID": "2bff2ad0-f233-48c6-8720-ca9dbexample",
    "serviceEventDetails": {
        "memberAccount": "111122223333",
        "memberResourceStatus": "DELETED",
        "apiOperation": "DeleteInvitations"
    },
    "eventCategory": "Management"
}
```

### 例: Macie の無効化
<a name="logging-ct-events-example-disablemacie"></a>

この例では、 の Amazon Macie を無効にする CloudTrail イベントを示しています AWS アカウント。この例では、IAM ユーザー (`JohnDoe`) がアカウントの Macie を無効にしています。その後、Macie はアカウントの他の Macie リソースとデータを削除するだけでなく、アカウントのすべての機密データ検出ジョブをキャンセルして削除しました。

次のイベントは、Amazon Macie オペレーションを使用してアカウントの Macie を無効にするユーザーのリクエストの詳細を示しています。 [https://docs.aws.amazon.com/macie/latest/APIReference/macie.html](https://docs.aws.amazon.com/macie/latest/APIReference/macie.html)

```
{
    "eventVersion": "1.09",
    "userIdentity": {
        "type": "AssumedRole",
        "principalId": "AROAXYKJR2G5JXEXAMPLE:JohnDoe",
        "arn": "arn:aws:sts::123456789012:assumed-role/Admin/JohnDoe",
        "accountId": "123456789012",
        "accessKeyId": "AKIAIOSFODNN7EXAMPLE",
        "sessionContext": {
            "sessionIssuer": {
                "type": "Role",
                "principalId": "AROAXYKJR2G5JXEXAMPLE",
                "arn": "arn:aws:iam::123456789012:role/Admin",
                "accountId": "123456789012",
                "userName": "Admin"
            },
            "attributes": {
                "creationDate": "2025-09-18T21:54:42Z",
                "mfaAuthenticated": "true"
            }
        }
    },
    "eventTime": "2025-09-18T21:57:06Z",
    "eventSource": "macie2.amazonaws.com",
    "eventName": "DisableMacie",
    "awsRegion": "us-east-2",
    "sourceIPAddress": "198.51.100.1",
    "userAgent": "aws-cli/2.17.9 md/awscrt#0.20.11 ua/2.0 os/macos#24.4.0 md/arch#x86_64 lang/python#3.11.8 md/pyimpl#CPython cfg/retry-mode#standard md/installer#exe md/prompt#off md/command#macie2.disable-macie",
    "requestParameters": null,
    "responseElements": null,
    "requestID": "941d1d6c-c1b2-4db5-845f-1250cexample",
    "eventID": "06554dba-417b-4a65-90b8-4e5d5example",
    "readOnly": false,
    "eventType": "AwsApiCall",
    "managementEvent": true,
    "recipientAccountId": "123456789012",
    "eventCategory": "Management"
}
```

次のイベントでは、Macie の詳細が表示され、アカウントの機密データ検出ジョブの 1 つをキャンセルおよび削除します。

```
{
    "eventVersion": "1.11",
    "userIdentity": {
        "type": "Root",
        "accountId": "123456789012",
        "invokedBy": "macie2.amazonaws.com"
    },
    "eventTime": "2025-09-18T21:57:18Z",
    "eventSource": "macie2.amazonaws.com",
    "eventName": "MacieClassificationJobCancelled",
    "awsRegion": "us-east-2",
    "sourceIPAddress": "macie2.amazonaws.com",
    "userAgent": "macie2.amazonaws.com",
    "requestParameters": null,
    "responseElements": null,
    "eventID": "df39ea1d-cd4e-4130-8cd5-cd33cexample",
    "readOnly": false,
    "resources": [{
        "accountId": "123456789012",
        "type": "AWS::Macie::ClassificationJob",
        "ARN": "arn:aws:macie2:us-east-2:123456789012:classification-job/f252cbe854ae0a1a47d8304f4example"
    }],
    "eventType": "AwsServiceEvent",
    "managementEvent": true,
    "recipientAccountId": "123456789012",
    "serviceEventDetails": {
        "macieStatus": "DISABLED",
        "classificationJobStatus": "CANCELLED"
    },
    "eventCategory": "Management"
}
```