收集 Imperva CEF 記錄
本文說明如何使用 Bindplane 代理程式,將 Imperva CEF 記錄檔擷取至 Google Security Operations。
剖析器會從 CEF (通用事件格式) 的 Imperva syslog 格式記錄中擷取欄位。這個剖析器會使用 grok 和/或 kv 剖析 CEF 訊息,然後將這些值對應至統合資料模型 (UDM)。並設定事件來源和類型的預設中繼資料值。
事前準備
請確認您已完成下列事前準備事項:
- Google SecOps 執行個體
- Windows 2016 以上版本或 Linux 主機,並安裝
systemd - 如果透過 Proxy 執行,請確保防火牆通訊埠已根據 Bindplane 代理程式需求開啟
- Imperva 管理控制台或設備的特殊權限存取權
取得 Bindplane 代理程式的 Google SecOps 憑證
如要向 Google SecOps 驗證 Bindplane 代理程式,請選擇下列其中一種方法:
- 新部署作業:使用 Chronicle API (選項 1)。
- 舊版部署作業:在 2027 年 7 月 20 日停用 Ingestion API 前,請繼續使用擷取驗證檔案 (選項 2)。
方法 1:為 Chronicle API 建立服務帳戶 (建議)
- 登入 Google Cloud 控制台,選取連結至 Google SecOps 執行個體的 Google Cloud 專案。
- 依序前往 「IAM & Admin」(IAM 與管理) >「Service Accounts」(服務帳戶)。
- 按一下「建立服務帳戶」。
- 請提供下列設定詳細資料:
- 「Service account name」(服務帳戶名稱):輸入帳戶名稱 (例如
bindplane-ingest)。 - 「服務帳戶說明」:輸入說明 (例如
Bindplane agent log ingestion)。
- 「Service account name」(服務帳戶名稱):輸入帳戶名稱 (例如
- 點按「Create and continue」(建立並繼續)。
- 在「將專案存取權授予這個服務帳戶」部分,按一下「選取角色」,然後選取「Chronicle 編輯者」。
- 依序點選「繼續」和「完成」。
- 按一下您建立的服務帳戶,然後前往「金鑰」分頁標籤。
- 依序點選「新增金鑰」>「建立新的金鑰」。
- 選取「JSON」,然後按一下「建立」。金鑰檔案會下載到電腦。
- 將金鑰檔案儲存為 Bindplane 收集器目錄中的
ingestion-auth.json(Linux 上的/opt/observiq-otel-collector/ingestion-auth.json或 Windows 上的C:\Program Files\observIQ OpenTelemetry Collector\ingestion-auth.json),或更新config.yaml中的creds_file_path,使其與儲存路徑相符。 - 依序前往「IAM 與管理」>「設定」,然後複製「專案編號」。設定匯出工具時會用到。
方法 2:下載擷取驗證檔案 (舊版)
- 登入 Google SecOps 控制台。
- 依序前往「SIEM 設定」>「收集代理程式」。
- 下載擷取驗證檔案。
- 將檔案安全地儲存在要安裝 Bindplane 代理程式的系統上。
取得 Google SecOps 客戶 ID
- 登入 Google SecOps 控制台。
- 依序前往「SIEM Settings」(SIEM 設定) >「Profile」(設定檔)。
- 複製並儲存「機構詳細資料」專區中的「客戶 ID」。
安裝 Bindplane 代理程式
請按照下列操作說明,在 Windows 或 Linux 作業系統上安裝 Bindplane 代理程式。
Windows 安裝
- 以管理員身分開啟命令提示字元或 PowerShell。
執行下列指令:
msiexec /i "https://github.com/observIQ/bindplane-agent/releases/latest/download/observiq-otel-collector.msi" /quiet
Linux 安裝
- 開啟具有 root 或 sudo 權限的終端機。
執行下列指令:
sudo sh -c "$(curl -fsSlL https://github.com/observiq/bindplane-agent/releases/latest/download/install_unix.sh)" install_unix.sh
其他安裝資源
如需其他安裝選項,請參閱 Bindplane 代理程式安裝指南。
設定 Bindplane 代理程式,擷取系統記錄並傳送至 Google SecOps
存取設定檔:
- 找出
config.yaml檔案。通常位於 Linux 的/opt/observiq-otel-collector/目錄,或 Windows 的安裝目錄。 - 使用文字編輯器 (例如
nano、vi或記事本) 開啟檔案。
- 找出
按照下列方式編輯
config.yaml檔案:receivers: udplog: # Replace the port and IP address as required listen_address: "0.0.0.0:514" exporters: chronicle/chronicle_w_labels: protocol: https # Region of your instance, for example us, europe, asia-southeast1 location: <LOCATION> # Project number of the Google Cloud project linked to the instance project: '<PROJECT_NUMBER>' compression: gzip # Adjust the path to the credentials file you downloaded in Step 1 creds_file_path: '/path/to/ingestion-authentication-file.json' # Replace with your actual customer ID from Step 2 customer_id: <CUSTOMER_ID> endpoint: chronicle.googleapis.com # Add optional ingestion labels for better organization log_type: 'IMPERVA_CEF' raw_log_field: body ingestion_labels: service: pipelines: logs/source0__chronicle_w_labels-0: receivers: - udplog exporters: - chronicle/chronicle_w_labels- 視基礎架構需求更換連接埠和 IP 位址。
- 將
<LOCATION>替換為 Google SecOps 執行個體的區域 (例如us、europe或asia-southeast1)。匯出工具會在這個值前面加上chronicle.googleapis.com。 - 將
<PROJECT_NUMBER>替換為「IAM 與管理」>「設定」中的專案編號。 - 將
<CUSTOMER_ID>替換為實際的客戶 ID。 - 將
/path/to/ingestion-authentication-file.json更新為步驟 1 中儲存服務帳戶金鑰檔案 (選項 1) 的檔案路徑。
舊版 Ingestion API 匯出工具
如果您使用選項 2 的擷取驗證檔案,請將
exporters區塊替換為下列內容。將creds_file_path設為擷取驗證檔案的路徑,如果您的執行個體位於美國境外,請將malachiteingestion-pa.googleapis.com替換為區域端點 (例如europe-malachiteingestion-pa.googleapis.com)。exporters: chronicle/chronicle_w_labels: compression: gzip # Adjust the path to the credentials file you downloaded in Step 1 creds_file_path: '/path/to/ingestion-authentication-file.json' # Replace with your actual customer ID from Step 2 customer_id: <CUSTOMER_ID> endpoint: malachiteingestion-pa.googleapis.com # Add optional ingestion labels for better organization log_type: 'IMPERVA_CEF' raw_log_field: body ingestion_labels:
重新啟動 Bindplane 代理程式,套用變更
如要在 Linux 中重新啟動 Bindplane 代理程式,請執行下列指令:
sudo systemctl restart observiq-otel-collector如要在 Windows 中重新啟動 Bindplane 代理程式,可以使用「服務」控制台,也可以輸入下列指令:
net stop observiq-otel-collector && net start observiq-otel-collector
設定 Imperva WAF Gateway (SecureSphere),透過系統記錄傳送 CEF
在 MX 控制台中建立動作組合:
- 依序前往「政策」> 動作集。
- 按一下「新增」並命名 (例如
Google SecOps CEF)。
新增 CEF syslog 動作介面:
- 在「Available Action Interfaces」中,開啟「系統記錄」,並視需要新增下列一或多個項目:
- 使用 CEF 標準將安全性事件記錄到系統記錄 (syslog)
- 使用 CEF 標準將網路安全性事件記錄到系統記錄 (syslog)
- 使用 CEF 標準將系統事件記錄到系統記錄 (syslog)
- 使用 CEF 標準將自訂安全性事件記錄到系統記錄 (syslog)
- 在「Available Action Interfaces」中,開啟「系統記錄」,並視需要新增下列一或多個項目:
設定動作介面參數:
- Syslog 主機:輸入 Bindplane 代理程式 IP 位址。如要使用非預設通訊埠,請附加
:PORT(如未指定,預設為 514)。範例:10.0.0.10:514。 - Facility / Log Level:依據政策規定設定。
- 訊息:除非您有自訂對應,否則請保留 CEF 的供應商預設值。
- Syslog 主機:輸入 Bindplane 代理程式 IP 位址。如要使用非預設通訊埠,請附加
將動作集附加至政策:
- 如果是「安全性 / 網路安全」事件:開啟相關政策,並將「後續動作」設為動作集。
- 系統事件:建立或驗證系統事件政策,並將「後續動作」設為動作集,這樣系統也會透過 CEF 傳送這些事件。
(選用) 設定閘道專屬目標:
- 如果不同的閘道群組必須傳送至不同的系統記錄伺服器,請設定每個「閘道群組」>「外部記錄器」,並在政策中啟用「如果存在閘道設定,則使用該設定」。
UDM 對應表
| 記錄欄位 | UDM 對應 | 邏輯 |
|---|---|---|
act |
security_result.action |
衍生。如果 act 為「allowed」、「alert」、開頭為「REQ_PASSED」或「REQ_CACHED」,則 action 為「ALLOW」。如果 act 為「deny」、「blocked」、開頭為「REQ_BLOCKED」或「REQ_CHALLENGE」,則 action 為「BLOCK」。如果 act 符合規則運算式 (?i)REQ_BAD,則 action 為「FAIL」。否則 action 為「UNKNOWN_ACTION」。security_result.action 則會設為 action 的值。 |
act |
security_result.action_details |
衍生。系統會根據 act 的值生成詳細說明。例如:「REQ_CACHED_FRESH:回應是從資料中心的快取傳回」、「REQ_BLOCKED:要求遭到封鎖」。 |
app |
network.application_protocol |
轉換為大寫後直接對應。 |
cs1 |
security_result.detection_fields.value |
如果 cs1 不是空白或「NA」,則會視情況對應。security_result.detection_fields.key 設為 cs1Label 的值。 |
cs1Label |
security_result.detection_fields.key |
如果 cs1 不是空白或「NA」,則會條件式對應。security_result.detection_fields.value 設為 cs1 的值。 |
cs2 |
security_result.detection_fields.value |
如有值,則有條件地對應。security_result.detection_fields.key 設為 cs2Label 的值。 |
cs2Label |
security_result.detection_fields.key |
如果 cs2 非空白,則會依條件對應。security_result.detection_fields.value 設為 cs2 的值。 |
cs3 |
security_result.detection_fields.value |
如果不是空白或「-」,則會依條件對應。security_result.detection_fields.key 會設為 cs3Label 的值。 |
cs3Label |
security_result.detection_fields.key |
如果 cs3 不是空白或「-」,則會進行條件式對應。security_result.detection_fields.value 會設為 cs3 的值。 |
cs4 |
security_result.detection_fields.value |
如果不是空白,則會依條件對應。security_result.detection_fields.key 設為 cs4Label 的值。 |
cs4Label |
security_result.detection_fields.key |
如果 cs4 不為空白,則有條件地對應。security_result.detection_fields.value 設為 cs4 的值。 |
cs5 |
security_result.detection_fields.value |
如有值,則有條件地對應。security_result.detection_fields.key 設為 cs5Label 的值。 |
cs5Label |
security_result.detection_fields.key |
如果 cs5 不為空白,則有條件地對應。security_result.detection_fields.value 設為 cs5 的值。 |
cs6 |
security_result.detection_fields.value |
如果不是空白,則會依條件對應。security_result.detection_fields.key 設為 cs6Label 的值。 |
cs6Label |
security_result.detection_fields.key |
如果 cs6 非空白,則會依條件對應。security_result.detection_fields.value 設為 cs6 的值。 |
cs7 |
principal.location.region_latitude |
如果 cs7Label 為「緯度」,則有條件地對應。 |
cs8 |
principal.location.region_longitude |
如果 cs8Label 為「longitude」,則會依條件對應。 |
cn1 |
security_result.detection_fields.value |
如果非空白且 cn1Label 非空白,則會依條件對應。security_result.detection_fields.key 設為 cn1Label 的值。 |
cn1Label |
security_result.detection_fields.key |
如果 cn1 和 cn1Label 不是空白,則會依條件對應。security_result.detection_fields.value 設為 cn1 的值。 |
fileType |
security_result.detection_fields.value |
如果不是空白,則會依條件對應。security_result.detection_fields.key 設為「fileType」。 |
filePermission |
security_result.detection_fields.value |
如果不是空白,則會依條件對應。security_result.detection_fields.key 設為「filePermission」。 |
request |
target.url |
直接對應。 |
requestClientApplication |
network.http.user_agent |
如果不是空白,則會依條件對應。覆寫從 CEF 酬載中的 requestContext 或 requestClientApplication 鍵/值組合擷取的 user_agent 欄位對應值。 |
requestMethod |
network.http.method |
直接對應。 |
siteid |
security_result.detection_fields.value |
如有值,則有條件地對應。security_result.detection_fields.key 設為「siteid」。 |
sourceServiceName |
target.hostname |
直接對應。如有,則覆寫 dhost 的值。 |
src |
principal.ip |
直接對應。 |
start |
metadata.event_timestamp.seconds |
使用 grok 模式擷取並轉換為時間戳記。如果 不存在,則會做為 deviceReceiptTime 的備用值。如果 deviceReceiptTime 和 start 皆為空白,系統會使用記錄時間戳記。 |
suid |
principal.user.userid |
如有內容,則會視情況對應。 |
| 不適用 | metadata.event_type |
硬式編碼為「NETWORK_HTTP」。 |
| 不適用 | metadata.log_type |
直接從頂層 log_type 欄位對應。 |
| 不適用 | metadata.product_event_type |
如果不是空白,則會從 csv.event_id 對應。 |
| 不適用 | metadata.product_name |
硬式編碼為「網頁應用程式防火牆」。 |
| 不適用 | metadata.vendor_name |
硬式編碼為「Imperva」。 |
kv.act |
event.idm.read_only_udm.security_result.action_details |
從變更記錄對應 |
kv.sourceServiceName |
event.idm.read_only_udm.target.resource.name |
從變更記錄對應 |
cicode |
event.idm.read_only_udm.principal.location.city |
從變更記錄對應 |
ccode |
event.idm.read_only_udm.principal.location.country_or_region |
從變更記錄對應 |
Customer |
event.idm.read_only_udm.network.organization_name |
從變更記錄對應 |
tls_cipher |
event.idm.read_only_udm.network.tls.cipher |
從變更記錄對應 |
cpt |
event.idm.read_only_udm.target.port |
從變更記錄對應 |
fileId |
event.idm.read_only_udm.target.resource.product_object_id |
從變更記錄對應 |
dproc |
event.idm.read_only_udm.security_result.category_details |
從變更記錄對應 |
deviceFacility |
event.idm.read_only_udm.security_result.detection_fields |
從變更記錄對應 |
deviceExternalId |
event.idm.read_only_udm.security_result.detection_fields |
從變更記錄對應 |
end |
event.idm.read_only_udm.metadata.collected_timestamp |
從變更記錄對應 |
變更記錄
還有其他問題嗎?向社群成員和 Google SecOps 專業人員尋求解答。