we recently migrated our Spring Boot (2.2 & 2.4) services to a new Kubernetes cluster (EKS). We have Traefik running as a reverse proxy with a public facing load balancer attached to it.
Since our migration the Spring services don't accept the X-Forwarded headers anymore. We triple checked the headers which are received by those services coming from the reverse proxy but spring just seems to ignore them and marking the HTTPServletRequest as insecure which basically breaks our system.
The following headers are sent from the proxy (User Agent and Sec-Fetch headers stripped) and received by our spring services.
Header: host=test.example.intern
Header: authorization=Bearer xxx
Header: referer=https://test.example.intern/profile
Header: x-forwarded-for=172.32.11.128
Header: x-forwarded-host=test.example.intern
Header: x-forwarded-port=443
Header: x-forwarded-proto=https
Header: x-forwarded-server=traefik-84794d75b9-p2q7z
Header: x-real-ip=172.32.11.128
Another "funny" thing is that if we swap the services using tools like telepresence and run the service locally it works even if the headers are the same. Same if we simulate the reverse proxies call, setting the X-Forwarded headers identical to those coming from the proxy it works.
We compared the config and sent headers from the same services running on our other k8s clusters on Google Cloud and Azure which are identical (besides the source ip's obv.).
The IP ranges of the cluster service and pod CIDRs are also set in the server.tomcat.remoteip.internal-proxies
setting. Another thing we tried without success is setting the server.forward-headers-strategy
to NATIVE.
Does anyone know what we possibly overlooked or could point us in the right direction here?
Thanks in advance, Rob