管理防火牆端點關聯

本頁說明如何使用 Google Cloud 控制台和 Google Cloud CLI 管理防火牆端點關聯。

將防火牆端點與一或多個虛擬私有雲 (VPC) 網路建立關聯時,請在防火牆端點的相同區域中建立關聯。您可以將區域中的虛擬私有雲網路與專案層級或機構層級的防火牆端點建立關聯。

設定端點關聯時,請遵守下列規定:

  • 在單一可用區中,您只能將虛擬私有雲網路與一個防火牆端點建立關聯 (專案層級 (搶先版) 或機構層級)。不過,您可以將一個虛擬私有雲網路與多個區域中的不同防火牆端點建立關聯。

  • 您可以將虛擬私有雲網路與其他專案中的防火牆端點建立關聯。這適用於專案層級 (預覽) 和機構層級端點。如果專案層級端點位於其他專案,該專案必須與虛擬私有雲網路位於相同機構。

支援巨型封包的防火牆端點只能接受大小上限為 8,500 個位元組的封包。或者,不支援巨型封包的防火牆端點只能接受大小上限為 1,460 個位元組的封包。如需網址篩選服務或入侵偵測與防護服務,建議您將相關聯的 VPC 網路設定為使用最大傳輸單元 (MTU) 限制,分別為 8,500 位元組和 1,460 位元組。詳情請參閱「 支援的封包大小」。

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

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

事前準備

角色

如要取得建立、查看、更新或刪除防火牆端點關聯所需的權限,請要求管理員在您的組織和專案中,授予您必要的 IAM 角色。如要進一步瞭解如何授予角色,請參閱「管理存取權」。

配額

如要查看防火牆端點關聯的配額,請參閱「配額與限制」。

查看防火牆端點關聯

如要查看機構層級或專案層級防火牆端點關聯的詳細資料,請使用 gcloud CLI。

gcloud

如要查看防火牆端點關聯,請使用 gcloud network-security firewall-endpoint-associations describe 指令。

機構層級防火牆端點

gcloud network-security firewall-endpoint-associations \
    describe NAME \
    --zone ZONE \
    [ --project PROJECT_ID ]

專案層級防火牆端點

gcloud beta network-security firewall-endpoint-associations \
    describe NAME \
    --zone ZONE \
    [ --project PROJECT_ID ]

更改下列內容:

  • NAME:防火牆端點關聯的名稱。

  • ZONE:防火牆端點關聯的可用區。

  • PROJECT_ID:建立關聯的 Google Cloud 專案 ID。

列出所有防火牆端點關聯

如要列出所有機構層級的防火牆端點關聯,請使用Google Cloud 控制台或 gcloud CLI。如要列出所有專案層級的防火牆端點關聯,請使用 gcloud CLI。

控制台

  1. 前往 Google Cloud 控制台的「Firewall endpoints」(防火牆端點) 頁面。

    前往「防火牆端點」

  2. 在專案選取器選單中,選取 Google Cloud 專案。

    在「防火牆端點關聯」部分,表格會列出這個專案的所有已設定防火牆端點關聯。

gcloud

如要列出特定網路的防火牆端點關聯,請使用 gcloud network-security firewall-endpoint-associations list 指令並加上 --filter 旗標。

機構層級防火牆端點

gcloud network-security firewall-endpoint-associations list \
    --filter network:NETWORK_NAME \
    [ --project PROJECT_ID ]

專案層級防火牆端點

gcloud beta network-security firewall-endpoint-associations list \
    --filter network:NETWORK_NAME \
    [ --project PROJECT_ID ]

更改下列內容:

  • NETWORK_NAME:虛擬私有雲網路的名稱。
  • PROJECT_ID:建立防火牆端點關聯的 Google Cloud 專案 ID。

編輯防火牆端點關聯

如要編輯機構層級的防火牆端點關聯,請使用Google Cloud 控制台或 gcloud CLI。如要編輯專案層級的防火牆端點關聯,請使用 gcloud CLI。

控制台

  1. 前往 Google Cloud 控制台的「Firewall endpoints」(防火牆端點) 頁面。

    前往「防火牆端點」

  2. 在專案選取器選單中,選取 Google Cloud 專案。

    在「防火牆端點關聯」部分,表格會列出這個專案的所有已設定防火牆端點關聯。

  3. 找到要更新的防火牆端點關聯,然後按一下旁邊的「編輯」。

  4. 如要停用防火牆端點關聯,請取消勾選「Enable association」(啟用關聯) 核取方塊。

  5. 如要更新 TLS 檢查政策,請從「TLS 檢查政策」清單中選取新政策。

  6. 按一下 [儲存]。

gcloud

如要更新防火牆端點關聯,請使用 gcloud network-security firewall-endpoint-associations update 指令。

機構層級防火牆端點

gcloud network-security firewall-endpoint-associations
    update NAME \
    --zone ZONE \
    --project PROJECT_ID \
    [ --disabled ] \
    [ --tls-inspection-policy projects/TLS_PROJECT_NAME/locations/REGION_NAME/tlsInspectionPolicies/TLS_POLICY_NAME ]

專案層級防火牆端點

gcloud beta network-security firewall-endpoint-associations
    update NAME \
    --zone ZONE \
    --project PROJECT_ID \
    [ --disabled ] \
    [ --tls-inspection-policy projects/TLS_PROJECT_NAME/locations/REGION_NAME/tlsInspectionPolicies/TLS_POLICY_NAME ]

更改下列內容:

  • NAME:防火牆端點關聯的名稱。

  • ZONE:防火牆端點關聯的可用區。

  • PROJECT_ID:建立關聯的 Google Cloud 專案 ID。

  • TLS_PROJECT_NAME:TLS 檢查政策的 Google Cloud 專案名稱。

  • REGION_NAME:TLS 檢查政策的區域名稱。

  • TLS_POLICY_NAME:TLS 檢查政策的名稱。

刪除防火牆端點關聯

如要刪除機構層級的防火牆端點關聯,請使用Google Cloud 控制台或 gcloud CLI。如要刪除專案層級的防火牆端點關聯,請使用 gcloud CLI。

刪除 Google Cloud 專案時,系統會自動移除相關聯的防火牆端點關聯。這項操作無法復原,即使日後還原專案也一樣。

不過,有時可能無法刪除這些關聯。 如果發生這種情況並還原專案,相關聯的防火牆端點會在還原的專案中顯示為 ORPHAN 狀態。這表示專案與資源之間的無效連結,因為刪除作業未成功。

您可以在 Google Cloud 控制台中查看這些孤立的關聯,但無法編輯這些關聯。Cloud Next Generation Firewall 會定期執行背景程序,刪除這些孤立資源。

控制台

  1. 前往 Google Cloud 控制台的「Firewall endpoints」(防火牆端點) 頁面。

    前往「防火牆端點」

  2. 在專案選取器選單中,選取 Google Cloud 專案。

    在「防火牆端點關聯」部分,表格會列出這個專案的所有已設定防火牆端點關聯。

  3. 選取防火牆端點關聯,然後按一下「Delete」(刪除)。

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

gcloud

如要刪除防火牆端點關聯,請使用 gcloud network-security firewall-endpoint-associations delete 指令。

機構層級防火牆端點

gcloud network-security firewall-endpoint-associations \
    delete NAME \
    --zone ZONE \
    --project PROJECT_ID

專案層級防火牆端點

gcloud beta network-security firewall-endpoint-associations \
    delete NAME \
    --zone ZONE \
    --project PROJECT_ID

更改下列內容:

  • NAME:防火牆端點關聯的名稱。

  • ZONE:防火牆端點關聯的可用區。

  • PROJECT_ID:建立關聯的 Google Cloud 專案 ID。

後續步驟