当 spring.cloud.vault.config.lifecycle.enabled 设置为 false 时,无法从保管库加载机密

发布于 2025-01-14 06:27:44 字数 2000 浏览 0 评论 0原文

我正在使用版本 2.2.5.RELEASE 的 Spring Cloud StarterVault 配置来连接到我的安全保管库服务器,该服务器正在使用 approle 身份验证机制,我观察到,如果我将 spring.cloud.vault.config.lifecycle 属性的值设置为 false .enabled spring 无法从保管库加载机密,其失败并出现以下错误:

17:27:05.823 DEBUG [ main] o.s.v.a.AppRoleAuthentication - - Login successful using AppRole authentication
17:27:06.121 WARN [ main] o.s.c.v.config.VaultConfigTemplate - - Could not locate PropertySource: Status 403 Forbidden [/*/local]: 1 error occurred:
* permission denied

below is my bootstrap.properties configuration:
#Project Details
info.app.name = ****
info.app.version = @project.version@

spring.application.name = ***

logging.level.org.springframework.vault = TRACE

spring.cloud.vault.app-role.auth-path=approle
spring.cloud.vault.app-role.role-id=****
spring.cloud.vault.app-role.secret-id=****
spring.cloud.vault.authentication=APPROLE
spring.cloud.vault.generic.application-name=****
spring.cloud.vault.generic.backend=***
spring.cloud.vault.generic.enabled=false
spring.cloud.vault.host=****
spring.cloud.vault.kv.application-name=****
spring.cloud.vault.kv.backend=****
spring.cloud.vault.kv.enabled=true
spring.cloud.vault.kv.profile-separator=/
spring.cloud.vault.port=8200
spring.cloud.vault.scheme=https
spring.cloud.vault.ssl.trust-store=*****.jks
spring.cloud.vault.ssl.trust-store-password=***
management.health.vault.enabled = false
spring.cloud.vault.config.lifecycle.enabled=false


Note if spring.cloud.vault.config.lifecycle.enabled is set to true then it is able to load secrets from vault. my goal for setting this property is to load secrets from vault only during application startup time and reduce further secret renew calls to vault once application is started.

以下是当属性设置为 true 时对保管库的请求序列

https://:/v1/sys/internal/ui/mounts///local

https://:/v1/auth/approle/login

https://:/v1//data//本地

https://:/v1/sys/internal/ui/mounts//

https://:/v1 //data/

下面是属性设置为 false 时对保管库的请求 https://:/v1///本地

I am using spring cloud starter vault config of version 2.2.5.RELEASE for connecting to my secured vault server which is working on approle authentication mechanism, i observed that if i setup value to false for property spring.cloud.vault.config.lifecycle.enabled spring is unable to load secrets from vault its failing with below error:

17:27:05.823 DEBUG [ main] o.s.v.a.AppRoleAuthentication - - Login successful using AppRole authentication
17:27:06.121 WARN [ main] o.s.c.v.config.VaultConfigTemplate - - Could not locate PropertySource: Status 403 Forbidden [/*/local]: 1 error occurred:
* permission denied

below is my bootstrap.properties configuration:
#Project Details
info.app.name = ****
info.app.version = @project.version@

spring.application.name = ***

logging.level.org.springframework.vault = TRACE

spring.cloud.vault.app-role.auth-path=approle
spring.cloud.vault.app-role.role-id=****
spring.cloud.vault.app-role.secret-id=****
spring.cloud.vault.authentication=APPROLE
spring.cloud.vault.generic.application-name=****
spring.cloud.vault.generic.backend=***
spring.cloud.vault.generic.enabled=false
spring.cloud.vault.host=****
spring.cloud.vault.kv.application-name=****
spring.cloud.vault.kv.backend=****
spring.cloud.vault.kv.enabled=true
spring.cloud.vault.kv.profile-separator=/
spring.cloud.vault.port=8200
spring.cloud.vault.scheme=https
spring.cloud.vault.ssl.trust-store=*****.jks
spring.cloud.vault.ssl.trust-store-password=***
management.health.vault.enabled = false
spring.cloud.vault.config.lifecycle.enabled=false


Note if spring.cloud.vault.config.lifecycle.enabled is set to true then it is able to load secrets from vault. my goal for setting this property is to load secrets from vault only during application startup time and reduce further secret renew calls to vault once application is started.

below are the sequence of requests to vault when property is set to true

https://:/v1/sys/internal/ui/mounts///local

https://:/v1/auth/approle/login

https://:/v1//data//local

https://:/v1/sys/internal/ui/mounts//

https://:/v1//data/

below are requests to vault when property is set to false
https://:/v1///local

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文