收集 Datadog 記錄
本文說明如何將 Datadog 記錄擷取至 Google Security Operations。Datadog 是雲端監控與分析平台,可從應用程式、基礎架構和雲端服務收集指標、追蹤記錄和記錄檔。您可以透過 Cloud Storage 或 Webhook,將 Datadog 記錄分享給 Google SecOps。
事前準備
請確認您已完成下列事前準備事項:
- Google SecOps 執行個體
- 具備 Datadog 特殊存取權的使用者
- 存取 Google Cloud 控制台 (用於建立 API 金鑰或設定 Cloud Storage)
方法 1:透過 Cloud Storage 設定分享 Datadog 記錄
設定 Datadog 與 Google Cloud的整合
在 Datadog 中設定 Google Cloud的整合項目。詳情請參閱 Datadog Google Cloud 整合設定。
建立 Cloud Storage bucket
- 登入 Google Cloud 控制台
前往「Cloud Storage Buckets」(Cloud Storage bucket) 頁面。
點選「建立」。
在「建立 bucket」頁面中,輸入 bucket 資訊。完成下列每個步驟後,請按一下「繼續」前往下一個步驟:
在「開始使用」部分,執行下列操作:
- 輸入符合值區名稱規定的專屬名稱 (例如
datadog-data)。 如要啟用階層命名空間,請按一下展開箭頭,展開「為檔案導向和資料密集型工作負載提供最理想的儲存空間」部分,然後選取「為這個值區啟用階層結構式命名空間」。
如要新增值區標籤,請按一下展開箭頭,展開「標籤」部分。
按一下「新增標籤」,然後指定標籤的鍵和值。
- 輸入符合值區名稱規定的專屬名稱 (例如
在「Choose where to store your data」(選擇資料的儲存位置) 部分,執行下列操作:
- 選取「位置類型」。
- 使用「位置類型」下拉式選單,選取要永久儲存 bucket 內物件資料的位置。
在「為資料選擇儲存空間級別」部分,選取 bucket 的預設儲存空間級別,或選取「Autoclass」,讓系統自動管理 bucket 資料的儲存空間級別。
在「選取如何控制物件的存取權」部分,選取「否」來強制執行禁止公開存取,並為值區物件選取存取控管模型。
在「選擇保護物件資料的方式」部分,執行下列操作:
- 選取「資料保護」下方的任何選項,為 bucket 設定資料保護措施。
- 如要選擇物件資料的加密方式,請按一下標示為「資料加密」的展開箭頭,然後選取「資料加密方法」。
點選「建立」。
建立 Google Cloud 服務帳戶
- 依序前往「IAM 與管理」>「服務帳戶」。
- 建立新的服務帳戶。
- 為其命名,名稱請使用描述性文字 (例如
datadog-user)。 - 在您於上一個步驟建立的 Cloud Storage bucket 中,將「Storage 物件管理員」角色授予服務帳戶。
- 為服務帳戶建立金鑰,並選取「JSON」做為金鑰類型。
- 下載服務帳戶的 JSON 金鑰檔案。請妥善保管這個檔案。
設定 Datadog 將記錄傳送至 Cloud Storage
- 使用具備權限的帳戶登入 Datadog。
- 依序前往「記錄」>「記錄轉送」。
- 按一下「+ 建立新封存」。
- 選取「Google Cloud Storage」。
- 輸入必要參數,然後按一下「儲存」。
在 Google SecOps 中設定資訊提供,從 Cloud Storage bucket 擷取記錄
- 依序前往「SIEM 設定」>「動態饋給」。
- 按一下「新增動態消息」。
- 在下一個頁面中,按一下「設定單一動態饋給」。
- 在「動態饋給名稱」欄位中輸入動態饋給名稱 (例如
Datadog Logs GCS)。 - 選取「Google Cloud Storage V2」做為「來源類型」。
- 選取「Datadog」做為「記錄類型」。
- 按一下「取得服務帳戶」,取得這個動態饋給的專屬服務帳戶。
- 將先前建立的 Cloud Storage bucket 的「Storage 物件檢視者」角色,授予這個服務帳戶。
- 點選「下一步」。
- 指定下列輸入參數的值:
- 儲存空間值區 URI:Cloud Storage 值區 URI,格式為
gs://datadog-data。 - 來源刪除選項:根據偏好設定選取刪除選項。
- 檔案存在時間上限:包含在過去天數內修改的檔案。預設值為 180 天。
- 資產命名空間:資產命名空間。
- 擷取標籤:套用至這個動態饋給事件的標籤。
- 儲存空間值區 URI:Cloud Storage 值區 URI,格式為
- 點選「下一步」。
- 在「Finalize」畫面中檢查動態饋給設定,然後按一下「Submit」。
方法 2:透過 Webhook 設定共用 Datadog 記錄
設定動態饋給
如要設定動態消息,請按照下列步驟操作:
- 依序前往「SIEM 設定」>「動態饋給」。
- 按一下「新增動態消息」。
- 在下一個頁面中,按一下「設定單一動態饋給」。
- 在「動態饋給名稱」欄位中輸入動態饋給名稱 (例如
Datadog Logs)。 - 選取「Webhook」做為「來源類型」。
- 選取「Datadog」做為「記錄類型」。
- 點選「下一步」。
- 選用:指定下列輸入參數的值:
- 分割分隔符號:用於分隔記錄行的分隔符號,例如
\n。
- 分割分隔符號:用於分隔記錄行的分隔符號,例如
- 點選「下一步」。
- 在「Finalize」畫面中檢查動態饋給設定,然後按一下「Submit」。
- 按一下「產生密鑰」,產生驗證這個動態饋給的密鑰。
- 複製並儲存密鑰。您無法再次查看這個密鑰。如有需要,您可以重新產生新的密鑰,但這項操作會使先前的密鑰失效。
- 在「詳細資料」分頁中,從「端點資訊」欄位複製動態消息端點網址。您需要在用戶端應用程式中指定這個端點網址。
- 按一下 [完成]。
為 Webhook 資訊提供建立 API 金鑰
- 前往 Google Cloud 主控台 > 憑證:前往「憑證」。
- 按一下 [Create credentials] (建立憑證),然後選取 [API key] (API 金鑰)。
- 限制 API 金鑰對 Chronicle API 的存取權。
指定端點網址
- 在用戶端應用程式中,指定 webhook 動態饋給中提供的 HTTPS 端點網址。
如要啟用驗證,請在自訂標頭中指定 API 金鑰和私密金鑰,格式如下:
X-goog-api-key = API_KEY X-Webhook-Access-Key = SECRET建議:將 API 金鑰指定為標頭,而非在網址中指定。
如果 Webhook 用戶端不支援自訂標頭,您可以使用查詢參數指定 API 金鑰和密鑰,格式如下:
ENDPOINT_URL?key=API_KEY&secret=SECRET更改下列內容:
ENDPOINT_URL:動態消息端點網址。API_KEY:用於向 Google Security Operations 進行驗證的 API 金鑰。SECRET:您產生的密鑰,用於驗證動態消息。
設定 Datadog,將記錄傳送至 Webhook
- 使用具備權限的帳戶登入 Datadog。
- 依序前往「記錄」>「記錄轉送」。
- 選取「自訂目的地」。
- 按一下「+ 建立新目的地」。
- 指定下列輸入參數的值:
- 選擇目的地類型:選取「HTTP」。
- 為目的地命名:為 Webhook 提供描述性名稱 (例如
Google SecOps Webhook)。 - 設定目的地:貼上動態饋給 ENDPOINT_URL。選擇下列其中一個驗證選項 (請勿同時選擇兩者):
- 選項 A (建議):保留不含憑證的網址,並將 API_KEY 和 SECRET 做為自訂標頭傳遞 (在下一個步驟中設定)。
- 方法 B:以查詢參數的形式將憑證附加至網址,格式為
ENDPOINT_URL?key=API_KEY&secret=SECRET。只有在用戶端無法傳送自訂標頭時,才使用這項功能。
- 設定驗證設定:Datadog 至少需要一個驗證標頭,才能儲存目的地。新增下列標題。Webhook 端點會忽略這項屬性,因此不會影響要求。
- 標頭名稱:
Authorization。 - 標頭值:
application/json。
- 標頭名稱:
- 按一下 [儲存]。
參考連結
UDM 對應表
| 記錄欄位 | UDM 對應 | 邏輯 |
|---|---|---|
additional_field |
additional.fields |
已合併 |
anonymous_label |
additional.fields |
已合併 |
as_domain_label |
additional.fields |
已合併 |
as_name_label |
additional.fields |
已合併 |
as_number_label |
additional.fields |
已合併 |
as_type_label |
additional.fields |
已合併 |
auth_method_label |
additional.fields |
已合併 |
category_label |
additional.fields |
已合併 |
emitted_source_label |
additional.fields |
已合併 |
event_type_label |
additional.fields |
已合併 |
geo_continent_code_label |
additional.fields |
已合併 |
geo_continent_label |
additional.fields |
已合併 |
geo_continent_name_label |
additional.fields |
已合併 |
geo_country_code_label |
additional.fields |
已合併 |
geo_latitude_label |
additional.fields |
已合併 |
geo_longitude_label |
additional.fields |
已合併 |
geo_subdivision_code_label |
additional.fields |
已合併 |
geo_subdivision_name_label |
additional.fields |
已合併 |
geo_timezone_label |
additional.fields |
已合併 |
http_level_label |
additional.fields |
已合併 |
indicator_label |
additional.fields |
已合併 |
indicators_matched_label |
additional.fields |
已合併 |
infrastructure_label |
additional.fields |
已合併 |
intention_label |
additional.fields |
已合併 |
iso_code_label |
additional.fields |
已合併 |
new_template_variable_name_label |
additional.fields |
已合併 |
new_template_variable_preset_name_label |
additional.fields |
已合併 |
new_template_variable_value_label |
additional.fields |
已合併 |
new_widget_definition_background_color_label |
additional.fields |
已合併 |
new_widget_definition_layout_type_label |
additional.fields |
已合併 |
new_widget_definition_show_title_label |
additional.fields |
已合併 |
new_widget_definition_title_label |
additional.fields |
已合併 |
new_widget_definition_type_label |
additional.fields |
已合併 |
new_widget_id_label |
additional.fields |
已合併 |
new_widget_layout_height_label |
additional.fields |
已合併 |
new_widget_layout_width_label |
additional.fields |
已合併 |
new_widget_layout_x_label |
additional.fields |
已合併 |
new_widget_layout_y_label |
additional.fields |
已合併 |
record_attributes_asset_id_label |
additional.fields |
已合併 |
record_attributes_asset_name_label |
additional.fields |
已合併 |
record_attributes_asset_new_value_dashboard_definition_author_handle_label |
additional.fields |
已合併 |
record_attributes_asset_new_value_dashboard_definition_author_name_label |
additional.fields |
已合併 |
record_attributes_asset_new_value_dashboard_definition_description_label |
additional.fields |
已合併 |
record_attributes_asset_new_value_dashboard_definition_id_label |
additional.fields |
已合併 |
record_attributes_asset_new_value_dashboard_definition_reflow_type_label |
additional.fields |
已合併 |
record_attributes_asset_new_value_dashboard_definition_title_label |
additional.fields |
已合併 |
record_attributes_asset_new_value_dashboard_definition_url_label |
additional.fields |
已合併 |
record_attributes_asset_prev_value_dashboard_definition_author_handle_label |
additional.fields |
已合併 |
record_attributes_asset_prev_value_dashboard_definition_author_name_label |
additional.fields |
已合併 |
record_attributes_asset_prev_value_dashboard_definition_description_label |
additional.fields |
已合併 |
record_attributes_asset_prev_value_dashboard_definition_id_label |
additional.fields |
已合併 |
record_attributes_asset_prev_value_dashboard_definition_reflow_type_label |
additional.fields |
已合併 |
record_attributes_asset_prev_value_dashboard_definition_title_label |
additional.fields |
已合併 |
record_attributes_asset_prev_value_dashboard_definition_url_label |
additional.fields |
已合併 |
record_attributes_asset_type_label |
additional.fields |
已合併 |
record_attributes_contextMap_cfRay_label |
additional.fields |
已合併 |
record_attributes_contextMap_tradingAccountId_label |
additional.fields |
已合併 |
record_attributes_evt_name_label |
additional.fields |
已合併 |
record_attributes_network_client_geoip_as_number_label |
additional.fields |
已合併 |
record_attributes_network_client_geoip_as_type_label |
additional.fields |
已合併 |
record_attributes_network_client_geoip_location_latitude_label |
additional.fields |
已合併 |
record_attributes_network_client_geoip_location_longitude_label |
additional.fields |
已合併 |
record_attributes_network_client_geoip_subdivision_iso_code_label |
additional.fields |
已合併 |
record_attributes_network_client_geoip_subdivision_name_label |
additional.fields |
已合併 |
record_attributes_network_client_geoip_timezone_label |
additional.fields |
已合併 |
record_trace_id_label |
additional.fields |
已合併 |
request_id_label |
additional.fields |
已合併 |
risk_label |
additional.fields |
已合併 |
service_label |
additional.fields |
已合併 |
source_name_label |
additional.fields |
已合併 |
source_type_label |
additional.fields |
已合併 |
source_url_label |
additional.fields |
已合併 |
span_id_label |
additional.fields |
已合併 |
symbol_label |
additional.fields |
已合併 |
tag_label |
additional.fields |
已合併 |
template_variable_name_label |
additional.fields |
已合併 |
template_variable_preset_name_label |
additional.fields |
已合併 |
template_variable_value_label |
additional.fields |
已合併 |
timezone_label |
additional.fields |
已合併 |
tunnels_operator_label |
additional.fields |
已合併 |
tunnels_type_label |
additional.fields |
已合併 |
type_label |
additional.fields |
已合併 |
type_label1 |
additional.fields |
已合併 |
url_details_host_label |
additional.fields |
已合併 |
url_details_path_label |
additional.fields |
已合併 |
user_created_timestamp_label |
additional.fields |
已合併 |
widget_definition_background_color_label |
additional.fields |
已合併 |
widget_definition_layout_type_label |
additional.fields |
已合併 |
widget_definition_show_title_label |
additional.fields |
已合併 |
widget_definition_title_label |
additional.fields |
已合併 |
widget_definition_type_label |
additional.fields |
已合併 |
widget_id_label |
additional.fields |
已合併 |
widget_layout_height_label |
additional.fields |
已合併 |
widget_layout_width_label |
additional.fields |
已合併 |
widget_layout_x_label |
additional.fields |
已合併 |
widget_layout_y_label |
additional.fields |
已合併 |
eventMessage |
metadata.description |
直接對應 |
date1 |
metadata.event_timestamp |
已剖析為 ISO8601 |
record.date1 |
metadata.event_timestamp |
已剖析為 ISO8601 |
event_type |
metadata.event_type |
直接對應 |
has_principal |
metadata.event_type |
已對應:true → NETWORK_CONNECTION、true → STATUS_UPDATE |
has_user |
metadata.event_type |
已對應:true → USER_UNCATEGORIZED |
attributes._trace.origin.operation |
metadata.product_event_type |
直接對應 |
eventType |
metadata.product_event_type |
直接對應 |
record_attributes_contextMap_eventType |
metadata.product_event_type |
直接對應 |
source |
metadata.product_event_type |
直接對應 |
_id |
metadata.product_log_id |
直接對應 |
record_attributes_thread_id |
metadata.product_log_id |
直接對應 |
threadID |
metadata.product_log_id |
直接對應 |
service |
metadata.product_name |
直接對應 |
attributes.@version |
metadata.product_version |
直接對應 |
attributes.http.method |
network.http.method |
直接對應 |
agnt |
network.http.parsed_user_agent |
直接對應 |
record_attributes_contextMap_userAgent |
network.http.parsed_user_agent |
直接對應 |
attributes.http.status_code |
network.http.response_code |
已重新命名/對應 |
agnt |
network.http.user_agent |
直接對應 |
attributes.http.useragent |
network.http.user_agent |
直接對應 |
record_attributes_contextMap_userAgent |
network.http.user_agent |
直接對應 |
attributes.logger_name |
principal.application |
直接對應 |
service |
principal.application |
直接對應 |
attributes._trace.baggage.device_id |
principal.asset.asset_id |
直接對應 |
attributes.metadata.host_metadata.hostname |
principal.asset.hostname |
直接對應 |
attributes.usr.id |
principal.asset.hostname |
直接對應 |
attributes.network.client.geoip.ipAddress |
principal.asset.ip |
已合併 |
attributes.network.client.ip |
principal.asset.ip |
已合併 |
ip1 |
principal.asset.ip |
已合併 |
ipAddress |
principal.asset.ip |
直接對應 |
principal_ip_address |
principal.asset.ip |
已合併 |
record_attributes_network_client_ip |
principal.asset.ip |
已合併 |
org |
principal.group.group_display_name |
直接對應 |
attributes.org.uuid |
principal.group.product_object_id |
直接對應 |
attributes.metadata.host_metadata.hostname |
principal.hostname |
直接對應 |
attributes.usr.id |
principal.hostname |
直接對應 |
host |
principal.hostname |
直接對應 |
record_host |
principal.hostname |
直接對應 |
attributes.network.client.geoip.ipAddress |
principal.ip |
已合併 |
attributes.network.client.ip |
principal.ip |
已合併 |
ip1 |
principal.ip |
已合併 |
ipAddress |
principal.ip |
直接對應 |
principal_ip_address |
principal.ip |
已合併 |
record_attributes_network_client_ip |
principal.ip |
已合併 |
record_attributes_http_url_details_host_label |
principal.labels |
已合併 |
record_attributes_http_url_details_path_label |
principal.labels |
已合併 |
record_attributes_http_useragent_label |
principal.labels |
已合併 |
record_attributes_network_client_geoip_as_domain_label |
principal.labels |
已合併 |
record_attributes_network_client_geoip_as_route_label |
principal.labels |
已合併 |
record_attributes_network_client_geoip_city_name_label |
principal.labels |
已合併 |
record_attributes_network_client_geoip_continent_code_label |
principal.labels |
已合併 |
record_attributes_network_client_geoip_continent_name_label |
principal.labels |
已合併 |
record_attributes_network_client_geoip_country_iso_code_label |
principal.labels |
已合併 |
record_attributes_network_client_geoip_country_name_label |
principal.labels |
已合併 |
record_attributes_usr_id_label |
principal.labels |
已合併 |
attributes.network.client.geoip.city.name |
principal.location.city |
直接對應 |
attributes.network.client.geoip.country.name |
principal.location.country_or_region |
直接對應 |
port |
principal.port |
已重新命名/對應 |
client_as_route_label |
principal.resource.attribute.labels |
已合併 |
client_type_label |
principal.resource.attribute.labels |
已合併 |
org_name_label |
principal.resource.attribute.labels |
已合併 |
record_attributes_usr_uuid_label |
principal.user.attribute.labels |
已合併 |
roles |
principal.user.attribute.roles |
已合併 |
attributes.usr.email |
principal.user.email_addresses |
已合併 |
email_id |
principal.user.email_addresses |
已合併 |
record_attributes_usr_email |
principal.user.email_addresses |
已合併 |
attributes.evt.actor.type |
principal.user.role_name |
直接對應 |
attributes.metadata.user_uuid |
principal.user.userid |
直接對應 |
attributes.usr.uuid |
principal.user.userid |
直接對應 |
record_attributes_contextMap_user |
principal.user.userid |
直接對應 |
user |
principal.user.userid |
直接對應 |
BusArch_label |
security_result.about.resource.attribute.labels |
已合併 |
CANDBVersion_label |
security_result.about.resource.attribute.labels |
已合併 |
alert_label |
security_result.about.resource.attribute.labels |
已合併 |
caller_label |
security_result.about.resource.attribute.labels |
已合併 |
component_label |
security_result.about.resource.attribute.labels |
已合併 |
esn_label |
security_result.about.resource.attribute.labels |
已合併 |
ftcpVersion_label |
security_result.about.resource.attribute.labels |
已合併 |
ingestMessageId_label |
security_result.about.resource.attribute.labels |
已合併 |
label |
security_result.about.resource.attribute.labels |
已合併 |
level_label |
security_result.about.resource.attribute.labels |
已合併 |
msg_label |
security_result.about.resource.attribute.labels |
已合併 |
query_label |
security_result.about.resource.attribute.labels |
已合併 |
redactedVin_label |
security_result.about.resource.attribute.labels |
已合併 |
updated_query_label |
security_result.about.resource.attribute.labels |
已合併 |
vehicleId_label |
security_result.about.resource.attribute.labels |
已合併 |
category1 |
security_result.category_details |
已合併 |
_id_label |
security_result.detection_fields |
已合併 |
action_label |
security_result.detection_fields |
已合併 |
org_uuid_label |
security_result.detection_fields |
已合併 |
record_attributes_http_method_label |
security_result.detection_fields |
已合併 |
record_message_label |
security_result.detection_fields |
已合併 |
record_source_label |
security_result.detection_fields |
已合併 |
record_status_label |
security_result.detection_fields |
已合併 |
status |
security_result.severity |
已對應:"INFO", "DEBUG", "debug", "info" → LOW、(?i)WARN → MEDIUM |
status |
security_result.severity_details |
直接對應 |
context.AlertName |
security_result.threat_name |
直接對應 |
src_ip_address |
src.ip |
已合併 |
record_attributes_contextMap_dd_service |
target.application |
直接對應 |
target_ip_address |
target.asset.ip |
已對應:^(?:[0-9]{1,3}[.]){3}[0-9]{1,3}$ → target_ip_address |
target_ip_address |
target.ip |
已對應:^(?:[0-9]{1,3}[.]){3}[0-9]{1,3}$ → target_ip_address |
record_attributes_contextMap_dd_version |
target.platform_version |
直接對應 |
logger_fqcn_label |
target.resource.attribute.labels |
已合併 |
logger_label |
target.resource.attribute.labels |
已合併 |
modified_fields_label |
target.resource.attribute.labels |
已合併 |
asset_name |
target.resource.name |
直接對應 |
asset_id |
target.resource.product_object_id |
直接對應 |
asset_type |
target.resource.type |
直接對應 |
record_attributes_contextMap_dd_env |
target.resource.type |
直接對應 |
record_attributes_contextMap_userId |
target.user.userid |
直接對應 |
record_attributes_user |
target.user.userid |
直接對應 |
| 不適用 | metadata.event_type |
常數:NETWORK_CONNECTION |
| 不適用 | network.http.parsed_user_agent |
常數:parseduseragent |
| 不適用 | security_result.severity |
常數:LOW |
還有其他問題嗎?向社群成員和 Google SecOps 專業人員尋求答案。