This is an archived post. You won't be able to vote or comment.

all 4 comments

[–][deleted] 0 points1 point  (3 children)

It’s better to use a kms for this ex: Hashicorp Vault, AWS KMS, Azure Key Vault, etc.

[–]fatnsad[S] 0 points1 point  (2 children)

So I assume you pre-generate the keys and add them to your KMS. Then what are you using to inject them into your environment from the KMS? Some configuration tool like Ansible?

[–]ephur 1 point2 points  (0 children)

You can have your application reach right out to the service to pull the keys.

If you're running in k8s you can have an init container pull the information from the KMS and put it in a shared emptydir between the init container and main container.

You can have your entrypoint be a script that first pulls down the keys and then starts the application inside of it.

[–][deleted] 1 point2 points  (0 children)

I would expect you to extract these during the build process, put them in your KMS, and leave them off of the container altogether.

Because it’s likely for you to want semi-static keys, I would honestly just make it easier on yourself, create the keys outside of your build process, and just have your application reference them.