spring-cloud / spring-cloud/spring-cloud-config

Replace Env Variables Placeholder in spring config server native mode with vault secret

Open
#2,321 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

waiting-for-triage
Dominant language
Java
Stars
2k
Forks
1.3k
Avg merge
2d 59m
Merged PRs (30d)
16

Description

I am currently working in a scenario where i need to use spring cloud config server for centralised config management .

Previously we were using the "native" mode to store the configurations in the local filesystem . And the sensitive information like database passwords were stored in the environment variables of the client services .

But , now we want to also use "Hashicorp Vault" to store the database passwords as "secrets" , and simply replace the env variable placeholders in the native files with the secret fetched from vault during the startup .

Current Setup (only "native" mode)
image

Sample content of serviceA-dev.properties

spring.datasource.connectionProperties=jdbc:postgresql://${PG_HOST}:${PG_PORT}/${DB_NAME};username=${DB_USERNAME};password=${DB_PASSWORD}

Expected Setup (both "native" & "vault" mode)
image

Sample content of serviceA-dev.properties

spring.datasource.connectionProperties=jdbc:postgresql://${PG_HOST}:${PG_PORT}/${DB_NAME};username=${DB_USERNAME};password=${DB_PASSWORD}

But here instead of storing the values of ${DB_PASSWORD} in env variables , we want to connect to vault during the startup , and then replace this with the actual value fetched from the vault

So , can this be achieved ?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the Spring Cloud Config server's native mode and the Vault-related configuration paths described in the issue. The issue names no source files, tests, or entry points and does not define an implementation or verification scope; done would require a decided approach for resolving the database password placeholder from Vault during startup.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, postgresql, spring-boot
Domain
backend, cloud, security
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
15/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.