收集 AWS Inspector 記錄
剖析器版本:1.0
本文說明如何使用 Amazon S3,將 AWS Inspector 記錄擷取至 Google Security Operations。
Amazon Inspector 是一種安全漏洞管理服務,可自動探索工作負載,並持續掃描軟體安全漏洞和非預期的網路暴露。這項服務會掃描 Amazon EC2 執行個體、Amazon ECR 中的容器映像檔和 AWS Lambda 函式,並產生詳細的調查結果,包括嚴重程度分數和補救建議。這項整合功能會使用 Amazon Inspector 的內建發現項目匯出功能,將 JSON 格式的發現項目報告傳送至 S3 值區,然後 Google SecOps 會使用 Amazon S3 V2 動態饋給擷取這些報告。
事前準備
請確認您已完成下列事前準備事項:
- Google SecOps 執行個體
- 具備管理下列項目的權限,可存取 AWS 管理主控台:
- Amazon Inspector (發現項目、報告)
- Amazon S3 (儲存桶、儲存桶政策)
- AWS KMS (金鑰政策)
- AWS IAM (角色、政策、使用者)
設定 Amazon Inspector 發現項目匯出作業的 S3 bucket
Amazon Inspector 會先使用 AWS KMS 金鑰加密調查結果報告,再將其儲存在 S3 bucket 中。您必須同時設定 S3 bucket 政策和 KMS 金鑰政策,才能允許 Amazon Inspector 存取。
建立及設定 S3 bucket
- 按照這份使用者指南建立 Amazon S3 bucket:建立 bucket。
請儲存 bucket 的「名稱」和「區域」,以供日後參考 (例如
inspector-findings-to-secops)。在 https://console.aws.amazon.com/s3 的 Amazon S3 控制台中,選取建立的值區。
選取 [權限] 分頁標籤。
在「Bucket policy」部分中,按一下「Edit」。
在 bucket 政策中加入下列陳述式 (將
inspector-findings-to-secops替換為 bucket 名稱,111122223333替換為 AWS 帳戶 ID,並將us-east-1替換為 AWS 區域):{ "Version": "2012-10-17", "Statement": [ { "Sid": "allow-inspector", "Effect": "Allow", "Principal": { "Service": "inspector2.amazonaws.com" }, "Action": [ "s3:PutObject", "s3:PutObjectAcl", "s3:AbortMultipartUpload" ], "Resource": "arn:aws:s3:::inspector-findings-to-secops/*", "Condition": { "StringEquals": { "aws:SourceAccount": "111122223333" }, "ArnLike": { "aws:SourceArn": "arn:aws:inspector2:us-east-1:111122223333:report/*" } } } ] }按一下 [儲存變更]。
設定 AWS KMS 金鑰
Amazon Inspector 需要與 S3 bucket 位於相同區域的客戶管理對稱式加密 AWS KMS 金鑰,才能加密調查結果報告。
- 前往 https://console.aws.amazon.com/kms 開啟 AWS KMS 控制台。
- 在導覽窗格中,選取「Customer managed keys」(客戶管理的金鑰)。
- 選取要使用的 KMS 金鑰 (或建立新的對稱加密金鑰)。
- 選取「重要政策」分頁,然後按一下「編輯」。
在金鑰政策中加入下列陳述式 (將
111122223333替換為您的 AWS 帳戶 ID,並將us-east-1替換為您的 AWS 區域):{ "Sid": "Allow Amazon Inspector to use the key", "Effect": "Allow", "Principal": { "Service": "inspector2.amazonaws.com" }, "Action": [ "kms:Decrypt", "kms:GenerateDataKey*" ], "Resource": "*", "Condition": { "StringEquals": { "aws:SourceAccount": "111122223333" }, "ArnLike": { "aws:SourceArn": "arn:aws:inspector2:us-east-1:111122223333:report/*" } } }按一下 [儲存變更]。
將 Amazon Inspector 發現項目匯出至 S3
- 前往 https://console.aws.amazon.com/inspector/v2/home,登入 Amazon Inspector 控制台。
- 在導覽窗格中,依序前往「發現項目」> 所有發現項目。
選用步驟:使用「發現項目」表格上方的篩選列,指定要在報告中納入哪些發現項目。
按一下「匯出調查結果」。
在「匯出設定」部分,選取「匯出檔案類型」的「JSON」。
在「匯出位置」下方的「S3 URI」,按一下「Browse S3」並選取 S3 值區
inspector-findings-to-secops。在「KMS key」(KMS 金鑰) 中,選取您設定的 AWS KMS 金鑰。
按一下 [匯出]。
使用 AWS CLI 自動匯出調查結果
如要定期匯出調查結果報表,請使用 AWS CLI create-findings-report 指令。您可以使用 Amazon EventBridge Scheduler 或 Cron 工作排定這項指令的執行時間。
指令範例:
aws inspector2 create-findings-report \ --report-format JSON \ --s3-destination bucketName=inspector-findings-to-secops,keyPrefix=findings/,kmsKeyArn=arn:aws:kms:us-east-1:111122223333:key/your-kms-key-id
詳情請參閱 create-findings-report AWS CLI 參考資料。
為 Google SecOps 設定 IAM 使用者
Google SecOps 需要具備 S3 值區讀取存取權的 IAM 使用者,才能擷取匯出的調查結果。
- 請按照這份使用者指南建立使用者:建立 IAM 使用者。
- 選取建立的「使用者」。
- 選取「安全憑證」分頁標籤。
- 在「Access Keys」部分中,按一下「Create Access Key」。
- 選取「第三方服務」做為「用途」。
- 按一下「下一步」。
- 新增說明標記 (如有需要)。
- 按一下「建立存取金鑰」。
- 按一下「Download .csv file」(下載 .csv 檔案),儲存「Access Key」(存取金鑰) 和「Secret Access Key」(私密存取金鑰),以供日後參考。
- 按一下 [完成]。
- 選取「權限」分頁標籤。
- 在「權限政策」部分中,按一下「新增權限」。
- 選取「新增權限」。
- 選取「直接附加政策」。
- 搜尋「AmazonS3FullAccess」AmazonS3FullAccess政策。
- 選取政策。
- 點選「下一步」。
- 按一下「Add permissions」。
在 Google SecOps 中設定資訊提供,擷取 AWS Inspector 記錄
- 依序前往「SIEM 設定」>「動態饋給」。
- 按一下「新增動態消息」。
- 在下一個頁面中,按一下「設定單一動態饋給」。
- 輸入動態饋給名稱的專屬名稱。
- 選取「Amazon S3 V2」做為「來源類型」。
- 選取「AWS Inspector」做為「記錄類型」。
- 依序點按「繼續」和「提交」。
為下列欄位指定值:
- S3 URI:
s3://inspector-findings-to-secops/findings/ - 來源刪除選項:根據偏好設定選取刪除選項
- 檔案存在時間上限:包含在過去天數內修改的檔案 (預設為 180 天)
- 存取金鑰 ID:具有 S3 值區存取權的使用者存取金鑰
- 存取密鑰:具有 S3 bucket 存取權的使用者私密金鑰
- 資產命名空間:資產命名空間
- 擷取標籤:要套用至這個動態饋給事件的標籤
- S3 URI:
依序點按「繼續」和「提交」。
UDM 對應表
| 記錄欄位 | UDM 對應 | 邏輯 |
|---|---|---|
duration_ms_label |
additional.fields |
已合併 |
evnt_app_class_label |
additional.fields |
已合併 |
evnt_cloud_application_class_label |
additional.fields |
已合併 |
evnt_cloud_sandbox_md5_label |
additional.fields |
已合併 |
evnt_cloudapp_rule_label |
additional.fields |
已合併 |
evnt_content_type_label |
additional.fields |
已合併 |
evnt_customer_label |
additional.fields |
已合併 |
evnt_department_label |
additional.fields |
已合併 |
evnt_location_label |
additional.fields |
已合併 |
evnt_lpclagg_label |
additional.fields |
已合併 |
evnt_lpcltype_label |
additional.fields |
已合併 |
evnt_network_service_label |
additional.fields |
已合併 |
evnt_tenant_label |
additional.fields |
已合併 |
evnt_url_category_label |
additional.fields |
已合併 |
exception_label |
additional.fields |
已合併 |
function_label |
additional.fields |
已合併 |
id_label |
additional.fields |
已合併 |
level_no_label |
additional.fields |
已合併 |
line_label |
additional.fields |
已合併 |
location_label |
additional.fields |
已合併 |
logger_field |
additional.fields |
已合併 |
msg_location_label |
additional.fields |
已合併 |
msg_record_functionName_label |
additional.fields |
已合併 |
msg_record_functionVersion_label |
additional.fields |
已合併 |
msg_record_initializationType_label |
additional.fields |
已合併 |
msg_record_instancId_label |
additional.fields |
已合併 |
msg_record_instanceMaxMemory_label |
additional.fields |
已合併 |
msg_record_phase_label |
additional.fields |
已合併 |
msg_service_label |
additional.fields |
已合併 |
msg_type_label |
additional.fields |
已合併 |
msg_xray_trace_id_label |
additional.fields |
已合併 |
protocol_label |
additional.fields |
已合併 |
record_version_label |
additional.fields |
已合併 |
repr_label |
additional.fields |
已合併 |
service_label |
additional.fields |
已合併 |
sourcetype_label |
additional.fields |
已合併 |
thread_name_label |
additional.fields |
已合併 |
type_label |
additional.fields |
已合併 |
xray_trace_id_label |
additional.fields |
已合併 |
evnt_device_hostname |
intermediary.hostname |
直接對應 |
evnt_fwd_method_label |
intermediary.resource.attribute.labels |
已合併 |
desc_msg |
metadata.description |
直接對應 |
message |
metadata.description |
直接對應 |
msg |
metadata.description |
直接對應 |
msg_desc_msg |
metadata.description |
直接對應 |
msg_record_desc_msg |
metadata.description |
直接對應 |
msg_text |
metadata.description |
直接對應 |
msg.time |
metadata.event_timestamp |
已剖析為 ISO8601 |
repr_time |
metadata.event_timestamp |
已剖析為 ISO8601 |
timestamp |
metadata.event_timestamp |
已剖析為 ISO8601 |
has_host |
metadata.event_type |
已對應:true → STATUS_UPDATE |
has_user |
metadata.event_type |
已對應:true → USER_COMMUNICATION、true → USER_UNCATEGORIZED |
msg_record_module |
metadata.product_event_type |
直接對應 |
id_1 |
metadata.product_log_id |
直接對應 |
evnt_bytes_in |
network.received_bytes |
直接對應 |
evnt_bytes_out |
network.sent_bytes |
直接對應 |
evnt_app_name |
principal.application |
直接對應 |
msg_record_process_name |
principal.application |
直接對應 |
evnt_device_app_version_label |
principal.asset.attribute.labels |
已合併 |
evnt_ssl_policy_label |
principal.asset.attribute.labels |
已合併 |
evnt_server_ip |
principal.asset.ip |
已合併 |
evnt_src_ip |
principal.asset.ip |
已合併 |
evnt_src_translated_ip |
principal.asset.ip |
已合併 |
msg_record_file_path |
principal.file.full_path |
直接對應 |
msg_record_file_name |
principal.file.names |
已合併 |
evnt_hostname |
principal.hostname |
直接對應 |
host |
principal.hostname |
直接對應 |
evnt_server_ip |
principal.ip |
已合併 |
evnt_src_ip |
principal.ip |
已合併 |
evnt_src_translated_ip |
principal.ip |
已合併 |
evnt_os |
principal.platform |
已對應:Windows → WINDOWS、Linux → LINUX |
evnt_src_port |
principal.port |
直接對應 |
port_number |
principal.port |
直接對應 |
msg_record_process_id |
principal.process.pid |
直接對應 |
cmd_status_label |
principal.resource.attribute.labels |
已合併 |
evnt_format_label |
principal.resource.attribute.labels |
已合併 |
evnt_os_label |
principal.resource.attribute.labels |
已合併 |
msg_record_runtimeVersionArn_label |
principal.resource.attribute.labels |
已合併 |
msg_record_runtimeVersion_label |
principal.resource.attribute.labels |
已合併 |
record_requestId_labels |
principal.resource.attribute.labels |
已合併 |
requestId_labels |
principal.resource.attribute.labels |
已合併 |
msg_record_name |
principal.resource.name |
直接對應 |
id |
principal.resource.product_object_id |
直接對應 |
evnt_url |
principal.url |
直接對應 |
evnt_device_owner |
principal.user.user_display_name |
直接對應 |
evnt_user |
principal.user.userid |
直接對應 |
msg_extra_desc_msg_body_account_id |
principal.user.userid |
直接對應 |
evnt_action |
security_result.action |
已對應:allow → security_result_action |
security_result_action |
security_result.action |
已合併 |
security_result_category_details |
security_result.category_details |
已合併 |
security_result_url_super_category |
security_result.category_details |
已合併 |
elapsed_time_label |
security_result.detection_fields |
已合併 |
evnt_session_count_label |
security_result.detection_fields |
已合併 |
evnt_ssl_decrypted_label |
security_result.detection_fields |
已合併 |
evnt_url_class_label |
security_result.detection_fields |
已合併 |
level_icon_label |
security_result.detection_fields |
已合併 |
level |
security_result.severity |
已對應:INFO → INFORMATIONAL、WARNING → MEDIUM |
msg_level |
security_result.severity |
已對應:INFO → INFORMATIONAL、WARNING → MEDIUM |
evnt_dest_ip |
target.ip |
已合併 |
evnt_dest_country |
target.location.country_or_region |
直接對應 |
evnt_dest_port |
target.port |
直接對應 |
dst_url |
target.url |
直接對應 |
| 不適用 | metadata.event_type |
常數:USER_COMMUNICATION |
| 不適用 | metadata.product_name |
常數:AWS Inspector |
| 不適用 | metadata.vendor_name |
常數:AWS Inspector |
| 不適用 | network.ip_protocol |
常數:UDP |
| 不適用 | principal.platform |
常數:WINDOWS |
| 不適用 | security_result.detection_fields |
常數:client_tunnel_ip_label |
| 不適用 | security_result.severity |
常數:INFORMATIONAL |
變更記錄
還有其他問題嗎?向社群成員和 Google SecOps 專業人員尋求答案。