-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Fix a handful of auto encrypt issues #8211
Conversation
mkeeler
commented
Jun 30, 2020
•
edited
Loading
edited
- Ensure that the original auto encrypt CSR contains the DNS and IP SANs from the configuration
- Initialize State of the agent leaf cert cache fetch result to prevent always issuing a second certificate signing RPC to the servers
- Move the connect CA signing rate limiter to the Server so that it can be shared with auto-encrypt and the main certificate signing RPC endpoints.
- Overwrite the agent leaf certificate trust domain on the servers. This ensures that the first certificate sent back is "correct" and has the correct trust domain instead of the dummy one.
- Fixed a bug where Consul would segfault if no client TLS certificate was available when initiating a connection.
87d08cf
to
8ab34e5
Compare
The initial auto encrypt CSR wasn’t containing the user supplied IP and DNS SANs. This fixes that. Also We were configuring a default :: IP SAN. This should be ::1 instead and was fixed.
…nnecessary second certificate signing
This fixes a bug where auto_encrypt was operating without utilizing a common rate limiter.
8ab34e5
to
2ddcba0
Compare
Also fix a bug where Consul could segfault if TLS was enabled but no client certificate was provided. How no one has reported this as a problem I am not sure.
137efbd
to
6e7acfa
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Played around with auto_encrypt a bit locally after going over the code with you, and everything worked as expected. Nice finds all around. 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, left a comment.
@@ -480,6 +428,30 @@ func (s *ConnectCA) Sign( | |||
return fmt.Errorf("SPIFFE ID in CSR from a different trust domain: %s, "+ | |||
"we are %s", serviceID.Host, signingID.Host()) | |||
} | |||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could also live in the AutoEncrypt.Sign endpoint, then we wouldn't have to check the cert type. And it would only fix it for the first time when we are starting an agent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we should enforce the trustdomain for agent certs too, after it was fixed once.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason why it cannot go there easily is that we would have to move out all the CSR and URI parsing too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
🍒✅ Cherry pick of commit f8e8f48 onto |