Enable validation of nginx.conf back in chroot mode#13098
Conversation
|
|
|
This issue is currently awaiting triage. If Ingress contributors determines this is a relevant issue, they will accept it by applying the The DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
Hi @sepich. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: sepich The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Signed-off-by: Alex R <i@sepa.spb.ru>
daa9ba0 to
61bd529
Compare
|
Please tell if I missing something in the CVE workflow. As the main part regarding "code execution in the context of the ingress-nginx controller" is actually code execution in the context of |
|
We won't accept this change for two reasons: There's way more to exploit than just secrets. The vulnerability gives unauthenticated users the possibility to execute any code. Accessing secrets is just an example. Even with the other CVEs fixed we can not safely enable the configuration check as there potentially still are other yet unknown vulnerabilities. So in the end chroot does not effectively solve this vulnerability and rather gives a wrong feeling of security as it also requires the pod to be executed with extendend privileges. |
|
Thank you for additional information!
Can we have working nginx.conf validation in this case? |
|
No, as the current validation implementation checks if the required secrets exist and therefore needs API access to them. chroot is not a security device, so I'd not consider the NGINX process isolated from the service account token. |
|
How about:
|
What this PR does / why we need it:
Due to CVE-2025-1974 validation of nginx.conf was disabled here:
#13070
Here is a more technical CVE description I was able to find:
ssl_engine load_moduledirective, causing NGINX to load the previously uploaded shared library/procfilesystem (in particular, by searching for it in/proc/*/fd/*)So to exploit it, attacker need no connect simultaneously to nginx and ingress-controller sharing the same FS. It works for
non-chrootmode, asnginxcan then access service-account token in Pod at/var/run/secrets.But that does not valid for
chrootimage, where nginx is running scoped to/chrootfolder in Pod, so cannot access/var/run/secretsabove. At time of Admission Webhook controller would callnginx -t:ingress-nginx/internal/ingress/controller/util.go
Line 145 in dcfa450
but in chroot image
nginxexecutable is actually a wrapper:ingress-nginx/rootfs/Dockerfile-chroot
Line 69 in 4038211
Which in turn would run
nginx -tscoped to the same/chroot.Validation of nginx.conf is very important in muti-team, multi-tenant clusters, where users learning k8s and often try to submit Ingress objects with errors. Currently that requires manual work to find out broken Ingress, fix it and communicate the problem.
Types of changes
Which issue/s this PR fixes
kubernetes/kubernetes#131009
How Has This Been Tested?
Unit tests are re-enabled back.
Also manual tests of resulting image in KIND by submitting invalid Ingress object.
Checklist: