-
Notifications
You must be signed in to change notification settings - Fork 690
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
Reject TLS secrets with certificate that has no CN or SANs #1965
Comments
I will be interested to know the use case why these fields will be empty. |
Clearly there isn't a use case, but it should not be possible to break Contour for the entire cluster just by creating one bad Ingress and Secret. |
On Nov 29, 2019, at 8:24 PM, Keith Burdis <[email protected]> wrote:
Envoy crashes when processing a TLS certificate that does not have a CN field in the Subject or SubjectAltNames.
Is there an envoy issue for this crash?
|
I couldn't find one so I raised envoyproxy/envoy#9182 |
Thanks @erwbgy |
I'm working on this now. The specific fix is straight forward but opens a lot of other questions about what other kinds of certificates will envoy reject. Obviously we'll fix this specific issue quick smart, but the yakity-sax whack-a-mole song is starting to grow in volume |
On Dec 3, 2019, at 6:10 PM, Dave Cheney <[email protected]> wrote:
I'm working on this now. The specific fix is straight forward but opens a lot of other questions about what other kinds of certificates will envoy reject. Obviously we'll fix this specific issue quick smart, but the yakity-sax whack-a-mole song is starting to grow in volume
Are you also going to validate the certificate chain? What about ensuring it the certificate matches the vhost name?
|
I'm classifying this class of problems into three groups a. crashes envoy At the moment, I'm prioritising a and b, the list of possible validation failures feels large enough. |
On Dec 3, 2019, at 7:25 PM, Dave Cheney <[email protected]> wrote:
Are you also going to validate the certificate chain? What about ensuring it the certificate matches the vhost name?
I'm classifying this class of problems into three groups
a. crashes envoy
b. doesn't crash envoy but will block updates if envoy NACKs a discovery response
c. valid configuration with nonsense values; a cert that doesn't match a signing chain.
At the moment, I'm prioritising a and b, the list of possible validation failures feels large enough.
(B) and (C) make sense to me, but for (A), my preference is to fix envoy. This issue has been there for ever AFAIK, so I don’t think there’s any urgency.
|
Fixes projectcontour#1965 During cache insertion reject certificates which lack a Subject CommonName (CN) or SubjectAltName extension. This PR uncovered that, well basically, all our TLS fixtures don't fit this requirement which is extra sadface and thus this PR contains replacement fixtures for all the previous ones. This PR also adds a unit test for dag.isValidSecret as we are likely to continue to add to this function as further validation edge cases are uncovered. This necessitated a small addition to the internal/assert comparator logic to be able to compare error values. Signed-off-by: Dave Cheney <[email protected]>
Fixes projectcontour#1965 During cache insertion reject certificates which lack a Subject CommonName (CN) or SubjectAltName extension. This PR uncovered that, well basically, all our TLS fixtures don't fit this requirement which is extra sadface and thus this PR contains replacement fixtures for all the previous ones. This PR also adds a unit test for dag.isValidSecret as we are likely to continue to add to this function as further validation edge cases are uncovered. This necessitated a small addition to the internal/assert comparator logic to be able to compare error values. Signed-off-by: Dave Cheney <[email protected]>
I don't want to have to explain to cluster admins that a user can crash their envoy process by creating a secret without a common name. |
Fixes projectcontour#1965 During cache insertion reject certificates which lack a Subject CommonName (CN) or SubjectAltName extension. This PR uncovered that, well basically, all our TLS fixtures don't fit this requirement which is extra sadface and thus this PR contains replacement fixtures for all the previous ones. This PR also adds a unit test for dag.isValidSecret as we are likely to continue to add to this function as further validation edge cases are uncovered. This necessitated a small addition to the internal/assert comparator logic to be able to compare error values. Signed-off-by: Dave Cheney <[email protected]>
Fixes #1965 During cache insertion reject certificates which lack a Subject CommonName (CN) or SubjectAltName extension. This PR uncovered that, well basically, all our TLS fixtures don't fit this requirement which is extra sadface and thus this PR contains replacement fixtures for all the previous ones. This PR also adds a unit test for dag.isValidSecret as we are likely to continue to add to this function as further validation edge cases are uncovered. This necessitated a small addition to the internal/assert comparator logic to be able to compare error values. Signed-off-by: Dave Cheney <[email protected]>
Envoy crashes when processing a TLS certificate that does not have SubjectAltNames or a CN field in the Subject.
Create a key, certificate and TLS Secret and then an Ingress that uses this Secret:
The envoy Pod logs show an assertion failure:
and stay in CrashLoopBackOff until the offending Ingress is removed.
The text was updated successfully, but these errors were encountered: