Note : Vault is managed by different team in my project. Below is my boorstrap.yml config

spring:
    application:
       name: MongoSecrets

profiles:
   active: dev
cloud:
   vault:
      enabled: true
      uri: https://vaulturl:443
      scheme: https
       token: "LDAP token"
       kv:
          enaled: true
           backend: MySecrets
       ssl:
           trust-store: cacerts

Dependencies used - spring-cloud-starter-vault-config, spring-cloud-dependencies

Received access to MySecrets folder from Vault team. Below is the policies set for the folder

path "MySecrets/*" {capabilities= ["create","read","update","delete","list"]}

Below is the exception i am getting:

org.springframework.vault.authentication.LifecycleAwareSessionManager : Scheduling Token renewal
  org.springframework.vault.core.lease.SecretLeaseEventPublisher$LoggingErrorListener : [RequestedSecret [path='secret/MySecrets/dev', mode=ROTATE]] Lease [leaseId='null', leaseDuration=PT0S, renewable=false] Status 403 FORBIDDEN secrets/MySecrets/dev: 1 error occurred:
  | * permission denied
  |  
  |  
  | org.springframework.vault.VaultException: Status 403 FORBIDDEN secret/MySecrets/dev: 1 error occurred:
  | * permission denied
2

There are 2 answers

0
giridhar gpr On BEST ANSWER
generic:  
  enabled: false    
kv:  
 enabled: true

Changing bootstrap to above worked for me. Seems there was some issue in the way my Client has set up Vault policies. By Default Generic backends are enabled.

2
jokarls On

Your bootstrap.yml is wrong, there is an indentation problem and you misspelled one property.

   kv:
      enaled: true
       backend: MySecrets

Should be:

   kv:
      enabled: true
      backend: MySecrets

But spring will still log some errors, as it tries different combinations of profile, app, and backend during startup.