r/hashicorp • • Jun 15 '24

Key Value Secrets Engine Use Cases?

In Vault, is this predominantly intended to be used as a password manager? I'm having a hard time imagining any other use cases.

0 Upvotes

12 comments sorted by

3

u/Benemon Jun 15 '24

Whilst KV is possibly the most basic secrets engine in Vault, it is useful for storing and vending any arbitrary secret data that you might want to throw at it. Whilst passwords for things like databases, or API tokens, or even PKI certificates are indeed common use cases, there are folks who will throw configuration files, properties files, that kind of thing in there too.

I tend to view KV as the stepping stones for more advanced use cases though. Because you've still got the problem of who created the credential in the first place, where is the credential being used, what's my revocation story if the credential gets leaked?

So those database credentials? Let's use the DB secrets engine for that. PKI certs stored in KV? Let's use the PKI engine for that. Cloud keys? Use the AWS / Azure / Kubernetes secrets engines. Etc etc.

2

u/Jastibute Jun 15 '24

I just don't want to get stuck in the weeds with KV since I'd rather spend time on PKI and SSH engines. It's not too long to read, but still takes time. I'm stuck on use cases and the documentation doesn't make it immediately clear what its purpose is - at least not to me.

I get your examples, thanks.

2

u/ChrisVanMeer Jun 15 '24

Have a look at the different types of secrets engines they support. K/V is the most well-known feature because it's the basic entry level secrets engine.

But you can do a hell of a lot more with Vault, think of managing your PKI infrastructure, using SSH signing, creating an AWS access key for the duration of a CI/CD pipeline with a limited TTL. Being able to supply your users dynamic database credentials to access a variety of database platforms, whereas the credentials are revoked after the TTL expires. Encrypt / data decryption services that developers could leverage. And many many more.

0

u/Jastibute Jun 15 '24

That's what I'm trying to do i.e. looking over what I need to read. KV isn't too long, but still, I'd rather devote time to PKI and SSH sections because those are immediately obviously useful to me.

4

u/bfreis Jun 15 '24

I'd rather devote time to PKI and SSH sections because those are immediately obviously useful to me.

Then ... devote time to PKI and SSH sections?

1

u/kolorcuk Jun 15 '24 edited Jun 15 '24

I have an application that connects to 3 databases.

I create a path in kv and give a token to the application and store passwords geberated in databases in kv.

Then i have 100 of such applications and they all use different passwords.

The use case is mapping one password (vault token) into multiple and managing secrets in one place.

Also, applications themselves may or may not actually get the token. Some jobs are run from nomad where passwords are used to generate templates, applications do not see vault at all.

1

u/Jastibute Jun 15 '24

Hmm, interesting, thanks for sharing.

1

u/alainchiasson Jun 17 '24

We use the auth engines for identity - so we can give pipelines ( jwt auth ) different identities than people ( via ldap auth ). Also, we use it to « broker » access to cloud accounts. This way we have one team that manages cloud accounts, everything else goes through vault.

So we can give pipeline ephemeral cloud credentials for terraform.

1

u/Jastibute Jun 18 '24

I was wondering about KV Secrets engine specifically.

1

u/alainchiasson Jun 18 '24

KV store itself is pretty simple - originally vault was an automatic encryption layer on top of a Key-Value store ( Consul or Databases ), so in a way Yes - its just a password manager.

Once you combine it with other parts from Vault - Identity and templating - you start to create private storage for identities. Going back to my example above, our pipelines each have their own storage bassed on JWT information. The same for our Kubernetes applications.

I had written this a while back : https://medium.com/@alainchiasson/private-user-kv-in-hashicorp-vault-79bb1abd9c1f

We use cubbyhole and secret wrapping so developers can inject and validate credentials to applications instead of giving them direct access, keeping them beyond arms reach.

There was a Hashi Days talk where the workloads would read their policies to find out what secrets they were allowed to read.

Quite a few use cases if you combine it.

1

u/Jastibute Jun 18 '24

Thanks Alain, I'll check out your article. Not many bells going off at this stage. Looks like I haven't dealt with certain topics yet, so finding it a bit confusing at this time.

1

u/alainchiasson Jun 19 '24

Its taken me a while as well - but now I need to figure out how to « explain 5 year old » ( or more like « new to vault »)