本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
了解 CloudTrail 事件
中的事件 CloudTrail 是 AWS 帳戶中活動的記錄。此活動可以是IAM識別所採取的動作,也可以是可監控的服務。 CloudTrail CloudTrail 事件提供透過 AWS Management Console、 AWS SDKs、命令列工具API和其他進行的和非API帳戶活動的歷史記錄 AWS services。
CloudTrail 日誌文件不是公共API調用的有序堆棧跟踪,因此事件不會以任何特定順序出現。
有三種類型的 CloudTrail 事件:
依預設,追蹤和事件資料存放區會記錄管理事件,但不會記錄資料或 Insights 事件。
所有事件類型都使用 CloudTrail JSON記錄格式。日誌會包含您帳戶中的資源請求資訊,例如請求的提出者、使用過的服務、執行過的動作,以及動作的參數。事件資料都包含在 Records
陣列中。
如需 CloudTrail 事件記錄欄位的資訊,請參閱CloudTrail 記錄內容。
管理事件
管理事件提供有關對您 AWS 帳戶中資源執行之管理作業的相關資訊。這些也稱為控制平面操作。
範例管理事件包含:
-
設定安全性 (例如 AWS Identity and Access Management
AttachRolePolicy
API作業)。 -
註冊設備(例如,Amazon EC2
CreateDefaultVpc
API 操作)。 -
設定路由資料的規則 (例如 Amazon EC2
CreateSubnet
API 作業)。 -
設定記錄 (例如 AWS CloudTrail
CreateTrail
API作業)。
管理事件也可能包含您帳戶中發生的非API事件。例如,當使用者登入您的帳戶時,會 CloudTrail 記錄ConsoleLogin
事件。如需詳細資訊,請參閱 擷取的非API事件 CloudTrail。
依預設, CloudTrail 追蹤和 CloudTrail Lake 事件資料會儲存記錄管理事件。如需記錄管理事件的詳細資訊,請參閱記錄管理事件。
下列範例顯示管理事件的單一記錄檔記錄。在此事件中,名為的IAM使用者會Mary_Major
執行aws cloudtrail start-logging命令來呼叫 CloudTrail StartLogging
動作,以便在名為的追蹤上啟動記錄程序myTrail
。
{ "eventVersion": "1.09", "userIdentity": { "type": "IAMUser", "principalId": "EXAMPLE6E4XEGITWATV6R", "arn": "arn:aws:iam::123456789012:user/Mary_Major", "accountId": "123456789012", "accessKeyId": "AKIAIOSFODNN7EXAMPLE", "userName": "Mary_Major", "sessionContext": { "attributes": { "creationDate": "2023-07-19T21:11:57Z", "mfaAuthenticated": "false" } } }, "eventTime": "2023-07-19T21:33:41Z", "eventSource": "cloudtrail.amazonaws.com", "eventName": "StartLogging", "awsRegion": "us-east-1", "sourceIPAddress": "192.0.2.0", "userAgent": "aws-cli/2.13.5 Python/3.11.4 Linux/4.14.255-314-253.539.amzn2.x86_64 exec-env/CloudShell exe/x86_64.amzn.2 prompt/off command/cloudtrail.start-logging", "requestParameters": { "name": "myTrail" }, "responseElements": null, "requestID": "9d478fc1-4f10-490f-a26b-EXAMPLE0e932", "eventID": "eae87c48-d421-4626-94f5-EXAMPLEac994", "readOnly": false, "eventType": "AwsApiCall", "managementEvent": true, "recipientAccountId": "123456789012", "eventCategory": "Management", "tlsDetails": { "tlsVersion": "TLSv1.2", "cipherSuite": "ECDHE-RSA-AES128-GCM-SHA256", "clientProvidedHostHeader": "cloudtrail.us-east-1.amazonaws.com" }, "sessionCredentialFromConsole": "true" }
在下一個範例中,名為的使用IAM者Paulo_Santos
執行aws cloudtrail start-event-data-store-ingestion命令來呼叫StartEventDataStoreIngestion
動作以開始擷取事件資料存放區。
{ "eventVersion": "1.09", "userIdentity": { "type": "IAMUser", "principalId": "EXAMPLEPHCNW5EQV7NA54", "arn": "arn:aws:iam::123456789012:user/Paulo_Santos", "accountId": "123456789012", "accessKeyId": "(AKIAIOSFODNN7EXAMPLE", "userName": "Paulo_Santos", "sessionContext": { "attributes": { "creationDate": "2023-07-21T21:55:30Z", "mfaAuthenticated": "false" } } }, "eventTime": "2023-07-21T21:57:28Z", "eventSource": "cloudtrail.amazonaws.com", "eventName": "StartEventDataStoreIngestion", "awsRegion": "us-east-1", "sourceIPAddress": "192.0.2.0", "userAgent": "aws-cli/2.13.1 Python/3.11.4 Linux/4.14.255-314-253.539.amzn2.x86_64 exec-env/CloudShell exe/x86_64.amzn.2 prompt/off command/cloudtrail.start-event-data-store-ingestion", "requestParameters": { "eventDataStore": "arn:aws:cloudtrail:us-east-1:123456789012:eventdatastore/2a8f2138-0caa-46c8-a194-EXAMPLE87d41" }, "responseElements": null, "requestID": "f62a3494-ba4e-49ee-8e27-EXAMPLE4253f", "eventID": "d97ca7e2-04fe-45b4-882d-EXAMPLEa9b2c", "readOnly": false, "eventType": "AwsApiCall", "managementEvent": true, "recipientAccountId": "123456789012", "eventCategory": "Management", "tlsDetails": { "tlsVersion": "TLSv1.2", "cipherSuite": "ECDHE-RSA-AES128-GCM-SHA256", "clientProvidedHostHeader": "cloudtrail.us-east-1.amazonaws.com" }, "sessionCredentialFromConsole": "true" }
資料事件
資料事件提供在資源上執行或於資源中執行之資源操作的相關資訊。這些也稱為資料平面操作。資料事件通常是大量資料的活動。
範例資料事件包含:
-
S3 儲存貯體中物件上的 Amazon S3 物件層級API活動 (例如
DeleteObject
,和PutObject
API操作)。GetObject
-
AWS Lambda 函數執行活動(的
Invoke
API)。 -
CloudTrail
PutAuditEvents
CloudTrail Lake 頻道上的活動,用於從外部記錄事件 AWS。 -
Amazon SNS
Publish
和主題的PublishBatch
API操作。
下表顯示可用於追蹤和事件資料存放區的資料事件類型。資料事件類型 (主控台) 欄顯示主控台中的適當選取項目。resource .type 值欄會顯示您要指定的resources.type
值,以便使用或將該類型的資料事件納入追蹤或事件資料存放區中。 AWS CLI CloudTrail APIs
對於追蹤,您可以使用基本或進階事件選取器,在一般用途儲存貯體、Lambda 函數和 DynamoDB 表格 (顯示在表格的前三列中) 記錄 Amazon S3 物件的資料事件。您只能使用進階事件選取器來記錄剩餘列中顯示的資料事件類型。
對於事件資料存放區,您只能使用進階事件選取器來包含資料事件。
AWS service | 描述 | 資料事件類型 (主控台) | resources.type 值 |
---|---|---|---|
Amazon DynamoDB | 資料表上的 Amazon DynamoDB 項目層級API活動 (例如 注意對於已啟用串流的資料表,資料事件中的 |
DynamoDB |
|
AWS Lambda | AWS Lambda 函數執行活動(的 |
Lambda | AWS::Lambda::Function |
Amazon S3 | 一般用途儲存貯體中物件上的 Amazon S3 物件層級API活動 (例如 |
S3 | AWS::S3::Object |
AWS AppConfig | AWS AppConfig API組態作業的活動,例如呼叫 |
AWS AppConfig | AWS::AppConfig::Configuration |
AWS 數據交換 | 用於變壓器作業的 B2B 資料交換API活動,例如呼叫 |
B2B 資料交換 | AWS::B2BI::Transformer |
Amazon Bedrock | 代理程式別名上的 Amazon 基岩API活動。 | Bedrock 代理程式別名 | AWS::Bedrock::AgentAlias |
Amazon Bedrock | 流程別名上的 Amazon 基岩API活動。 | 基岩流別名 | AWS::Bedrock::FlowAlias |
Amazon Bedrock | 在護欄上的 Amazon 基岩API活動。 | 基岩護欄 | AWS::Bedrock::Guardrail |
Amazon Bedrock | 在知識庫上的 Amazon 基岩API活動。 | Bedrock 知識庫 | AWS::Bedrock::KnowledgeBase |
Amazon CloudFront | CloudFront API上的活動KeyValueStore。 |
CloudFront KeyValueStore | AWS::CloudFront::KeyValueStore |
AWS Cloud Map | AWS Cloud Map API命名空間上的活動。 | AWS Cloud Map 命名空間 |
|
AWS Cloud Map | AWS Cloud Map API服務上的活動。 | AWS Cloud Map 服務 |
|
AWS CloudTrail | CloudTrail |
CloudTrail 渠道 | AWS::CloudTrail::Channel |
Amazon CloudWatch | 指標上的 Amazon CloudWatch API 活動。 |
CloudWatch 公制 | AWS::CloudWatch::Metric |
Amazon CloudWatch RUM | 應用監視器上的 Amazon CloudWatch RUM API 活動。 |
RUM應用監視器 | AWS::RUM::AppMonitor |
Amazon CodeWhisperer | 在定制 Amazon CodeWhisperer API 活動。 | CodeWhisperer 定制 | AWS::CodeWhisperer::Customization |
Amazon CodeWhisperer | 設定檔上的 Amazon CodeWhisperer API 活動。 | CodeWhisperer | AWS::CodeWhisperer::Profile |
Amazon Cognito | 亞馬遜認可身份API池上的 Amazon Cognito 活動。 |
Cognito 身分池 | AWS::Cognito::IdentityPool |
Amazon DynamoDB | 資料流上的亞馬遜動態 B API 活動。 |
DynamoDB Streams | AWS::DynamoDB::Stream |
Amazon Elastic Block Store | Amazon 彈性區塊存放區 (EBS) 直接APIs,例如 |
Amazon EBS 直接 APIs | AWS::EC2::Snapshot |
Amazon EMR | 預寫日誌工作區上的 Amazon EMR API 活動。 | EMR預寫日誌工作區 | AWS::EMRWAL::Workspace |
Amazon FinSpace | Amazon FinSpaceAPI環境上的活動。 |
FinSpace | AWS::FinSpace::Environment |
AWS Glue | AWS Glue API在由 Lake Formation 創建的表活動。 |
Lake Formation | AWS::Glue::Table |
Amazon GuardDuty | Amazon GuardDuty API 活動的檢測器。 |
GuardDuty 探測器 | AWS::GuardDuty::Detector |
AWS HealthImaging | AWS HealthImaging API資料存放區上的活動。 |
MedicalImaging 資料倉庫 | AWS::MedicalImaging::Datastore |
AWS IoT | IoT 證書 | AWS::IoT::Certificate |
|
AWS IoT | IoT 的事 | AWS::IoT::Thing |
|
AWS IoT Greengrass Version 2 | 來自組件版本的 Greengrass 核心設備的 Greengrass API 活動。 注意Greengrass 不會記錄訪問被拒絕的事件。 |
IoT Greengrass 件版本 | AWS::GreengrassV2::ComponentVersion |
AWS IoT Greengrass Version 2 | 在部署中,來自 Greengrass 核心裝置的API活動。 注意Greengrass 不會記錄訪問被拒絕的事件。 |
IoT 環境部署 | AWS::GreengrassV2::Deployment |
AWS IoT SiteWise | IoT SiteWise 資產 | AWS::IoTSiteWise::Asset |
|
AWS IoT SiteWise | IoT SiteWise 時間序列 | AWS::IoTSiteWise::TimeSeries |
|
AWS IoT TwinMaker | 實體上的 IoT TwinMaker API 活動。 |
IoT TwinMaker 實體 | AWS::IoTTwinMaker::Entity |
AWS IoT TwinMaker | 工作區上的 IoT TwinMaker API 活動。 |
IoT TwinMaker 工作區 | AWS::IoTTwinMaker::Workspace |
Amazon Kendra Intelligent Ranking | Amazon Kendra 在重新評分執行計API劃上的智能排名活動。 |
Kendra Ranking | AWS::KendraRanking::ExecutionPlan |
Amazon Keyspaces (適用於 Apache Cassandra) | 桌子上的 Amazon Keyspaces API 活動。 | 卡桑德拉表 | AWS::Cassandra::Table |
Amazon Kinesis Data Streams | 串流上的 Kinesis Data Streams 串流API活動。 | Kinesis 流 | AWS::Kinesis::Stream |
Amazon Kinesis Data Streams | 串流取用者上的 Kinesis Data Stre ams API 活動。 | Kinesis 流消費者 | AWS::Kinesis::StreamConsumer |
Amazon Kinesis Video Streams | Kinesis Video Streams 上的影片串流API活動,例如呼叫GetMedia 和PutMedia 。 |
Kinesis 視訊串流 | AWS::KinesisVideo::Stream |
Amazon Machine Learning | ML 模型上的 API Machine Learning 活動。 | 機械學習 MlModel | AWS::MachineLearning::MlModel |
Amazon Managed Blockchain | 亞馬遜網絡上的受管區塊鏈API活動。 |
Managed Blockchain 網路 | AWS::ManagedBlockchain::Network |
Amazon Managed Blockchain | Amazon Managed Blockchain JSON-在以太坊節點上進行RPC呼叫,例如 |
Managed Blockchain | AWS::ManagedBlockchain::Node |
Amazon Neptune 圖形 | 資料API活動,例如查詢、演算法或向量搜尋,在 Neptune 圖。 |
Neptune 圖形 | AWS::NeptuneGraph::Graph |
Amazon One Enterprise | Amazon 一個企業API活動上UKey. |
Amazon 一 UKey | AWS::One::UKey |
Amazon One Enterprise | 對用戶的 Amazon 一個企業API活動。 |
Amazon 一個用戶 | AWS::One::User |
AWS Payment Cryptography | AWS Payment Cryptography API別名上的活動。 | 付款密碼編譯別名 | AWS::PaymentCryptography::Alias |
AWS Payment Cryptography | AWS Payment Cryptography API按鍵上的活動。 | 付款密碼編譯金鑰 | AWS::PaymentCryptography::Key |
AWS Private CA | AWS Private CA 作用中目錄API活動的連接器。 |
AWS Private CA 作用中目錄的連接器 | AWS::PCAConnectorAD::Connector |
AWS Private CA | AWS Private CA 連接器,用於SCEPAPI活動。 |
AWS Private CA 用於連接器 SCEP | AWS::PCAConnectorSCEP::Connector |
Amazon Q 應用 | Amazon Q 應用程式上的資料API活動。 |
Amazon Q 應用 | AWS::QApps:QApp |
Amazon Q Business | 應用程式上的 Amazon Q 商務API活動。 |
Amazon Q Business 應用程式 | AWS::QBusiness::Application |
Amazon Q Business | 資料來源上的 Amazon Q 商務API活動。 |
Amazon Q Business 資料來源 | AWS::QBusiness::DataSource |
Amazon Q Business | Amazon Q 商業API活動上的索引。 |
Amazon Q Business 索引 | AWS::QBusiness::Index |
Amazon Q Business | 在網絡體驗上的 Amazon Q 商務API活動。 |
Amazon Q Business Web 體驗 | AWS::QBusiness::WebExperience |
Amazon RDS | 數據庫集群上的 Amazon RDS API 活動。 |
RDS數據 API-數據庫集群 | AWS::RDS::DBCluster |
Amazon S3 | 存取點上的 Amazon S3 API 活動。 |
S3 存取點 | AWS::S3::AccessPoint |
Amazon S3 | 目錄儲存貯體中物件上的 Amazon S3 物件層級API活動 (例如 |
中三快遞 | AWS::S3Express::Object |
Amazon S3 | Amazon S3 物件 Lambda 存取點API活動,例如呼叫 |
S3 Object Lambda | AWS::S3ObjectLambda::AccessPoint |
Amazon S3 on Outposts | S3 Outposts | AWS::S3Outposts::Object |
|
Amazon SageMaker | 端點上的 Amazon SageMaker InvokeEndpointWithResponseStream 活動。 |
SageMaker 端點 | AWS::SageMaker::Endpoint |
Amazon SageMaker | 功能商店的 Amazon SageMaker API 活動。 |
SageMaker feature store | AWS::SageMaker::FeatureGroup |
Amazon SageMaker | 實驗試驗組件的 Amazon SageMaker API 活動。 |
SageMaker 度量實驗試驗元件 | AWS::SageMaker::ExperimentTrialComponent |
Amazon SNS | 平台端點上的 Amazon SNS |
SNS平台端點 | AWS::SNS::PlatformEndpoint |
Amazon SNS | Amazon SNS |
SNS話題 | AWS::SNS::Topic |
Amazon SQS | 消息上的 Amazon SQS API 活動。 |
SQS | AWS::SQS::Queue |
AWS Step Functions | Step Functions 狀態機器 | AWS::StepFunctions::StateMachine |
|
AWS Supply Chain | AWS Supply Chain API執行個體上的活動。 |
供應鏈 | AWS::SCN::Instance |
Amazon SWF | SWF網域 | AWS::SWF::Domain |
|
AWS Systems Manager | 控制通道上的 Systems Manager API 活動。 | Systems Manager | AWS::SSMMessages::ControlChannel |
AWS Systems Manager | 受管理節點上的系統管理員API活動。 | 系統管理員管理節點 | AWS::SSM::ManagedNode |
Amazon Timestream | 資料庫上的 Amazon Timestream Query API活動。 |
Timestream 資料庫 | AWS::Timestream::Database |
Amazon Timestream | 表上的 Amazon Timestream Query API活動。 |
Timestream 資料表 | AWS::Timestream::Table |
Amazon Verified Permissions | 政策存放區上的 Amazon 驗證許可API活動。 |
Amazon Verified Permissions | AWS::VerifiedPermissions::PolicyStore |
Amazon WorkSpaces 瘦客戶端 | WorkSpaces 裝置上的精簡型用戶端API活動。 | 精簡型客戶端裝置 | AWS::ThinClient::Device |
Amazon WorkSpaces 瘦客戶端 | WorkSpaces 環境上的精簡型用戶端API活動。 | 精簡型客戶端環境 | AWS::ThinClient::Environment |
AWS X-Ray | 在痕跡上的 X-Ray API 活動。 |
X-Ray 軌跡 | AWS::XRay::Trace |
依預設,在您建立追蹤或事件資料存放區時,不會記錄資料事件。若要記錄資 CloudTrail 料事件,您必須明確新增要收集活動的支援資源或資源類型。如需詳細資訊,請參閱 使用 CloudTrail 主控台建立追蹤 及 使用主控台為 CloudTrail事件建立事件資料存放區。
記錄資料事件需支付額外的費用。如需 CloudTrail 定價,請參閱AWS CloudTrail 定價
下列範例顯示 Amazon SNS Publish
動作之資料事件的單一日誌記錄。
{ "eventVersion": "1.09", "userIdentity": { "type": "AssumedRole", "principalId": "EX_PRINCIPAL_ID", "arn": "arn:aws:iam::123456789012:user/Bob", "accountId": "123456789012", "accessKeyId": "AKIAIOSFODNN7EXAMPLE", "sessionContext": { "sessionIssuer": { "type": "Role", "principalId": "AKIAIOSFODNN7EXAMPLE", "arn": "arn:aws:iam::123456789012:role/Admin", "accountId": "123456789012", "userName": "ExampleUser" }, "attributes": { "creationDate": "2023-08-21T16:44:05Z", "mfaAuthenticated": "false" } } }, "eventTime": "2023-08-21T16:48:37Z", "eventSource": "sns.amazonaws.com", "eventName": "Publish", "awsRegion": "us-east-1", "sourceIPAddress": "192.0.2.0", "userAgent": "aws-cli/1.29.16 md/Botocore#1.31.16 ua/2.0 os/linux#5.4.250-173.369.amzn2int.x86_64 md/arch#x86_64 lang/python#3.8.17 md/pyimpl#CPython cfg/retry-mode#legacy botocore/1.31.16", "requestParameters": { "topicArn": "arn:aws:sns:us-east-1:123456789012:ExampleSNSTopic", "message": "HIDDEN_DUE_TO_SECURITY_REASONS", "subject": "HIDDEN_DUE_TO_SECURITY_REASONS", "messageStructure": "json", "messageAttributes": "HIDDEN_DUE_TO_SECURITY_REASONS" }, "responseElements": { "messageId": "0787cd1e-d92b-521c-a8b4-90434e8ef840" }, "requestID": "0a8ab208-11bf-5e01-bd2d-ef55861b545d", "eventID": "bb3496d4-5252-4660-9c28-3c6aebdb21c0", "readOnly": false, "resources": [{ "accountId": "123456789012", "type": "AWS::SNS::Topic", "ARN": "arn:aws:sns:us-east-1:123456789012:ExampleSNSTopic" }], "eventType": "AwsApiCall", "managementEvent": false, "recipientAccountId": "123456789012", "eventCategory": "Data", "tlsDetails": { "tlsVersion": "TLSv1.2", "cipherSuite": "ECDHE-RSA-AES128-GCM-SHA256", "clientProvidedHostHeader": "sns.us-east-1.amazonaws.com" } }
下一個範例顯示 Amazon Cognito GetCredentialsForIdentity
動作之資料事件的單一日誌記錄。
{ "eventVersion": "1.08", "userIdentity": { "type": "Unknown" }, "eventTime": "2023-01-19T16:55:08Z", "eventSource": "cognito-identity.amazonaws.com", "eventName": "GetCredentialsForIdentity", "awsRegion": "us-east-1", "sourceIPAddress": "192.0.2.4", "userAgent": "aws-cli/2.7.25 Python/3.9.11 Darwin/21.6.0 exe/x86_64 prompt/off command/cognito-identity.get-credentials-for-identity", "requestParameters": { "logins": { "cognito-idp.us-east-1.amazonaws.com/us-east-1_aaaaaaaaa": "HIDDEN_DUE_TO_SECURITY_REASONS" }, "identityId": "us-east-1:1cf667a2-49a6-454b-9e45-23199EXAMPLE" }, "responseElements": { "credentials": { "accessKeyId": "ASIAIOSFODNN7EXAMPLE", "sessionToken": "aAaAaAaAaAaAab1111111111EXAMPLE", "expiration": "Jan 19, 2023 5:55:08 PM" }, "identityId": "us-east-1:1cf667a2-49a6-454b-9e45-23199EXAMPLE" }, "requestID": "659dfc23-7c4e-4e7c-858a-1abce884d645", "eventID": "6ad1c766-5a41-4b28-b5ca-e223ccb00f0d", "readOnly": false, "resources": [{ "accountId": "111122223333", "type": "AWS::Cognito::IdentityPool", "ARN": "arn:aws:cognito-identity:us-east-1:111122223333:identitypool/us-east-1:2dg778b3-50b7-565c-0f56-34200EXAMPLE" }], "eventType": "AwsApiCall", "managementEvent": false, "recipientAccountId": "111122223333", "eventCategory": "Data" }
洞察活動
CloudTrail 洞察事件會透過分析 CloudTrail 管理活動,擷取您 AWS 帳戶中不尋常的通API話率或錯誤率活動。見解事件提供相關資訊,例如相關資訊API、錯誤代碼、事件時間和統計資料,協助您瞭解異常活動並採取行動。與 CloudTrail 追蹤或事件資料存放區中擷取的其他類型事件不同,Insights 事件只有在 CloudTrail 偵測到帳戶API使用狀況或錯誤率記錄的變更時,才會記錄與帳戶的一般使用模式明顯不同。
可能產生 Insights 事件的活動範例包括:
-
您的帳戶通常每分鐘記錄不超過 20 個 Amazon S3
deleteBucket
API 呼叫,但是您的帳戶平均每分鐘開始記錄 100 個deleteBucket
API呼叫。異常活動開始時會記錄 Insights 事件,並記錄另一個 Insights 事件以標示異常的活動結束。 -
您的帳戶通常每分鐘記錄 20 個呼叫到 Amazon EC2
AuthorizeSecurityGroupIngress
API,但您的帳戶開始記錄零呼叫AuthorizeSecurityGroupIngress
。異常活動開始時會記錄 Insights 事件,並在十分鐘後,當異常活動結束時,記錄另一個 Insights 事件以標示異常的活動結束。 -
您的帳戶通常會在 AWS Identity and Access Management API、
DeleteInstanceProfile
的七天期間內記錄少於一個AccessDeniedException
錯誤。您的帳戶開始平均記錄 12 每分鐘的DeleteInstanceProfile
API通話AccessDeniedException
錯誤。異常錯誤率活動開始時會記錄 Insights 事件,並記錄另一個 Insights 事件以標示異常活動的結束。
這些範例僅供說明之用。您的結果可能會根據您的使用案例而有所不同。
若要記錄 CloudTrail Insights 事件,您必須在新的或現有的追蹤或事件資料存放區上明確啟用 Insights 事件。如需建立線索的詳細資訊,請參閱 使用 CloudTrail 主控台建立追蹤。如需有關建立事件資料存放區的詳細資訊,請參閱 使用主控台為 Insights 事件建立事件資料存放區。
Insights 事件會產生額外費用。如果您同時為追蹤和事件資料存放區啟用 Insights,則將分別支付它們的費用。如需詳細資訊,請參閱 AWS CloudTrail 定價
在 CloudTrail Insights 中記錄了兩個事件,以顯示異常活動:開始事件和結束事件。下列範例顯示當 Application Auto Scaling API CompleteLifecycleAction
呼叫異常次數時,所發生之起始 Insights 事件的單一記錄記錄。對於 Insights 事件,eventCategory
的值為 Insight
。insightDetails
區塊會識別事件狀態、來源、名稱、Insights 類型和內容,包括統計資料和歸因。如需 insightDetails
區塊的詳細資訊,請參閱 CloudTrail 見解insightDetails元素。
{ "eventVersion": "1.08", "eventTime": "2023-07-10T01:42:00Z", "awsRegion": "us-east-1", "eventID": "55ed45c5-0b0c-4228-9fe5-EXAMPLEc3f4d", "eventType": "AwsCloudTrailInsight", "recipientAccountId": "123456789012", "sharedEventID": "979c82fe-14d4-4e4c-aa01-EXAMPLE3acee", "insightDetails": { "state": "Start", "eventSource": "autoscaling.amazonaws.com", "eventName": "CompleteLifecycleAction", "insightType": "ApiCallRateInsight", "insightContext": { "statistics": { "baseline": { "average": 9.82222E-5 }, "insight": { "average": 5.0 }, "insightDuration": 1, "baselineDuration": 10181 }, "attributions": [{ "attribute": "userIdentityArn", "insight": [{ "value": "arn:aws:sts::123456789012:assumed-role/CodeDeployRole1", "average": 5.0 }, { "value": "arn:aws:sts::123456789012:assumed-role/CodeDeployRole2", "average": 5.0 }, { "value": "arn:aws:sts::123456789012:assumed-role/CodeDeployRole3", "average": 5.0 }], "baseline": [{ "value": "arn:aws:sts::123456789012:assumed-role/CodeDeployRole1", "average": 9.82222E-5 }] }, { "attribute": "userAgent", "insight": [{ "value": "codedeploy.amazonaws.com", "average": 5.0 }], "baseline": [{ "value": "codedeploy.amazonaws.com", "average": 9.82222E-5 }] }, { "attribute": "errorCode", "insight": [{ "value": "null", "average": 5.0 }], "baseline": [{ "value": "null", "average": 9.82222E-5 }] }] } }, "eventCategory": "Insight" }