-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Description
Feature: Increase the flexibility of the whitelisting
The current whitelisting acts as a strict gate to incoming traffic. The authentication is also used as a strict gate. To gain access you have to meet both criteria and there is no mechanism to support meeting either.
Whilst it may be too late to change this naming now it would appear to the current functionality is more of a greylist than a whitelist since the requests get challenged again.
The feature behaviour would be have two groups of access lists, one that does indeed whitelist the traffic and hence allow it straight through, and a second which allows the traffic through to the next level of checking.
For the simple case of no auth the two lists would be essentially the same. And if no lists are set the auth would continue to be the decider.
There is no obvious need for the blacklist variant since this can be better achieved using a normal firewall.
What did you do?
Using the docker image traefik:1.4 enable both authentication and whitelisting for entrypoints:
[entryPoints]
[entryPoints.http]
address = ":80"
whiteListSourceRange = [ "x.x.x.x" ]
[entryPoints.http.auth.basic]
usersFile = "/etc/htpasswd"What did you expect to see?
Requests that failed the IP address check would trigger the basic authentication instead.
What did you see instead?
- Requests that failed the IP address check where blocked immediately.
- Requests that met the IP address check had to meet the basic authentication criteria
Output of traefik version: (What version of Traefik are you using?)
Version: v1.4.0-rc5
Codename: roquefort
Go version: go1.9.1
Built: 2017-10-10_02:04:46PM
OS/Arch: linux/amd64
Additional notes
There is a secondary part to this which is that when you are using the docker container the incoming IP address may be that of the docker host, not the original requesting host. This is certainly the case if you are working with a swarm because then the traefik container must be on an internal network. Ideally the checks would be against the originating IP address.