Accept the proxy user header only from trusted addresses
In proxy mode, each client that reached the port could send the user header. PROXY_AUTH_TRUSTED_IPS now lists the addresses and networks that can send it. The default is the loopback and private addresses, so a request that comes straight from the internet cannot log in.
This commit is contained in:
@@ -64,6 +64,7 @@ Environment variables set the configuration. **Restart the container after a cha
|
||||
| `BINDERY_PASSWORD_HASH` | The password hash for `AUTH_METHOD=local`. See "Local login". | None |
|
||||
| `CWA_ALLOWED_USERS` | The CWA users that can log in. Empty allows every CWA user. | Empty |
|
||||
| `PROXY_AUTH_USER_HEADER` | The header in which a reverse proxy sends the user name | `X-Remote-User` |
|
||||
| `PROXY_AUTH_TRUSTED_IPS` | The addresses and networks that can send the user header. See "Logins". | Loopback and private addresses |
|
||||
| `PROXY_AUTH_LOGOUT_URL` | Where the Log out button goes in proxy mode | None |
|
||||
| `BINDERY_API_KEY` | A key for scripts. See "Scripts". | None |
|
||||
| `SESSION_COOKIE_SECURE` | `true` if users reach Bindery only over HTTPS | `false` |
|
||||
@@ -109,6 +110,13 @@ Each build without a saved CWA book ID then puts a plain ePub in that folder, in
|
||||
because Bindery trusts this header. If a request gets a 401 because the proxy session ended,
|
||||
Bindery reloads the page, so the proxy can step in again.
|
||||
|
||||
Bindery accepts the header only from the addresses in `PROXY_AUTH_TRUSTED_IPS`. The default is the
|
||||
loopback and private addresses, such as `127.0.0.1`, `10.x`, `172.16.x` to `172.31.x` and
|
||||
`192.168.x`. This stops a request that comes straight from the internet, but not one from your own
|
||||
network. **Set it to the address of the proxy**, for example `PROXY_AUTH_TRUSTED_IPS=172.18.0.3`,
|
||||
or publish the port of Bindery only on the host, as `127.0.0.1:8085:8085` in the Compose file.
|
||||
`TRUST_PROXY` does not change this check. It is only for the lockouts.
|
||||
|
||||
**If the login settings are incomplete or wrong, Bindery refuses every request**, also with the API
|
||||
key, and shows the reason.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user