通过设置密码政策提高实例安全性

本页面介绍了 AlloyDB 密码政策 Recommender,它可帮助您识别未设置密码政策的实例、强制使用安全系数高的密码并满足合规性要求。

AlloyDB 密码政策 Recommender 会立即检测未启用实例密码政策的实例,并提供分析洞见和建议,以提高实例安全性。

建议每天生成一次。

价格

所有 Google Cloud 客户都可免费使用 AlloyDB 密码政策 Recommender。如需了解详情,请参阅 Recommender 价格

准备工作

您必须先执行以下操作,然后才能查看建议和数据分析:

列出建议

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

控制台

如需使用Google Cloud 控制台列出密码政策建议,请按照以下步骤操作:

  1. 在 Google Cloud 控制台中,前往 AlloyDB 集群页面。

    转到集群

    如需了解详情,请参阅 Recommendation Hub 使用入门

  2. 安全卡片中,点击没有密码政策

  3. 资源表格下,选择具有没有密码政策建议的实例。

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

应用建议

如需实施此建议,请执行以下操作:

  1. 点击问题列中的没有密码政策
  2. 启用密码政策窗口中,点击修改实例
  3. 设置实例密码政策

后续步骤