啟用及使用 Notebook 安全性掃描器

Notebook Security Scanner 可協助您偵測及解決 Colab Enterprise 筆記本 (.ipynb 檔案) 中 Python 套件的安全漏洞。在 Google Cloud 控制台透過 Security Command Center 啟用掃描器後,掃描器會每 24 小時掃描一次筆記本,並將發現項目發布至 Security Command Center 的「Findings」(發現項目) 頁面。

Notebook Security Scanner 支援 us-central1、us-east4、us-west1 和 europe-west4 區域的 Colab Enterprise 筆記本。這項功能是透過 Google Cloud 控制台管理,Notebook Security Scanner API (notebooksecurityscanner.googleapis.com) 不適合直接使用。

啟用 Notebook Security Scanner

您可以在組織或專案層級啟用 Notebook Security Scanner。

啟用 Notebook Security Scanner 的方式,取決於組織或專案是否需要啟用 Security Command Center,或組織或專案啟用的 Security Command Center 級別。請根據您的用途,按照適用章節的指示操作:

新啟用進階級

如果貴組織沒有 Security Command Center,請為組織或專案啟用 Security Command Center 進階級,並啟用 Notebook Security Scanner。

  1. 前往 Google Cloud 控制台的「Security Command Center」頁面。

    前往 Security Command Center

  2. 在資源選取器中,選取組織或專案。
  3. 按一下「取得 Security Command Center」。
  4. 選取「Premium」級,然後點選「Next」(下一步)。
  5. 在「Notebook Security Scanner」部分,從清單中選取「Enable」(啟用),然後點選「Next」(下一步)。
  6. 選取「自動授予角色」,然後點選「授予角色」。
  7. 佈建服務帳戶後,請點選「Next」(下一步)。
  8. 如要完成啟用程序,請按一下「Finish」(完成)。

新啟用 Enterprise 級

如果貴組織沒有 Security Command Center,請為貴組織啟用 Security Command Center Enterprise 級別,並啟用 Notebook Security Scanner。

現有的 Premium 或 Enterprise 級別

如果組織或專案已啟用 Security Command Center Premium 或 Enterprise 方案,請啟用 Notebook Security Scanner。

  1. 前往 Google Cloud 控制台的「Security Command Center」頁面。

    前往 Security Command Center

  2. 按一下「設定」。
  3. 在「Notebook Security Scanner」資訊卡中,按一下「Manage settings」(管理設定)。
  4. 在專案的「Notebook Security Scanner」欄中,選取「啟用」。

查看並解決套件安全漏洞發現項目

啟用 Notebook Security Scanner 後,這項服務每 24 小時會掃描專案或組織中的 Colab Enterprise 筆記本 (副檔名為 ipynb 的檔案),偵測 Python 套件中的安全漏洞,並將發現項目發布至 Security Command Center 的「發現項目」頁面。如果是新建立的 Colab Enterprise 筆記本,套件安全漏洞發現項目最多可能需要四小時,才會顯示在 Security Command Center 的「Findings」(發現項目) 頁面。

如要在 Security Command Center 查看套件安全漏洞發現項目,請按照下列步驟操作:

  1. 前往 Google Cloud 控制台的 Security Command Center「Findings」(發現項目) 頁面。

    前往「發現項目」

  2. 在資源選取器中,選取組織或專案。

  3. 在「快速篩選器」部分,前往「來源顯示名稱」子節,然後選取「Notebook Security Scanner」。

    「發現項目查詢結果」面板只會顯示 Notebook Security Scanner 的套件安全漏洞發現項目。

  4. 如要查看特定發現項目的詳細資料,請按一下「Category」(類別) 欄中的發現項目名稱。發現項目詳細資料面板會展開,顯示發現項目詳細資料的摘要。

  5. 如要解決套件安全漏洞發現項目,請按照發現項目「Next steps」(後續步驟) 部分所述的步驟操作。

    在某些情況下,套件安全漏洞可能無法修正。在這種情況下,建議您使用其他 Python 套件。

後續步驟