收集 Imperva 資料庫記錄
本文說明如何使用 Bindplane 代理程式,將 Imperva 資料庫記錄擷取至 Google Security Operations。
剖析器會從 Imperva Database syslog 格式的記錄中擷取欄位。它會使用 grok 和/或 kv 剖析記錄訊息,然後將這些值對應至統合式資料模型 (UDM)。並設定事件來源和類型的預設中繼資料值。Imperva Database Security 提供全方位的資料庫活動監控、稽核和保護功能。
事前準備
請確認您已完成下列事前準備事項:
- Google SecOps 執行個體
- Windows 2016 以上版本或 Linux 主機,並安裝
systemd - 如果是在 Proxy 後方執行,請確認防火牆通訊埠已按照 Bindplane 代理程式規定開啟
- Imperva SecureSphere 管理控制台的特殊存取權
取得 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 & Admin」(IAM 與管理) >「Settings」(設定),然後複製「Project number」(專案編號)。設定匯出工具時會用到。
方法 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
- 開啟具有根層級或 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_DB' 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_DB' raw_log_field: body ingestion_labels:
重新啟動 Bindplane 代理程式,套用變更
如要在 Linux 中重新啟動 Bindplane 代理程式,請執行下列指令:
sudo systemctl restart observiq-otel-collector如要在 Windows 中重新啟動 Bindplane 代理程式,可以使用「Services」控制台,或輸入下列指令:
net stop observiq-otel-collector && net start observiq-otel-collector
在 Imperva 資料庫上設定 Syslog 轉送
- 登入 Imperva SecureSphere 管理控制台。
- 依序前往「設定」「動作組合」。
- 按一下「新增」,建立新的動作組合或編輯現有組合。
- 按一下「新增動作」,然後提供下列設定詳細資料:
- 名稱:輸入描述性名稱 (例如
Google SecOps Syslog)。 - 動作類型:選取「GW Syslog」。
- 主機:輸入 Bindplane 代理程式 IP 位址。
- 「通訊埠」:輸入 Bindplane 代理程式通訊埠號碼 (預設為 514)。
- 「Protocol」(通訊協定):依據 Bindplane 代理程式設定,選取「UDP」或「TCP」。
- 「系統記錄記錄層級」:選取「DEBUG」,即可進行全面記錄。
- 系統記錄設施:選取「LOCAL0」或適當的設施。
- 動作介面:如要使用 SYSLOG+JSON 格式,請選取「閘道記錄 - 安全性事件 - 系統記錄 (syslog) - JSON 格式 (擴充)」;如要使用標準 SYSLOG 格式,請選取「閘道記錄 - 安全性事件 - 系統記錄 (syslog)」。
- 名稱:輸入描述性名稱 (例如
- 儲存動作設定。
- 依序前往「政策」>「安全性政策」或「政策」>「資料庫稽核政策」。
- 編輯相關政策,並新增包含 Syslog 動作的動作集,確保事件轉送至 Google SecOps。
UDM 對應表
| 記錄欄位 | UDM 對應 | 邏輯 |
|---|---|---|
| acct | principal.user.userid | 如果 acct 為「admin」,則對應至 target.user.userid,否則對應至 principal.user.userid。請先移除 acct 中的引號和空格,再進行對應。 |
| 動作 | security_result.action_details | 原始記錄中 action 欄位的值 |
| alertSev | security_result.severity | 如果 alertSev 為「Informative」,則對應為「INFORMATIONAL」,否則對應為 alertSev 的大寫版本 |
| 調度應用程式資源 | principal.application | 如果 application 為「pam_unix(sudo:session)」或 description 包含「pam_unix」,則對應為「pam_unix」。如果 message 包含「run-parts」,則對應為「run-parts」。如果 message 包含「audispd」,則對應為「audispd」。如果 message 包含「FSS audit」,則對應為「FSS audit」。否則,請從原始記錄對應為 application 欄位 |
| application-name | target.application | 原始記錄中 application-name 欄位的值 |
| audit-policy | security_result.category_details | 原始記錄中 audit-policy 欄位的值 |
| 繫結變數 | additional.fields.bind_variables_label.value.string_value | 原始記錄中的 bind-variables 欄位值 |
| category | security_result.category_details | 原始記錄中的 category 欄位值 |
| COMMAND | target.process.command_line | 如果 exe 不是空白,則對應為原始記錄中的 exe 欄位。否則,請從原始記錄對應為 COMMAND 欄位 |
| createTime | 未對應 | |
| db-schema-pair | additional.fields.DB Name_{index}.value.string_value、additional.fields.Schema Name_{index}.value.string_value |
針對原始記錄中的每個 db-schema-pair 物件,擷取 db-name 和 schema-name 欄位,並分別對應至 UDM 中的 DB Name_{index} 和 Schema Name_{index},其中 index 是陣列中物件的索引。 |
| db-user | principal.user.userid | 如果 db-user 不是空白,則對應為原始記錄中的 db-user 欄位。如果 os-user 不是空白,且 db-user 是空白,則對應為原始記錄中的 os-user 欄位 |
| dbName | target.resource.name | 原始記錄中的 dbName 欄位值 |
| dest-ip | target.ip、target.asset.ip | 原始記錄中 dest-ip 欄位的值 |
| dest-port | target.port | 原始記錄中 dest-port 欄位的值 |
| 說明 | metadata.description | 如果 description 包含「user:」,請從 description 擷取使用者 ID,並對應至 userid。如果 userid 不是空白,且 description 包含「Invalid」或「invalid」,請將「Invalid user」替換為「Invalid」。如果 application 為「sshd」,請從 description 中移除「from」和「by」。否則,對應為原始記錄中的 description 欄位 |
| dst | target.ip、target.asset.ip | 原始記錄中的 dst 欄位值 |
| dstIP | target.ip、target.asset.ip | 原始記錄中的 dstIP 欄位值 |
| dstPort | target.port | 原始記錄中的 dstPort 欄位值 |
| event-type | metadata.product_event_type | 原始記錄中 event-type 欄位的值 |
| eventType | metadata.product_event_type、metadata.event_type | 如果 eventType、srcIP 和 dstIP 不是空白,則將 eventType 對應至 metadata.product_event_type,並將「NETWORK_CONNECTION」對應至 metadata.event_type |
| evntDesc | security_result.description | 原始記錄中的 evntDesc 欄位值 |
| exe | target.process.command_line | 原始記錄中 exe 欄位的值 |
| 來自 | network.email.from | 從 from 中移除「<」和「>」,並對應至 network.email.from |
| 群組 | target.user.group_identifiers | 原始記錄中的 group 欄位值 |
| gw-ip | intermediary.ip、intermediary.asset.ip | 原始記錄中的 gw-ip 欄位值 |
| 主機 | target.hostname、target.asset.hostname | 原始記錄中 host 欄位的值 |
| host-name | principal.hostname、principal.asset.hostname | 原始記錄中的 host-name 欄位值 |
| 主機名稱 | principal.hostname、principal.asset.hostname | 原始記錄中 hostname 欄位的值 |
| ip | target.ip、target.asset.ip | 原始記錄中 ip 欄位的值 |
| mx-ip | intermediary.ip、intermediary.asset.ip | 原始記錄中 mx-ip 欄位的值 |
| objects-list | additional.fields.Object_{index}.value.string_value |
針對原始記錄中的每個 objects-list 物件,擷取該物件並對應至 UDM 中的 Object_{index},其中 index 是陣列中物件的索引。 |
| 作業 | about.labels.Operation.value | 原始記錄中 Operation 欄位的值 |
Operation type |
about.labels.Operation Type.value |
原始記錄中 Operation type 欄位的值 |
| os-user | principal.user.userid, additional.fields.OS User.value.string_value |
如果 os-user 不是空白,且 db-user 為空白,則對應為原始記錄中的 os-user 欄位。否則,對應為原始記錄中的 OS User 欄位 |
| 經剖析的查詢 | target.process.command_line | 原始記錄中的 Parsed Query 欄位值 |
| parsed-query | additional.fields.Parsed Query.value.string_value |
原始記錄中 parsed-query 欄位的值 |
| pid | target.process.pid | 原始記錄中的 pid 欄位值 |
| policy-id | security_result.detection_fields.Policy_ID_{index}.value |
針對原始記錄中的每個 policy-id 物件,擷取政策並對應至 UDM 中的 Policy_ID_{index},其中 index 是陣列中物件的索引。 |
| policyName | security_result.detection_fields.policyName_label.value | 原始記錄中的 policyName 欄位值 |
| 通訊埠 | target.port | 原始記錄中的 port 欄位值 |
| 特殊權限 | about.labels.Privileged.value | 如果 Privileged 為 true,則對應為「True」,否則對應為「False」 |
| proto | network.ip_protocol | 原始記錄中的 proto 欄位值 |
| 通訊協定 | network.ip_protocol | 如果 protocol 是「TCP」或「UDP」,請從原始記錄對應為 protocol 欄位 |
| PWD | target.file.full_path | 原始記錄中 PWD 欄位的值 |
Raw Data |
target.resource.attribute.labels.raw_Data.value | 原始記錄中 Raw Data 欄位的值 |
| raw-query | additional.fields.Raw Query.value.string_value |
原始記錄中的 raw-query 欄位值 |
| ruleName | security_result.rule_name | 原始記錄中 ruleName 欄位的值 |
| server-group | additional.fields.serve_group_label.value.string_value | 原始記錄中的 server-group 欄位值 |
| service-name | additional.fields.service_name_label.value.string_value | 原始記錄中的 service-name 欄位值 |
Service Type |
additional.fields.Service Type.value.string_value |
原始記錄中的 Service Type 欄位值 |
| 大小 | network.received_bytes | 原始記錄中 size 欄位的值 |
Stored Proc |
about.labels.Stored_Proc.value | 如果 Stored Proc 為 true,則對應為「True」,否則對應為「False」 |
Table Group |
target.group.group_display_name | 原始記錄中 Table Group 欄位的值 |
| 時間戳記 | metadata.event_timestamp | 原始記錄中 timestamp 欄位的值 |
| 至 | network.email.to | 從 to 移除「<」和「>」,然後對應至 network.email.to |
| 使用者 | principal.user.userid, target.user.userid | 如果 USER 不為空白且 USER 為「admin」,請將原始記錄中的 USER 欄位對應至 target.user.userid。否則,如果 USER 不是空白,則將原始記錄中的 USER 欄位對應至 principal.user.userid |
| user-authenticated | security_result.detection_fields.user_authenticated.value | 原始記錄中 user-authenticated 欄位的值 |
| user-group | additional.fields.user_group_label.value.string_value | 原始記錄中的 user-group 欄位值 |
| 使用者名稱 | principal.user.user_display_name | 原始記錄中 username 欄位的值 |
| usrName | principal.user.userid | 原始記錄中的 usrName 欄位值 |
| extensions.auth.mechanism | 如果 description 包含「authentication failure」、「check pass; user unknown」、「Invalid user」或「invalid user」,或 error 不為空白,則會硬式編碼為「USERNAME_PASSWORD」 |
|
| extensions.auth.type | 如果 has_principal 為「true」,且 has_target 為「true」,且 event-type 為「Login」,則會硬式編碼為「AUTHTYPE_UNSPECIFIED」 |
|
| metadata.event_type | 如果 PWD 不是空白,則硬式編碼為「PROCESS_OPEN」。如果 message 包含「starting」或 application 為「pman」、「CROND」或「run-parts」,且 event_type 為空白,則硬式編碼為「PROCESS_OPEN」。如果 description 為「Syslog connection established」、「Syslog connection broken」或「Syslog connection failed」,則硬式編碼為「NETWORK_CONNECTION」。如果 application 為「postfix/qmgr」、「postfix/local」或「postfix/pickup」,則會硬式編碼為「EMAIL_UNCATEGORIZED」。如果 application 為「postfix/local」或「postfix/pickup」,且 status 為「sent (delivered to mailbox)」,則會硬式編碼為「EMAIL_TRANSACTION」。如果 application 為「sshd」,且 description 不含「check pass; user unknown」、不含「authentication failure」,也不含「invalid」,則會硬式編碼為「NETWORK_HTTP」。descriptiondescription如果 description 包含「authentication failure」、「check pass; user unknown」、「Invalid user」或「invalid user」,或 error 不為空白,則硬式編碼為「USER_LOGIN」。如果 file_path 不是空白,則硬式編碼為「FILE_SYNC」。如果 message 包含「reconfigure」,且 application 為「pman」,則硬式編碼為「PROCESS_UNCATEGORIZED」。如果 message 包含「exit code 1」,且 application 為「pman」,則硬式編碼為「PROCESS_TERMINATION」。如果 eventType 不為空白,且 srcIP 和 dstIP 也不為空白,則會硬式編碼為「NETWORK_CONNECTION」。如果 has_principal 為「true」、has_target 為「true」,且 event-type 為「Login」,則會硬式編碼為「USER_LOGIN」。如果 has_principal 為「true」、has_target 為「true」,且 protocol 不為空白,則硬式編碼為「NETWORK_CONNECTION」。如果 has_principal 為「true」,則硬式編碼為「STATUS_UPDATE」。如果 event_type 為空白或「GENERIC_EVENT」,則會硬式編碼為「GENERIC_EVENT」 |
|
| metadata.log_type | 硬式編碼為「IMPERVA_DB」 | |
| metadata.product_name | 硬式編碼為「IMPERVA DB」 | |
| metadata.vendor_name | 硬式編碼為「IMPERVA DB」 | |
| security_result.action | 如果 description 不含「authentication failure」、「check pass; user unknown」、「Invalid user」或「invalid user」,且 error 為空白,則會硬式編碼為「ALLOW」。如果 description 包含「authentication failure」、「check pass; user unknown」、「Invalid user」或「invalid user」,或 error 不為空白,則硬式編碼為「BLOCK」 |
|
| security_result.rule_id | 如果 description 包含「alert_score」或「new_alert_score」,則從 description 擷取 ruleid 並對應至 security_result.rule_id |
|
version |
metadata.product_version |
從變更記錄對應 |
source-ip |
principal.ip |
從變更記錄對應 |
source-port |
principal.port |
從變更記錄對應 |
server-group", "service-name", "user-group", "raw-query", "parsed-query", "bind-variables", "sql-error", "db-schema-pair.db-name", "db-schema-pair.schema-name", and "objects-list |
additional.fields |
從變更記錄對應 |
source-application |
principal.application |
從變更記錄對應 |
event-id |
metadata.product_log_id |
從變更記錄對應 |
application-user |
principal.user.user_display_name |
從變更記錄對應 |
mx-ip", "gw-ip |
intermediary.ip |
從變更記錄對應 |
policy-id" and "user-authenticated |
security_result.detection_fields |
從變更記錄對應 |
srcPort |
principal.port |
從變更記錄對應 |
srcIP |
principal.ip |
從變更記錄對應 |
event_name |
metadata.product_event_type |
從變更記錄對應 |
變更記錄
還有其他問題嗎?向社群成員和 Google SecOps 專業人員尋求解答。