收集 Imperva WAF 記錄

支援語言:

本文說明如何使用第三方 API 或 Amazon S3 設定 Google Security Operations 資訊提供,藉此收集 Imperva WAF 記錄。

Imperva WAF 是一種雲端式網頁應用程式防火牆,可保護網站和應用程式免受網路攻擊,包括 SQL 注入、跨網站指令碼攻擊 (XSS) 和 DDoS 威脅。Imperva WAF 會即時分析傳入的 HTTP/HTTPS 流量,套用安全規則和機器人緩解政策,在惡意要求到達原始伺服器前加以封鎖。

收集方法差異

將 Imperva WAF 與 Google SecOps 整合時,支援下列記錄檔擷取方法:

  • API 集合:Google SecOps 會直接從 Imperva API 提取記錄。這是直接連線,僅支援 IMPERVA_WAF 記錄類型,且只會收集稽核記錄,如「Imperva 稽核追蹤記錄」一文所述。Google SecOps 每 24 小時會查詢一次 Imperva Audit Trail API。
  • Amazon S3 V2 值區集合:Imperva WAF 會將記錄推送至指定的 Amazon S3 值區,然後 Google SecOps 會從這個值區提取記錄。這個方法會收集 Cloud WAF 產生的安全性事件存取記錄,如「整合 Imperva 記錄」一文所述。由於儲存空間可接收來自多個來源的記錄,因此只要明確設定將其他 Imperva 記錄推送至儲存空間,這個方法也支援其他 Imperva 記錄類型。

事前準備

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

  • Google SecOps 執行個體
  • Imperva Cloud Security Console 的特殊權限 (my.imperva.com)
  • Imperva 帳戶管理員,可為其他使用者建立 API 金鑰。沒有管理員權限的使用者只能為自己的帳戶建立 API 金鑰。
  • Amazon S3 方法:AWS 的特殊權限存取權 (S3、IAM)

設定 Imperva WAF API 存取權

API 收集方法會使用 Imperva API IDAPI 金鑰,向 api.imperva.com 進行驗證。在 Imperva Cloud Security Console 中產生這些憑證。

產生 API 憑證

  1. 前往 my.imperva.com 登入 Imperva Cloud Security Console
  2. 在頂端選單列,依序點選「帳戶」>「帳戶管理」
  3. 在側欄中,依序點選「使用者管理」>「使用者」
  4. 找出動態饋給使用的使用者,按一下「動作」欄中的省略號,然後按一下「編輯」
  5. 按一下「API 金鑰」分頁標籤。
  6. 按一下「新增 API 金鑰」。新增名稱和說明,指出金鑰的用途。
  7. 從彈出式視窗複製並儲存下列值:
    • API ID:不重複的 API ID (例如 12345)。
    • API 金鑰:您的 API 金鑰 (例如 abcdef-123456-ghijkl-789012)。
  • 或者,不具管理員權限的使用者可以為自己的帳戶產生金鑰。在頂端選單列中,依序點選「帳戶」>「我的設定檔」,然後在「API 金鑰」下方,點選「新增 API 金鑰」

在 Google SecOps 中設定動態饋給,擷取 Imperva WAF 記錄

  1. 依序前往「SIEM 設定」>「動態饋給」
  2. 按一下「新增動態消息」
  3. 在下一個頁面中,按一下「設定單一動態饋給」
  4. 在「動態饋給名稱」欄位中輸入動態饋給名稱 (例如 Imperva WAF Logs)。
  5. 選取「第三方 API」做為「來源類型」
  6. 選取「Imperva」做為「記錄類型」
  7. 點選「下一步」
  8. 指定下列輸入參數的值:

    • 驗證 HTTP 標頭:輸入驗證憑證,格式如下:

      x-API-Id:your-api-id-value
      x-API-Key:your-api-key-value
      

      每項憑證都必須以 key:value 格式獨立成行。

      請輸入顯示的標頭名稱。Imperva Audit Trail API 只接受 API ID 和 API 金鑰做為 x-API-Idx-API-Key HTTP 標頭。

    • 資產命名空間資產命名空間

    • 擷取標籤:要套用至這個動態饋給事件的標籤。

  9. 點選「下一步」

  10. 在「Finalize」(完成) 畫面中檢查新的動態饋給設定,然後按一下「Submit」(提交)

設定完成後,動態饋給會擷取 Imperva 稽核記錄事件,記錄帳戶使用者、系統程序和 Imperva 管理員在帳戶中執行的動作。如要收集 Cloud WAF 安全性事件和存取記錄,請使用下一節所述的 Amazon S3 方法。

使用 Amazon S3 收集 Imperva WAF 記錄

設定 AWS IAM 和 S3

  1. 按照這份使用者指南建立 Amazon S3 bucket:建立 bucket
  2. 儲存 bucket 的「名稱」和「區域」,稍後會用到。
  3. 請按照這份使用者指南建立使用者建立 IAM 使用者
  4. 選取建立的「使用者」
  5. 選取「安全憑證」分頁標籤。
  6. 在「Access Keys」部分中,按一下「Create Access Key」
  7. 選取「第三方服務」做為「用途」
  8. 點選「下一步」
  9. 選用:新增說明標記。
  10. 按一下「建立存取金鑰」
  11. 按一下「Download .csv file」,然後儲存「Access Key」和「Secret Access Key」,以供日後使用。
  12. 按一下「完成」
  13. 選取 [權限] 分頁標籤。
  14. 在「Permissions policies」(權限政策) 區段中,按一下「Add permissions」(新增權限)
  15. 選取「新增權限」
  16. 選取「直接附加政策」
  17. 搜尋並選取 AmazonS3FullAccess 政策。
  18. 點選「下一步」
  19. 按一下「Add permissions」。

設定 Imperva WAF Amazon S3 連線

  1. 使用具備權限的帳戶,登入 Imperva Cloud Security Console (網址:my.imperva.com)。
  2. 在頂端選單列,依序點選「帳戶」>「帳戶管理」
  3. 在側欄中,依序按一下「SIEM 記錄」>「記錄設定」
  4. 在「連線」表格中,按一下「新增連線」
  5. 選用:選取 SIEM 供應商。Google SecOps 並非 SIEM 供應商,因此請略過這個步驟,改為選取傳送方式。

  6. 選取「Amazon S3」做為傳送方式。

  7. 請提供下列設定詳細資料:

    • 存取金鑰:您建立的 IAM 使用者存取金鑰。
    • 密鑰:您建立的 IAM 使用者存取金鑰。
    • 路徑:bucket 路徑,格式為 <bucket-name>/<folder> (例如 imperva-waf-logs/logs)。
  8. 按一下「測試連線」,執行完整測試週期,將測試檔案傳輸至您指定的資料夾。

  9. 按一下「新增記錄類型」,然後選取「Cloud WAF」服務。

  10. 請提供下列設定詳細資料:

    • 設定名稱:輸入帳戶中不重複的名稱。
    • 選取記錄類型:Imperva 會一併提供 Cloud WAF 安全性記錄和存取記錄。
    • 格式:選取「CEF」。剖析器也會讀取 LEEF,但不會讀取 W3C
    • 壓縮記錄:取消勾選這個選項。Imperva 預設會壓縮記錄檔,但剖析器無法解壓縮。
    • 加密:保持停用加密功能。剖析器無法解密加密的記錄檔。
    • 狀態:設為「已啟用」
  11. 儲存記錄類型設定。

在 Google SecOps 中設定動態饋給,從 Amazon S3 V2 擷取 Imperva WAF 記錄

  1. 依序前往「SIEM 設定」>「動態饋給」
  2. 按一下「新增動態消息」
  3. 在「動態饋給名稱」欄位中輸入動態饋給名稱 (例如 Imperva WAF Logs)。
  4. 選取「Amazon S3 V2」做為「來源類型」
  5. 選取「Imperva」做為「記錄類型」
  6. 點選「下一步」
  7. 指定下列輸入參數的值:

    • S3 URI:值區 URI。

      s3://your-log-bucket-name/
      

      請將 your-log-bucket-name 替換為值區的實際名稱。

    • 來源刪除選項:根據偏好設定選取刪除選項。

    • 檔案存在時間上限:包含在過去天數內修改的檔案。預設值為 180 天。

    • 存取金鑰 ID:具有 S3 值區存取權的使用者存取金鑰。

    • 存取密鑰:具有 S3 bucket 存取權的使用者私密金鑰。

    • 資產命名空間資產命名空間

    • 擷取標籤:要套用至這個動態饋給事件的標籤。

  8. 點選「下一步」

  9. 在「Finalize」(完成) 畫面中檢查新的動態饋給設定,然後按一下「Submit」(提交)

UDM 對應表

記錄欄位 UDM 對應 邏輯
csv_message about 已對應:CEF:about
csv_message about.asset.ip 已對應:CEF:kv.dvc
kv.dvc about.asset.ip 已合併
csv_message about.ip 已對應:CEF:kv.dvc
kv.dvc about.ip 已合併
additional_devicedata additional.fields 已合併
additional_factors_label additional.fields 已合併
additional_severity additional.fields 已合併
cn1_value_label additional.fields 已合併
csv_message additional.fields 已對應:CEF:additional_severityCEF:cn1_value_label
random_id_label additional.fields 已合併
site_id_label additional.fields 已合併
site_name_label additional.fields 已合併
zuid_labels additional.fields 已合併
csv_message extensions.vulns.vulnerabilities 已對應:CEF:vuln
message extensions.vulns.vulnerabilities 已對應:LEEF:vuln
vuln extensions.vulns.vulnerabilities 已合併
message intermediary 已對應:LEEF:intermediary
forwardedIp intermediary.asset.hostname 直接對應
forwardedIp intermediary.asset.ip 已合併
xff intermediary.asset.ip 已合併
forwardedIp intermediary.hostname 直接對應
forwardedIp intermediary.ip 已合併
log.mx-ip intermediary.ip 已合併
xff intermediary.ip 已合併
popName intermediary.location.country_or_region 已重新命名/對應
csv.description metadata.description csv_message =~ CEF: 時對應
log.message metadata.description json_array != `` 時對應
deviceReceiptTime metadata.event_timestamp 已剖析為 MMM dd HH:mm:ss
log.@timestamp metadata.event_timestamp 已剖析為 UNIX_MS
log.time metadata.event_timestamp 已剖析為 UNIX
log_timestamp metadata.event_timestamp 已剖析為 UNIX_MS
start metadata.event_timestamp 已剖析為 UNIX_MS
timestamp metadata.event_timestamp 已剖析為 MMM dd yyyy HH:mm:ss
csv_message metadata.event_type 對應值 (共 6 個,例如 CEF:NETWORK_HTTPCEF:SCAN_UNCATEGORIZEDCEF: ...
has_principal metadata.event_type 已對應:trueNETWORK_CONNECTION
message metadata.event_type 已對應:LEEF:NETWORK_HTTP
principal_present metadata.event_type 對應:trueNETWORK_HTTPtrueNETWORK_CONNECTIONtrueSTATUS_UPDATE
csv.event_id metadata.product_event_type 直接對應
log.type_key metadata.product_event_type json_array != `` 時對應
log.imperva.ids.account_id metadata.product_log_id json_array != `` 時對應
log.header.product-version metadata.product_version json_array != `` 時對應
product_version metadata.product_version csv_message =~ CEF: 時對應
csv_message network.application_protocol 已對應:CEF:HTTPSCEF:HTTP
proto network.application_protocol 已重新命名/對應
deviceExternalId network.community_id 已重新命名/對應
message network.direction 已對應:LEEF:INBOUND
kv.cs8 network.http.method csv_message =~ CEF: 時對應
kv.requestMethod network.http.method 已重新命名/對應
log.http.request.method network.http.method json_array != `` 時對應
requestMethod network.http.method 已重新命名/對應
http_user_agent network.http.parsed_user_agent 已重新命名/對應
log.http.request.user-agent network.http.parsed_user_agent 已重新命名/對應
log.imperva.abp.headers_referer network.http.referral_url json_array != `` 時對應
log.imperva.referrer network.http.referral_url json_array != `` 時對應
ref network.http.referral_url 已重新命名/對應
cn1 network.http.response_code 已重新命名/對應
cn1_value network.http.response_code 已重新命名/對應
kv.flexString1 network.http.response_code 已重新命名/對應
kv.flexString2 network.http.response_code 已重新命名/對應
log.http.response.code network.http.response_code 已重新命名/對應
kv.requestClientApplication network.http.user_agent csv_message =~ CEF: 時對應
log.http.request.user-agent network.http.user_agent json_array != `` 時對應
requestClientApplication network.http.user_agent 已重新命名/對應
user_agent network.http.user_agent 已重新命名/對應
kv.proto network.ip_protocol 已重新命名/對應
log.protocol network.ip_protocol json_array != `` 時對應
message network.ip_protocol 已對應:LEEF:TCP
kv.Customer network.organization_name csv_message =~ CEF: 時對應
csv_message network.received_bytes 已對應:CEF:uinteger
in network.received_bytes 已重新命名/對應
kv.in network.received_bytes csv_message =~ CEF: 時對應
message network.received_bytes 已對應:LEEF:uinteger
log.http.request.body.bytes network.sent_bytes 已重新命名/對應
fileId network.session_id 已重新命名/對應
log.http.session-id network.session_id json_array != `` 時對應
log.imperva.abp.customer_request_id network.session_id json_array != `` 時對應
log.imperva.request_session_id network.session_id json_array != `` 時對應
tls_cipher network.tls.cipher 已重新命名/對應
tls_version network.tls.version 已重新命名/對應
cs6 principal.application 已重新命名/對應
log.client.domain principal.asset.hostname json_array != `` 時對應
csv_message principal.asset.ip 已對應:CEF:kvsrc
kvsrc principal.asset.ip 已合併
log.client.ip principal.asset.ip 已合併
log.source-ip principal.asset.ip 已合併
message principal.asset.ip 已對應:LEEF:src
src principal.asset.ip 已合併
log.client.domain principal.hostname json_array != `` 時對應
csv_message principal.ip 已對應:CEF:kvsrc
kvsrc principal.ip 已合併
log.client.ip principal.ip 已合併
log.source-ip principal.ip 已合併
message principal.ip 已對應:LEEF:src
src principal.ip 已合併
request_type_label principal.labels 已合併
cicode principal.location.city 已重新命名/對應
kv.cicode principal.location.city csv_message =~ CEF: 時對應
calCountryOrRegion principal.location.country_or_region 已重新命名/對應
kv.ccode principal.location.country_or_region csv_message =~ CEF: 時對應
log.client.geo.country_iso_code principal.location.country_or_region json_array != `` 時對應
log.imperva.country principal.location.country_or_region json_array != `` 時對應
cs7 principal.location.region_latitude 已重新命名/對應
csv_message principal.location.region_latitude 已對應:CEF:float
kv.cs7 principal.location.region_latitude 已重新命名/對應
message principal.location.region_latitude 已對應:LEEF:float
cs8 principal.location.region_longitude 已重新命名/對應
csv_message principal.location.region_longitude 已對應:CEF:float
kv.cs8 principal.location.region_longitude 已重新命名/對應
message principal.location.region_longitude 已對應:LEEF:float
log.source-port principal.port 已重新命名/對應
port principal.port csv_message =~ CEF: 時對應
srcPort principal.port 已重新命名/對應
log.imperva.path principal.process.file.full_path json_array != `` 時對應
log.imperva.abp.pid principal.process.pid json_array != `` 時對應
header_map_label principal.resource.attribute.labels 已合併
log.user.email principal.user.email_addresses 已合併
log.user_details principal.user.email_addresses 已合併
log.event.provider principal.user.user_display_name json_array != `` 時對應
log.http.user-name principal.user.userid json_array != `` 時對應
log.user_id principal.user.userid json_array != `` 時對應
user_name principal.user.userid json_array != `` 時對應
csv_message security_result 已對應:CEF:security_result
message security_result 已對應:LEEF:security_result
_action security_result.action 已合併
action security_result.action 已合併
csv_message security_result.action 已對應:CEF:action
message security_result.action 已對應:LEEF:_action
security_action security_result.action 已合併
cat security_result.action_details 直接對應
kv.act security_result.action_details 直接對應
kv.cat security_result.action_details 直接對應
log.action security_result.action_details 直接對應
csv_message security_result.category_details 已對應:CEF:kv.cat
dproc security_result.category_details 已合併
kv.cat security_result.category_details 已合併
message security_result.category_details 已對應:LEEF:dproc
log.description security_result.description 直接對應
log.imperva.abp.tls_fingerprint security_result.description 直接對應
log.imperva.risk_reason security_result.description 直接對應
accept_encoding_label security_result.detection_fields 已合併
accept_language_label security_result.detection_fields 已合併
apollo_rule security_result.detection_fields 已合併
behavior security_result.detection_fields 已合併
class_label security_result.detection_fields 已合併
cn1_field security_result.detection_fields 已合併
cn2_field security_result.detection_fields 已合併
condition_id security_result.detection_fields 已合併
condition_name security_result.detection_fields 已合併
cs10Label_field security_result.detection_fields 已合併
cs11_field security_result.detection_fields 已合併
cs12Label_field security_result.detection_fields 已合併
cs1_field security_result.detection_fields 已合併
cs2_field security_result.detection_fields 已合併
cs3_field security_result.detection_fields 已合併
cs4_field security_result.detection_fields 已合併
cs5Label_field security_result.detection_fields 已合併
cs5_field security_result.detection_fields 已合併
cs6_field security_result.detection_fields 已合併
cs8_label security_result.detection_fields 已合併
cs97Label_field security_result.detection_fields 已合併
cs98_field security_result.detection_fields 已合併
cs99_field security_result.detection_fields 已合併
cs9_field security_result.detection_fields 已合併
cs9_label security_result.detection_fields 已合併
csv_message security_result.detection_fields 對應值 (共 30 個,例如 CEF:flexString1_fieldCEF:cs1_fieldCEF: → `...
detection_fields_domain_risk security_result.detection_fields 已合併
detection_fields_event_action security_result.detection_fields 已合併
detection_fields_event_context security_result.detection_fields 已合併
detection_fields_significant_domain_name security_result.detection_fields 已合併
detection_fields_violated_directive security_result.detection_fields 已合併
deviceExternalId_label security_result.detection_fields 已合併
deviceFacility_field security_result.detection_fields 已合併
dproc_label security_result.detection_fields 已合併
end_label security_result.detection_fields 已合併
filePermission_field security_result.detection_fields 已合併
fileType_field security_result.detection_fields 已合併
flexNumber1_field security_result.detection_fields 已合併
flexString1_field security_result.detection_fields 已合併
flexString2_field security_result.detection_fields 已合併
fname_field security_result.detection_fields 已合併
gateway_name_label security_result.detection_fields 已合併
headers_connection_label security_result.detection_fields 已合併
hsig security_result.detection_fields 已合併
log_imperva_classified_client_field security_result.detection_fields 已合併
log_imperva_credentials_leaked_field security_result.detection_fields 已合併
log_imperva_declared_client_field security_result.detection_fields 已合併
log_imperva_failed_logins_last_24h_field security_result.detection_fields 已合併
log_imperva_fingerprint_field security_result.detection_fields 已合併
log_imperva_successful_logins_last_24h_field security_result.detection_fields 已合併
message security_result.detection_fields 對應值 (共 11 個,例如 LEEF:siteid_labelLEEF:start_labelLEEF: → `...
policy_id security_result.detection_fields 已合併
policy_label security_result.detection_fields 已合併
policy_name security_result.detection_fields 已合併
postbody_field security_result.detection_fields 已合併
postbody_label security_result.detection_fields 已合併
request_user_label security_result.detection_fields 已合併
selector security_result.detection_fields 已合併
selector_derived_id security_result.detection_fields 已合併
siteTag_field security_result.detection_fields 已合併
siteid_label security_result.detection_fields 已合併
start_label security_result.detection_fields 已合併
tag_label security_result.detection_fields 已合併
triggered_condition_id security_result.detection_fields 已合併
triggered_condition_name security_result.detection_fields 已合併
violation security_result.detection_fields 已合併
violation_id_label security_result.detection_fields 已合併
violation_type_label security_result.detection_fields 已合併
cs9 security_result.rule_name 直接對應
kv.cs9 security_result.rule_name 直接對應
fileType security_result.rule_type message =~ LEEF: 時對應
kv.fileType security_result.rule_type 直接對應
csv_message security_result.severity 已對應:CEF:HIGHCEF:MEDIUMCEF:LOWCEF:UNKNOWN_SEVERITY
log.severity security_result.severity 直接對應
severity security_result.severity 對應:HighHIGHMediumMEDIUMLowLOWUnknownUNKNOWN_SEVERITY
sevs security_result.severity 已對應:"error", "warning"HIGHcriticalCRITICAL"medium","notice" → `MED...
log.imperva.risk_level security_result.severity_details 直接對應
severity security_result.threat_id 直接對應
description security_result.threat_name 直接對應
log.application-name target.application json_array != `` 時對應
kv.dhost target.asset.hostname csv_message =~ CEF: 時對應
kv.sourceServiceName target.asset.hostname csv_message =~ CEF: 時對應
log.server.domain target.asset.hostname json_array != `` 時對應
csv_message target.asset.ip 已對應:CEF:kv.dstCEF:kv.sip
dst target.asset.ip 已合併
kv.dst target.asset.ip 已合併
kv.sip target.asset.ip 已合併
log.dest-ip target.asset.ip 已合併
message target.asset.ip 已對應:LEEF:dst
kv.dhost target.hostname csv_message =~ CEF: 時對應
kv.sourceServiceName target.hostname csv_message =~ CEF: 時對應
log.server.domain target.hostname json_array != `` 時對應
sourceServiceName target.hostname 已重新命名/對應
csv_message target.ip 已對應:CEF:kv.dstCEF:kv.sip
dst target.ip 已合併
kv.dst target.ip 已合併
kv.sip target.ip 已合併
log.dest-ip target.ip 已合併
message target.ip 已對應:LEEF:dst
log.server.geo.name target.location.name json_array != `` 時對應
dstPort target.port 已重新命名/對應
kv.cpt target.port 已重新命名/對應
kv.dpt target.port 已重新命名/對應
log.dest-port target.port 已重新命名/對應
kv.deviceProcessName target.process.file.full_path csv_message =~ CEF: 時對應
log.url.path target.process.file.full_path json_array != `` 時對應
header_map_label target.resource.attribute.labels 已合併
server_group_label target.resource.attribute.labels 已合併
server_group_simulation_mode_label target.resource.attribute.labels 已合併
service_label target.resource.attribute.labels 已合併
log.resource_id target.resource.id json_array != `` 時對應
log.context_key target.resource.name json_array != `` 時對應
log.imperva.audit_trail.resource_name target.resource.name json_array != `` 時對應
kv.fileId target.resource.product_object_id csv_message =~ CEF: 時對應
log.imperva.abp.token_id target.resource.product_object_id json_array != `` 時對應
log.resource_type_key target.resource.type json_array != `` 時對應
kv.request target.url 已重新命名/對應
url target.url 已重新命名/對應
Customer target.user.user_display_name 已重新命名/對應
log.imperva.ids.account_name target.user.user_display_name json_array != `` 時對應
kv.duser target.user.userid 已重新命名/對應
kv.suid target.user.userid csv_message =~ CEF: 時對應
log.account_id target.user.userid json_array != `` 時對應
suid target.user.userid 已重新命名/對應
不適用 metadata.event_type 常數:NETWORK_HTTP
不適用 network.direction 常數:INBOUND
不適用 network.ip_protocol 常數:TCP
不適用 security_result.severity 常數:HIGH

變更記錄

查看這個剖析器的變更記錄

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