將 Apigee 與 SIEM 解決方案整合

本頁適用於 ApigeeApigee Hybrid

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

目標對象

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

  • API 管理員:負責確保 API 安全性、管理平台設定、支援營運效率,以及遵守安全性法規遵循規定。
  • 安全分析師專注於主動偵測及調查 API 相關的安全事件,以降低風險並保護機密資料。

設定選項

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

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

將 Apigee 與 SIEM 整合

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

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

記錄 Advanced API 安全性資料

如果您想記錄 Advanced API 安全性「濫用偵測」功能所識別的資料,可以使用「動作」搭配 Apigee 訊息記錄政策。

步驟如下:

  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 訊息記錄政策,將 Apigee 記錄資料傳送至 SIEM。使用這個選項時,您可以在「訊息記錄」政策中指定要傳送至 SIEM 的 Apigee 流程變數。這個選項可讓您將更豐富的記錄詳細資料傳送至 SIEM,而非使用 Cloud Platform 記錄選項。

  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 Endpoint Post Flow。請參閱「透過使用者介面附加和設定政策」。

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