將 Apigee 與 SIEM 解決方案整合

本頁內容適用於 ApigeeApigee Hybrid

許多機構都想將 Apigee 與安全資訊與事件管理 (SIEM) 解決方案整合。這項整合功能可將 Apigee 資料與其他網路和安全性產品記錄檔建立關聯,有助於進行進階威脅偵測、全面記錄及法規遵循報告。本文將探討各種整合方法,適用於有和沒有 Advanced API Security 外掛程式的案例。

目標對象

這份文件的目標對象包括:

  • API 管理員:負責確保 API 安全、管理平台設定、提升作業效率,以及遵守安全法規遵循規定。
  • 安全分析師:主動偵測及調查 API 相關安全事件,盡量降低風險並保護機密資料。

設定選項

Apigee 提供兩種主要方法,可將記錄資訊傳送至 SIEM:

選項 說明
Google Cloud Platform 記錄 提供基礎層級的 API 記錄資料,包括有助於偵錯和疑難排解的服務專屬記錄。
Apigee Message Logging 政策 訊息記錄政策提供更高的彈性和控管權,讓您將各種 Apigee 記錄資料 (包括特定流程變數) 傳送至 SIEM。

將 Apigee 與 SIEM 整合

Apigee 的適應性可確保與您選擇的 SIEM 解決方案順利整合。 一般整合步驟如下:

  1. 選擇整合方式。根據資料需求和 SIEM 功能,選取 Google Cloud Platform 記錄或 Apigee Message Logging 政策
  2. 建立資料轉送。如要建立資料轉送功能,請設定 Apigee 將所需記錄資料傳送至 SIEM。設定方式的基本步驟如下。 確切步驟取決於 SIEM 系統的設定和設定詳細資料:
    1. 在 Apigee 和 SIEM 之間設定連線或整合。
    2. 在 SIEM 設定中,指定要轉送至 SIEM 的 Apigee 記錄或事件。
    3. 在 SIEM 中授予必要權限,以接收及處理 Apigee 資料。
  3. 對齊資料結構。對應 Apigee 記錄檔欄位和流程變數 (例如 client.iprequest.uri 等) 對應至 SIEM 資料模型中的相應欄位。這項對應作業可確保 SIEM 系統正確解讀及分類 Apigee 資料,以便有效分析及與其他安全性事件建立關聯。

記錄 Advanced API Security 資料

如要記錄 Advanced API Security 濫用行為偵測功能識別的資料,可以使用 Apigee Message Logging 政策搭配「動作」

步驟如下:

  1. 使用 Advanced API Security 動作,標記要記錄的規則。
  2. 使用動作新增的標頭觸發訊息記錄政策,記錄標記的要求。舉例來說,下圖顯示在動作 UI 中,以值 abuse 設定的標頭 apisec

    螢幕截圖:顯示在 API 安全性動作 UI 中,以值濫用行為設定的標頭 apisec

    按照這個範例,您可以設定郵件記錄政策,在看到以下標頭時觸發政策:

    <PostFlow name="PostFlow">
      <Request>
        <Step>
          <Condition>request.header.apisec="abuse"</Condition>
          <Name>LogMessagePolicy</Name>
        </Step>
      </Request>
    </PostFlow>

範例:使用 Apigee 訊息記錄政策

本例示範如何設定 Apigee Message Logging 政策,將 Apigee 記錄資料傳送至 SIEM。使用這個選項時,您可以在 Message Logging 政策中指定要傳送至 SIEM 的 Apigee 流程變數。與 Cloud Platform 記錄選項相比,這個選項可讓您將更豐富的記錄詳細資料傳送至 SIEM。

  1. 啟用將 Apigee 資料擷取至 SIEM 的功能。
  2. 使用下列 XML 主體建立訊息記錄政策。如需相關說明,請參閱「透過使用者介面附加和設定政策」。
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
        <MessageLogging continueOnError="false" enabled="true" name="ML-SIEM-Integration">
          <CloudLogging>
            <LogName>projects/{organization.name}/logs/Apigee-SIEM-Integration-{environment.name}</LogName>
            <Message contentType="application/json" defaultVariableValue="unknown">
            {
              "apigee.metrics.policy.{policy_name}.timeTaken": "{apigee.metrics.policy.{policy_name}.timeTaken}",
              "client.country": "{client.country}",
              "client.host": "{client.host}",
              "client.ip": "{client.ip}",
              "client.locality": "{client.locality}",
              "client.port": "{client.port}",
             "client.state": "{client.state}",
              "organization.name": "{organization.name}",
            "proxy.client.ip": "{proxy.client.ip}",
            "proxy.name": "{proxy.name}",
            "proxy.pathsuffix": "{proxy.pathsuffix}",
            "proxy.url": "{proxy.url}",
            "request.uri": "{request.uri}",
            "request.verb": "{request.verb}",
            "response.content": "{response.content}",
            "response.reason.phrase": "{response.reason.phrase}",
            "response.status.code": "{response.status.code}",
            "system.region.name": "{system.region.name}",
            "system.timestamp": "{system.timestamp}",
            "system.uuid": "{system.uuid}",
            "target.country": "{target.country}",
            "target.host": "{target.host}",
            "target.ip": "{target.ip}",
            "target.locality": "{target.locality}",
            "target.organization": "{target.organization}",
            "target.port": "{target.port}",
            "target.scheme": "{target.scheme}",
            "target.state": "{target.state}",
            "target.url": "{target.url}"
            }
             </Message>
          </CloudLogging>
        </MessageLogging>
  3. 將政策附加至 Proxy 端點後續流程。請參閱「透過使用者介面附加和設定政策」。

API Proxy 處理流量時,記錄政策會從要求和回應中擷取指定欄位,並寫入記錄檔以供分析和偵錯。