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

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

事前準備

角色

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

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

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

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

您可以在機構或專案層級建立安全性設定檔群組 (預覽版)。您只能使用 CUSTOM_MIRRORING 類型的安全性設定檔建立安全性設定檔群組。

控制台

  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_MIRRORING_PROFILE_NAME \
     --description DESCRIPTION \
     --organization ORGANIZATION_ID | --project PROJECT_ID \
     --location=global \
     [--billing-project QUOTA_PROJECT_ID]

更改下列內容:

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

    如果沒有以專屬網址 ID 格式指定名稱,則必須指定機構或專案名稱和位置。

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

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

  • ORGANIZATION_ID:您的機構 ID。使用這個標記建立機構層級的安全性設定檔群組。

  • PROJECT_ID:專案 ID。使用這個旗標建立專案層級的安全性設定檔群組 (預先發布版)。

    --project 標記適用於 (預先發布版)。如要使用這個旗標,請執行 gcloud beta network-security security-profile-groups create 指令

  • QUOTA_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 list 指令

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

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

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

更改下列內容:

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

    如果沒有以專屬網址 ID 格式指定名稱,則必須指定機構或專案名稱和位置。

  • CUSTOM_MIRRORING_PROFILE:要篩選的自訂鏡像安全設定檔。

  • ORGANIZATION_ID:安全設定檔群組所在的機構 ID。

  • PROJECT_ID:安全設定檔群組所在的專案 ID。

    --project 標記適用於 (預先發布版)。如要使用這個旗標,請執行 gcloud beta network-security security-profile-groups describe 指令

  • QUOTA_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 | --project PROJECT_ID \
    --location=global \
    --description 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 \
    --organization ORGANIZATION_ID | --project PROJECT_ID \
    --location=global \
    [--billing-project QUOTA_PROJECT_ID]

更改下列內容:

  • SECURITY_PROFILE_GROUP_NAME:要刪除的安全設定檔群組名稱。

    如果沒有以專屬網址 ID 格式指定名稱,則必須指定機構或專案名稱和位置。

  • ORGANIZATION_ID:安全設定檔群組所在的機構 ID。

  • PROJECT_ID:安全設定檔群組所在的專案 ID。

    --project 標記適用於 (預先發布版)。如要使用這個旗標,請執行 gcloud beta network-security security-profile-groups delete 指令

  • QUOTA_PROJECT_ID:配額專案 ID。 這個標記僅適用於機構層級的安全性設定檔群組。

後續步驟