https://github.com/microsoft/azure-spring-boot中的样本安全吗?

Is the Sample in https://github.com/microsoft/azure-spring-boot Secure?

readme 描述了在属性中放置服务主体的 ID 和密码。这不是与使用密钥保管库存储您的秘密相反吗?还是我读错了?

是的,在示例中,它公开了 application.properties 中的 client idclient secret

如果想在azure的生产环境中使用sample,最好的做法是使用MSI(managed identity),那么就不需要在application.properties中暴露id和secret了, 只需启用 MSI 并将其添加到 keyvault 访问策略,它支持 Azure Spring Cloud、App Service、VM。

参考 - https://github.com/microsoft/azure-spring-boot/blob/master/azure-spring-boot-starters/azure-keyvault-secrets-spring-boot-starter/README.md#use-msi--managed-identities

但真正的问题是如果你不想使用 MSI 怎么办,给 key, tenant & enable = false 是行不通的。如上参考。