收集 HackerOne 記錄

支援的服務:

本文說明如何設定 HackerOne,使用 Webhook 將記錄推送至 Google Security Operations。

HackerOne 是安全漏洞協調和漏洞獎勵平台,可協助機構與資安研究人員合作,找出並修復安全漏洞。這個平台提供錯誤獎金計畫、安全漏洞揭露計畫、滲透測試,以及整個軟體開發生命週期的持續安全性測試。

事前準備

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

  • Google SecOps 執行個體

  • Professional 或 Enterprise 級別的 HackerOne 計畫 (只有這些級別提供 Webhook)

  • HackerOne 計畫設定的管理員權限

  • 可存取 Google Cloud 控制台 (用於建立 API 金鑰)

在 Google SecOps 中建立 Webhook 動態饋給

建立動態饋給

  1. 依序前往「SIEM 設定」>「動態饋給」。
  2. 按一下「新增動態饋給」。
  3. 在下一個頁面中,按一下「設定單一動態饋給」。
  4. 在「Feed name」(動態饋給名稱) 欄位中,輸入動態饋給名稱 (例如 HackerOne Webhook)。
  5. 「Source type」(來源類型) 請選取「Webhook」。
  6. 選取「HackerOne」做為「記錄類型」。
  7. 點選「下一步」。
  8. 指定下列輸入參數的值:
    • 分割分隔符號:留空。每個 Webhook 要求都包含單一 JSON 事件。
    • 資產命名空間:資產命名空間
    • 擷取標籤:要套用至這個動態饋給事件的標籤
  9. 點選「下一步」。
  10. 在「Finalize」(完成) 畫面中檢查新的新聞動態消息設定,然後按一下「Submit」(提交)。

產生並儲存密鑰

建立動態饋給後,您必須產生用於驗證的密鑰:

  1. 在動態饋給詳細資料頁面,按一下「產生 Secret Key」。
  2. 對話方塊會顯示密鑰。
  3. 複製並妥善儲存密鑰。

重要事項:密鑰只會顯示一次,之後便無法擷取。如果遺失,就必須產生新的密鑰。

取得動態饋給端點網址

  1. 前往動態饋給的「詳細資料」分頁。
  2. 在「Endpoint Information」部分,複製「Feed endpoint URL」。
  3. 網址格式為:

    https://{region}-chronicle.googleapis.com/v1/{parent}/logs:import
    

    其中 {region} 是 Google SecOps 執行個體的區域 (例如 us、europe 或 asia-southeast1),{parent} 是資源路徑,格式為 projects/<PROJECT_ID>/locations/<LOCATION>/instances/<INSTANCE_ID>/logTypes/<LOG_TYPE>。

  4. 請儲存這個網址,以便進行後續步驟。

  5. 按一下「完成」。

建立 Google Cloud API 金鑰

Chronicle 需要 API 金鑰才能進行驗證。在 Google Cloud 控制台中建立受限制的 API 金鑰。

建立 API 金鑰

  1. 前往 Google Cloud 控制台的「憑證」頁面。
  2. 選取專案 (與 Google SecOps 執行個體相關聯的專案)。
  3. 依序點選「建立憑證」 > 「API 金鑰」。
  4. 系統會建立 API 金鑰,並在對話方塊中顯示。
  5. 按一下「編輯 API 金鑰」即可限制金鑰。

限制 API 金鑰

  1. 在「API 金鑰」設定頁面中:
    • 名稱:輸入描述性名稱 (例如 Chronicle HackerOne Webhook API Key)。
  2. 在「API 限制」下方:
    1. 選取「Restrict key」(限制金鑰)。
    2. 在「選取 API」下拉式選單中,搜尋並選取「Google SecOps API」 (或「Chronicle API」)。
  3. 按一下 [儲存]。
  4. 複製頁面頂端「API 金鑰」欄位中的 API 金鑰值。
  5. 妥善保存 API 金鑰。

設定 HackerOne Webhook

建構 Webhook 網址

將 Google SecOps 端點網址、API 金鑰和密鑰組合成單一網址。API 金鑰和密鑰都必須附加為查詢參數。

網址格式:

```none
<ENDPOINT_URL>?key=<API_KEY>&secret=<SECRET_KEY>
```

範例:

```none
https://{region}-chronicle.googleapis.com/v1/{parent}/logs:import?key=AIzaSyD...&secret=abcd1234...
```

替換下列項目: - <ENDPOINT_URL>:取得動態饋給端點網址一節中的動態饋給端點網址。 - <API_KEY>:來自「建立 Google Cloud API 金鑰」一節的 Google Cloud API 金鑰。 - <SECRET_KEY>:產生並儲存密鑰一節中的密鑰。

重要事項:請勿將 Google SecOps 密鑰放在 HackerOne 的「Secret」欄位中。HackerOne 的「Secret」欄位用於 HMAC 酬載簽章驗證 (X-H1-Signature 標頭),這與 Google SecOps Webhook 驗證機制不同。如果將 Google SecOps 密鑰放在 HackerOne 的「Secret」欄位,會導致 403 Forbidden 錯誤,因為 HackerOne 不會將該值做為 Google SecOps 驗證憑證傳遞。請改為在酬載網址中,將 key 和 secret 附加為查詢參數。

在 HackerOne 中建立 Webhook

  1. 登入 HackerOne,然後前往您的計畫。
  2. 前往「參與」,按一下要設定的計畫所屬三點選單,然後點選「設定」。
  3. 依序前往「Automation」 >「Webhooks」。
  4. 按一下「New webhook」(新增 Webhook)。
  5. 請提供下列設定詳細資料:
    • Payload URL:貼上完整的網址,並附上上述 API 金鑰和密鑰。例如:https://{region}-chronicle.googleapis.com/v1/{parent}/logs:import?key=AIzaSyD...&secret=abcd1234...。
    • Secret:將這個欄位留空。
  6. 選取要觸發 Webhook 的事件。選擇下列其中一個選項:
    • Send me everything:所有事件都會觸發 Webhook。
    • 「讓我指定個別事件」:選取要傳送至 Google SecOps 的特定事件。
  7. 按一下 [Add Webhook]。

測試 Webhook

  1. 在 Webhook 設定頁面中,按一下「測試要求」,將範例要求傳送至設定的酬載網址。
  2. 確認回應為 HTTP 200。
  3. 按一下 Webhook 即可查看詳細資料。
  4. 在「最近的傳送作業」部分下方,確認最近的傳送作業顯示成功狀態 (HTTP 200)。
  5. 按一下任一傳送作業,即可查看 POST 酬載要求。

如果收到錯誤訊息: - HTTP 403:請確認 API 金鑰和私密金鑰已正確附加至酬載網址做為查詢參數。確認 HackerOne「密鑰」欄位空白。 - HTTP 401:確認 API 金鑰有效,且僅限用於 Google SecOps API。 - HTTP 404:確認端點網址正確無誤,且包含完整路徑 (/v1/{parent}/logs:import)。

確認 Google SecOps 中的擷取作業

  1. 前往 Google SecOps 中的「SIEM 設定」>「動態饋給」。
  2. 找出 HackerOne 網路鉤子動態消息。
  3. 檢查「狀態」欄 (應為「有效」)。
  4. 查看「Events received」(已接收事件) 計數 (應該會遞增)。
  5. 查看「上次成功時間」時間戳記 (應為最近)。

Webhook 限制和最佳做法

要求限制

| Limit | Value |
|-------|-------|
| **Max request size** | 4 MB |
| **Max QPS (queries per second)** | 15,000 |
| **Request timeout** | 30 seconds |
| **Retry behavior** | Automatic with exponential backoff |

UDM 對應表

記錄欄位 UDM 對應 邏輯
attributes.cleared、attributes.rules_of_engagement_signed、attributes.identity_verified、attributes.background_checked、attributes.citizenship_verified、attributes.residency_verified、type、attributes.title、attributes.main_state、attributes.state、relationships.reporter.data.type、relationships.reporter.data.attributes.reputation、relationships.reporter.data.attributes.signal、relationships.reporter.data.attributes.impact、relationships.reporter.data.attributes.disabled、relationships.reporter.data.attributes.profile_picture.62x62、relationships.reporter.data.attributes.profile_picture.82x82、relationships.reporter.data.attributes.profile_picture.110x110、relationships.reporter.data.attributes.profile_picture.260x260、relationships.reporter.data.attributes.hackerone_triager、relationships.program.data.id、relationships.program.data.type、relationships.program.data.attributes.handle、relationships.severity.data.type、relationships.severity.data.attributes.rating、relationships.severity.data.attributes.author_type、relationships.severity.data.attributes.calculation_method、relationships.weakness.data.id、relationships.weakness.data.type、relationships.weakness.data.attributes.name、relationships.weakness.data.attributes.description、relationships.weakness.data.attributes.external_id、relationships.structured_scope.data.id、relationships.structured_scope.data.type、relationships.structured_scope.data.attributes.asset_type、relationships.structured_scope.data.attributes.eligible_for_bounty、relationships.structured_scope.data.attributes.eligible_for_submission、relationships.structured_scope.data.attributes.instruction、relationships.structured_scope.data.attributes.max_severity、relationships.structured_scope.data.attributes.confidentiality_requirement、relationships.structured_scope.data.attributes.integrity_requirement、relationships.structured_scope.data.attributes.availability_requirement、relationships.inboxes.data.id、relationships.inboxes.data.type、relationships.inboxes.data.attributes.name、relationships.inboxes.data.attributes.type additional.fields 合併為鍵/值標籤
時間戳記 metadata.event_timestamp 使用日期篩選器剖析,格式為 yyyy-MM-dd'T'HH:mm:ss.SSSZ
metadata.event_type 如果 has_principal 為 true,則設為「STATUS_UPDATE」;如果 has_principal_user_user 為 true,則設為「USER_UNCATEGORIZED」;否則設為「GENERIC_EVENT」
id metadata.product_log_id 直接複製值
relationships.structured_scope.data.attributes.asset_identifier principal.asset.asset_id 開頭為「ASSET:」
attributes.email_alias principal.user.email_addresses 已合併
relationships.reporter.data.id principal.user.employee_id 直接複製值
relationships.reporter.data.attributes.name principal.user.first_name 直接複製值
attributes.username, relationships.reporter.data.attributes.username principal.user.user_display_name 如果 relationships.reporter.data.attributes.username 不為空白,則使用該值,否則使用 attributes.username
relationships.severity.data.attributes.user_id principal.user.userid 直接複製值
relationships.severity.data.id security_result.rule_id 直接複製值
relationships.severity.data.attributes.max_severity security_result.severity 已轉換為大寫
attributes.vulnerability_information security_result.summary 直接複製值

變更記錄

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

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