I'm going against a wall with using ipAllowList for my internal services. It's easy enough to setup in the simplest case, but adding in Cloudflare DNS Proxy and Tailscale, it's becoming a massive headache that I couldn't figure out.
Here's my journey so far.
First, adding forwardedHeaders.trustedIPs to entry points has nothing to do with ipAllowList. It is still necessary for accesslog to get the correct IP for Crowdsec.
Case 1: Just CF Proxy
Add ipstrategy.depth = 1 and add WAN IP to sourceRange will work, but all local traffic is now routed through CF proxy
Case 2: CF Proxy + local DNS
For devices using local DNS has to remove ipstrategy.depth = 1
For devices using manually assigned DNS, has to have ipstrategy.depth = 1
to try to solve this conflict, I got this Plugin to work and successfully got correct X-Real-Ip, but ipAllowList does seems to use X-Real-Ip at all. Is there a better solution?
Case 3 remote via tailscale + CF Proxy + magic DNS + split DNS + realip plug in
My TS client is via docker on the same network as Traefik, and I got below header
X-Forwarded-For: 172.18.0.1
X-Forwarded-Host: whoami.domain.com
X-Forwarded-Port: 443
X-Forwarded-Proto: https
X-Real-Ip: 172.18.0.1
172.18.0.1 is the docker traefik network IP. I think this will change over time, and I don't know enough about docker to tell if its a good idea to whitelist this IP and what range it might change into?