Are there any emerging patterns for how people structure their Vault path hierarchy? Why do you follow the pattern that you use?
I’m just starting to use Vault and am wondering how best to structure my secrets.
I’ve considered the following two patterns:
schema: service/host/[scope/]user
examples:
- postgres/host1.internal/db1/batch_user
- postgres/host2.internal/db1/nick
- ftp/ftp-host.internal/ftp_user
- posix/posix-host1.internal/root
In the above pattern, things are roughly organized in a network hierarchy. This just seems intuitive to me, but perhaps others feel the same way too.
schema: friendly-name/user
examples:
- production-db/batch_user
- dev-db/nick
- stock-prices-ftp/ftp_user
- monitoring/root
In this pattern, every access point just gets a friendly name and then the user. The friendly name could refer to a database, FTP, or anything really. You’d query the details of how to access a given resource by looking up the same friendly name in a configuration service like Consul.
Do you use either of these patterns for organizing your secrets, or perhaps something else? More importantly, why do you use the pattern that you use?
I’m just starting out with Vault, so I don’t have the experience of using it with hundreds of resources over many months to know what is gonna work better.
Nick
Thanks Clay. That’s a good mental exercise to go through to test out any proposed schema: What will I think of this schema when it’s pushed to the limit?
As a good as an exercise as that is, however, my mental abilities are limited. I’d prefer to complement any mental design exercise I do with examples from people who have had experience using Vault.
Every person will have their own answers for these questions/situations so it’s tough to recommend a particular solution. If you have more specific questions, though…
Let me rephrase my original question, in case it helps elicit some examples from people: I’m not asking for a recommendation for what I should do. :) I’m asking what others have done and why it worked for them. It may or may not apply in my case, but I can determine that on my own. The examples that people share, however, can be useful as a resource that Vault newbies can review when first getting up to speed. Does that make sense?
Paths are open ended. The HashiCorp docs say that we "should decide on the naming convention that makes most sense".
The workflow for a path naming convention probably looks like the diagram below, except that you only get to do it once or twice, at the start of setting up Vault.
Replace the word "policy" with "path naming convention":

That said, what makes sense is likely a combination of design to invariants (paths should change less), and the fact that the path & key names should not reveal especially sensitive information.
team1policy.hcl policy access to a shallow-depth secrets/db/a_mysqlpass may be better than giving a simple team1policy.hcl access to path secrets/team1/db/a_mysqlpass. However, this is just a trivial example. Actual use will all depend on the security model and how the organization changes who has access to what.Path Examples:
Example path names (Used by examples in HashiCorp docs)
secret/dev/config/mongodb
Example naming conventions (Used by examples in HashiCorp docs)
secret/<OWNER>/apikey/<APP> for API keys
secret/eng/apikey/Google
secret/<ENVIRONMENT>/cert/<SYSTEM>
To store the root certificate for production MySQL, the path becomes
secret/prod/cert/mysql
To store the root certificate for Staging PostGRES, the path becomes
secret/staging/cert/postgres
Example naming convention (made up)
secret/<PRODUCT>/<ENVIRONMENT>/<TYPE>/<SYSTEM>
Where type is something like apikey or cert
secret/cart/dev/apikey/Azure
Example path names (Made up)
secret/db/mysql
secret/db/mysql/pass
secret/team1/db/mysql
secret/product/
secret/cart
Example naming convention (Used by PIPES)
secret/db/<project>/<secretnames>
secret/<project>/<secretnames>
Example naming convention (Used by Infinum)
#<technology>/#<git_repo_name>/#<environment>
rails/#<git_repo_name>/#<environment>
rails/awesome-app/#<environment>
rails/awesome-app/production
You received this message because you are subscribed to a topic in the Google Groups "Vault" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vault-tool/poPIzKtDOEY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vault-tool+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vault-tool/db480101-401b-42b7-a274-a3f36858f9f2%40googlegroups.com.