-
Notifications
You must be signed in to change notification settings - Fork 49
Description
After deploying Thruster to production, some of our customers (most likely behind a corporate VPN or other setup) started seeing our HTTP ERROR 500 page.
Our error tracking software gave us this error (IP addresses changed)
ActionDispatch::RemoteIp::IpSpoofAttackError: IP spoofing attack?! HTTP_CLIENT_IP="5.6.7.8" HTTP_X_FORWARDED_FOR="1.2.3.4"
Before using Thruster, I was using a simple nginx container in front with minimal config that never had this issue
https://github.com/SteveLTN/https-portal
I like using Thruster, because I just add a gem, and instead I can remove 1 Docker container.
We are using docker-compose.yml, these are the relevant parts:
services:
app: &app_base
volumes:
- thruster:/rails/storage/thruster
environment:
- FORWARD_HEADERS=0
volumes:
app-postgres:
thruster:
I added the FORWARD_HEADERS=0 but that did not solve my spoofing issue.
This is probably not Thruster specific issue, but any suggestions or ideas would be welcome.
Maybe Thruster needs another ENV var to remove the HTTP_CLIENT_IP if that conflict is causing this?
This is how I reproduced the issue:
curl -i https://app.mydomain.com/ \
-H 'X-Forwarded-For: 1.2.3.4' \
-H 'Client-IP: 5.6.7.8'