收集 Security Command Center 姿勢違規記錄

支援的國家/地區:

本文說明如何使用 Cloud Storage,將 Security Command Center 姿勢違規記錄匯出及擷取至 Google Security Operations。剖析器會將調查結果的原始 JSON 資料轉換為統一資料模型 (UDM)。這項服務會擷取相關欄位、重組資料、將資料對應至 UDM 欄位,並執行各種驗證和擴充作業,確保資料品質和一致性。

事前準備

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

  • 在 Google Cloud 環境中啟用 Security Command Center。
  • Google SecOps 執行個體。
  • 具備 Security Command Center 和 Cloud Logging 的特殊權限。

建立 Cloud Storage 值區

  1. 登入Google Cloud 控制台
  2. 前往「Cloud Storage Buckets」(Cloud Storage bucket) 頁面。

    前往「Buckets」(值區) 頁面

  3. 點選「建立」

  4. 在「建立 bucket」頁面中,輸入 bucket 資訊。完成下列每個步驟後,請按一下「繼續」前往下一個步驟:

    1. 在「開始使用」部分執行下列操作:

      1. 輸入符合值區名稱規定的不重複名稱,例如 gcp-scc-posture-violation-logs
      2. 如要啟用階層命名空間,請按一下展開箭頭,展開「為檔案導向和資料密集型工作負載提供最理想的儲存空間」部分,然後選取「為這個值區啟用階層結構式命名空間」

      3. 如要新增值區標籤,請按一下展開箭頭,展開「標籤」部分。

      4. 按一下「新增標籤」,然後指定標籤的鍵和值。

    2. 在「Choose where to store your data」(選擇資料的儲存位置) 專區中執行下列操作:

      1. 選取「位置類型」
      2. 使用位置類型選單選取位置,永久儲存 bucket 中的物件資料。

      3. 如要設定跨 bucket 複製作業,請展開「設定跨 bucket 複製作業」部分。

    3. 在「為資料選擇儲存空間級別」部分,選取值區的預設儲存空間級別,或選取「Autoclass」,讓系統自動管理值區資料的儲存空間級別。

    4. 在「選取如何控制物件的存取權」部分,選取「否」以強制禁止公開存取,並為值區物件選取存取權控管模型

    5. 在「選擇保護物件資料的方式」部分,執行下列操作:

      1. 選取「資料保護」下要為值區設定的任何選項。
      2. 如要選擇物件資料的加密方式,請按一下標示為「資料加密」的展開箭頭,然後選取「資料加密方法」
  5. 點選「建立」

設定 Security Command Center 記錄

  1. 登入Google Cloud 控制台
  2. 前往 Security Command Center 頁面。

    前往 Security Command Center

  3. 選取您的機構。

  4. 按一下「設定」

  5. 按一下「持續匯出作業」分頁標籤。

  6. 在「匯出名稱」下方,按一下「記錄匯出」

  7. 在「接收器」下方,開啟「將發現項目記錄至 Logging」

  8. 在「記錄專案」下方,輸入或搜尋要記錄調查結果的專案。

  9. 按一下 [儲存]

設定匯出 Security Command Center 違規記錄

  1. 登入Google Cloud 控制台
  2. 依序前往「Logging」>「Log Router」
  3. 按一下「建立接收器」
  4. 提供下列設定參數:

    • 接收器名稱:輸入有意義的名稱,例如 scc-posture-violation-logs-sink
    • 接收器目的地:選取「Cloud Storage Storage」,然後輸入值區的 URI,例如 gs://gcp-scc-posture-violation-logs
    • 記錄檔篩選器

      logName="projects/<your-project-id>/logs/cloudsecurityscanner.googleapis.com%2Fposture_violations"
      resource.type="cloud_security_center_posture_violation"
      
    • 設定匯出選項:包括所有記錄項目。

  5. 點選「建立」

設定 Cloud Storage 的權限

  1. 前往「IAM 與管理」>「IAM」
  2. 找到 Cloud Logging 服務帳戶。
  3. 授予值區的 roles/storage.admin

設定動態饋給

在 Google SecOps 平台中,有兩種不同的進入點可設定動態饋給:

  • 「SIEM 設定」>「動態消息」
  • 內容中心 > 內容包

依序前往「SIEM 設定」>「動態饋給」,設定動態饋給

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

  1. 依序前往「SIEM 設定」>「動態消息」
  2. 按一下「新增動態消息」
  3. 在下一個頁面中,按一下「設定單一動態饋給」
  4. 在「動態饋給名稱」欄位中,輸入動態饋給的名稱,例如「Security Command Center Posture Violation Logs」
  5. 選取「Google Cloud Storage」做為「來源類型」。
  6. 選取「Security Command Center Posture Violation」(Security Command Center 狀態違規) 做為「記錄類型」
  7. 按一下「Chronicle Service Account」(Chronicle 服務帳戶) 欄位旁的「Get Service Account」(取得服務帳戶)
  8. 點選「下一步」
  9. 指定下列輸入參數的值:

    • 儲存空間值區 URI:Cloud Storage 值區網址,例如 gs://gcp-scc-posture-violation-logs
    • 「URI Is A」(URI 為):選取「Directory which includes subdirectories」(包含子目錄的目錄)
    • 來源刪除選項:根據偏好選取刪除選項。

  10. 點選「下一步」

  11. 在「Finalize」畫面上檢查新的動態饋給設定,然後按一下「Submit」

從內容中心設定動態饋給

為下列欄位指定值:

  • 儲存空間值區 URI:Cloud Storage 值區網址,例如 gs://gcp-scc-posture-violation-logs
  • 「URI Is A」(URI 為):選取「Directory which includes subdirectories」(包含子目錄的目錄)
  • 來源刪除選項:根據偏好選取刪除選項。

進階選項

  • 動態饋給名稱:系統預先填入的值,用於識別動態饋給。
  • 來源類型:將記錄收集到 Google SecOps 的方法。
  • 資產命名空間:與動態饋給相關聯的命名空間。
  • 擷取標籤:套用至這個動態饋給所有事件的標籤。

UDM 對應表

記錄欄位 UDM 對應 邏輯
category read_only_udm.metadata.product_event_type 直接對應。
changed_policy read_only_udm.security_result.rule_name 直接對應。
cloudProvider read_only_udm.target.resource.attribute.cloud.environment 直接對應。
createTime read_only_udm.security_result.detection_fields[createTime] 直接對應。
finding.risks.riskCategory read_only_udm.security_result.detection_fields[risk_category] 直接對應。
靜音 read_only_udm.security_result.detection_fields[mute] 直接對應。
名稱 read_only_udm.metadata.product_log_id 直接對應。
originalProviderId read_only_udm.target.resource.attribute.labels[original_provider_id] 直接對應。
parent read_only_udm.target.resource_ancestors[0].name 直接對應。
parentDisplayName read_only_udm.metadata.description 直接對應。
propertyDataTypes.changed_policy.primitiveDataType read_only_udm.security_result.rule_labels[changed_policy_primitive_data_type] 直接對應。
propertyDataTypes.policy_drift_details.listValues.propertyDataTypes[0].structValue.fields.drift_details.structValue.fields.detected_configuration.primitiveDataType read_only_udm.security_result.rule_labels[detected_configuration_primitive_data_type] 直接對應。
propertyDataTypes.policy_drift_details.listValues.propertyDataTypes[0].structValue.fields.drift_details.structValue.fields.expected_configuration.primitiveDataType read_only_udm.security_result.rule_labels[expected_configuration_primitive_data_type] 直接對應。
propertyDataTypes.policy_drift_details.listValues.propertyDataTypes[0].structValue.fields.field_name.primitiveDataType read_only_udm.security_result.rule_labels[field_name_primitive_data_type] 直接對應。
propertyDataTypes.posture_deployment_name.primitiveDataType read_only_udm.security_result.detection_fields[posture_deployment_name_primitiveDataType] 直接對應。
propertyDataTypes.posture_deployment_resource.primitiveDataType read_only_udm.security_result.detection_fields[posture_deployment_resource_primitiveDataType] 直接對應。
propertyDataTypes.posture_name.primitiveDataType read_only_udm.security_result.detection_fields[posture_name_primitiveDataType] 直接對應。
propertyDataTypes.posture_revision_id.primitiveDataType read_only_udm.security_result.detection_fields[posture_revision_id_primitiveDataType] 直接對應。
resource.cloudProvider read_only_udm.target.resource.attribute.cloud.environment 直接對應。
resource.displayName read_only_udm.target.resource.attribute.labels[resource_displayName] 直接對應。
resource.gcpMetadata.organization read_only_udm.target.resource.attribute.labels[resource_organization] 直接對應。
resource.gcpMetadata.parent read_only_udm.target.resource.attribute.labels[resource_parent] 直接對應。
resource.gcpMetadata.parentDisplayName read_only_udm.target.resource.attribute.labels[resource_parentDisplayName] 直接對應。
resource.gcpMetadata.project read_only_udm.target.resource.attribute.labels[resource_project] 直接對應。
resource.gcpMetadata.projectDisplayName read_only_udm.target.resource.attribute.labels[resource_projectDisplayName] 直接對應。
resource.organization read_only_udm.target.resource.attribute.labels[resource_organization] 直接對應。
resource.resourcePath.nodes.displayName read_only_udm.target.resource_ancestors.name 直接對應。
resource.resourcePath.nodes.id read_only_udm.target.resource_ancestors.product_object_id 直接對應。
resource.resourcePath.nodes.nodeType read_only_udm.target.resource_ancestors.resource_subtype 直接對應。
resource.resourcePathString read_only_udm.target.resource.attribute.labels[resource_path_string] 直接對應。
resource.service read_only_udm.target.resource_ancestors[10].name 直接對應。
resource.type read_only_udm.target.resource.attribute.labels[resource_type] 直接對應。
resourceName read_only_udm.target.resource.name 直接對應。
securityPosture.changedPolicy read_only_udm.security_result.rule_labels[changed_policy] 直接對應。
securityPosture.name read_only_udm.security_result.detection_fields[security_posture_name] 直接對應。
securityPosture.policyDriftDetails[0].detectedValue read_only_udm.security_result.rule_labels[policy_drift_details_detected_value] 直接對應。
securityPosture.policyDriftDetails[0].expectedValue read_only_udm.security_result.rule_labels[policy_drift_details_expected_value] 直接對應。
securityPosture.policyDriftDetails[0].field read_only_udm.security_result.rule_labels[policy_drift_details_field] 直接對應。
securityPosture.policySet read_only_udm.security_result.rule_set 直接對應。
securityPosture.postureDeployment read_only_udm.security_result.detection_fields[posture_deployment] 直接對應。
securityPosture.postureDeploymentResource read_only_udm.security_result.detection_fields[posture_deployment_resource] 直接對應。
securityPosture.revisionId read_only_udm.security_result.detection_fields[security_posture_revision_id] 直接對應。
嚴重性 read_only_udm.security_result.severity 直接對應。
sourceProperties.categories[0] read_only_udm.security_result.detection_fields[source_properties_categories] 直接對應。
sourceProperties.changed_policy read_only_udm.security_result.rule_name 直接對應。
sourceProperties.name read_only_udm.target.application 直接對應。
sourceProperties.policy_drift_details[0].drift_details.detected_configuration read_only_udm.security_result.rule_labels[policy_drift_details_detected_configuration] 直接對應。
sourceProperties.policy_drift_details[0].drift_details.expected_configuration read_only_udm.security_result.rule_labels[policy_drift_details_expected_configuration] 直接對應。
sourceProperties.policy_drift_details[0].field_name read_only_udm.security_result.rule_labels[policy_drift_details_field_name] 直接對應。
sourceProperties.posture_deployment read_only_udm.security_result.detection_fields[source_properties_posture_deployment_name] 直接對應。
sourceProperties.posture_deployment_name read_only_udm.security_result.detection_fields[source_properties_posture_deployment_name] 直接對應。
sourceProperties.posture_deployment_resource read_only_udm.security_result.detection_fields[source_properties_posture_deployment_resource] 直接對應。
sourceProperties.posture_name read_only_udm.target.application 直接對應。
sourceProperties.posture_revision_id read_only_udm.security_result.detection_fields[source_properties_posture_revision_id] 直接對應。
sourceProperties.revision_id read_only_udm.security_result.detection_fields[source_properties_posture_revision_id] 直接對應。
state read_only_udm.security_result.detection_fields[state] 直接對應。
read_only_udm.metadata.vendor_name 剖析器會對應靜態值 Google
read_only_udm.metadata.product_name 剖析器會對應靜態值 Security Command Center
read_only_udm.target.resource.resource_type 剖析器會對應靜態值 CLUSTER
read_only_udm.security_result.about.investigation.status 剖析器會對應靜態值 NEW
read_only_udm.security_result.alert_state 剖析器會對應靜態值 ALERTING
read_only_udm.metadata.event_type 剖析器會對應至 GENERIC_EVENT 做為預設值。如果「category」欄位等於「SECURITY_POSTURE_DRIFT」,且「client_device_present」和「token_target.application」不為空白,則會對應至「SERVICE_MODIFICATION」。如果欄位「category」等於「SECURITY_POSTURE_POLICY_DRIFT」、「SECURITY_POSTURE_POLICY_DELETE」、「SECURITY_POSTURE_DETECTOR_DRIFT」或「SECURITY_POSTURE_DETECTOR_DELETE」,且「network_edr_not_present」為 false,「client_device_present」為 true,則會對應至「SCAN_UNCATEGORIZED」。如果欄位「token_metadata.event_type」等於「GENERIC_EVENT」,且「network_edr_not_present」為 false,「client_device_present」為 true,則會對應至「STATUS_UPDATE」。
read_only_udm.target.resource_ancestors[1].resource_type 剖析器會對應靜態值 CLOUD_PROJECT
read_only_udm.target.resource.product_object_id 剖析器會從「parent」欄位中,擷取第二個和第三個「/」字元之間的值。
read_only_udm.target.resource_ancestors[1].name 剖析器會從「resourceName」欄位中,擷取第四個和第五個「/」字元之間的值。
read_only_udm.security_result.url_back_to_product 剖析器會使用從記錄中擷取的機構、來源和發現項目 ID,動態建構網址。
securityMarks.name read_only_udm.security_result.detection_fields[securityMarks_name] 直接對應。

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