2024年2月14日 星期三

如何利用AWS CloudTrail建立線索找到RDS的kms key

 

觀念釐清:

若想要的是 "資源組態" 紀錄,應使用 AWS Config 而非 CloudTrail,因 CloudTrail 是記錄帳號所呼叫的 AWS API

 

若欲使用 "建立線索"(CloudTrail Trail) 的方式[文下方文檔A] 進行查詢,待完成建立後 Trail 會將日誌檔案傳送至 S3 或是 CloudWatch Logs,接著針對 S3/CloudWatch Logs 使用 Athena/CloudWatch Logs Insights 進行語法查詢相關 RDS API 呼叫紀錄:

createDBInstance, modifyDBInstance, StartDBinstance, StopDBinstance...

即可於查詢結果中的 responseElements 找到 kmsKeyId 的資訊。

 

關於 responseElements kmsKeyId 的資訊,也可以於 CloudTrail 搜尋 90 天內相關 RDS 的紀錄,通過將頁面拉至 responseElements 區塊,即可找到上述所提及的 kmsKeyId 資訊。





CloudTrail 建立和更新線索說明文件

 https://docs.aws.amazon.com/zh_tw/awscloudtrail/latest/userguide/cloudtrail-create-and-update-a-trail-by-using-the-console.html

沒有留言:

張貼留言

搜尋此網誌