建立及管理自訂攔截安全性設定檔

本頁說明如何建立及管理自訂攔截安全設定檔。

事前準備

角色

如要建立、查看、更新或刪除自訂攔截安全設定檔,請要求管理員在貴機構中授予您必要的 IAM 角色。如要進一步瞭解如何授予角色,請參閱「管理專案、資料夾和機構的存取權」。

如要查看本頁列出的作業進度,請確認您的使用者角色具備下列 Compute 網路使用者角色 (roles/compute.networkUser) 權限:

  • networksecurity.operations.get
  • networksecurity.operations.list

建立自訂攔截安全性設定檔

如要進行頻內整合,您只能建立 custom-intercept 類型的安全性設定檔。

控制台

  1. 前往 Google Cloud 控制台的「Security profiles」(安全性設定檔) 頁面。

    前往「安全性設定檔」

  2. 在專案選擇工具中選取機構。

  3. 在「安全性設定檔」分頁中,按一下「建立設定檔」

  4. 在「Name」(名稱) 中輸入名稱。

  5. 在「安全性設定檔用途」部分,選取「頻帶內 NSI」

  6. 在「Project」(專案),選取代管攔截端點群組的專案。

  7. 在「Intercept endpoint group」(攔截端點群組) 部分,選取攔截端點群組。

  8. 點選「建立」

gcloud

如要為頻內整合建立自訂攔截安全設定檔,請使用 gcloud network-security security-profiles custom-intercept create 指令

gcloud network-security security-profiles custom-intercept create CUSTOM_INTERCEPT_PROFILE_ID \
    --organization ORGANIZATION_ID \
    --location global \
    --billing-project BILLING_PROJECT_ID \
    --intercept-endpoint-group \
        projects/ENDPOINT_GROUP_PROJECT_ID/locations/global/interceptEndpointGroups/ENDPOINT_GROUP_ID

更改下列內容:

  • CUSTOM_INTERCEPT_PROFILE_ID:自訂攔截安全設定檔的 ID。
  • ORGANIZATION_ID:要建立自訂攔截安全設定檔的機構。
  • BILLING_PROJECT_ID:用於配額的專案 ID。
  • ENDPOINT_GROUP_PROJECT_ID:您建立攔截端點群組的專案 ID。
  • ENDPOINT_GROUP_ID:端點群組的 ID。

Terraform

如要建立安全性設定檔,可以使用 google_network_security_security_profile 資源

resource "google_network_security_security_profile" "default" {
  name     = "security-profile"
  type     = "CUSTOM_INTERCEPT"
  parent   = "organizations/${data.google_organization.default.org_id}"
  location = "global"

  custom_intercept_profile {
    intercept_endpoint_group = google_network_security_intercept_endpoint_group.default.id
  }
}

如要瞭解如何套用或移除 Terraform 設定,請參閱「基本 Terraform 指令」。

查看自訂攔截安全性設定檔的詳細資料

您可以查看自訂攔截安全設定檔的詳細資料,例如名稱和端點群組 ID。

控制台

  1. 前往 Google Cloud 控制台的「Security profiles」(安全性設定檔) 頁面。

    前往「安全性設定檔」

  2. 在專案選擇工具中選取機構。

  3. 在「安全性設定檔」分頁中,按一下安全性設定檔名稱。

gcloud

如要查看自訂攔截安全設定檔的詳細資料,請使用 gcloud network-security security-profiles custom-intercept describe 指令

gcloud network-security security-profiles custom-intercept describe CUSTOM_INTERCEPT_PROFILE_ID \
    --billing-project BILLING_PROJECT_ID \
    --location global

更改下列內容:

  • CUSTOM_INTERCEPT_PROFILE_ID:自訂攔截安全設定檔的 ID。

  • BILLING_PROJECT_ID:用於配額的專案 ID。

輸出內容會以 organizations/ORGANIZATION_ID/locations/global/securityProfiles/SECURITY_PROFILE_ID 格式顯示自訂攔截安全性設定檔的名稱。

列出自訂攔截安全性設定檔

您可以列出機構中的所有自訂攔截安全設定檔,包括其 ID。

控制台

  1. 前往 Google Cloud 控制台的「Security profiles」(安全性設定檔) 頁面。

    前往「安全性設定檔」

  2. 在專案選擇工具中選取機構。

  3. 在「安全性設定檔」分頁中,查看專案的所有安全性設定檔。

gcloud

如要列出所有自訂攔截安全設定檔,請使用 gcloud network-security security-profiles custom-intercept list 指令:

gcloud network-security security-profiles custom-intercept list \
    --organization ORGANIZATION_ID \
    --location global \
    --billing-project BILLING_PROJECT_ID

更改下列內容:

  • ORGANIZATION_ID:建立自訂攔截安全設定檔的機構 ID。

  • BILLING_PROJECT_ID:用於配額的專案 ID。

刪除自訂攔截安全性設定檔

您可以指定自訂攔截安全設定檔的名稱和機構,藉此刪除設定檔。刪除安全性設定檔前,請確認安全性設定檔群組未使用該設定檔。

控制台

  1. 前往 Google Cloud 控制台的「Security profiles」(安全性設定檔) 頁面。

    前往「安全性設定檔」

  2. 在專案選擇工具中選取機構。

  3. 在「Security profiles」(安全性設定檔) 分頁中,勾選安全性設定檔的核取方塊,然後按一下「Delete」(刪除)

  4. 再按一下 [刪除] 加以確認。

gcloud

如要刪除自訂攔截安全設定檔,請使用 gcloud network-security security-profiles custom-profile delete 指令:

gcloud network-security security-profiles custom-profile delete CUSTOM_INTERCEPT_PROFILE_ID \
    --organization ORGANIZATION_ID \
    --location global \
    [--billing-project BILLING_PROJECT_ID]

更改下列內容:

  • CUSTOM_INTERCEPT_PROFILE_ID:要刪除的攔截安全設定檔 ID。
  • ORGANIZATION_ID:建立攔截安全設定檔的機構。
  • BILLING_PROJECT_ID:用於配額的專案 ID。

後續步驟