在規則中納入 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) 實體和事件記錄。

如要瞭解如何將 Sensitive Data Protection 資料擷取至 Google SecOps,請參閱「將 Sensitive Data Protection 資料匯出至 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 值為 mikeross,received_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 事件擷取了端點裝置上的活動。下列程式碼片段是 CrowdStrike Falcon EDR 記錄,儲存為 UDM 事件記錄。它會擷取涉及 Microsoft Excel 應用程式和具有 userid 值 mikeross 的使用者的網路事件。

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
}

關於偵測

如果使用現有資料測試規則,且規則識別出定義中指定的活動模式,就會產生偵測結果。「偵測」面板會顯示測試規則後產生的偵測結果。「Detection」(偵測) 面板也會顯示導致規則建立偵測結果的事件和實體記錄。在這個範例中,系統會顯示下列記錄:

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

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

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

後續步驟

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

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

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

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