Skip to content

Allow importing secrets with a full alternative key #1428

@naumannt

Description

@naumannt

Type: Feature

Is your feature request related to a problem? Please describe.
I am currently setting up mostly automated secret rotations in a complex project infrastructure run on AWS. We use Infrastructure-as-Code to manage our AWS resources. To make the configurations as concise and understandable as possible, we want to have a single secret for each usage, e.g. a single database password secret used to connect to a database, used by different services. Due to how the services are set up, they use different keys for the passwords, which creates problems on secret import.

Describe the solution you'd like
Similar to the original prefix addition that was added in this PR, it would be great if it was possible to configure a full alternativ key used by the service property on importing a secret. This way, each consumer can decide their own key when importing secrets, moving that configuration to the consumer themselves.

Describe alternatives you've considered
Defining the secret import with custom properties file (using @Valid and the likes) sadly is not an option for implicitly set environment properties such as database connection passwords and username, and if it was, it would be an suboptimal amount of more or less boilerplate code to do something that spring boot already abstracted for developers.
We currently use an extra secret as an abstraction layer to fix this problem (each service module creates its own secret by aggregating all secrets required for the secret), but then each secret rotation process would need to update multiple secrets (the original source secrets and all aggregation secrets for each consumer), which explodes in complexity.

Additional context
The solution could be as simple as these changes (am not authorized to push a branch): https://pastebin.com/raw/1uachHjE

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions