整合 Cloud Armor 與 Google SecOps
本文說明如何整合 Google Cloud Armor 與 Google Security Operations。
用途
Cloud Armor 整合功能支援下列用途:
自動封鎖威脅:在事件發生期間更新安全性政策規則,立即在 Google Cloud 邊緣封鎖惡意 IP 位址或範圍。
安全性政策管理:列出、擷取及更新環境中的安全性政策和規則,確保 WAF 防護措施一致。
動態 DDoS 緩解:以程式輔助方式調整安全政策設定,因應巨流量或以通訊協定為基礎的攻擊。
鑑識稽核:擷取現有安全政策的設定詳細資料,將邊緣防護措施與內部安全快訊相互關聯。
事前準備
在 Google SecOps 中設定 Cloud Armor 整合功能前,請先完成下列必要步驟:
選擇並設定下列其中一種驗證方法:
選項 1:Workload Identity (建議):這個方法會使用服務帳戶模擬功能,取得短期權杖。
選項 2:服務帳戶 JSON 金鑰:這個方法依賴靜態的長期密鑰檔案。
建立及設定 IAM 角色
如要為整合功能提供必要權限,請在 Google Cloud 專案中建立自訂角色:
前往 Google Cloud 控制台的「Roles」(角色)。
按一下「建立自訂角色」。
提供「名稱」、「說明」和不重複的「ID」。
將「角色發布階段」設為「正式發布」。
為角色新增下列權限:
compute.backendBuckets.setSecurityPolicycompute.backendServices.setSecurityPolicycompute.regionBackendServices.setSecurityPolicycompute.regionSecurityPolicies.createcompute.regionSecurityPolicies.getcompute.regionSecurityPolicies.listcompute.regionSecurityPolicies.updatecompute.securityPolicies.createcompute.securityPolicies.getcompute.securityPolicies.listcompute.securityPolicies.update
點選「建立」。
建立服務帳戶
在 Google Cloud 控制台中,依序前往 「IAM & Admin」(IAM 與管理) >「Service Accounts」(服務帳戶)。
按一下「add」(新增)「Create service account」(建立服務帳戶)。
提供名稱和說明,然後按一下「建立並繼續」。
在「Grant this service account access to project」(將專案存取權授予這個服務帳戶) 步驟中,指派您建立的自訂 IAM 角色。
點按「Done」(完成)。記下服務帳戶的電子郵件地址。
設定 Workload Identity 憑證
建議使用 Workload Identity,因為這項功能會透過服務帳戶模擬功能使用短期權杖。
找出專屬執行個體 ID
建立連線時,您必須授予 Google SecOps 執行個體權限,模擬您的服務帳戶。
在 Google SecOps 中,依序前往「Content Hub」>「Response Integrations」。
選取「Cloud Armor」整合服務,並在
Workload Identity Email中輸入服務帳戶電子郵件地址。依序點選「儲存」>「測試」。測試失敗。
按一下「測試」旁邊的 close_small 按鈕,找出開頭為
gke-init-python@...或soar-python@...的身分識別電子郵件。複製這個專屬電子郵件地址。
在 Google Cloud中授權執行個體身分
在 Google Cloud 控制台中,依序前往 「IAM & Admin」(IAM 與管理) >「Service Accounts」(服務帳戶)。
選取目標服務帳戶,然後依序前往「權限」> 授予存取權。
將專屬電子郵件地址貼到「新增主體」欄位,然後指派「服務帳戶憑證建立者」角色 (
roles/iam.serviceAccountTokenCreator)。
設定 JSON 金鑰
靜態的長期密鑰檔案需要手動輪替。只有在無法使用 Workload Identity 驗證時,才使用這個方法。
在 Google Cloud 控制台中,依序前往「IAM 與管理」>「服務帳戶」,然後選取您的服務帳戶。
前往「金鑰」分頁,依序點按「新增金鑰 > 建立新的金鑰」。
選取「JSON」,然後按一下「建立」。金鑰檔案會下載到您的電腦。
整合參數
整合 Cloud Armor 時需要下列參數:
| 參數 | 說明 |
|---|---|
API Root |
必填。 Cloud Armor 服務的 API 根層級。 預設值為 |
Project ID |
選填。 Cloud Armor 的目標專案 ID。 如未提供值,整合服務會從服務帳戶憑證擷取 ID。 |
Workload Identity Email |
選填。 服務帳戶的用戶端電子郵件地址。設定這個參數,以進行 Workload Identity 驗證。 如果已設定,系統會忽略 |
User Service Account |
選填。 服務帳戶金鑰 JSON 檔案的完整內容。為服務帳戶金鑰驗證設定這個參數。 如果已設定,整合服務會忽略 |
Verify SSL |
必填。 如果選取這個選項,整合服務會在連線至 Google Cloud 伺服器時驗證 SSL 憑證。 (預設為啟用)。 |
如需在 Google SecOps 中設定整合功能的操作說明,請參閱「設定整合功能」。
如有需要,您可以在稍後階段進行變更。設定整合執行個體後,您可以在應對手冊中使用該執行個體。如要進一步瞭解如何設定及支援多個執行個體,請參閱「支援多個執行個體」。
動作
如要進一步瞭解動作,請參閱「 從工作台回覆待處理動作」和「執行手動動作」。
為安全性政策新增規則
在 Cloud Armor 服務中,為安全性政策新增規則。
實體
這項操作不會對實體執行。
動作輸入內容
如要設定動作,請使用下列參數:
| 參數 | |
|---|---|
Policy Name |
必要 要新增規則的安全政策名稱。 |
Region |
選用 要新增規則的政策所屬區域。 如未提供任何值,系統會將規則新增至全域層級的安全政策。 |
Rule JSON |
必要 要新增的規則的 JSON 定義。 如要進一步瞭解如何將規則新增至政策,請參閱「方法:securityPolicies.addRule」。 |
動作輸出內容
| 動作輸出類型 | |
|---|---|
| 案件總覽附件 | 不適用 |
| 案件總覽連結 | 不適用 |
| 案件牆表格 | 不適用 |
| 充實資料表 | 不適用 |
| JSON 結果 | 可用 |
| 指令碼結果 | 可用 |
指令碼結果
| 指令碼結果名稱 | 值 |
|---|---|
| is_success | True 或 False |
JSON 結果
{
"kind": "compute#securityPolicy",
"id": "ID",
"creationTimestamp": "2024-04-14T05:39:05.798-07:00",
"name": "example",
"description": "Test for integration",
"rules": [
{
"kind": "compute#securityPolicyRule",
"description": "test",
"priority": 100,
"match": {
"versionedExpr": "SRC_IPS_V1",
"config": {
"srcIpRanges": [
"*"
]
}
},
"action": "allow",
"preview": false
},
{
"kind": "compute#securityPolicyRule",
"description": "Default rule, higher priority overrides it",
"priority": 2147483647,
"match": {
"versionedExpr": "SRC_IPS_V1",
"config": {
"srcIpRanges": [
"*"
]
}
},
"action": "allow",
"preview": false
}
],
"fingerprint": "A3hq2ZQYxj8=",
"selfLink": "https://www.googleapis.com/compute/v1/projects/PROJECT_NAME/regions/northamerica-northeast1/securityPolicies/example",
"type": "CLOUD_ARMOR",
"labelFingerprint": "42WmSpB8rSM=",
"region": "https://www.googleapis.com/compute/v1/projects/PROJECT_NAME/regions/northamerica-northeast1"
}
案件總覽
這項動作會提供下列輸出訊息:
| 輸出訊息 | 訊息說明 |
|---|---|
Successfully added a new rule to the security policy! |
動作成功。 |
Error executing action "Add a Rule to a Security Policy".
Reason: ERROR_REASON |
動作失敗。 檢查與伺服器的連線、輸入參數、憑證、區域名稱、JSON 檔案內容或政策名稱。 |
建立安全性政策
在 Cloud Armor 服務中建立安全性政策。
實體
這項操作不會對實體執行。
動作輸入內容
如要設定動作,請使用下列參數:
| 參數 | |
|---|---|
Region |
選用 要建立政策的區域。 如未提供任何值,系統會建立全域層級的安全性政策。 |
Policy JSON |
必要 要建立的政策 JSON 定義。 如要進一步瞭解政策,請參閱「REST 資源:securityPolicies」。 |
動作輸出內容
| 動作輸出類型 | |
|---|---|
| 案件總覽附件 | 不適用 |
| 案件總覽連結 | 不適用 |
| 案件牆表格 | 不適用 |
| 充實資料表 | 不適用 |
| JSON 結果 | 可用 |
| 指令碼結果 | 可用 |
指令碼結果
| 指令碼結果名稱 | 值 |
|---|---|
| is_success | True 或 False |
JSON 結果
{
"kind": "compute#securityPolicy",
"id": "ID",
"creationTimestamp": "2024-04-14T05:39:05.798-07:00",
"name": "example",
"description": "Test for integration",
"rules": [
{
"kind": "compute#securityPolicyRule",
"description": "test",
"priority": 100,
"match": {
"versionedExpr": "SRC_IPS_V1",
"config": {
"srcIpRanges": [
"*"
]
}
},
"action": "allow",
"preview": false
},
{
"kind": "compute#securityPolicyRule",
"description": "Default rule, higher priority overrides it",
"priority": 2147483647,
"match": {
"versionedExpr": "SRC_IPS_V1",
"config": {
"srcIpRanges": [
"*"
]
}
},
"action": "allow",
"preview": false
}
],
"fingerprint": "A3hq2ZQYxj8=",
"selfLink": "https://www.googleapis.com/compute/v1/projects/PROJECT_NAME/regions/northamerica-northeast1/securityPolicies/example",
"type": "CLOUD_ARMOR",
"labelFingerprint": "42WmSpB8rSM=",
"region": "https://www.googleapis.com/compute/v1/projects/PROJECT_NAME/regions/northamerica-northeast1"
}
案件總覽
這項動作會提供下列輸出訊息:
| 輸出訊息 | 訊息說明 |
|---|---|
Successfully created a new security policy! |
動作成功。 |
Error executing action "Create a Security Policy". Reason:
ERROR_REASON |
動作失敗。 檢查與伺服器的連線、輸入參數、憑證、區域名稱或 JSON 檔案內容。 |
Ping
使用整合設定頁面提供的參數,測試與 Cloud Armor 服務的連線。
實體
這項操作不會對實體執行。
動作輸入內容
不適用
動作輸出內容
| 動作輸出類型 | |
|---|---|
| 案件總覽附件 | 不適用 |
| 案件總覽連結 | 不適用 |
| 案件牆表格 | 不適用 |
| 充實資料表 | 不適用 |
| JSON 結果 | 不適用 |
| 指令碼結果 | 可用 |
指令碼結果
| 指令碼結果名稱 | 值 |
|---|---|
| is_success | True 或 False |
案件總覽
這項動作會提供下列輸出訊息:
| 輸出訊息 | 訊息說明 |
|---|---|
Successfully connected to the Google Cloud Armor service with
the provided connection parameters! |
動作成功。 |
Failed to connect to the Google Cloud Armor service! Error is
ERROR_REASON |
動作失敗。 檢查伺服器的連線、 輸入參數或憑證。 |
更新安全性政策
在 Cloud Armor 服務中更新現有的安全性政策。
這項操作無法更新政策中的規則。如要為相關政策新增規則,請使用「為安全性政策新增規則」動作。
實體
這項操作不會對實體執行。
動作輸入內容
如要設定動作,請使用下列參數:
| 參數 | |
|---|---|
Policy Name |
必要 要新增規則的安全政策名稱。 |
Region |
選用 新版政策的適用地區。 如未提供任何值,系統會建立全域層級的安全性政策。 |
Rule JSON |
必要 要更新的政策 JSON 定義。 如要進一步瞭解政策更新,請參閱方法:securityPolicies.patch 。 您無法透過這項操作更新規則。 如要為政策新增規則,請使用「Add a Rule to a Security Policy」(為安全性政策新增規則) 動作。 |
動作輸出內容
| 動作輸出類型 | |
|---|---|
| 案件總覽附件 | 不適用 |
| 案件總覽連結 | 不適用 |
| 案件牆表格 | 不適用 |
| 充實資料表 | 不適用 |
| JSON 結果 | 可用 |
| 指令碼結果 | 可用 |
指令碼結果
| 指令碼結果名稱 | 值 |
|---|---|
| is_success | True 或 False |
JSON 結果
{
"kind": "compute#securityPolicy",
"id": "ID",
"creationTimestamp": "2024-04-14T05:39:05.798-07:00",
"name": "example",
"description": "Test for integration",
"rules": [
{
"kind": "compute#securityPolicyRule",
"description": "test",
"priority": 100,
"match": {
"versionedExpr": "SRC_IPS_V1",
"config": {
"srcIpRanges": [
"*"
]
}
},
"action": "allow",
"preview": false
},
{
"kind": "compute#securityPolicyRule",
"description": "Default rule, higher priority overrides it",
"priority": 2147483647,
"match": {
"versionedExpr": "SRC_IPS_V1",
"config": {
"srcIpRanges": [
"*"
]
}
},
"action": "allow",
"preview": false
}
],
"fingerprint": "A3hq2ZQYxj8=",
"selfLink": "https://www.googleapis.com/compute/v1/projects/PROJECT_NAME/regions/northamerica-northeast1/securityPolicies/example",
"type": "CLOUD_ARMOR",
"labelFingerprint": "42WmSpB8rSM=",
"region": "https://www.googleapis.com/compute/v1/projects/PROJECT_NAME/regions/northamerica-northeast1"
}
案件總覽
這項動作會提供下列輸出訊息:
| 輸出訊息 | 訊息說明 |
|---|---|
Successfully added comment to the
identity protection detection with ID
DETECTION_ID in CrowdStrike |
動作成功。 |
Error executing action "Update a Security Policy". Reason:
ERROR_REASON |
動作失敗。 檢查伺服器的連線、 輸入參數或憑證。 |
還有其他問題嗎?向社群成員和 Google SecOps 專業人員尋求解答。