mirror of
https://github.com/fosrl/pangolin.git
synced 2026-05-22 17:43:04 -05:00
[GH-ISSUE #615] What about getting client public IPs? #18616
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @chris-coria on GitHub (Apr 29, 2025).
Original GitHub issue: https://github.com/fosrl/pangolin/issues/615
By default, pangolin is using this network:
So it means it is behind Docker NAT, and thus, Pangolin cannot get real IP because it is using network's default gateway.
The only solution is by exposing Gerbil to
network_mode: hostbut doing so, Docker hostnames won't be available. But, if you change things like--reachableAt,--remoteConfigor--reportBandwidthTo, it won't work and show a HTTP Bad Gateway error in the Pangolin dashboard.So, how to achieve this in order to log in the Traefik's
access.logthe real IP? Things like Traefik's plugins to achieve this won't work as I described, it is behind Docker NAT. And "mode: host" in "ports" won't work for docker compose files.This is the docker-compose.yml I am trying to modify:
And this is the config.yml file:
@TuncTaylan commented on GitHub (Apr 29, 2025):
Could you please elaborate why you need this or what doesn’t work?
Pangolin is reachable with the public ip of the host via the ports 443.
@chris-coria commented on GitHub (Apr 29, 2025):
I not mean Pangolin is not reachable, I mean getting the real IP of the client is not working due to "bridge" network. Docker NATs the requests and due so, crowdsec will NOT work because ALL THE TRAFFIC IPs is "coming" from the Pangolin's network gateway.
So if anyone does something tricky, crowdsec will ban the Pangolin's docker network gateway and not the real IP of the attacker. Do I mean?
You could see by mounting
- ./config/logs/:/var/log/traefik/in traefik's volumes and enableaccessLogin the traefik static file:Use the default pangolin manual installation guide and you'll see.
@TuncTaylan commented on GitHub (Apr 30, 2025):
I'm still having difficulties with understanding you, of what client are you talking about?
I have the stack pangolin + crowdsec and it sees the real IPs of the attackers and blocks them:
@chris-coria commented on GitHub (Apr 30, 2025):
Then I don't understand why in my Traefik's access log it is showing the Pangolin docker network instead of real IP. Here is my debug:
You can see the docker network inspect, the default gateway is taken IP.
@parsoli commented on GitHub (Apr 30, 2025):
Hey, I see where the OP is coming from. I don't have a fancy Crowdsec GUI either. How did you get that? I do have Crowdsec working but even with Grafana and Prometheus, I only see the docker networks IP address as SOURCE, not the public IP's of the persons accessing resources....I'd love to know more
@chris-coria commented on GitHub (Apr 30, 2025):
Glad to know i'm not the only one with that problem. The GUI he is using is Crowdsec.net dashboard. You need to enroll your instance there. Free plans only allow you to record 500 alerts.
@parsoli commented on GitHub (Apr 30, 2025):
Yea, I haven't been able to run cscli commands. Say's "FATA[2025-04-30T22:45:58Z] while reading yaml file: open /etc/crowdsec/config.yaml: no such file or directory". There is no crowdsec folder in etc. It's all buried where I installed docker from under /home/docker. Have had to tweak things to work overall.
@github-actions[bot] commented on GitHub (May 15, 2025):
This issue has been automatically marked as stale due to 14 days of inactivity. It will be closed in 14 days if no further activity occurs.
@sorcer1122 commented on GitHub (May 17, 2025):
I am having exactly the same problem - I cannot see real IPs of the clients trying to access my pangolin instance, so there is no way to limit pangolin to say only certain IP addresses due to Docker NAT. Having 2FA is great but it would be even better to have an option to limit access to pangolin from say one or two IPs only.
@dpurnam commented on GitHub (May 26, 2025):
For now, I just run it in HOST Docker Network Mode. I'm yet to setup crowdsec, though.
Also in this setup, the IP Based Bypass Rules for Resources don't work.
@github-actions[bot] commented on GitHub (Jun 10, 2025):
This issue has been automatically marked as stale due to 14 days of inactivity. It will be closed in 14 days if no further activity occurs.
@github-actions[bot] commented on GitHub (Jun 24, 2025):
This issue has been automatically closed due to inactivity. If you believe this is still relevant, please open a new issue with up-to-date information.