本頁說明如何使用 Google Cloud 控制台或 Google Cloud CLI,建立及管理安全性設定檔群組。
事前準備
- 您必須在專案中啟用 Network Security API。
如要執行本指南中的
gcloud
指令列範例,請安裝 gcloud CLI。您需要威脅防護安全性設定檔或網址篩選安全性設定檔。
角色
如要取得建立、查看、更新或刪除安全性設定檔群組所需的權限,請要求管理員授予您機構的必要 IAM 角色。如要進一步瞭解如何授予角色,請參閱管理存取權。
建立安全性設定檔群組
每個安全性設定檔群組最多可包含下列各類型的安全性設定檔各一項:
url-filtering
threat-prevention
建立安全性設定檔群組時,您可以將安全性設定檔群組的名稱指定為字串或專屬網址 ID。機構範圍安全性設定檔群組的專屬網址可採用下列格式:
organization/ORGANIZATION_ID/locations/LOCATION/securityProfileGroups/SECURITY_PROFILE_GROUP_NAME
如果您使用專屬網址 ID 做為安全性設定檔群組名稱,網址 ID 中已包含安全性設定檔群組的機構和位置。不過,如果只使用安全性設定檔群組名稱,則必須分別指定機構和位置。如要進一步瞭解專屬網址 ID,請參閱安全性設定檔群組規格。
主控台
前往 Google Cloud 控制台的「Security profiles」頁面。
在專案選取器選單中,選取您的機構。
選取「安全性設定檔群組」分頁標籤。
設定安全性設定檔群組:
- 按一下「建立設定檔群組」。
- 在「名稱」欄位中輸入名稱。
- 選用:在「說明」欄位中輸入說明。
- 在「威脅防護設定檔」清單或「網址篩選設定檔」清單中,選取要新增至這個安全性設定檔群組的安全性設定檔。
- 點選「建立」。
gcloud
如要建立安全性設定檔群組,請使用 gcloud network-security
security-profile-groups create
指令:
gcloud network-security security-profile-groups create NAME \ --organization ORGANIZATION_ID \ --location LOCATION \ --project PROJECT_ID \ --url-filtering-profile SECURITY_PROFILE_URL \ --threat-prevention-profile SECURITY_PROFILE_URL \ --description DESCRIPTION
更改下列內容:
NAME
:安全性設定檔群組的名稱;您可以將名稱指定為字串或專屬網址 ID。ORGANIZATION_ID
:建立安全設定檔群組的機構。如果您使用不重複的網址 ID 做為name
標記,可以省略organization
標記。LOCATION
:安全性設定檔群組的位置。位置一律設為「
global
」。如果您使用專屬網址 ID 做為name
標記,可以省略location
標記。PROJECT_ID
:選用專案 ID,用於安全性設定檔群組的配額和存取限制。SECURITY_PROFILE_URL
:url-filtering
或threat-prevention
類型安全設定檔的專屬網址 ID。您必須至少新增其中一個安全性設定檔。DESCRIPTION
:安全性設定檔群組的選用說明。
查看安全性設定檔群組
您可以查看機構中特定安全性設定檔群組的詳細資料。
主控台
前往 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 \ --project PROJECT_ID
更改下列內容:
NAME
:安全性設定檔群組的名稱;您可以將名稱指定為字串或專屬網址 ID。ORGANIZATION_ID
:建立安全設定檔群組的機構。如果您使用不重複的網址 ID 做為name
標記,可以省略organization
標記。LOCATION
:安全性設定檔群組的位置。位置一律設為「
global
」。如果您使用專屬網址 ID 做為name
標記,可以省略location
標記。PROJECT_ID
:選用專案 ID,用於安全性設定檔群組的配額和存取限制。
列出安全性設定檔群組
您可以列出機構中的所有安全性設定檔群組。
主控台
前往 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 PROJECT_ID
更改下列內容:
ORGANIZATION_ID
:建立安全設定檔群組的機構。如果您使用不重複的網址 ID 做為name
標記,可以省略organization
標記。LOCATION
:安全性設定檔群組的位置。位置一律設為「
global
」。如果您使用專屬網址 ID 做為name
標記,可以省略location
標記。PROJECT_ID
:用於安全設定檔群組帳單的選用專案 ID。
更新安全性設定檔群組
您可以更新安全性設定檔群組中參照的安全性設定檔名稱。
主控台
前往 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 \ --project PROJECT_ID \ --description DESCRIPTION
更改下列內容:
NAME
:您要更新的安全設定檔群組名稱;您可以將名稱指定為字串或專屬網址 ID。ORGANIZATION_ID
:建立安全設定檔群組的機構。如果您使用不重複的網址 ID 做為name
標記,可以省略organization
標記。LOCATION
:安全性設定檔群組的位置。位置一律設為「
global
」。如果您使用專屬網址 ID 做為name
標記,可以省略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 欄位。
PROJECT_ID
:選用專案 ID,用於安全性設定檔群組的配額和存取限制。DESCRIPTION
:安全性設定檔群組的選用說明。
刪除安全性設定檔群組
您可以指定安全性設定檔群組的名稱、位置和機構,藉此刪除該群組。不過,如果防火牆政策參照安全性設定檔,就無法刪除該安全性設定檔群組。
主控台
前往 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 PROJECT_ID
更改下列內容:
NAME
:要刪除的安全設定檔群組名稱;您可以將名稱指定為字串或不重複的網址 ID。ORGANIZATION_ID
:建立安全設定檔群組的機構。如果您使用不重複的網址 ID 做為name
標記,可以省略organization
標記。LOCATION
:安全性設定檔群組的位置。位置一律設為「
global
」。如果您使用專屬網址 ID 做為name
標記,可以省略location
標記。PROJECT_ID
:選用專案 ID,用於安全性設定檔群組的配額和存取限制。