收集 Cloud Storage 內容記錄

剖析器版本:1.0

支援的國家/地區:

本文說明如何使用 Cloud Storage,將 Cloud Storage 內容記錄匯出及擷取至 Google Security Operations。剖析器會清除並建構 Cloud Storage 記錄檔中的傳入 JSON 資料。接著,系統會將相關欄位對應至統一資料模型 (UDM),並使用標籤和中繼資料擴充資料,以便在安全防護生態系統中一致地呈現及分析資料。

事前準備

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

  • Google SecOps 執行個體。
  • 在 Google Cloud 環境中設定並啟用 Cloud Storage。
  • 特殊存取權限 Google Cloud 和適當的權限。

建立 Cloud Storage bucket

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

    前往「Buckets」(值區) 頁面

  3. 點選「建立」。

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

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

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

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

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

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

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

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

    3. 在「Choose a storage class for your data」(為資料選擇儲存空間級別) 部分,選取 bucket 的預設儲存空間級別,或選取「Autoclass」(自動分類),讓系統自動管理 bucket 資料的儲存空間級別。

    4. 在「選取如何控制物件的存取權」部分,選取「否」來強制執行「禁止公開存取」,並為 bucket 的物件選取「存取控管模式」。

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

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

設定匯出 Cloud Storage 內容記錄

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

    • 接收器名稱:輸入有意義的名稱,例如 Storage-Context-Sink。
    • 接收器目的地:選取「Cloud Storage」,然後輸入 bucket 的 URI,例如 gs://google-storage-context-logs/。
    • 記錄檔篩選器:

      logName="*storage*"
      resource.type="gcs_bucket"
      
  5. 點選「建立」。

設定 Cloud Storage 的權限

  1. 依序前往「IAM 與管理」>「身分與存取權管理」。
  2. 找出 Cloud Logging 服務帳戶。
  3. 在 bucket 上授予 roles/storage.admin。

設定動態饋給

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

  • SIEM 設定 > 摘要 > 新增摘要
  • 依序點選「內容中心」「內容包」「開始使用」

如何設定雲端儲存空間內容動態消息

  1. 按一下「Google Cloud Compute platform」套件。
  2. 找到「GCP Google Cloud Storage Context」記錄類型,然後點選「新增動態饋給」。
  3. 為下列欄位指定值:

    • 來源類型:Google Cloud Storage V2。
    • 儲存空間 Bucket URI:Cloud Storage bucket 網址,例如 gs://compute-context-logs/。這個網址結尾必須為正斜線 (/)。
    • 來源刪除選項:根據偏好選取刪除選項。
  • 檔案存在時間上限:納入在過去天數內修改的檔案。預設值為 180 天。

進階選項

  • 動態饋給名稱:系統預先填入的值,用於識別動態饋給。
  • 資產命名空間:與動態饋給相關聯的命名空間。
  • 擷取標籤:套用至這個動態饋給所有事件的標籤。
  1. 點選「建立動態饋給」。

如要進一步瞭解如何為這個產品系列的各種記錄類型設定多個動態饋給,請參閱「依產品設定動態饋給」。

UDM 對應表

記錄欄位 UDM 對應 邏輯
上階 event.idm.entity.entity.resource.attribute.labels.value 系統會從原始記錄的祖系陣列中擷取祖系值。
assetType event.idm.entity.entity.resource.type 直接從原始記錄的 assetType 欄位對應。
insertId event.idm.entity.metadata.product_entity_id 直接從原始記錄中的 insertId 欄位對應。
labels.compute.googleapis.com/resource_name event.idm.entity.entity.resource.name 直接從原始記錄中的 labels.compute.googleapis.com/resource_name 欄位對應。
labels.k8s-pod/controller-revision-hash event.idm.entity.entity.file.sha1 直接對應原始記錄中的 labels.k8s-pod/controller-revision-hash 欄位。
labels.k8s-pod/name event.idm.entity.entity.resource.attribute.labels.value 直接從原始記錄中的 labels.k8s-pod/name 欄位對應。
labels.k8s-pod/pod-template-generation event.idm.entity.entity.resource.attribute.labels.value 直接對應原始記錄中的 labels.k8s-pod/pod-template-generation 欄位。
logName event.idm.entity.entity.resource.attribute.labels.value 直接從原始記錄的 logName 欄位對應。
名稱 event.idm.entity.entity.resource.name 直接從原始記錄的名稱欄位對應。
receiveTimestamp event.idm.entity.entity.resource.attribute.creation_time 從原始記錄中的 receiveTimestamp 欄位轉換為時間戳記格式。
resource.data.iamConfiguration.publicAccessPrevention event.idm.entity.entity.resource.attribute.labels.value 直接從原始記錄中的 resource.data.iamConfiguration.publicAccessPrevention 欄位對應。
resource.data.id event.idm.entity.entity.resource.product_object_id 直接從原始記錄檔中的 resource.data.id 欄位對應。
resource.data.kind event.idm.entity.entity.resource.type 直接從原始記錄中的 resource.data.kind 欄位對應。
resource.data.labels.app_id event.idm.entity.entity.resource.attribute.labels.value 直接從原始記錄檔中的 resource.data.labels.app_id 欄位對應。
resource.data.labels.app_name event.idm.entity.entity.resource.attribute.labels.value 直接從原始記錄中的 resource.data.labels.app_name 欄位對應。
resource.data.labels.bucket_id event.idm.entity.entity.resource.attribute.labels.value 直接從原始記錄檔中的 resource.data.labels.bucket_id 欄位對應。
resource.data.labels.data_classification event.idm.entity.entity.resource.attribute.labels.value 直接從原始記錄中的 resource.data.labels.data_classification 欄位對應。
resource.data.labels.dept_name event.idm.entity.entity.resource.attribute.labels.value 直接從原始記錄中的 resource.data.labels.dept_name 欄位對應。
resource.data.labels.dept_no event.idm.entity.entity.resource.attribute.labels.value 直接從原始記錄中的 resource.data.labels.dept_no 欄位對應。
resource.data.labels.environment event.idm.entity.entity.resource.attribute.labels.value 直接從原始記錄中的 resource.data.labels.environment 欄位對應。
resource.data.labels.goog-composer-environment event.idm.entity.entity.resource.attribute.labels.value 直接對應至原始記錄中的 resource.data.labels.goog-composer-environment 欄位。
resource.data.labels.goog-composer-location event.idm.entity.entity.resource.attribute.labels.value 直接從原始記錄中的 resource.data.labels.goog-composer-location 欄位對應。
resource.data.labels.goog-composer-version event.idm.entity.entity.resource.attribute.labels.value 直接對應至原始記錄中的 resource.data.labels.goog-composer-version 欄位。
resource.data.labels.technical_contact event.idm.entity.entity.resource.attribute.labels.value 直接對應至原始記錄中的 resource.data.labels.technical_contact 欄位。
resource.data.labels.type event.idm.entity.entity.resource.attribute.labels.value 直接從原始記錄中的 resource.data.labels.type 欄位對應。
resource.data.location event.idm.entity.entity.location.name 直接從原始記錄中的 resource.data.location 欄位對應。
resource.data.projectNumber event.idm.entity.entity.resource.attribute.cloud.project.id 直接從原始記錄檔中的 resource.data.projectNumber 欄位對應。
resource.data.selfLink event.idm.entity.entity.url 直接從原始記錄中的 resource.data.selfLink 欄位對應。
resource.data.timeCreated event.idm.entity.entity.resource.attribute.creation_time 從原始記錄的 resource.data.timeCreated 欄位轉換為時間戳記格式。
resource.data.updated event.idm.entity.entity.resource.attribute.last_update_time 從原始記錄中的 resource.data.updated 欄位轉換為時間戳記格式。
resource.discoveryDocumentUri event.idm.entity.entity.file.full_path 直接從原始記錄中的 resource.discoveryDocumentUri 欄位對應。
resource.labels.cluster_name event.idm.entity.entity.resource.attribute.labels.value 直接從原始記錄中的 resource.labels.cluster_name 欄位對應。
resource.labels.container_name event.idm.entity.entity.resource.attribute.labels.value 直接從原始記錄檔的 resource.labels.container_name 欄位對應。
resource.labels.location event.idm.entity.entity.location.name 直接從原始記錄中的 resource.labels.location 欄位對應。
resource.labels.namespace_name event.idm.entity.entity.resource.attribute.labels.value 直接從原始記錄中的 resource.labels.namespace_name 欄位對應。
resource.labels.pod_name event.idm.entity.entity.resource.attribute.labels.value 直接從原始記錄中的 resource.labels.pod_name 欄位對應。
resource.labels.project_id event.idm.entity.entity.resource.attribute.cloud.project.id 直接從原始記錄檔中的 resource.labels.project_id 欄位對應。
resource.parent event.idm.entity.entity.resource.parent 直接從原始記錄中的 resource.parent 欄位對應。
resource.type event.idm.entity.entity.resource.type 直接從原始記錄中的 resource.type 欄位對應。
resource.version event.idm.entity.entity.resource.attribute.labels.value 直接從原始記錄中的 resource.version 欄位對應。
textPayload event.idm.entity.entity.resource.attribute.labels.value 直接從原始記錄中的 textPayload 欄位對應。
不適用 event.idm.entity.metadata.collected_timestamp 收集到的時間戳記是記錄項目的時間戳記。
不適用 event.idm.entity.metadata.entity_type 硬式編碼為 RESOURCE。
不適用 event.idm.entity.metadata.product_name 硬式編碼為 GCP Storage Context。
不適用 event.idm.entity.metadata.vendor_name 硬式編碼為 Google Cloud Platform。
不適用 event.idm.entity.entity.resource.attribute.cloud.environment 硬式編碼為 GOOGLE_CLOUD_PLATFORM。
不適用 event.idm.entity.entity.resource.resource_type 硬式編碼為 STORAGE_BUCKET。
不適用 event.timestamp 事件時間戳記就是記錄項目的時間戳記。

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