最佳做法
本页介绍有关使用 Identity-Aware Proxy (IAP) 的最佳做法。
缓存
- 请勿在应用的前面使用第三方 CDN。CDN 可能缓存内容并将缓存的页面提供给未经身份验证的用户。
- 如果您希望通过 CDN 提供大量非敏感资源,请为这些资源使用单独的网域(例如
images.yourapp.com
)。然后在该网域中使用 CDN,同时向只能提供给经过身份验证的用户的所有对象添加 Cache-control:
private
HTTP 响应标头。
保护应用的安全
要妥善保护应用的安全,您必须对 App Engine 柔性环境Beta 版、App Engine 标准环境、Compute Engine 和 GKE 应用使用签名标头。
配置防火墙
-
确保向 Compute Engine 或 GKE 发出的所有请求均通过负载平衡器进行路由:
-
配置防火墙规则以支持健康检查,并确保发往虚拟机 (VM) 的所有流量均来自 Google 前端 (GFE) IP。
-
如需获得额外的保护,请检查应用中请求的来源 IP,确保它们来自防火墙规则允许的同一 IP 范围。
-
在 Google Cloud Console 中,如果您的防火墙规则设置有误,IAP 会显示错误或警告。IAP Google Cloud Console 不会检测每项服务使用的是哪个虚拟机,因此防火墙分析不包含非默认网络和防火墙规则标记等高级功能。如需绕过此分析,请通过
gcloud compute backend-services update
命令启用 IAP。
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2022-06-29 UTC.
[{
"type": "thumb-down",
"id": "hardToUnderstand",
"label":"很难理解"
},{
"type": "thumb-down",
"id": "incorrectInformationOrSampleCode",
"label":"信息或示例代码不正确"
},{
"type": "thumb-down",
"id": "missingTheInformationSamplesINeed",
"label":"没有我需要的信息/示例"
},{
"type": "thumb-down",
"id": "translationIssue",
"label":"翻译问题"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"其他"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"易于理解"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"解决了我的问题"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"其他"
}]