本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
使用記錄 AWS Direct Connect API呼叫 AWS CloudTrail
AWS Direct Connect 與 (提供中的使用者 AWS CloudTrail、角色或服務所採取的動作記錄) 的 AWS 服務整合 AWS Direct Connect。 CloudTrail 擷取 AWS Direct Connect 為事件的所有API呼叫。擷取的呼叫包括來自 AWS Direct Connect 主控台的呼叫和對 AWS Direct Connect API作業的程式碼呼叫。如果您建立追蹤,您可以啟用持續交付 CloudTrail 事件到 Amazon S3 儲存貯體,包括 AWS Direct Connect. 如果您未設定追蹤,您仍然可以在 [事件歷程記錄] 中檢視 CloudTrail 主控台中最近的事件。使用收集的資訊 CloudTrail,您可以判斷提出的要求 AWS Direct Connect、提出要求的 IP 位址、提出要求的人員、提出要求的時間,以及其他詳細資訊。
如需詳細資訊,請參閱《AWS CloudTrail 使用者指南》https://docs.aws.amazon.com/awscloudtrail/latest/userguide/。
AWS Direct Connect 中的資訊 CloudTrail
CloudTrail 在您創建 AWS 帳戶時,您的帳戶已啟用。當活動發生在中時 AWS Direct Connect,該活動會與事件歷史記錄中的其他 AWS 服務 CloudTrail 事件一起記錄在事件中。您可以檢視、搜尋和下載 AWS 帳戶的最新事件。如需詳細資訊,請參閱檢視具有事 CloudTrail 件記錄的事件。
如需 AWS 帳戶中持續記錄事件 (包括的事件) AWS Direct Connect,請建立追蹤。追蹤可 CloudTrail 將日誌檔交付到 Amazon S3 儲存貯體。根據預設,當您在主控台中建立追蹤時,追蹤會套用至所有 AWS 區域。追蹤記錄來自 AWS 分區中所有區域的事件,並將日誌檔傳送到您指定的 Amazon S3 儲存貯體。此外,您還可以設定其他 AWS 服務,以進一步分析 CloudTrail 記錄中收集的事件資料並採取行動。如需詳細資訊,請參閱下列內容:
所有 AWS Direct Connect 動作均由記錄, CloudTrail 並將其記錄在「AWS Direct Connect API參考」中。例如,呼叫CreateConnection
和動CreatePrivateVirtualInterface
作會在 CloudTrail 記錄檔中產生項目。
每一筆事件或日誌專案都會包含產生請求者的資訊。身分資訊可協助您判斷下列事項:
-
請求是使用根或 AWS Identity and Access Management (IAM用戶)憑據提出的。
-
提出該請求時,是否使用了特定角色或聯合身分使用者的暫時安全憑證。
-
請求是否由其他 AWS 服務提出。
如需詳細資訊,請參閱CloudTrailuserIdentity
元素。
瞭解 AWS Direct Connect 記錄檔項目
追蹤是一種組態,可讓事件以日誌檔的形式傳遞到您指定的 Amazon S3 儲存貯體。 CloudTrail 記錄檔包含一或多個記錄項目。事件代表來自任何來源的單一請求,包括有關請求的操作,動作的日期和時間,請求參數等信息。 CloudTrail 日誌文件不是公共API調用的有序堆棧跟踪,因此它們不會以任何特定順序顯示。
以下是的範例記 CloudTrail 錄檔記錄 AWS Direct Connect。
範例: CreateConnection
{
"Records": [
{
"eventVersion": "1.0",
"userIdentity": {
"type": "IAMUser",
"principalId": "EX_PRINCIPAL_ID",
"arn": "arn:aws:iam::123456789012:user/Alice",
"accountId": "123456789012",
"accessKeyId": "EXAMPLE_KEY_ID",
"userName": "Alice",
"sessionContext": {
"attributes": {
"mfaAuthenticated": "false",
"creationDate": "2014-04-04T12:23:05Z"
}
}
},
"eventTime": "2014-04-04T17:28:16Z",
"eventSource": "directconnect.amazonaws.com",
"eventName": "CreateConnection",
"awsRegion": "us-west-2",
"sourceIPAddress": "127.0.0.1",
"userAgent": "Coral/Jakarta",
"requestParameters": {
"location": "EqSE2",
"connectionName": "MyExampleConnection",
"bandwidth": "1Gbps"
},
"responseElements": {
"location": "EqSE2",
"region": "us-west-2",
"connectionState": "requested",
"bandwidth": "1Gbps",
"ownerAccount": "123456789012",
"connectionId": "dxcon-fhajolyy",
"connectionName": "MyExampleConnection"
}
},
...
]
}
範例: CreatePrivateVirtualInterface
{
"Records": [
{
"eventVersion": "1.0",
"userIdentity": {
"type": "IAMUser",
"principalId": "EX_PRINCIPAL_ID",
"arn": "arn:aws:iam::123456789012:user/Alice",
"accountId": "123456789012",
"accessKeyId": "EXAMPLE_KEY_ID",
"userName": "Alice",
"sessionContext": {
"attributes": {
"mfaAuthenticated": "false",
"creationDate": "2014-04-04T12:23:05Z"
}
}
},
"eventTime": "2014-04-04T17:39:55Z",
"eventSource": "directconnect.amazonaws.com",
"eventName": "CreatePrivateVirtualInterface",
"awsRegion": "us-west-2",
"sourceIPAddress": "127.0.0.1",
"userAgent": "Coral/Jakarta",
"requestParameters": {
"connectionId": "dxcon-fhajolyy",
"newPrivateVirtualInterface": {
"virtualInterfaceName": "MyVirtualInterface",
"customerAddress": "[PROTECTED]",
"authKey": "[PROTECTED]",
"asn": -1,
"virtualGatewayId": "vgw-bb09d4a5",
"amazonAddress": "[PROTECTED]",
"vlan": 123
}
},
"responseElements": {
"virtualInterfaceId": "dxvif-fgq61m6w",
"authKey": "[PROTECTED]",
"virtualGatewayId": "vgw-bb09d4a5",
"customerRouterConfig": "[PROTECTED]",
"virtualInterfaceType": "private",
"asn": -1,
"routeFilterPrefixes": [],
"virtualInterfaceName": "MyVirtualInterface",
"virtualInterfaceState": "pending",
"customerAddress": "[PROTECTED]",
"vlan": 123,
"ownerAccount": "123456789012",
"amazonAddress": "[PROTECTED]",
"connectionId": "dxcon-fhajolyy",
"location": "EqSE2"
}
},
...
]
}
範例: DescribeConnections
{
"Records": [
{
"eventVersion": "1.0",
"userIdentity": {
"type": "IAMUser",
"principalId": "EX_PRINCIPAL_ID",
"arn": "arn:aws:iam::123456789012:user/Alice",
"accountId": "123456789012",
"accessKeyId": "EXAMPLE_KEY_ID",
"userName": "Alice",
"sessionContext": {
"attributes": {
"mfaAuthenticated": "false",
"creationDate": "2014-04-04T12:23:05Z"
}
}
},
"eventTime": "2014-04-04T17:27:28Z",
"eventSource": "directconnect.amazonaws.com",
"eventName": "DescribeConnections",
"awsRegion": "us-west-2",
"sourceIPAddress": "127.0.0.1",
"userAgent": "Coral/Jakarta",
"requestParameters": null,
"responseElements": null
},
...
]
}
範例: DescribeVirtualInterfaces
{
"Records": [
{
"eventVersion": "1.0",
"userIdentity": {
"type": "IAMUser",
"principalId": "EX_PRINCIPAL_ID",
"arn": "arn:aws:iam::123456789012:user/Alice",
"accountId": "123456789012",
"accessKeyId": "EXAMPLE_KEY_ID",
"userName": "Alice",
"sessionContext": {
"attributes": {
"mfaAuthenticated": "false",
"creationDate": "2014-04-04T12:23:05Z"
}
}
},
"eventTime": "2014-04-04T17:37:53Z",
"eventSource": "directconnect.amazonaws.com",
"eventName": "DescribeVirtualInterfaces",
"awsRegion": "us-west-2",
"sourceIPAddress": "127.0.0.1",
"userAgent": "Coral/Jakarta",
"requestParameters": {
"connectionId": "dxcon-fhajolyy"
},
"responseElements": null
},
...
]
}