本頁說明如何使用 Google Cloud 控制台或 Google Cloud CLI 管理安全性設定檔群組。
如要查看本頁列出的作業進度,請確認您的使用者角色具備下列 Compute 網路使用者 (roles/compute.networkUser) 權限:
networksecurity.operations.getnetworksecurity.operations.list
事前準備
- 您必須在專案中啟用 Network Security API。
如要執行本指南中的
gcloud指令列範例,請安裝 gcloud CLI。您需要威脅防護安全性設定檔或網址篩選安全性設定檔。
角色
如要取得檢視、更新或刪除安全設定檔群組所需的權限,請要求系統管理員在您的機構或專案中,授予您必要的 IAM 角色。如要進一步瞭解如何授予角色,請參閱「管理存取權」。
查看安全性設定檔群組
您可以在機構或專案中查看特定安全性設定檔群組的詳細資料。
機構層級安全性設定檔群組
如要查看機構層級的安全設定檔群組,請使用Google Cloud 控制台或 gcloud CLI。
控制台
前往 Google Cloud 控制台的「Security profiles」(安全性設定檔) 頁面。
選取「安全性設定檔群組」分頁標籤。這個分頁會列出已設定的安全性設定檔群組。
選取安全性設定檔群組,即可查看詳細資料。
gcloud
如要查看安全性設定檔群組的詳細資料,請使用 gcloud
network-security security-profile-groups describe 指令:
gcloud network-security security-profile-groups describe NAME \
--organization ORGANIZATION_ID \
--location LOCATION \
--billing-project QUOTA_PROJECT_ID
更改下列內容:
NAME:安全性設定檔群組的名稱,您可以將名稱指定為字串或專屬網址 ID。ORGANIZATION_ID:安全設定檔群組所在的機構。如果您使用不重複的網址 ID 做為NAME變數,可以省略--organization旗標。LOCATION:安全性設定檔群組的位置。位置一律設為「
global」。如果您使用NAME變數的專屬網址 ID,可以省略--location標記。QUOTA_PROJECT_ID:用於安全設定檔群組配額和存取限制的選用專案 ID。
專案層級安全性設定檔群組
如要查看專案層級安全設定檔群組,請使用 gcloud CLI。
gcloud
如要查看安全性設定檔群組的詳細資料,請使用 gcloud
beta network-security security-profile-groups describe 指令:
gcloud beta network-security security-profile-groups describe NAME \
--project PROJECT_ID \
--location LOCATION
更改下列內容:
NAME:安全性設定檔群組的名稱,您可以將名稱指定為字串或專屬網址 ID。PROJECT_ID:安全設定檔群組所在的專案。如果您使用不重複的網址 ID 做為NAME標記,可以省略--project標記。LOCATION:安全性設定檔群組的位置。位置一律設為「
global」。如果您使用專屬網址 ID 做為NAME標記,可以省略--location標記。
列出安全性設定檔群組
您可以列出機構或專案中的所有安全設定檔群組。
機構層級安全性設定檔群組
如要列出所有機構層級的安全設定檔群組,請使用Google Cloud 控制台或 gcloud CLI。
控制台
前往 Google Cloud 控制台的「Security profiles」(安全性設定檔) 頁面。
選取「安全性設定檔群組」分頁標籤。這個分頁會列出已設定的安全性設定檔群組。
gcloud
如要列出安全性設定檔群組,請使用 gcloud network-security
security-profile-groups list 指令:
gcloud network-security security-profile-groups list \
--organization ORGANIZATION_ID \
--location LOCATION \
--billing-project BILLING_PROJECT_ID
更改下列內容:
ORGANIZATION_ID:安全設定檔群組所在的機構。如果您使用不重複的網址 ID 做為NAME變數,可以省略--organization旗標。LOCATION:安全性設定檔群組的位置。位置一律設為「
global」。如果您使用NAME變數的專屬網址 ID,可以省略--location標記。BILLING_PROJECT_ID:用於安全設定檔群組帳單的選用專案 ID。
專案層級安全性設定檔群組
如要列出所有專案層級安全性設定檔群組,請使用 gcloud CLI。
gcloud
如要列出安全性設定檔群組,請使用 gcloud network-security
security-profile-groups list 指令:
gcloud network-security security-profile-groups list \
--project PROJECT_ID \
--location LOCATION
更改下列內容:
PROJECT_ID:安全設定檔群組所在的專案。LOCATION:安全性設定檔群組的位置。位置一律設為「
global」。
更新安全性設定檔群組
您可以更新安全性設定檔群組中參照的安全性設定檔名稱。
機構層級安全性設定檔群組
如要更新機構層級的安全設定檔群組,請使用Google Cloud 控制台或 gcloud CLI。
控制台
前往 Google Cloud 控制台的「Security profiles」(安全性設定檔) 頁面。
選取「安全性設定檔群組」分頁標籤。這個分頁會列出已設定的安全性設定檔群組。
選取安全性設定檔群組,然後按一下「編輯」。
更新必填欄位,然後按一下「儲存」。
gcloud
如要更新安全性設定檔群組,請使用 gcloud network-security
security-profile-groups update 指令:
gcloud network-security security-profile-groups update NAME \
--organization ORGANIZATION_ID \
--location LOCATION \
--clear-threat-prevention-profile | --threat-prevention-profile SECURITY_PROFILE_URL \
--clear-url-filtering-profile | --url-filtering-profile SECURITY_PROFILE_URL \
--billing-project QUOTA_PROJECT_ID \
--description DESCRIPTION
更改下列內容:
NAME:要更新的安全設定檔群組名稱,您可以將名稱指定為字串或專屬網址 ID。ORGANIZATION_ID:安全設定檔群組所在的機構。如果您使用不重複的網址 ID 做為NAME變數,可以省略--organization旗標。LOCATION:安全性設定檔群組的位置。位置一律設為「
global」。如果您使用NAME變數的專屬網址 ID,可以省略--location標記。SECURITY_PROFILE_URL:url-filtering或threat-prevention類型安全設定檔的不重複網址 ID。最多請指定下列其中一個標記:
clear-threat-prevention-profile:清除 threat-prevention-profile 欄位。threat-prevention-profile:使用threat-prevention類型安全設定檔的專屬網址 ID,更新 threat-prevention-profile 欄位。
同樣地,最多只能指定下列其中一個標記:
clear-url-filtering-profile:清除 url-filtering-profile 欄位。url-filtering-profile:使用url-filtering類型安全設定檔的專屬網址 ID,更新 url-filtering-profile 欄位。
QUOTA_PROJECT_ID:用於安全設定檔群組配額和存取限制的選用專案 ID。DESCRIPTION:安全性設定檔群組的選用說明。
專案層級安全性設定檔群組
如要更新專案層級安全設定檔群組,請使用 gcloud CLI。
gcloud
如要更新安全性設定檔群組,請使用 gcloud beta network-security
security-profile-groups update 指令:
gcloud beta network-security security-profile-groups update NAME \
--project PROJECT_ID \
--location LOCATION \
--clear-threat-prevention-profile | --threat-prevention-profile SECURITY_PROFILE_URL \
--clear-url-filtering-profile | --url-filtering-profile SECURITY_PROFILE_URL \
--description DESCRIPTION
更改下列內容:
NAME:要更新的安全設定檔群組名稱,您可以將名稱指定為字串或專屬網址 ID。PROJECT_ID:安全設定檔群組所在的專案。如果您使用不重複的網址 ID 做為NAME標記,可以省略--project標記。LOCATION:安全性設定檔群組的位置。位置一律設為「
global」。如果您使用NAME變數的專屬網址 ID,可以省略--location標記。SECURITY_PROFILE_URL:url-filtering或threat-prevention類型安全設定檔的不重複網址 ID。最多請指定下列其中一個標記:
clear-threat-prevention-profile:清除 threat-prevention-profile 欄位。threat-prevention-profile:使用threat-prevention類型安全設定檔的專屬網址 ID,更新 threat-prevention-profile 欄位。
同樣地,最多只能指定下列其中一個標記:
clear-url-filtering-profile:清除 url-filtering-profile 欄位。url-filtering-profile:使用url-filtering類型安全設定檔的專屬網址 ID,更新 url-filtering-profile 欄位。
DESCRIPTION:安全性設定檔群組的選用說明。
刪除安全性設定檔群組
您可以指定安全性設定檔群組的名稱、位置和機構/專案,藉此刪除該群組。不過,如果防火牆政策參照安全性設定檔,就無法刪除該安全性設定檔群組。
機構層級安全性設定檔群組
如要刪除機構層級的安全設定檔群組,請使用Google Cloud 控制台或 gcloud CLI。
控制台
前往 Google Cloud 控制台的「Security profiles」(安全性設定檔) 頁面。
選取「安全性設定檔群組」分頁標籤。這個分頁會列出已設定的安全性設定檔群組。
選取安全性設定檔群組,然後按一下「刪除」。
再按一下 [刪除] 加以確認。
gcloud
如要刪除安全性設定檔群組,請使用 gcloud network-security
security-profile-groups delete 指令:
gcloud network-security security-profile-groups delete NAME \
--organization ORGANIZATION_ID \
--location LOCATION \
--billing-project QUOTA_PROJECT_ID
更改下列內容:
NAME:要刪除的安全設定檔群組名稱,可以指定為字串或專屬網址 ID。ORGANIZATION_ID:安全設定檔群組所在的機構。如果您使用不重複的網址 ID 做為NAME變數,可以省略--organization旗標。LOCATION:安全性設定檔群組的位置。位置一律設為「
global」。如果您使用NAME變數的專屬網址 ID,可以省略--location標記。QUOTA_PROJECT_ID:用於安全設定檔群組配額和存取限制的選用專案 ID。
專案層級安全性設定檔群組
如要刪除專案層級的安全性設定檔群組,請使用 gcloud CLI。
gcloud
如要刪除安全性設定檔群組,請使用 gcloud beta network-security
security-profile-groups delete 指令:
gcloud beta network-security security-profile-groups delete NAME \
--project PROJECT_ID \
--location LOCATION
更改下列內容:
NAME:要刪除的安全設定檔群組名稱,可以指定為字串或專屬網址 ID。PROJECT_ID:安全設定檔群組所在的專案。如果您使用不重複的網址 ID 做為NAME變數,可以省略--project旗標。LOCATION:安全性設定檔群組的位置。位置一律設為「
global」。如果您使用NAME變數的專屬網址 ID,可以省略--location標記。