-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
TLS Handshake Issues when using Consul and Vault with Github Auth #700
Comments
Hi Bryant, Unfortunately I haven't come up with any great ideas since your posting on the mailing list. I guess your debugging didn't turn up anything useful? Can you try running
I want to make sure that there isn't some kind of strange DNS mapping somewhere. |
Hey Jeff- Thanks for the help. Nope, nothing abnormal DNS wise. This is what I'm seeing on Ubuntu...
|
@jefferai sorry for the repost, btw, it's just an unfortunate blocker. I can move to gossip based encryption on the consul node(s), but obviously that wouldn't be a long term solution. My debugging didn't turn up much at all, actually. Essentially, from what I have been able to learn, it appears that Vault is simply having Github attempt to connect directly to Consul to perform a write. Interestingly enough, this same thing occurs when you attempt to perform a READ operation from AWS. Example:
So this is unfortunately not a bug relegated to only the Github Auth plugin. This handshake error does make sense, if it is working the way I believe: Vault receives request --> AWS is contacted --> AWS tried to verify AWS credentials (likely) from Consul --> ERROR: NO TLS CERT. So my assumption is that the verify_incoming is causing the issue. What really needs to be happening, if this is indeed the issue, is that Vault needs to retrieve these values, and return them to whatever API endpoint it is attempting to hit, rather than redirecting the request to Consul. Then complete any write operations itself to Consul. I could be wrong about this, but this is my working theory as to what is going wrong currently. Thoughts? EDIT: should have mentioned, when using the http to consul protocol, it does work perfectly fine. |
I don't have any thoughts yet, but I'll dig into this more. Nothing should be redirecting any request to Consul, because no values stored in Consul are cleartext...there would be no way for any verification or lookup to succeed (that's kind of the point! :-) ) I was going to ask about whether this failed for you when using an unencrypted Consul connection. Knowing that scenario works helps nail it down. BTW, are you running a local Consul agent? If so, any reason you're connecting to a Consul server instead of simply connecting to the local agent and letting it select the right server? |
@brockoffdev I had a brainwave and found something that would affect only Consul, AWS, and GitHub -- looks quite promising. I will likely push this change to master anyways once I'm done with it and after running unit tests. I could send you an updated binary to try, or you could built at that point. |
This strips out http.DefaultClient everywhere I could immediately find it. Too many things use it and then modify it in incompatible ways. Fixes #700, I believe.
This strips out http.DefaultClient everywhere I could immediately find it. Too many things use it and then modify it in incompatible ways. Fixes #700, I believe.
@jefferai thanks so much for helping out with this! I'll check out the changes in the PR. As an update, your idea to run a consul agent directly on the Vault box did work with the local loopback. I'm curious how your update would work with my previous build; I'll give it a shot at some point in the next 24 hours. Thanks so much again. |
Basically, when using TLS the Consul API library makes some changes to the HTTP client it uses. Unfortunately, so does the GitHub library, and the AWS library...and it turns out they were all using the same client: the I'm pretty sure this is the fix... let me know how the PR works for you! |
Hey @jefferai my sincerest apologies for not getting back to you sooner. Crazy past few days, so I hadn't had the chance to test out the new binary for #702. That being said, I can confirm that the binary does seem to have fixed the issue! I disabled my local consul agent, and once again directed tls traffic from the vault server to a dedicated consul server, and both AWS and Github handshakes were appropriately handled. Great work! 👍 |
Nice! Glad to hear it. I'm in the process of going through HC's other projects and tearing out usage of Thanks for all the help reporting and debugging! |
@jefferai no problem, thanks so much for taking it on! |
So, I have a config that has Consul and Vault communicating with one another over TLS, having setup a Certificate Authority built for our app, which Vault utiliizes to handshake between it and Consul. Vault, itself, also has TLS enabled on incoming requests. Now, this system works flawlessly for token and TLS based authentication. However, for the ease of our developers, I would love to get Vault authentication working with Github Auth as well.
My problem is it appears that the TLS handshake is not actually happening between Vault and Consul when I utilize the Github Auth method...
....while Vault should be performing the handshake, it appears that Github may be trying to access Consul to verify information? This is problematic, as consul is set to verify a x509 certificate generated by my own CA. As such, Github is not able to retrieve the information I assume it needs, ?regarding "org"?, to verify the authentication.
Any ideas from the community?
My Consul Config and Vault Config Below:
_VAULT:_
_CONSUL:_
The text was updated successfully, but these errors were encountered: