AlloyDB 強制執行 SSL 模式建議可協助您偵測重要執行個體,以及資料遺失風險。
本頁面說明 AlloyDB 強制執行 SSL 模式建議、這項建議的運作方式,以及如何使用這項建議。
AlloyDB 強制啟用 SSL 模式建議工具會分析執行個體中繼資料。如果執行個體是正式版執行個體,且未針對直接連線強制執行加密規定,建議啟用 SSL 模式。
建議每天都會產生。
事前準備
如要查看最佳化建議和洞察資料,請先完成下列步驟:
如要取得查看及使用洞察和建議的權限,請確認您具備必要的身分與存取權管理 (IAM) 角色。
Tasks 角色 查看建議 recommender.alloydbViewer套用建議 recommender.alloydbAdmin或alloydb.admin詳情請參閱「授予其他使用者存取權」。
列出建議
您可以使用 Google Cloud 控制台、gcloud CLI 或 Recommender API,列出強制執行 SSL 模式的建議。
主控台
前往 Google Cloud 控制台的「Clusters」(叢集) 頁面。
詳情請參閱「透過建議中心查看最佳化建議」。
在「安全性」資訊卡中,按一下「允許未加密的直接連線」。
系統會顯示執行個體叢集清單,其中包含適用「允許未加密的直接連線」建議的執行個體。
gcloud CLI
如要使用 gcloud CLI 列出強制執行 SSL 模式的建議,請執行 gcloud recommender recommendations list 指令,如下所示:
gcloud recommender recommendations list \ --project=PROJECT_ID \ --location=LOCATION \ --recommender=google.alloydb.instance.SecurityRecommender \ --filter=recommenderSubtype=REQUIRE_SSL
更改下列內容:
PROJECT_ID:您的專案 ID。LOCATION:執行個體所在的區域,例如us-central1。
API
如要使用 Recommendations API 列出強制執行 SSL 模式的建議,請呼叫 recommendations.list 方法,如下所示:
GET https://recommender.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/recommenders/google.alloydb.instance.SecurityRecommender/recommendations?filter=recommenderSubtype=REQUIRE_SSL
更改下列內容:
PROJECT_ID:您的專案 ID。LOCATION:執行個體所在的區域,例如us-central1。
查看洞察資料和詳細建議
如要查看需要強制執行 SSL 模式的執行個體相關深入分析和詳細建議,請使用 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=SSL_NOT_REQUIRED
更改下列內容:
- PROJECT_ID:您的專案 ID。
- LOCATION:執行個體所在的區域,例如
us-central1。
API
呼叫 insights.list 方法,如下所示:
GET https://recommender.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/insightTypes/google.alloydb.instance.SecurityInsight/insights?filter=insightSubtype=SSL_NOT_REQUIRED
更改下列內容:
- PROJECT_ID:您的專案 ID。
- LOCATION:執行個體所在的區域,例如
us-central1。
套用最佳化建議
請仔細評估建議,然後執行下列任一操作:
主控台
如要實作這項建議,請在執行個體上強制執行 SSL/TLS 模式。
gcloud CLI
如要實作這項建議,請在執行個體上強制執行 SSL/TLS 模式。