-
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
acme-challenge blocked with 403 when auth-tls-match-cn is being used #10185
Comments
/assign @rikatz |
Ok, so taking a look here, the issue is An alternative you have is to set it as When cert auth is enabled, the var https://nginx.org/en/docs/http/ngx_http_ssl_module.html#var_ssl_client_verify is passed to the backend (see https://github.com/kubernetes/ingress-nginx/blob/main/rootfs/etc/nginx/template/nginx.tmpl#L1180) so you can turn it optional, but on your backends deny the authentication. We can set on the template a validation enforcement or a new type of validation called So, my suggestion right now is to turn it optional and validate on backend, if this is possible |
Hi,
I will check back with our backend DEVs and see if that can be easily done. But it is vacation time, so might take a while :-). Will post later how we decided to go on. Thanks! |
This is stale, but we won't close it automatically, just bare in mind the maintainers may be busy with other tasks and will reach your issue ASAP. If you have any question or request to prioritize this, please reach |
We got the same problem, is there any information if this will be fixed? Maybe by reordering in the nginx template? When having a |
@strongjz Would a change like this be accepted? It would be really great if this issue could be fixed.
ingress-nginx/rootfs/etc/nginx/template/nginx.tmpl Lines 986 to 992 in dc999d8
|
Hi The fix for this issue was reverted in 11082 Is it possible to reopen as the issue is still present in the current release. |
What happened:
When using cert-manager to get an SSL cert in an ingress that also verifies the client with a client ssl cert and also uses auth-tls-match-cn the acme-challenge is blocked with a 403.
This does NOT happen when you do not use auth-tls-match-cn!
cert-manager(acme challenge ingress) + mTLS client auth = OK
cert-manager(acme challenge ingress) + mTLS client auth + auth-tls-match-cn = NOK
What you expected to happen:
The location
/.well-known/acme-challenge/redacted/
should not be blocked as 403, so the challenge could be answered even when the auth-tls-match-cn is set in the ingress.What do you think went wrong?
When looking at the configuration that is being produced I see:
pretty early in the server section.
More detail:
NGINX Ingress controller version (exec into the pod and run nginx-ingress-controller --version.):
NGINX Ingress controller
Release: v1.5.1
Build: d003aae
Repository: https://github.com/kubernetes/ingress-nginx
nginx version: nginx/1.21.6
Kubernetes version (use
kubectl version
):$ kubectl version
Client Version: version.Info{Major:"1", Minor:"25", GitVersion:"v1.25.10", GitCommit:"e770bdbb87cccdc2daa790ecd69f40cf4df3cc9d", GitTreeState:"clean", BuildDate:"2023-05-17T14:12:20Z", GoVersion:"go1.19.9", Compiler:"gc", Platform:"linux/amd64"}
Kustomize Version: v4.5.7
Server Version: version.Info{Major:"1", Minor:"25+", GitVersion:"v1.25.10-eks-c12679a", GitCommit:"bbfa7e393476eb418f98a8c785721a006ba830cd", GitTreeState:"clean", BuildDate:"2023-05-22T20:31:17Z", GoVersion:"go1.19.9", Compiler:"gc", Platform:"linux/amd64"}
Environment:
Cloud provider or hardware configuration: AWS (EKS)
OS (e.g. from /etc/os-release): AMI 1.25.9-20230607
Kernel (e.g.
uname -a
): 5.10.179-168.710.amzn2.x86_64Install tools: helm (version.BuildInfo{Version:"v3.12.0", GitCommit:"c9f554d75773799f72ceef38c51210f1842a1dea", GitTreeState:"clean", GoVersion:"go1.20.3"})
How was the ingress-nginx-controller installed:
How to reproduce this issue:
Create an application with an ingress that will get an SSL cert from any ACME provider (lets encrypt staging) and additionally activate client ssl cert authentication with CN checking.
Anything else we need to know:
https://github.com/kubernetes/ingress-nginx/blob/helm-chart-4.4.0/rootfs/etc/nginx/template/nginx.tmpl#L961 is producing the CN checking line in the nginx config file. This needs to be smartened to not kill acme challenge pod locations.
As a test take out the CN checking (you will get your cert!).
Caveat: When you need to retest, you might need to use a different URL because once you succeeded, cert-manager will take the cert from the local cache!
The text was updated successfully, but these errors were encountered: