收集 ntopng 記錄

支援:

這個剖析器會以 SYSLOG 或 JSON 格式,擷取 ntopng 網路監控記錄。剖析記錄訊息、將相關欄位轉換為 UDM 格式,並加入產品和供應商名稱等中繼資料,豐富事件內容。剖析器也會處理巢狀 JSON 結構,並將特定 ntopng 欄位對應至 UDM 網路事件,包括流量快訊和使用者資源存取權。

事前準備

請確認您已完成下列事前準備事項:

  • Google SecOps 執行個體。
  • ntopng 的特殊存取權。

設定動態饋給

如要設定動態消息,請按照下列步驟操作:

  1. 依序前往「SIEM 設定」>「動態饋給」。
  2. 按一下「新增動態饋給」。
  3. 在下一頁,點按「設定單一動態饋給」。
  4. 在「Feed name」(動態饋給名稱) 欄位中,輸入動態饋給名稱,例如 Ntopng Logs。
  5. 選取「Webhook」做為「來源類型」。
  6. 選取「Ntopng」做為「記錄類型」。
  7. 點選「下一步」。
  8. 選用:指定下列輸入參數的值:
    • 分割分隔符號:用於分隔記錄行的分隔符號,例如 \n。
  9. 點選「下一步」。
  10. 在「Finalize」畫面中檢查動態饋給設定,然後按一下「Submit」。
  11. 按一下「產生密鑰」,產生用於驗證這個動態消息的密鑰。
  12. 複製並儲存密鑰。您無法再次查看這組密鑰。如有需要,您可以重新產生新的密鑰,但這項操作會使舊密鑰失效。
  13. 在「詳細資料」分頁中,複製「端點資訊」欄位中的動態饋給端點網址。您需要在用戶端應用程式中指定這個端點網址。
  14. 按一下「完成」。

為 Webhook 動態饋給建立 API 金鑰

  1. 依序前往 Google Cloud 控制台>「憑證」。

    前往「憑證」

  2. 按一下 [Create credentials] (建立憑證),然後選取 [API key] (API 金鑰)。

  3. 將 API 金鑰存取權限制在 Google Security Operations API。

指定端點網址

  1. 在用戶端應用程式中,指定 Webhook 動態饋給提供的 HTTPS 端點網址。
  2. 如要啟用驗證功能,請在自訂標頭中指定 API 金鑰和密鑰,格式如下:

    X-goog-api-key = API_KEY
    X-Webhook-Access-Key = SECRET
    

    建議:將 API 金鑰指定為標頭,而非在網址中指定。

  3. 如果 Webhook 用戶端不支援自訂標頭,您可以使用下列格式的查詢參數,指定 API 金鑰和密鑰:

    ENDPOINT_URL?key=API_KEY&secret=SECRET
    

    更改下列內容:

    • ENDPOINT_URL:動態饋給端點網址。
    • API_KEY:用於向 Google Security Operations 驗證身分的 API 金鑰。
    • SECRET:您產生的密鑰,用於驗證動態饋給。

在 ntopng 設定 Google SecOps 的 Webhook

  1. 登入 ntopng 網頁介面。
  2. 從下拉式選單中選取「系統」選單。
  3. 依序前往「通知」>「端點」。
  4. 按一下「add」 。
  5. 指定下列輸入參數的值:
    • 端點名稱:提供不重複且具描述性的名稱 (例如 Google SecOps)。
    • 端點類型:從清單中選取「Webhook」。
    • Webhook 網址:輸入 Google SecOps ENDPOINT_URL,並附上 API_KEY 和 SECRET。
  6. 按一下「新增」。
  7. 依序前往「通知」>「收件者」。
  8. 按一下「add」 。
  9. 指定下列輸入參數的值:
    • Recipient Name:提供不重複且具描述性的名稱 (例如 Google SecOps)。
    • 選取端點:選取先前建立的端點。
    • 嚴重程度:選取要傳送至 Google SecOps 的嚴重程度 (例如「資訊」、「警告」和「錯誤」)。
    • 類別篩選器:選取要傳送至 Google SecOps 的內容。
  10. 按一下「測試收件者」,驗證連線。
  11. 按一下「新增」儲存 Webhook。

設定 ntopng Webhook 資源訂閱者

  1. 前往「Pools」(集區)。
  2. 選取要分享事件的資源。

  3. 按一下「動作」欄中的鉛筆圖示。

  4. 按一下「收件者」下拉式選單。

  5. 選取「Google SecOps」Webhook 接收端。

  6. 按一下「編輯」儲存設定。

  7. 對其他資源重複上述程序。

UDM 對應表

記錄欄位 UDM 對應 邏輯
action security_result.detection_fields.key=action、security_result.detection_fields.value=%{action} 原始記錄中的 action 值會對應至含有「action」鍵的 security_result.detection_fields 物件。
alert_generation.host_info.broadcast_domain_host security_result.detection_fields.key=host_info broadcast_domain_host、security_result.detection_fields.value=%{alert_generation.host_info.broadcast_domain_host} 巢狀 JSON 中的 alert_generation.host_info.broadcast_domain_host 值會對應至 security_result.detection_fields 物件,並以「host_info broadcast_domain_host」做為鍵。
alert_generation.host_info.dhcpHost security_result.detection_fields.key=host_info dhcpHost、security_result.detection_fields.value=%{alert_generation.host_info.dhcpHost} 巢狀 JSON 中的 alert_generation.host_info.dhcpHost 值會對應至具有「host_info dhcpHost」鍵的 security_result.detection_fields 物件。
alert_generation.host_info.is_blacklisted security_result.detection_fields.key=host_info is_blacklisted、security_result.detection_fields.value=%{alert_generation.host_info.is_blacklisted} 巢狀 JSON 中的 alert_generation.host_info.is_blacklisted 值會對應至 security_result.detection_fields 物件,並以「host_info is_blacklisted」做為鍵。
alert_generation.host_info.is_broadcast security_result.detection_fields.key=host_info is_broadcast、security_result.detection_fields.value=%{alert_generation.host_info.is_broadcast} 巢狀 JSON 的 alert_generation.host_info.is_broadcast 值會對應至鍵為「host_info is_broadcast」的 security_result.detection_fields 物件。
alert_generation.host_info.is_multicast security_result.detection_fields.key=host_info is_multicast、security_result.detection_fields.value=%{alert_generation.host_info.is_multicast} 巢狀 JSON 中的 alert_generation.host_info.is_multicast 值會對應至 security_result.detection_fields 物件,並以「host_info is_multicast」做為鍵。
alert_generation.host_info.localhost security_result.detection_fields.key=host_info localhost、security_result.detection_fields.value=%{alert_generation.host_info.localhost} 巢狀 JSON 中的 alert_generation.host_info.localhost 值會對應至鍵為「host_info localhost」的 security_result.detection_fields 物件。
alert_generation.host_info.privatehost security_result.detection_fields.key=host_info privatehost、security_result.detection_fields.value=%{alert_generation.host_info.privatehost} 巢狀 JSON 中的 alert_generation.host_info.privatehost 值會對應至鍵為「host_info privatehost」的 security_result.detection_fields 物件。
alert_generation.host_info.systemhost security_result.detection_fields.key=host_info systemhost、security_result.detection_fields.value=%{alert_generation.host_info.systemhost} 巢狀 JSON 的 alert_generation.host_info.systemhost 值會對應至鍵為「host_info systemhost」的 security_result.detection_fields 物件。
alert_generation.script_key security_result.category_details=%{alert_generation.script_key} 巢狀 JSON 中的 alert_generation.script_key 值會對應至 security_result.category_details。
alert_generation.subdir security_result.detection_fields.key=alert_generation_subdir、security_result.detection_fields.value=%{alert_generation.subdir} 巢狀 JSON 中的 alert_generation.subdir 值會對應至鍵為「alert_generation_subdir」的 security_result.detection_fields 物件。
alert_id security_result.detection_fields.key=alert_id、security_result.detection_fields.value=%{alert_id} 原始記錄中的 alert_id 值會對應至含有「alert_id」鍵的 security_result.detection_fields 物件。
alerts_map security_result.detection_fields.key=alerts_map、security_result.detection_fields.value=%{alerts_map} 原始記錄中的 alerts_map 值會對應至含有「alerts_map」鍵的 security_result.detection_fields 物件。
cli2srv_bytes network.sent_bytes 原始記錄中的 cli2srv_bytes 值會轉換為不帶正負號的整數,並對應至 network.sent_bytes。
cli_asn principal.resource.attribute.labels.key=cli_asn、principal.resource.attribute.labels.value=%{cli_asn} 原始記錄中的 cli_asn 值會轉換為字串,並對應至鍵為「cli_asn」的 principal.resource.attribute.labels 物件。
cli_blacklisted principal.resource.attribute.labels.key=cli_blacklisted、principal.resource.attribute.labels.value=%{cli_blacklisted} 原始記錄中的 cli_blacklisted 值會轉換為字串,並對應至含有「cli_blacklisted」鍵的 principal.resource.attribute.labels 物件。
cli_city_name principal.location.city 原始記錄中的 cli_city_name 值會對應至 principal.location.city。
cli_continent_name principal.resource.attribute.labels.key=cli_continent_name、principal.resource.attribute.labels.value=%{cli_continent_name} 原始記錄中的 cli_continent_name 值會對應至鍵為「cli_continent_name」的 principal.resource.attribute.labels 物件。
cli_country_name principal.location.country_or_region 原始記錄中的 cli_country_name 值會對應至 principal.location.country_or_region。
cli_host_pool_id principal.resource.attribute.labels.key=cli_host_pool_id、principal.resource.attribute.labels.value=%{cli_host_pool_id} 原始記錄中的 cli_host_pool_id 值會轉換為字串,並對應至鍵為「cli_host_pool_id」的 principal.resource.attribute.labels 物件。
cli_ip principal.ip、principal.asset.ip 原始記錄中的 cli_ip 值會對應至 principal.ip 和 principal.asset.ip。
cli_localhost principal.resource.attribute.labels.key=cli_localhost、principal.resource.attribute.labels.value=%{cli_localhost} 原始記錄中的 cli_localhost 值會轉換為字串,並對應至鍵為「cli_localhost」的 principal.resource.attribute.labels 物件。
cli_location principal.location.name 原始記錄中的 cli_location 值會轉換為字串。如果不是「0」,則會對應至 principal.location.name。
cli_name principal.hostname、principal.asset.hostname 原始記錄中的 cli_name 值會對應至 principal.hostname 和 principal.asset.hostname。
cli_network principal.resource.attribute.labels.key=cli_network、principal.resource.attribute.labels.value=%{cli_network} 原始記錄中的 cli_network 值會轉換為字串,並對應至鍵為「cli_network」的 principal.resource.attribute.labels 物件。
cli_port principal.port 原始記錄中的 cli_port 值會轉換為整數,並對應至 principal.port。
entity_id principal.resource.attribute.labels.key=entity_id、principal.resource.attribute.labels.value=%{entity_id} 原始記錄中的 entity_id 值會轉換為字串,並對應至含有「entity_id」鍵的 principal.resource.attribute.labels 物件。
entity_val principal.resource.attribute.labels.key=entity_val、principal.resource.attribute.labels.value=%{entity_val} 原始記錄中的 entity_val 值會對應至鍵為「entity_val」的 principal.resource.attribute.labels 物件,除非該值等於 ip 的值。
event.type metadata.event_type 由剖析器邏輯根據 principal、target 和 network 欄位是否存在而決定。可能的值:NETWORK_FLOW、NETWORK_UNCATEGORIZED、USER_RESOURCE_ACCESS、GENERIC_EVENT。
first_seen principal.asset.first_seen_time 原始記錄中的 first_seen 值會轉換為字串,剖析為自 Epoch 時間起算的毫秒數,並對應至 principal.asset.first_seen_time。
flow_risk_bitmap security_result.detection_fields.key=flow_risk_bitmap、security_result.detection_fields.value=%{flow_risk_bitmap} 原始記錄中的 flow_risk_bitmap 值會轉換為字串,並對應至鍵為「flow_risk_bitmap」的 security_result.detection_fields 物件。
granularity security_result.detection_fields.key=granularity、security_result.detection_fields.value=%{granularity} 原始記錄中的 granularity 值會轉換為字串,並對應至鍵為「granularity」的 security_result.detection_fields 物件。
hash_entry_id security_result.detection_fields.key=hash_entry_id、security_result.detection_fields.value=%{hash_entry_id} 巢狀 JSON 中的 hash_entry_id 值會對應至具有「hash_entry_id」鍵的 security_result.detection_fields 物件。
host_ip principal.ip、principal.asset.ip 從郵件的 <INT>Oct 20 15:34:53 1.1.1.1 部分擷取的 IP 位址會對應至 principal.ip 和 principal.asset.ip。
ifid principal.asset_id 原始記錄中的 ifid 值會轉換為字串,並對應至 principal.asset_id,前置字串為「ifid: 」。
ip principal.ip、principal.asset.ip 或 target.ip,target.asset.ip 如果 is_client 為 true,原始記錄中的 ip 值會對應至 principal.ip 和 principal.asset.ip。如果 is_server 為 true,則會對應至 target.ip 和 target.asset.ip。
is_cli_attacker security_result.detection_fields.key=is_cli_attacker、security_result.detection_fields.value=%{is_cli_attacker} 原始記錄中的 is_cli_attacker 值會轉換為字串,並對應至鍵為「is_cli_attacker」的 security_result.detection_fields 物件。
is_cli_victim security_result.detection_fields.key=is_cli_victim、security_result.detection_fields.value=%{is_cli_victim} 原始記錄中的 is_cli_victim 值會轉換為字串,並對應至鍵為「is_cli_victim」的 security_result.detection_fields 物件。
is_flow_alert security_result.detection_fields.key=is_flow_alert、security_result.detection_fields.value=%{is_flow_alert}、security_result.detection_fields.key=alert type、security_result.detection_fields.value=flow 原始記錄中的 is_flow_alert 值會轉換為字串,並對應至含有「is_flow_alert」鍵的 security_result.detection_fields 物件。如果 is_flow_alert 為 true,系統也會建立 security_result.detection_fields 物件,其鍵為「alert type」,值為「flow」。
is_srv_attacker security_result.detection_fields.key=is_srv_attacker、security_result.detection_fields.value=%{is_srv_attacker} 原始記錄中的 is_srv_attacker 值會轉換為字串,並對應至含有「is_srv_attacker」鍵的 security_result.detection_fields 物件。
is_srv_victim security_result.detection_fields.key=is_srv_victim、security_result.detection_fields.value=%{is_srv_victim} 原始記錄中的 is_srv_victim 值會轉換為字串,並對應至含有「is_srv_victim」鍵的 security_result.detection_fields 物件。
metadata.product_name metadata.product_name=NTOPNG 硬式編碼為「NTOPNG」。
metadata.vendor_name metadata.vendor_name=%{vendor_name} 訊息中的 vendor_name 值會對應至 metadata.vendor_name。
name principal.hostname、principal.asset.hostname 或 target.hostname,target.asset.hostname 如果 is_client 為 true,原始記錄中的 name 值會對應至 principal.hostname 和 principal.asset.hostname。如果 is_server 為 true,則會對應至 target.hostname 和 target.asset.hostname。
ntopng_key security_result.detection_fields.key=ntopng_key、security_result.detection_fields.value=%{ntopng_key} 巢狀 JSON 中的 ntopng.key 值 (已重新命名為 ntopng_key) 會對應至鍵為「ntopng_key」的 security_result.detection_fields 物件。
observation_point_id observer.asset_id 原始記錄中的 observation_point_id 值會轉換為字串。如果不是「0」,則會對應至 observer.asset_id,並加上「id: 」前置字串。
pool_id principal.resource.attribute.labels.key=pool_id、principal.resource.attribute.labels.value=%{pool_id} 原始記錄中的 pool_id 值會轉換為字串,並對應至含有「pool_id」鍵的 principal.resource.attribute.labels 物件。
probe_ip intermediary.ip 原始記錄中的 probe_ip 值會對應至 intermediary.ip。
proto.confidence security_result.confidence_details 原始記錄中的 proto.confidence 值會轉換為字串,並對應至 security_result.confidence_details。
proto.http.last_method network.http.method 原始記錄中的 proto.http.last_method 值會對應至 network.http.method。
proto.http.last_return_code network.http.response_code 原始記錄中的 proto.http.last_return_code 值會轉換為整數,並對應至 network.http.response_code。
proto.http.last_server_name network.tls.client.server_name 原始記錄中的 proto.http.server_name 值會對應至 network.tls.client.server_name。
proto.http.last_url network.http.referral_url 原始記錄中的 proto.http.last_url 值會對應至 network.http.referral_url。
proto.http.last_user_agent network.http.user_agent 原始記錄中的 proto.http.last_user_agent 值會對應至 network.http.user_agent。
proto.http.server_name network.tls.client.server_name 原始記錄中的 proto.http.server_name 值會對應至 network.tls.client.server_name。
proto.l4 network.ip_protocol 原始記錄中的 proto.l4 值會對應至 network.ip_protocol。
proto_ndpi additional.fields.key=proto ndpi、additional.fields.value.string_value=%{proto_ndpi}、network.application_protocol 原始記錄中的 proto.ndpi 值 (已重新命名為 proto_ndpi) 會對應至鍵為「proto ndpi」的 additional.fields 物件。此外,系統也會根據「NTP」和「HTTP」等關鍵字,判斷 network.application_protocol 的值。
proto_ndpi_app principal.application 原始記錄中的 proto_ndpi_app 值會對應至 principal.application。
proto_ndpi_breed security_result.detection_fields.key=proto_ndpi_breed、security_result.detection_fields.value=%{proto_ndpi_breed} 原始記錄中的 proto_ndpi_breed 值會轉換為字串,並對應至鍵為「proto_ndpi_breed」的 security_result.detection_fields 物件。
proto_ndpi_cat security_result.category_details 原始記錄中的 proto_ndpi_cat 值會對應至 security_result.category_details。
proto_ndpi_cat_id security_result.detection_fields.key=proto_ndpi_cat_id、security_result.detection_fields.value=%{proto_ndpi_cat_id} 原始記錄中的 proto_ndpi_cat_id 值會轉換為字串,並對應至以「proto_ndpi_cat_id」為鍵的 security_result.detection_fields 物件。
score security_result.detection_fields.key=score、security_result.detection_fields.value=%{score} 原始記錄中的 score 值會轉換為字串,並對應至鍵為「score」的 security_result.detection_fields 物件。
srv2cli_bytes network.received_bytes 原始記錄中的 srv2cli_bytes 值會轉換為不帶正負號的整數,並對應至 network.received_bytes。
srv_asn target.resource.attribute.labels.key=srv_asn、target.resource.attribute.labels.value=%{srv_asn} 原始記錄中的 srv_asn 值會轉換為字串,並對應至鍵為「srv_asn」的 target.resource.attribute.labels 物件。
srv_blacklisted target.resource.attribute.labels.key=srv_blacklisted、target.resource.attribute.labels.value=%{srv_blacklisted} 原始記錄中的 srv_blacklisted 值會轉換為字串,並對應至鍵為「srv_blacklisted」的 target.resource.attribute.labels 物件。
srv_city_name target.location.city 原始記錄中的 srv_city_name 值會對應至 target.location.city。
srv_continent_name target.resource.attribute.labels.key=srv_continent_name、target.resource.attribute.labels.value=%{srv_continent_name} 原始記錄中的 srv_continent_name 值會對應至含有「srv_continent_name」鍵的 target.resource.attribute.labels 物件。
srv_country_name target.location.country_or_region 原始記錄中的 srv_country_name 值會對應至 target.location.country_or_region。
srv_host_pool_id target.resource.attribute.labels.key=srv_host_pool_id、target.resource.attribute.labels.value=%{srv_host_pool_id} 原始記錄中的 srv_host_pool_id 值會轉換為字串,並對應至鍵為「srv_host_pool_id」的 target.resource.attribute.labels 物件。
srv_ip target.ip、target.asset.ip 原始記錄中的 srv_ip 值會對應至 target.ip 和 target.asset.ip。
srv_localhost target.resource.attribute.labels.key=srv_localhost、target.resource.attribute.labels.value=%{srv_localhost} 原始記錄中的 srv_localhost 值會轉換為字串,並對應至鍵為「srv_localhost」的 target.resource.attribute.labels 物件。
srv_location target.location.name 原始記錄中的 srv_location 值會轉換為字串。如果不是「0」,則會對應至 target.location.name。
srv_location_lat target.location.region_coordinates.latitude 原始記錄中的 srv_location_lat 值會對應至 target.location.region_coordinates.latitude。
srv_location_lon target.location.region_coordinates.longitude 原始記錄中的 srv_location_lon 值會對應至 target.location.region_coordinates.longitude。
srv_name target.hostname、target.asset.hostname 原始記錄中的 srv_name 值會對應至 target.hostname 和 target.asset.hostname。
srv_network target.resource.attribute.labels.key=srv_network、target.resource.attribute.labels.value=%{srv_network} 原始記錄中的 srv_network 值會轉換為字串,並對應至鍵為「srv_network」的 target.resource.attribute.labels 物件。
srv_port target.port 原始記錄中的 srv_port 值會轉換為整數,並對應至 target.port。
tstamp additional.fields.key=tstamp、additional.fields.value.string_value=%{tstamp} 原始記錄中的 tstamp 值會轉換為字串,並對應至鍵為「tstamp」的 additional.fields 物件。
vlan_id principal.resource.attribute.labels.key=vlan_id、principal.resource.attribute.labels.value=%{vlan_id} 原始記錄中的 vlan_id 值會轉換為字串,並對應至以「vlan_id」為鍵的 principal.resource.attribute.labels 物件。
when metadata.event_timestamp 系統會將原始記錄中的 when 值剖析為時間戳記,並對應至 metadata.event_timestamp。

變更記錄

查看這個剖析器的變更記錄

還有其他問題嗎?向社群成員和 Google SecOps 專家尋求解答。