在情境感知分析中使用 Sensitive Data Protection 資料

支援的國家/地區:

本文說明如何使用Sensitive Data Protection 的實體背景資料和其他記錄來源,在執行調查時,進一步瞭解潛在威脅的影響和範圍。

本文件所述的用途是偵測使用者是否執行惡意檔案 (MITRE ATT&CK 技術 T1204.002),以及該使用者是否也能存取網路其他位置的機密資料。

在這個範例中,您必須先在 Google Security Operations 中擷取並正規化下列資料:

  • 使用網路和 EDR 記錄的使用者活動資料。
  • 來自 Google Cloud IAM 分析等資料來源的資源關係。
  • Sensitive Data Protection 記錄,其中包含有關儲存資料類型和機密程度的標籤。

Google SecOps 必須能夠將原始資料剖析為 Unified Data Model (UDM) 實體和事件記錄。

如要瞭解如何將私密資料保護資料匯入 Google SecOps,請參閱「將私密資料保護資料匯出至 Google SecOps」。

Google Cloud IAM 分析資料

本例中的 Google Cloud IAM 分析記錄資料會識別機構中的使用者,並擷取每個使用者與網路上其他系統的關係。以下是儲存為 UDM 實體記錄的 IAM 分析記錄片段。這個資料表會儲存使用者 (mikeross) 的相關資訊,該使用者是名為 analytics:claim.patients 的 BigQuery 資料表管理員。

metadata.vendor_name: "Google Cloud Platform"
metadata.product_name: "GCP IAM Analysis"
metadata.entity_type: "USER"
entity.user.userid: "mikeross"
relations[2].entity.resource.name: "analytics:claim.patients"
relations[2].entity.resource.resource_type: "TABLE"
relations[2].entity_type: "RESOURCE"
relations[2].relationship: "ADMINISTERS"

Sensitive Data Protection 資料

本範例中的 Sensitive Data Protection 記錄檔資料會儲存 BigQuery 表格的相關資訊。以下是儲存為 UDM 實體記錄的 Sensitive Data Protection 記錄片段。這代表名為 analytics:claim.patients 的 BigQuery 資料表具有 Predicted InfoType 標籤 US_SOCIAL_SECURITY_NUMBER,表示該資料表儲存美國社會安全號碼。

metadata.vendor_name: "Google Cloud Platform"
metadata.product_name: "GCP DLP CONTEXT"
metadata.entity_type: "RESOURCE"
metadata.description: "RISK_HIGH"
entity.resource.resource_type: "TABLE"
entity.resource.resource_subtype: "BigQuery Table"
entity.resource.attribute.cloud.environment"GOOGLE_CLOUD_PLATFORM"
entity.resource.attribute.labels[0].key: "Sensitivity Score"
entity.resource.attribute.labels[0].value: "SENSITIVITY_HIGH"
entity.resource.attribute.labels[1].key: "Predicted InfoType"
entity.resource.attribute.labels[1].value: "US_SOCIAL_SECURITY_NUMBER"
entity.resource.product_object_id: "analytics:claim.patients"

網路 Proxy 事件

本範例中的網路 Proxy 事件會擷取網路活動。以下程式碼片段是儲存為 UDM 事件記錄的 Zscaler 網頁 Proxy 記錄。這項規則會擷取使用者下載可執行檔的網路事件,其中 userid 值為 mikerossreceived_bytes 值為 514605。

metadata.log_type = "ZSCALER_WEBPROXY"
metadata.product_name = "NSS"
metadata.vendor_name = "Zscaler"
metadata.event_type = "NETWORK_HTTP"
network.http.response_code = 200
network.received_bytes = 514605
principal.user.userid = "mikeross"
target.url = "http://manygoodnews.com/dow/Client%20Update.exe"

EDR 事件

本例中的 EDR 事件會擷取端點裝置上的活動。以下程式碼片段是儲存為 UDM 事件記錄的 CrowdStrike Falcon EDR 記錄。這個規則會擷取涉及 Microsoft Excel 應用程式和具有 useridmikeross 的使用者網路事件。

metadata.log_type = "CS_EDR"
metadata.product_name = "Falcon"
metadata.vendor_name = "Crowdstrike"
metadata.event_type = "NETWORK_HTTP"
target.process.file.full_path = "\\Device\\HarddiskVolume1\\Program Files\\C:\\Program Files\\Microsoft Office\\Office16\\EXCEL.exe"
target.url = "http://manygoodnews.com/dow/Client%20Update.exe"
target.user.userid = "mikeross"

請注意,這些記錄都有共同資訊,包括使用者 ID mikeross 和資料表名稱 analytics:claim.patients。本文的下一節將說明如何在規則中使用這些值來聯結記錄。

本例中的偵測引擎規則

這項規則範例會偵測使用者執行的惡意檔案 (MITRE ATT&CK 技術 T1204.002)。

如果使用者也能存取網路上的其他機密資料,這項規則就會為偵測結果指派較高的風險分數。這項規則會關聯下列資訊:

  • 使用者活動,例如下載或啟動可執行檔。
  • 資源之間的關係,例如使用者與 BigQuery 資料表的關係。
  • 使用者可存取的資源中是否含有私密資訊,例如 BigQuery 資料表中儲存的資料類型。

以下說明範例規則中的各個部分。

  • events」部分會指定規則要尋找的資料模式,並包含下列項目:

    • 第 1 組和第 2 組會識別網路和 EDR 事件,這些事件會擷取大量資料或可執行檔的下載作業,而這些作業也與 Excel 應用程式中的活動相關。
    • 第 3 組會找出網路和 EDR 事件中識別的使用者,這些使用者也擁有 BigQuery 資料表的權限。
    • 第 4 組會找出使用者有權存取的 BigQuery 資料表,並提供 Sensitive Data Protection 記錄。

    每組運算式都會使用 $table_name 變數或 $user 變數,加入與同一使用者和資料庫表格相關的記錄。

  • outcome 區段中,規則會建立 $risk_score 變數,並根據表格中資料的機密程度設定值。在本例中,系統會檢查資料是否標示為 US_SOCIAL_SECURITY_NUMBER Sensitive Data Protection infoType

    outcome 區段也會設定其他變數,例如 $principalHostname$entity_resource_name。這些變數會連同偵測結果一併傳回及儲存,因此您在 Google SecOps 中查看時,也可以將變數值顯示為資料欄。

  • condition 區段表示模式會尋找 events 區段中指定的所有 UDM 記錄。

  rule high_risk_user_download_executable_from_macro {
 meta:
   author = "Google Cloud Security Demos"
   description = "Executable downloaded by Microsoft Excel from High Risk User"
   severity = "High"
   technique = "T1204.002"

 events:
   //Group 1. identify a proxy event with suspected executable download
   $proxy_event.principal.user.userid = $user
   $proxy_event.target.url =  /.*\.exe$/ or
   $proxy_event.network.received_bytes > 102400

   //Group 2. correlate with an EDR event indicating Excel activity
   $edr_event.target.user.userid  = $user
   $edr_event.target.process.file.full_path = /excel/ nocase
   $edr_event.metadata.event_type = "NETWORK_HTTP"

   //Group 3. Use the entity to find the permissions
   $user_entity.graph.entity.user.userid = $user
   $user_entity.graph.relations.entity.resource.name = $table_name

   //Group 4. the entity is from Cloud DLP data
   $table_context.graph.entity.resource.product_object_id = $table_name
   $table_context.graph.metadata.product_name = "GCP DLP CONTEXT"

 match:
    $user over 5m

 outcome:
   //calculate risk score
   $risk_score = max(
       if( $table_context.graph.entity.resource.attribute.labels.value = "US_SOCIAL_SECURITY_NUMBER", 80)
       )
   $technique = array_distinct("T1204.002")
   $principalHostname = array_distinct($proxy_event.principal.hostname)
   $principalIp = array_distinct($proxy_event.principal.ip)
   $principalMac = array_distinct($proxy_event.principal.mac)
   $targetHostname = array_distinct($proxy_event.target.hostname)
   $target_url = array_distinct($proxy_event.target.url)
   $targetIp = array_distinct($proxy_event.target.ip)
   $principalUserUserid =  array_distinct($proxy_event.principal.user.userid)
   $entity_resource_name = array_distinct($table_context.graph.entity.resource.name)

condition:
   $proxy_event and $edr_event and $user_entity and $table_context
}

關於偵測

如果您針對現有資料測試規則,且規則識別出定義中指定的活動模式,就會產生偵測結果。「偵測」面板會顯示測試規則後產生的偵測結果。「偵測」面板也會顯示導致規則建立偵測結果的事件和實體記錄。本例中會顯示下列記錄:

  • Google Cloud IAM 分析 UDM 實體
  • Sensitive Data Protection UDM 實體
  • Zscaler 網路 Proxy UDM 事件
  • CrowdStrike Falcon EDR UDM 事件

在「偵測」面板中,選取任一事件或實體記錄即可查看詳細資料。

偵測結果也會儲存規則 outcome 區段中定義的變數。如要在「偵測」面板中顯示變數,請選取「欄」,然後從「欄」選單中選取一或多個變數名稱。所選資料欄會顯示在「偵測」面板中。

後續步驟

如要編寫自訂規則,請參閱 YARA-L 2.0 語言總覽

如要建立自訂情境感知分析,請參閱「建立情境感知分析」一文。

如要使用預先定義的威脅分析,請參閱「使用 Google SecOps 精選偵測」。

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