thomseddon / traefik-forward-auth

Minimal forward authentication service that provides Google/OpenID oauth based login and authentication for the traefik reverse proxy
MIT License
2.18k stars 412 forks source link

Whitelist requester's IP CIDR #374

Closed IngwiePhoenix closed 6 months ago

IngwiePhoenix commented 6 months ago

Hello there!

I want to allow anyone from the local network to access all resources without authentication and only require it when accessing from outside. So, I would love to just whitelist my network's entire CIDR to forego the authentication when at home.

There is middleware chaining in Traefik as far as I know, but I am not aware of any "conditional middleware" (i.e. if $ip in 192.168.1.0/24 then next() else end()).

My use-case is with k3s/traefik - ServiceLB is configured and traffic policy is set to local on the LoadBalancer; so Traefik sees the actual IP.

Thanks and kind regards, Ingwie

AdriDevelopsThings commented 6 months ago

I gues you are search for this option: https://github.com/jordemort/traefik-forward-auth/blob/main/README.md?plain=1#L183