建立及管理安全性設定檔群組

本頁說明如何使用 Google Cloud CLI,建立及管理具有自訂安全設定檔的安全設定檔群組

事前準備

角色

如要取得建立、查看、更新或刪除安全性設定檔群組所需的權限,請要求管理員授予您組織的必要Identity and Access Management (IAM) 角色。如要進一步瞭解如何授予角色,請參閱「管理專案、資料夾和機構的存取權」。

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

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

建立含有自訂設定檔的安全性設定檔群組

您只能使用 CUSTOM_MIRRORING 類型的安全性設定檔建立安全性設定檔群組。

建立安全性設定檔群組時,您可以將安全性設定檔群組的名稱指定為字串或專屬網址 ID。機構範圍安全性設定檔群組的專屬網址可採用下列格式建構:

  organizations/ORGANIZATION_ID/locations/LOCATION/securityProfileGroups/SECURITY_PROFILE_GROUP_NAME

更改下列內容:

  • ORGANIZATION_ID:組織 ID。

  • LOCATION:安全性設定檔群組的範圍。 位置一律設為「global」。

  • SECURITY_PROFILE_GROUP_NAME:安全性設定檔群組的名稱。

如果您使用專屬網址 ID 做為安全性設定檔群組名稱,網址 ID 中已包含安全性設定檔群組的機構和位置。不過,如果只使用安全性設定檔群組名稱,就必須分別指定機構和位置。如要進一步瞭解專屬網址 ID,請參閱規格

控制台

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

    前往「安全性設定檔群組」

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

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

  4. 在「Name」(名稱),輸入安全性設定檔群組的名稱。

  5. 在「安全性設定檔群組用途」部分,選取「NSI out-of-band」

  6. 在「自訂 mirroring 設定檔」中,選取帶內整合的自訂安全性設定檔。

  7. 點選「建立」

gcloud

如要建立安全性設定檔群組,請使用 gcloud network-security security-profile-groups create 指令

 gcloud network-security security-profile-groups \
     create SECURITY_PROFILE_GROUP_NAME \
     --custom-mirroring-profile CUSTOM_MIRROING_PROFILE_NAME \
     --description DESCRIPTION \
     --organization ORGANIZATION_ID \
     --location=global \
     --billing-project PROJECT_ID

更改下列內容:

  • SECURITY_PROFILE_GROUP_NAME:安全設定檔群組的名稱,可以指定為字串或專屬網址 ID。

  • CUSTOM_MIRRORING_PROFILE_NAME:自訂鏡像安全設定檔的名稱。

  • DESCRIPTION:安全性設定檔群組的選用說明。

  • ORGANIZATION_ID:建立安全性設定檔群組的機構。

  • PROJECT_ID:用於安全設定檔群組的配額和存取限制的專案 ID。

Terraform

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

resource "google_network_security_security_profile_group" "default" {
  name                     = "security-profile-group"
  parent                   = "organizations/${data.google_organization.default.org_id}"
  location                 = "global"
  custom_mirroring_profile = google_network_security_security_profile.default.id
}

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

查看安全性設定檔群組

您可以查看機構中特定安全性設定檔群組的詳細資料。

控制台

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

    前往「安全性設定檔群組」

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

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

gcloud

如要查看安全性設定檔群組的詳細資料,請使用 gcloud network-security security-profile-groups describe 指令

 gcloud network-security security-profile-groups \
     describe SECURITY_PROFILE_GROUP_NAME \
     --organization ORGANIZATION_ID \
     --location=global \
     --billing-project PROJECT_ID

更改下列內容:

  • SECURITY_PROFILE_GROUP_NAME:安全性設定檔群組的名稱,您可以將名稱指定為字串或專屬網址 ID。

  • ORGANIZATION_ID:建立安全性設定檔群組的機構。

  • PROJECT_ID:用於安全設定檔群組的配額和存取限制的專案 ID。

列出安全性設定檔群組

您可以列出機構中的所有自訂鏡像安全性設定檔群組。

控制台

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

    前往「安全性設定檔群組」

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

  3. 在「安全性設定檔群組」分頁中,您可以查看安全性設定檔群組清單。

gcloud

如要列出自訂鏡像安全性設定檔群組,請使用 gcloud network-security security-profile-groups list 指令

gcloud network-security security-profile-groups list \
    --organization ORGANIZATION_ID \
    --location=global \
    --filter CUSTOM_MIRRORING_PROFILE
    --billing-project PROJECT_ID

更改下列內容:

  • ORGANIZATION_ID:建立安全性設定檔群組的機構。

  • CUSTOM_MIRRORING_PROFILE:已定義 custom_mirroring_profile 的設定檔群組名稱。

  • PROJECT_ID:用於安全設定檔群組帳單的專案 ID。

更新安全性設定檔群組

您可以更新安全性設定檔群組中參照的安全性設定檔說明和標籤。

控制台

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

    前往「安全性設定檔群組」

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

  3. 按一下安全性設定檔群組。

  4. 按一下 [編輯]

  5. 編輯規則後,請按一下「儲存」

gcloud

如要更新安全性設定檔群組,請使用 gcloud network-security security-profile-groups update 指令

gcloud network-security security-profile-groups \
    update SECURITY_PROFILE_GROUP_NAME \
    --organization ORGANIZATION_ID \
    --location=global \
    --description DESCRIPTION

更改下列內容:

  • SECURITY_PROFILE_GROUP_NAME:您要更新的安全設定檔群組名稱;您可以將名稱指定為字串或專屬網址 ID。

  • ORGANIZATION_ID:建立安全性設定檔群組的機構。

  • DESCRIPTION:安全性設定檔群組的選用說明。

刪除安全性設定檔群組

您可以指定安全性設定檔群組的名稱、位置和機構,藉此刪除該群組。不過,如果網路防火牆政策參照自訂安全性設定檔,就無法刪除該安全性設定檔群組。

控制台

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

    前往「安全性設定檔群組」

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

  3. 在「安全性設定檔群組」分頁中,選取要刪除的安全性設定檔群組核取方塊,然後按一下「刪除」

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

gcloud

如要刪除安全性設定檔群組,請使用 gcloud network-security security-profile-groups delete 指令

gcloud network-security security-profile-groups \
    delete SECURITY_PROFILE_GROUP_NAME \
    --custom-profile CUSTOM_PROFILE_NAME \
    --organization ORGANIZATION_ID \
    --location-global \
    --billing-project PROJECT_ID

更改下列內容:

  • SECURITY_PROFILE_GROUP_NAME:要刪除的安全設定檔群組名稱;您可以將名稱指定為字串或專屬網址 ID。

  • CUSTOM_PROFILE_NAME:自訂安全性設定檔的名稱。

  • ORGANIZATION_ID:建立安全性設定檔群組的機構。

  • PROJECT_ID:用於安全設定檔群組的配額和存取限制的專案 ID。

後續步驟