使用記錄麥西API呼叫 AWS CloudTrail - Amazon Macie

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

使用記錄麥西API呼叫 AWS CloudTrail

Amazon Macie 與整合 AWS CloudTrail,這是一項服務,可提供使用者、角色或其他使用者在 Macie 中採取的動作記錄。 AWS 服務 CloudTrail捕獲對 Macie 的所有API呼叫作為事件。擷取的呼叫包括來自 Amazon Macie 主控台的呼叫,以及對 Amazon Macie 操作的程式設計呼叫。API

如果您建立追蹤,您可以啟用持續交付 CloudTrail 事件到 Amazon Simple Storage Service (Amazon S3) 儲存貯體,包括 Macie 的事件。如果您未設定追蹤,您仍然可以使用 AWS CloudTrail 主控台上的事件歷程記錄來檢閱最近的事件。使用收集的信息 CloudTrail,您可以確定向 Macie 提出的請求,提出請求的 IP 地址,提出請求的人員,提出請求的時間以及其他詳細信息。

若要進一步了解 CloudTrail,請參閱使AWS CloudTrail 用者指南

马西埃信息 AWS CloudTrail

AWS CloudTrail 在您建立帳戶 AWS 帳戶 時啟用。當 Amazon Macie 中發生活動時,該活動會與事件歷史記錄中的其他 CloudTrail 事件一起記錄在 AWS 事件中。您可以查看,搜索和下載最近的事件 AWS 帳戶。若要取得更多資訊,請參閱《使用指南》中的〈AWS CloudTrail 使用 CloudTrail 事件歷程

為了持續記錄您的事件 AWS 帳戶,包括 Macie 的事件,請創建一個跟踪。追蹤可 CloudTrail 將日誌檔交付到 Amazon Simple Storage Service (Amazon S3) 儲存貯體。依預設,當您使用 AWS CloudTrail 主控台建立追蹤時,追蹤會套用至所有項目 AWS 區域。追蹤記錄來自 AWS 分割區中所有區域的事件,並將日誌檔傳送到您指定的 S3 儲存貯體。此外,您可以設定其他, AWS 服務 以進一步分析 CloudTrail 記錄中收集的事件資料並採取行動。如需詳細資訊,請參閱《AWS CloudTrail 使用者指南》中的以下主題:

所有 Macie 動作都會記錄下來, CloudTrail 並記錄在 Amazon Macie API 參考資料中。例如,呼叫CreateClassificationJobDescribeBuckets、和ListFindings動作會在 CloudTrail 記錄檔中產生項目。

每一筆事件或日誌專案都會包含產生請求者的資訊。身分資訊可協助您判斷下列事項:

  • 要求是使用 root 或 AWS Identity and Access Management (IAM) 使用者認證進行。

  • 提出該請求時,是否使用了特定角色或聯合身分使用者的暫時安全憑證。

  • 該請求是否由另一項 AWS 服務服務提出。

若要取得更多資訊,請參閱《AWS CloudTrail 使用指南》中的CloudTrail userIdentity元素

瞭解 Macie 的記錄檔項目

追蹤是一種組態,可讓事件以日誌檔的形式交付到您指定的 Amazon Simple Storage Service (Amazon S3) 儲存貯體。事件代表來自任何來源的單一請求,包括有關請求的操作,動作的日期和時間,請求參數等信息。 AWS CloudTrail 記錄檔包含一或多個事件記錄項目。 CloudTrail 日誌文件不是公共API調用的有序堆棧跟踪,因此它們不會以任何特定順序顯示。

下列範例顯示示範 Amazon Macie 動作事件的 CloudTrail 記錄項目。如需有關記錄項目可能包含之資訊的詳細資訊,請參閱《AWS CloudTrail 使用指南》中的瞭解 CloudTrail 事件

範例:列出搜尋結果

下列範例顯示示範 Macie ListFindings動作事件的 CloudTrail 記錄項目。在此範例中, AWS Identity and Access Management (IAM) user () 使用者 (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": "2023-11-14T15:49:57Z", "mfaAuthenticated": "false" } } }, "eventTime": "2023-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" }
範例:擷取發現項目的敏感資料範例

此範例顯示的 CloudTrail 記錄項目會示範擷取和顯示 Macie 在發現項目中報告之敏感資料樣本的事件。在此範例中,使用IAM者 (JohnDoe) 使用 Amazon Macie 主控台擷取和顯示敏感資料樣本。使用者的 Macie 帳戶設定為假設IAM角色 (MacieReveal) 來擷取和揭露敏感資料範例。

下列記錄事件顯示使用者透過執行 Macie GetSensitiveDataOccurrences動作擷取和顯示敏感資料樣本之要求的詳細資料。

{ "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": "2023-12-12T14:40:23Z", "mfaAuthenticated": "false" } } }, "eventTime": "2023-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 的詳細資料,然後透過執行 (MacieReveal) AssumeRole動作假設指定的 IAM role AWS Security Token Service (AWS STS)。

{ "eventVersion": "1.08", "userIdentity": { "type": "AWSService", "invokedBy": "reveal-samples.macie.amazonaws.com" }, "eventTime": "2023-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, 2023, 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" }