Secret Management with Vault
At my employer we considered Vault.  It&#x27;s easily the best-in-class right now for free vaulting of credentials but it&#x27;s missing a number of features and I disagree with a few implementation details...<p>Firstly, it doesn&#x27;t actually <i>manage</i> credentials for you (other than with AWS, a bunch of databases, and a few other things).  It&#x27;s not going out and logging into your 10s of thousands of Linux hosts making sure all the root passwords are vaulted, unique, and must be checked out before use.  This is where products like CyberArk&#x27;s come in (we use CyberArk and it&#x27;s crap to be honest; it doesn&#x27;t scale, its API is broken--REALLY broken--and its architecture is some of the worst junk I&#x27;ve seen in years and that&#x27;s just scratching the surface of how bad it is!).<p>Another problem with Vault is that it exposes too much information about the secrets via their URL&#x2F;path.  This is a <i>very</i> minor concern of mine and probably shouldn&#x27;t impact your decision to use the product but here&#x27;s what I&#x27;m talking about:  The article author says that they&#x27;re going to use this model for their paths:<p><pre><code>    http:&#x2F;&#x2F;&lt;vault&gt;&#x2F;secret&#x2F;ENVIRONMENT&#x2F;APP&#x2F;KEY
</code></pre>
Here&#x27;s my problem with this: If any configuration information is ever exposed an attacker will know that this application is part of ENVIRONMENT and has access to the keys for APP.  If the host or container running this application were compromised this isn&#x27;t really of concern since the attacker will probably be able to figure these things out anyway but my concern has more to do with configuration management systems.  It&#x27;s easy to imagine the ability to map out who-has-access-to-what in the vault just by examining their configurations.<p>It&#x27;s the difference between a config file with this:<p><pre><code>    &quot;secret_url&quot;: &quot;http:&#x2F;&#x2F;&lt;vault&gt;&#x2F;v1&#x2F;secret&#x2F;ENVIRONMENT&#x2F;APP&#x2F;KEY&quot;,
    &quot;certificate&quot;: &quot;&#x2F;path&#x2F;to&#x2F;vault&#x2F;client_cert.pem&quot;
</code></pre>
...and this, my preferred way (I split the vault_url and secret below just to save space since indented lines don&#x27;t get wrapped on HN):<p><pre><code>    &quot;secret&quot;: &quot;2a9ac85d-f6f1-4ef5-8d36-65331708623a&quot;,
    &quot;vault_url&quot;: &quot;https:&#x2F;&#x2F;&lt;vault&gt;&#x2F;api&#x2F;v1&#x2F;secret&#x2F;{secret}&quot;,
    &quot;credential&quot;: &quot;whatever&quot; &#x2F;&#x2F; I&#x27;d support multiple auth options
</code></pre>
The latter doesn&#x27;t give an attacker much info at all about what that credential is.  Even if they&#x27;re able to retrieve it all they&#x27;ll get back is, &quot;&lt;the secret&gt;&quot;.  &quot;Great, now what do I do with this?&quot;<p>How I would do things different:<p>* Secrets may only be accessed via their unique (e.g. UUID) object identifier.  This means that if you want the credential for ENVIRONMENT and APP you <i>must</i> have the object ID.  It cannot be inferred by the path.<p>* Access to credentials will be controlled via attributes (extra keys&#x2F;values attached to the same record as the secrets).  This is <i>mostly</i> standard attribute-based access control (ABAC) with one exception...<p>* Attributes can exist in namespaces that are controlled via independent groups.  So you can imagine an internal team controlling namespace FOO and attaching `{&quot;foo.admin&quot;:[&#x27;userx&#x27;]}` to the secret record for X.  So if the FOO team wants to grant admin access to their app they can add a user (aka a <i>subject</i>) to their little &quot;foo.admin&quot; attribute on that particular secret.  The point being that the FOO team doesn&#x27;t need to open a ticket with the <i>one true attribute authority</i> (i.e. traditional ABAC) they can make the change themselves; the whole thing would be entirely self-service.  There&#x27;s zillions of ways to handle namespaced attributes like this but I personally prefer to just stick them right in the secret record itself and control access at the application layer.<p>At my current employer I&#x27;ve been tasked with writing a vaulting <i>and management</i> application from scratch because nothing in the market will suit our needs.  We (me specifically) tried <i>really</i> hard to avoid this situation but it seems that nothing that exists currently can do everything.  Most notably:<p><pre><code>    1. Sane architecture (i.e. something that doesn&#x27;t send all its
       logs to the same database as the secrets and doesn&#x27;t run on
       Windows, gahh!  Among other things)
    2. Secure vaulting of secrets (aka &quot;dumb vault&quot;)
    3. Can *manage* credentials for various platforms
    4. Provides a user interface for &quot;checking out&quot; secrets
</code></pre>
Hashicorp Vault does a great job with #1 and #2 but it doesn&#x27;t do #3 or #4.  We had initially planned to use it as a &quot;dumb back end&quot; for a custom system but it didn&#x27;t work out for reasons that have nothing to do with faults in the product.  That just isn&#x27;t really what it was meant for.<p>For reference, here&#x27;s some of the problems we had with Vault that most won&#x27;t run into:<p><pre><code>    * Uses its own Certificate Authority (my employer only allows
      *one true authority*, sigh).
    * Written in Go which isn&#x27;t approved.
</code></pre>
There were others as well but they were mostly bureaucratic.<p>Note:  In theory Hashicorp&#x27;s Vault <i>can</i> do full credential management for anything but at this point in time it does not support writing your own custom back-ends.  That feature is <i>essential</i> for managing zillions of disparate and possibly <i>proprietary</i> systems.  For example, say you wanted to manage admin&#x2F;root credentials for all Unix-like OSes at your company.  All you&#x27;d need is a generic SSH back-end that can be scripted (e.g. expect or state machine scripts like CyberArk).  Why they haven&#x27;t added this is beyond me.<p>The vault we&#x27;re writing at my employer is actually pretty damned awesome and innovative.  I wish I could share more about it but I can&#x27;t.  I&#x27;m pushing to make it open source but that probably won&#x27;t happen.