本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
使用 記錄 Amazon Kinesis Data Streams API呼叫 AWS CloudTrail
Amazon Kinesis Data Streams 與 整合 AWS CloudTrail,此服務提供 Kinesis Data Streams AWS 中使用者、角色或服務所採取動作的記錄。 會 CloudTrail 擷取 Kinesis Data Streams 作為事件的所有API呼叫。擷取的呼叫包括 Kinesis Data Streams 主控台的呼叫,以及 Kinesis Data Streams API操作的程式碼呼叫。如果您建立追蹤,則可以啟用 CloudTrail 事件持續交付至 Amazon S3 儲存貯體,包括 Kinesis Data Streams 的事件。如果您未設定追蹤,仍然可以在 事件歷史記錄 中檢視 CloudTrail 主控台中的最新事件。 使用 收集的資訊 CloudTrail,您可以判斷對 Kinesis Data Streams 提出的請求、提出請求的 IP 地址、提出請求的人員、提出請求的時間,以及其他詳細資訊。
若要進一步了解 CloudTrail,包括如何設定和啟用 ,請參閱 AWS CloudTrail 使用者指南 。
Kinesis Data Streams 中的資訊 CloudTrail
CloudTrail 會在您建立 AWS 帳戶時,在您的帳戶上啟用 。當 Kinesis Data Streams 中發生支援的事件活動時,該活動會與 CloudTrail 事件歷史記錄 中的其他 AWS 服務事件一起記錄在事件中。您可以在 AWS 帳戶中檢視、搜尋和下載最近的事件。如需詳細資訊,請參閱檢視具有 CloudTrail事件歷史記錄的事件。
若要持續記錄您 AWS 帳戶中的事件,包括 Kinesis Data Streams 的事件,請建立追蹤。追蹤可讓 CloudTrail 將日誌檔案交付至 Amazon S3 儲存貯體。根據預設,當您在主控台中建立追蹤時,追蹤會套用至所有 AWS 區域。追蹤會記錄 AWS 分割區中所有 區域的事件,並將日誌檔案傳遞至您指定的 Amazon S3 儲存貯體。此外,您可以設定其他 AWS 服務,以進一步分析 CloudTrail 日誌中收集的事件資料並對其採取行動。如需詳細資訊,請參閱下列內容:
Kinesis Data Streams 支援將下列動作記錄為 CloudTrail 日誌檔案中的事件:
每一筆事件或日誌專案都會包含產生請求者的資訊。身分資訊可協助您判斷下列事項:
-
請求是使用根 還是 AWS Identity and Access Management (IAM) 使用者憑證提出。
-
提出該請求時,是否使用了特定角色或聯合身分使用者的暫時安全憑證。
-
該請求是否由其他 AWS 服務提出。
如需詳細資訊,請參閱CloudTrail userIdentity 元素 。
範例:Kinesis Data Streams 日誌檔案項目
追蹤是一種組態,可讓您將事件作為日誌檔案交付至您指定的 Amazon S3 儲存貯體。 CloudTrail 日誌檔案包含一或多個日誌項目。一個事件為任何來源提出的單一請求,並包含請求動作、請求的日期和時間、請求參數等資訊。 CloudTrail 日誌檔案不是公開API呼叫的有序堆疊追蹤,因此它們不會以任何特定順序顯示。
下列範例顯示 、CreateStream
、、DescribeStream
ListStreams
DeleteStream
、 SplitShard
和 MergeShards
動作的 CloudTrail 日誌項目。
{ "Records": [ { "eventVersion": "1.01", "userIdentity": { "type": "IAMUser", "principalId": "EX_PRINCIPAL_ID", "arn": "arn:aws:iam::012345678910:user/Alice", "accountId": "012345678910", "accessKeyId": "EXAMPLE_KEY_ID", "userName": "Alice" }, "eventTime": "2014-04-19T00:16:31Z", "eventSource": "kinesis.amazonaws.com", "eventName": "CreateStream", "awsRegion": "us-east-1", "sourceIPAddress": "127.0.0.1", "userAgent": "aws-sdk-java/unknown-version Linux/x.xx", "requestParameters": { "shardCount": 1, "streamName": "GoodStream" }, "responseElements": null, "requestID": "db6c59f8-c757-11e3-bc3b-57923b443c1c", "eventID": "b7acfcd0-6ca9-4ee1-a3d7-c4e8d420d99b" }, { "eventVersion": "1.01", "userIdentity": { "type": "IAMUser", "principalId": "EX_PRINCIPAL_ID", "arn": "arn:aws:iam::012345678910:user/Alice", "accountId": "012345678910", "accessKeyId": "EXAMPLE_KEY_ID", "userName": "Alice" }, "eventTime": "2014-04-19T00:17:06Z", "eventSource": "kinesis.amazonaws.com", "eventName": "DescribeStream", "awsRegion": "us-east-1", "sourceIPAddress": "127.0.0.1", "userAgent": "aws-sdk-java/unknown-version Linux/x.xx", "requestParameters": { "streamName": "GoodStream" }, "responseElements": null, "requestID": "f0944d86-c757-11e3-b4ae-25654b1d3136", "eventID": "0b2f1396-88af-4561-b16f-398f8eaea596" }, { "eventVersion": "1.01", "userIdentity": { "type": "IAMUser", "principalId": "EX_PRINCIPAL_ID", "arn": "arn:aws:iam::012345678910:user/Alice", "accountId": "012345678910", "accessKeyId": "EXAMPLE_KEY_ID", "userName": "Alice" }, "eventTime": "2014-04-19T00:15:02Z", "eventSource": "kinesis.amazonaws.com", "eventName": "ListStreams", "awsRegion": "us-east-1", "sourceIPAddress": "127.0.0.1", "userAgent": "aws-sdk-java/unknown-version Linux/x.xx", "requestParameters": { "limit": 10 }, "responseElements": null, "requestID": "a68541ca-c757-11e3-901b-cbcfe5b3677a", "eventID": "22a5fb8f-4e61-4bee-a8ad-3b72046b4c4d" }, { "eventVersion": "1.01", "userIdentity": { "type": "IAMUser", "principalId": "EX_PRINCIPAL_ID", "arn": "arn:aws:iam::012345678910:user/Alice", "accountId": "012345678910", "accessKeyId": "EXAMPLE_KEY_ID", "userName": "Alice" }, "eventTime": "2014-04-19T00:17:07Z", "eventSource": "kinesis.amazonaws.com", "eventName": "DeleteStream", "awsRegion": "us-east-1", "sourceIPAddress": "127.0.0.1", "userAgent": "aws-sdk-java/unknown-version Linux/x.xx", "requestParameters": { "streamName": "GoodStream" }, "responseElements": null, "requestID": "f10cd97c-c757-11e3-901b-cbcfe5b3677a", "eventID": "607e7217-311a-4a08-a904-ec02944596dd" }, { "eventVersion": "1.01", "userIdentity": { "type": "IAMUser", "principalId": "EX_PRINCIPAL_ID", "arn": "arn:aws:iam::012345678910:user/Alice", "accountId": "012345678910", "accessKeyId": "EXAMPLE_KEY_ID", "userName": "Alice" }, "eventTime": "2014-04-19T00:15:03Z", "eventSource": "kinesis.amazonaws.com", "eventName": "SplitShard", "awsRegion": "us-east-1", "sourceIPAddress": "127.0.0.1", "userAgent": "aws-sdk-java/unknown-version Linux/x.xx", "requestParameters": { "shardToSplit": "shardId-000000000000", "streamName": "GoodStream", "newStartingHashKey": "11111111" }, "responseElements": null, "requestID": "a6e6e9cd-c757-11e3-901b-cbcfe5b3677a", "eventID": "dcd2126f-c8d2-4186-b32a-192dd48d7e33" }, { "eventVersion": "1.01", "userIdentity": { "type": "IAMUser", "principalId": "EX_PRINCIPAL_ID", "arn": "arn:aws:iam::012345678910:user/Alice", "accountId": "012345678910", "accessKeyId": "EXAMPLE_KEY_ID", "userName": "Alice" }, "eventTime": "2014-04-19T00:16:56Z", "eventSource": "kinesis.amazonaws.com", "eventName": "MergeShards", "awsRegion": "us-east-1", "sourceIPAddress": "127.0.0.1", "userAgent": "aws-sdk-java/unknown-version Linux/x.xx", "requestParameters": { "streamName": "GoodStream", "adjacentShardToMerge": "shardId-000000000002", "shardToMerge": "shardId-000000000001" }, "responseElements": null, "requestID": "e9f9c8eb-c757-11e3-bf1d-6948db3cd570", "eventID": "77cf0d06-ce90-42da-9576-71986fec411f" } ] }