使用 VPC Service Controls 設定 service perimeter

瞭解如何在 Google Cloud 控制台使用 VPC Service Controls 設定 service perimeter。

事前準備

建議您檢查自己是否具備管理 VPC Service Controls 所需的 Identity and Access Management (IAM) 角色

如果沒有必要的 IAM 角色,請參閱「管理專案、資料夾和組織的存取權」一文,瞭解如何授予 IAM 角色。

設定 VPC Service Controls perimeter

在下列各節中,您將指定 perimeter 詳細資料、新增要保護的專案和服務,以及建立 perimeter。

新增 VPC Service Controls perimeter 詳細資料

  1. 前往 Google Cloud 控制台的「VPC Service Controls」頁面。

    前往 VPC Service Controls

  2. 如要使用預設的存取權政策來建立新的 perimeter,請從專案選取器選單中選取您的組織。

    如果貴組織沒有存取權政策,請按照下列步驟操作:

    1. 在「VPC Service Controls」頁面上,按一下「Manage policies」(管理政策)

    2. 在「Manage VPC Service Controls」(管理 VPC Service Controls) 頁面上,按一下「Create」(建立)

    3. 在「Create access policy」(建立存取權政策) 頁面的「Access policy title」(存取權政策標題) 欄位中,輸入 access_policy_1

    4. 按一下「Create access policy」(建立存取政策)

  3. 在「VPC Service Controls」頁面上,按一下「New perimeter」(新增 perimeter)

  4. 在「Create a service perimeter」(建立 service perimeter) 頁面的「Title」(標題) 欄位中,輸入 perimeter_storage_services

  5. 保留「Perimeter type」(perimeter 類型) 和「Enforcement mode」(強制執行模式) 的預設選項。

  6. 按一下「Continue」(繼續)

將專案新增至 perimeter

  1. 如要將專案新增至 perimeter,請按一下「Add projects」(新增專案)

  2. 在「Add Projects」(新增專案) 窗格中,選取要新增至 perimeter 的專案,然後按一下「Add selected projects」(新增所選專案)。

  3. 按一下「Continue」(繼續)

保護 perimeter 內的 BigQuery 和 Cloud Storage 服務

  1. 在「Restricted services」(受限服務) 窗格中,按一下「Add services」(新增服務)

  2. 在「Add services」(新增服務) 窗格中,勾選 BigQuery 和 Cloud Storage API 的核取方塊。

    如要尋找服務,可使用篩選查詢。

  3. 按一下「Add selected services」(新增所選服務)

  4. 點按「Create」(建立)

您成功建立一個 perimeter 了!該 perimeter 會列於「VPC Service Controls」頁面上。perimeter 最多可能需要 30 分鐘才能全面生效。變更生效後,只有您已新增至 perimeter 的專案才能存取 BigQuery 和 Cloud Storage 服務。

此外,針對您透過 perimeter 保護的 BigQuery 和 Cloud Storage 服務,其 Google Cloud 控制台介面可能會變成部分甚至完全無法存取。

清除所用資源

如要避免系統向您的 Google Cloud 帳戶收取本頁所用資源的費用,請按照下列步驟操作。

  1. 前往 Google Cloud 控制台的「VPC Service Controls」頁面。

    前往 VPC Service Controls

  2. 在「VPC Service Controls」頁面中找到您建立的 perimeter,然後在相應的列中按一下「Delete」(刪除)

  3. 按一下對話方塊中的「Delete」(刪除),確認要刪除這個 perimeter。

後續步驟