本頁面說明 AlloyDB 密碼政策建議,可協助您找出沒有密碼政策的執行個體、強制使用高強度密碼,以及符合法規遵循要求。
AlloyDB 密碼政策建議工具會立即偵測未啟用執行個體密碼政策的執行個體,並提供洞察資料和建議,協助您提升執行個體安全性。
建議每天都會產生。
定價
所有客戶皆可免費使用 AlloyDB 密碼政策建議。 Google Cloud 詳情請參閱「Recommender 定價」。
事前準備
如要查看最佳化建議和洞察資料,請務必完成下列事項:
如要取得查看及使用洞察和建議的權限,請確認您具備必要的身分與存取權管理 (IAM) 角色。
Tasks 角色 查看建議 下列其中一個角色: recommender.alloydbViewer
。套用建議 下列任一角色: recommender.alloydbAdmin
或alloydb.admin
。詳情請參閱「授予其他使用者存取權」。
列出建議
您可以使用 Google Cloud 控制台、gcloud CLI
或 Recommender API 列出密碼政策建議。
主控台
如要使用Google Cloud 控制台列出密碼政策建議,請按照下列步驟操作:
前往 Google Cloud 控制台的 AlloyDB「叢集」頁面。
詳情請參閱「開始使用建議中心」一文。
在「安全性」資訊卡中,按一下「沒有密碼政策」。
在「資源」表格下方,選取具有「沒有密碼政策」建議的執行個體。
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
如要使用 Recommendations API 列出密碼政策建議,請呼叫 recommendations.list
方法,如下所示:
GET https://recommender.googleapis.com/v1beta1/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,查看需要啟用執行個體密碼政策的執行個體洞察資料和詳細建議。
主控台
如要查看需要啟用執行個體密碼政策的執行個體相關深入分析和詳細建議,請按一下「叢集」頁面執行個體清單中的建議連結。
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
如要查看需要啟用執行個體密碼政策的執行個體相關深入分析和詳細建議,請使用 Recommendations 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
。
套用最佳化建議
如要實作這項建議,請按照下列步驟操作:
- 按一下「問題」欄中的「沒有密碼政策」。
- 在「啟用密碼政策」視窗中,按一下「編輯執行個體」。
- 設定執行個體密碼政策。