-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vault ignores the tls_ca_file
value inside of the storage/consul
config block
#6602
Comments
For anybody that hits a similar snag, adding the CA's cert to the system CA store seems to work. It's not the best idea to mingle the CAs cert the system CA (depending on your security model/posture...) but i was able to unblock myself using this quick guide. |
Thanks for submitting the issue! I’ve looked at the code and I believe I’ve found a way to get your configuration working correctly. The consul stanza in the configuration requires “scheme” to be set to “https” before it will look at the TLS settings. See https://www.vaultproject.io/docs/configuration/storage/consul.html#scheme If you change your configuration to
you should see better behavior; the TLS options will be applied. I’ll look into whether we should make a change to parse the address for a protocol type; it seems like the Consul client library accepts a whole URL, even though our configuration handling did not expect it. Please follow up with me if you have any further concerns. Mark |
@mgritter thanks for getting back to me! I'll spin my lab back up and give it a shot... If my vote counts for anything, i'd strongly encourage parsing to determine the protocol as:
But i would totally settle for a "hey... you specified a protocol where only a host should go. Here's a hint: see the docs pertaining to As for the |
Thanks for the suggestions, @karl-tpio. The |
@mgritter Thanks for your message about the I agree with @karl-tpio that parsing the address for a scheme would be intuitive, especially because this is the route I went configuring and debugging Vault:
The main confusion is that adding the scheme to the I think the logical behaviour would either be to:
|
I have two bugs, i think. I discovered the second one while trying to resolve the first. The second bug seems to be "smaller" so i'll lead with it
Bug the second:
The documents for the storage/consul portion indicate that
tls_skip_verify
is of typeBOOL
but this does not appear to be the case.See the
vault.hcl
file that configures the vault server for the details.The problem
When i follow the docs and use a
BOOL
value fortls_skip_verify
i get anunknown type for string
error.And when you take the error literally and treat
tls_skip_verify
as aSTRING
, the failure to parse error is not present on startup:It would seem that #1559 is related.
The
certificate signed by unknown authority
error is the "first" bug that got me started on this whole journey.Bug the first
I am using the
pki
backend in vault to generate certificates for hosts internally.The consul server that is hosted at
bootstrap.my-corp.tld
uses one of these certificates.I am using
consul-template
to fetch the CA from vault and thevault.hcl
file does havetls_ca_file
pointing to the correctca.pem
on disk.I can verify that the
/etc/vault.d/tls/ca.pem
file works withcUrl
:And when i omit the
--cacert ./tls/ca.pem
argument:clearly the certificate being offered up by
https://bootstrap.my-corp.tld:8501/v1/kv/vault/core/migration
is trusted when the tool accessing the URL is told to use the/etc/vault.d/tls/ca.pem
file.When using the default system CAs, the certificate offered up by that URL is not trusted.
The problem
The problem is that vault does not respect the
tls_ca_file
setting inside of thestorage "consul"
block.When i use the
tls_ca_file = "/etc/vault.d/tls/ca.pem"
setting, i still get the"storage migration check error: x509: certificate signed by unknown authority"
error.When i point the
tls_ca_file
directive to a file that is not present on disk (bonkers.pem
), i get no startup exception saying that the file could not be found. This leads me to believe that the value is ignored.Here's my
vault.hcl
file:I can share the
vault.service
systemd file if that's something you'd want to seeAnd my system info, too:
The text was updated successfully, but these errors were encountered: