Hello,
I’m managing several PostGres instances, each of them containing several databases.
We are using LDAP for authentication, and we plan to use it through Vault to allow for temporary access to people on our LDAP server to the PostGres instances.
So a user connect to Vault with his LDAP creds, and then read on the proper database endpoints for Vault to generate credentials for him on the concerned database.
Everything works fine so far.
The problems comes when I want to use the root rotation feature that comes with the Database Secret Engine.
From what I understand of the Secret Engine, I have to create one Database Configuration per database, and not per PostGres instance (vault write database/config/my-postgresql-database
).
If I have database A and B on the same instance, I’ll have 2 databases configuration in my Secret Engine.
The thing is, as they’re on the same instance, they use the same set of credentials (it’s a user dedicated for Vault as recommended in the doc’).
And, when I rotate the root creds for database A, everything is working fine.
But then, when I want to generate creds for database B, it’s not working anymore, because the creds for the vault user have been rotated with database A.
The only workaround I can think of, if I want to keep the rotation feature, is to have one vault user per database on each PostGres instance, for the creds to be isolated from each other.
Is this the only way? Or am I missing something here?
Thanks.