收集 HackerOne 記錄
本文說明如何設定 HackerOne,使用 Webhook 將記錄推送至 Google Security Operations。
HackerOne 是安全漏洞協調和漏洞獎勵平台,可協助機構與資安研究人員合作,找出並修復安全漏洞。該平台提供漏洞獎勵計畫、安全漏洞揭露計畫、滲透測試,以及在整個軟體開發生命週期中持續進行安全性測試。
事前準備
請確認您符合下列必要條件:
Google SecOps 執行個體
Professional 或 Enterprise 級別的 HackerOne 計畫 (只有這些級別提供 Webhook)
HackerOne 計畫設定的管理員權限
Google Cloud 控制台存取權 (用於建立 API 金鑰)
在 Google SecOps 建立 Webhook 動態饋給
建立動態饋給
- 依序前往「設定」>「資料管理」>「動態饋給」。如果使用的是 SIEM 專用平台,請依序前往「設定」>「動態饋給」。
- 按一下「新增動態饋給」。
- 在下一頁,點按「設定單一動態饋給」。
- 在「Feed name」(動態饋給名稱) 欄位中,輸入動態饋給名稱 (例如
HackerOne Webhook)。 - 「Source type」(來源類型) 請選取「Webhook」。
- 選取「HackerOne」做為「記錄類型」。
- 點選「下一步」。
- 指定下列輸入參數的值:
- Split delimiter:留空。每個 Webhook 要求都包含一個 JSON 事件。
- 資產命名空間:資產命名空間
- 擷取標籤:要套用至這個動態饋給事件的標籤
- 點選「下一步」。
- 在「完成」畫面中檢查新的新聞動態消息設定,然後按一下「提交」。
產生並儲存密鑰
建立動態饋給後,請務必產生用於驗證的密鑰:
- 在動態饋給詳細資料頁面,按一下「產生 Secret Key」。
- 對話方塊會顯示密鑰。
- 複製並妥善儲存密鑰。
重要事項:密鑰只會顯示一次,之後便無法擷取。如果遺失,就必須產生新的密鑰。
取得動態饋給端點網址
- 前往動態饋給的「詳細資料」分頁。
- 在「Endpoint Information」部分,複製「Feed endpoint URL」。
網址格式如下:
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>。請儲存這個網址,以便進行後續步驟。
按一下「完成」。
建立 Google Cloud API 金鑰
Chronicle 需要 API 金鑰才能進行驗證。在 Google Cloud 控制台中建立受限制的 API 金鑰。
建立 API 金鑰
- 前往 Google Cloud 控制台憑證頁面。
- 選取專案 (與 Google SecOps 執行個體相關聯的專案)。
- 依序點選「建立憑證」>「API 金鑰」。
- 系統會建立 API 金鑰,並在對話方塊中顯示。
- 按一下「編輯 API 金鑰」,即可限制金鑰。
限制 API 金鑰
- 在「API 金鑰」設定頁面中:
- 名稱:輸入描述性名稱 (例如
Chronicle HackerOne Webhook API Key)。
- 名稱:輸入描述性名稱 (例如
- 在「API 限制」下方:
- 選取「Restrict key」(限制金鑰)。
- 在「選取 API」下拉式選單中,搜尋並選取「Google SecOps API」(或「Chronicle API」)。
- 按一下「儲存」。
- 複製頁面頂端「API 金鑰」欄位中的 API 金鑰值。
妥善保存 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
- 登入 HackerOne,然後前往您的計畫。
- 前往「參與」,按一下要設定的計畫三點選單,然後點選「設定」。
- 依序前往「Automation」>「Webhooks」。
- 按一下「New webhook」(新增 Webhook)。
- 提供下列設定詳細資料:
- Payload URL:貼上完整的網址,並附上上述 API 金鑰和密鑰。例如:
https://{region}-chronicle.googleapis.com/v1/{parent}/logs:import?key=AIzaSyD...&secret=abcd1234...。 - Secret:將這個欄位留空。
- Payload URL:貼上完整的網址,並附上上述 API 金鑰和密鑰。例如:
- 選取要觸發 Webhook 的事件。選擇下列其中一個選項:
- Send me everything:所有事件都會觸發 Webhook。
- 讓我指定個別事件:選取要傳送至 Google SecOps 的特定事件。
按一下 [Add Webhook]。
測試 Webhook
- 在 Webhook 設定頁面中,按一下「測試要求」,將範例要求傳送至設定的酬載網址。
- 確認回應為 HTTP 200。
- 按一下 Webhook 即可查看詳細資料。
- 在「Recent deliveries」(近期傳送) 專區,確認近期傳送作業顯示成功狀態 (HTTP 200)。
- 按一下任一傳送作業,即可查看 POST 酬載要求。
如果收到錯誤:
- HTTP 403:確認 API 金鑰和 Secret 金鑰已正確附加為酬載網址中的查詢參數。確認 HackerOne 的「Secret」欄位為空白。- HTTP 401:確認 API 金鑰有效,且僅限用於 Google SecOps API。
HTTP 404:確認端點網址正確無誤,且包含完整路徑 (/v1/{parent}/logs:import)。
在 Google SecOps 中驗證擷取作業
- 在 Google SecOps 中,依序前往「Settings」(設定) >「Data Management」(資料管理) >「Feeds」(動態饋給)。如果使用的是 SIEM 專用平台,請依序前往「設定」>「動態饋給」。
- 找出 HackerOne Webhook 動態饋給。
- 查看「狀態」欄 (應為「有效」)。
- 查看「Events received」(收到的事件) 計數 (應該會遞增)。
- 查看「上次成功時間」時間戳記 (應為最近)。
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 專業人員尋求解答。