如要找出沒有密碼政策的 AlloyDB for PostgreSQL 執行個體、強制執行高強度密碼,以及協助符合法規遵循要求,您可以查看並套用 AlloyDB 密碼政策建議工具提供的建議。
AlloyDB 密碼政策推薦工具會偵測未啟用執行個體密碼政策的執行個體,並提供洞察資料和建議,協助您提升執行個體安全性。
系統每天都會產生建議。
定價
所有 Google Cloud 客戶都能免費使用 AlloyDB 密碼政策建議工具。詳情請參閱「建議工具定價」。
事前準備
您必須先完成下列事項,才能查看建議和洞察資料:
如要取得查看及使用深入分析和建議的權限,請要求管理員授予您必要的 Identity and Access Management (IAM) 角色:
Tasks 角色 查看建議 AlloyDB 建議工具檢視者 ( roles/recommender.alloydbViewer)套用建議 AlloyDB 建議工具管理員 ( roles/recommender.alloydbAdmin) 或 AlloyDB 管理員 (roles/alloydb.admin)詳情請參閱「將存取權授予其他使用者」。
列出建議
您可以使用 Google Cloud 控制台、gcloud CLI 或 Recommender API,列出密碼政策建議。
控制台
如要使用Google Cloud 控制台列出密碼政策建議,請按照下列步驟操作:
前往 Google Cloud 控制台的 AlloyDB「Clusters」(叢集) 頁面。
詳情請參閱「開始使用 Active Assist」。
在「Resources」(資源) 清單表格中,找到叢集,然後按一下「Issues」(問題) 欄中的「View issues」(查看問題)。
在「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。
套用建議
如要採行這項建議,請按照下列步驟操作:
- 在「Resources」(資源) 清單表格中,按一下叢集「Issues」(問題) 欄中的「View issues」(查看問題)。
- 在「Aggregated issues」(匯總問題) 面板中,選取「No password policy」(無密碼政策) 建議資訊卡,然後按一下「Edit instance」(編輯執行個體)。
- 設定執行個體密碼政策。