DescriptionThe current authentication model works OK when communicating directly with JILS.
However, if the JILS server is behind a reverse proxy, it's not currently possible to identify whether the originating IP is authorised or not.
Most reverse proxies will set an X-Forwarded-For header, however we cannot simply rely on that as a malicious client could simply send a request with a known authorised IP in that header.
So, we need an extra configuration parameter to list known authorised reverse proxies. If the connection has come from one of those IP's the source IP should be extracted from X-Forwarded-For and authentication performed based on that.
This makes a couple of assumptions which must be true in order for the planned model to work
- Downstream Proxy will always set X-Forwarded-For
- Downstream Proxy will pass through the client's User-Agent
If either of those is untrue then the planned model won't work (or will give unexpected results). They don't seem like unreasonable constraints though.
Activity
2015-11-06 12:34:57
2015-11-06 12:46:13
Edit:
Earlier commit message referenced the wrong issue. Tit.
Webhook User-Agent
View Commit
Not sure where I got LAN-37 from, that's ages old and not in anyway related (facepalm)
2015-11-06 13:10:40
Tested direct from an authorised host, and there's no change in behaviour there.
Via Unauthorised Proxy
Gives a 302 as expected
With an authorised UA
Gives a 302 as expected
Via Authorised Proxy
Gives a 302 as expected
With an authorised UA
Gives the document content as expected
Unauthorised Host pretending to be proxy
From an unauthorised host, tried spoofing the X-Forwarded for header and going direct to the origin
Got a 302 as expected
Looks good to me
2015-11-06 13:12:56
2015-11-06 13:13:15
2015-11-06 13:14:04
Webhook User-Agent
View Commit
2015-11-06 13:22:42
2015-11-06 14:59:59
2015-11-06 15:05:43
2015-11-06 15:05:57
Webhook User-Agent
View Commit
2015-11-06 15:53:05
2015-11-06 15:53:05
2015-11-06 15:53:05
2015-11-06 15:53:54
2016-04-29 14:54:08
2016-04-29 14:54:08
2016-04-29 14:54:08
2016-04-29 14:55:34
2016-04-29 14:55:35
2016-04-29 14:55:35
2016-04-29 15:05:17
2016-04-29 15:05:17
2016-04-29 15:05:17
2016-04-29 15:05:22