-
Notifications
You must be signed in to change notification settings - Fork 8.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
Re-Enable Secure Upstream Annotation #3287
Conversation
/hold |
977f055
to
8fdd346
Compare
06ff842
to
28da226
Compare
@diazjf please rebase to fix the e2e issue |
28da226
to
c9e1c18
Compare
/hold remove |
/hold cancel |
/assign @aledbf |
c9e1c18
to
42c0858
Compare
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: diazjf If they are not already assigned, you can assign the PR to them by writing The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
71c70b6
to
9ce30cb
Compare
@aledbf updated the tests. This one should be good to go. |
@diazjf please add a request and assertion/s to make sure the certificate is being used |
/hold |
@aledbf since the certificate is being verified against a service, will I need to create a service which uses a particular CA or do we have that available? |
2ec220c
to
6815bb2
Compare
/hold remove |
/hold cancel |
Set("Host", host). | ||
End() | ||
Expect(len(errs)).Should(BeNumerically("==", 0)) | ||
for _, pc := range resp.TLS.PeerCertificates { |
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.
@aledbf is this what you had in mind?
e79bc5c
to
8696e74
Compare
@aledbf @ElvinEfendi Ready for review. |
|
||
annotations := map[string]string{ | ||
"nginx.ingress.kubernetes.io/backend-protocol": "HTTPS", | ||
"nginx.ingress.kubernetes.io/secure-verify-ca-secret": host, |
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 secret host
is used for communication between client and ingress-nginx, can you use another secret here to make it realistic? (I actually expect the test to fail when you use a different secret, because the secret won't be available in the pod)
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.
@ElvinEfendi updated the PR with your suggestions, however I'm not sure how to check that the certificate is being proxied by NGINX. I have the tests just make sure that the configuration is generated, and we trust nginx to pass it to the upstream.
Can you add some docs? How does this work, should the user first create secret and manually mount it to ingress-nginx pods first and then configure annotation to refer to that secret? FWIW we use:
|
Sure I can add some docs as well as |
Renables the secure-verify-ca-secret annotation. This annotation allows a CA to be verified against a service. Also adds e2e tests.
8696e74
to
4c8f862
Compare
/assign @ElvinEfendi |
annotations: | ||
# Create the secret containing the trusted ca certificates | ||
nginx.ingress.kubernetes.io/secure-verify-ca-secret: "ca-secret" | ||
# Setup the backend protocol, must be either "HTTPS" or "GRPC". |
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.
Should this not be GRPCS instead of GRPC?
paths: | ||
- backend: | ||
serviceName: http-svc:80 | ||
servicePort: 80 |
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.
80? not 443?
|
||
f.WaitForNginxServer(host, | ||
func(server string) bool { | ||
return strings.Contains(server, proxySslTrustedCertificate) && strings.Contains(server, proxySslVerify) && strings.Contains(server, proxySslVerifyDepth) |
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.
please break this into multiple lines
f.WaitForNginxServer(host, | ||
func(server string) bool { | ||
return strings.Contains(server, proxySslTrustedCertificate) && strings.Contains(server, proxySslVerify) && strings.Contains(server, proxySslVerifyDepth) | ||
}) |
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.
can we also send a request and assert that it is successfully proxied all the way to the echo server?
Renables the secure-verify-ca-secret annotation. This annotation allows a CA to be verified against a service. Also adds e2e tests.