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

本頁說明如何使用自訂攔截安全性設定檔,建立及管理安全性設定檔群組

事前準備

角色

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

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

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

建立安全性設定檔群組

您可以在機構或專案層級建立安全性設定檔群組。建議您在安全性管理員擁有的專案中建立安全性設定檔群組。

控制台

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

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

  2. 在專案選取器選單中,選取機構或專案。

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

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

  5. 在「Security profile group purpose」部分,選取「NSI in-band」

  6. 在「自訂攔截設定檔」部分,選取頻內整合的自訂安全性設定檔。

  7. 點選「建立」

gcloud

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

gcloud network-security security-profile-groups create SECURITY_PROFILE_GROUP_NAME \
    --custom-intercept-profile CUSTOM_INTERCEPT_PROFILE_ID \
    --organization ORGANIZATION_ID | --project PROJECT_ID \
    [--billing-project QUOTA_PROJECT_ID] \
    --location global

更改下列內容:

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

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

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

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

  • PROJECT_ID:專案 ID。使用這個旗標建立專案層級的安全性設定檔群組。

  • 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_intercept_profile = google_network_security_security_profile.default.id
}

以下範例說明如何建立專案層級的安全性設定檔群組:

resource "google_network_security_security_profile_group" "default" {
  name                     = "security-profile-group"
  parent                   = "projects/${data.google_project.default.project_id}"
  location                 = "global"
  custom_intercept_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 \
    [--billing-project QUOTA_PROJECT_ID]

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

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

更改下列內容:

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

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

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

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

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

輸出內容會以以下格式顯示安全性設定檔群組名稱:

  • 機構層級安全性設定檔群組organizations/ORGANIZATION_ID/locations/global/securityProfileGroups/SECURITY_PROFILE_GROUP_ID
  • 專案層級安全性設定檔群組projects/PROJECT_ID/locations/global/securityProfileGroups/SECURITY_PROFILE_GROUP_ID

刪除安全性設定檔群組

刪除安全性設定檔群組前,請先刪除參照該安全性設定檔群組的自訂攔截安全性設定檔

控制台

  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_ID \
    --organization ORGANIZATION_ID | --project PROJECT_ID \
    [--billing-project QUOTA_PROJECT_ID] \
    --location global

更改下列內容:

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

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

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

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

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

後續步驟