設定密碼政策,提升執行個體安全性

如要找出沒有密碼政策的 AlloyDB for PostgreSQL 執行個體、強制執行高強度密碼,以及協助符合法規遵循要求,您可以查看並套用 AlloyDB 密碼政策建議工具提供的建議。

AlloyDB 密碼政策推薦工具會偵測未啟用執行個體密碼政策的執行個體,並提供洞察資料和建議,協助您提升執行個體安全性。

系統每天都會產生建議。

定價

所有 Google Cloud 客戶都能免費使用 AlloyDB 密碼政策建議工具。詳情請參閱「建議工具定價」。

事前準備

您必須先完成下列事項,才能查看建議和洞察資料:

列出建議

您可以使用 Google Cloud 控制台、gcloud CLI 或 Recommender API,列出密碼政策建議。

控制台

如要使用Google Cloud 控制台列出密碼政策建議,請按照下列步驟操作:

  1. 前往 Google Cloud 控制台的 AlloyDB「Clusters」(叢集) 頁面。

    前往「Clusters」(叢集) 頁面

    詳情請參閱「開始使用 Active Assist」。

  2. 在「Resources」(資源) 清單表格中,找到叢集,然後按一下「Issues」(問題) 欄中的「View issues」(查看問題)。

  3. 在「Aggregated issues」(匯總問題) 面板中,選取「No password policy」(無密碼政策) 建議資訊卡。

gcloud CLI

如要使用 gcloud CLI 列出密碼政策建議,請執行 gcloud recommender recommendations list 指令,如下所示:

gcloud recommender recommendations list \
--project=PROJECT_ID \
--location=LOCATION \
--recommender=google.alloydb.instance.SecurityRecommender \
--filter=recommenderSubtype=ENABLE_INSTANCE_PASSWORD_POLICY

更改下列內容:

  • PROJECT_ID:您的專案 ID。

  • LOCATION:執行個體所在的區域,例如 us-central1。

API

如要使用 Recommender API 列出密碼政策建議,請呼叫 recommendations.list 方法,如下所示:

GET https://recommender.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/recommenders/google.alloydb.instance.SecurityRecommender/recommendations?filter=recommenderSubtype=ENABLE_INSTANCE_PASSWORD_POLICY

更改下列內容:

  • PROJECT_ID:您的專案 ID。

  • LOCATION:執行個體所在的區域,例如 us-central1。

查看洞察資料和詳細建議

您可以使用 Google Cloud 控制台、gcloud CLI 或 Recommender API,查看需要啟用執行個體密碼政策的執行個體深入分析和詳細建議。

控制台

在「Clusters」(叢集) 頁面的「Resources」(資源) 表格下方,按一下叢集「Issues」(問題) 欄中的「View issues」(查看問題)。

右側會顯示「Aggregated issues」(匯總問題) 面板,其中包含「No password policy」(無密碼政策) 的深入分析和詳細建議。

gcloud CLI

如要查看洞察資料和詳細建議,瞭解哪些執行個體需要啟用執行個體密碼政策,請執行 gcloud recommender insights list 指令,如下所示:

gcloud recommender insights list \
--project=PROJECT_ID \
--location=LOCATION \
--insight-type=google.alloydb.instance.SecurityInsight \
--filter=insightSubtype=INSTANCE_PASSWORD_POLICY_NOT_ENABLED

更改下列內容:

  • PROJECT_ID:您的專案 ID。

  • LOCATION:執行個體所在的區域,例如 us-central1。

API

如要使用 Recommender API,查看需要啟用執行個體密碼政策的執行個體洞察和詳細建議,請按照下列方式呼叫 insights.list 方法:

GET https://recommender.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/insightTypes/google.alloydb.instance.SecurityInsight/insights?filter=insightSubtype=INSTANCE_PASSWORD_POLICY_NOT_ENABLED

更改下列內容:

  • PROJECT_ID:您的專案 ID。

  • LOCATION:執行個體所在的區域,例如 us-central1。

套用建議

如要採行這項建議,請按照下列步驟操作:

  1. 在「Resources」(資源) 清單表格中,按一下叢集「Issues」(問題) 欄中的「View issues」(查看問題)。
  2. 在「Aggregated issues」(匯總問題) 面板中,選取「No password policy」(無密碼政策) 建議資訊卡,然後按一下「Edit instance」(編輯執行個體)。
  3. 設定執行個體密碼政策。

後續步驟