Found while testing K-W3 (sign-in limits with several webmail replicas) on kind.
The problem. "Use X-Forwarded-For" is off by default, so behind a proxy the server counts every client as the proxy:
Failed sign-ins are banned per address (100 a day, then 30 days). Enough wrong passwords between all users behind one ingress ban the ingress, and nobody can sign in on the web.
Anonymous requests, which include the first use of each new token on each node, are limited per address (100 a minute). The webmail sends every user's tokens from its own address.
The trusted proxies and the header name could already be set from the environment (INBUXA_HTTP_TRUSTED_PROXIES, INBUXA_HTTP_FORWARDED_HEADER); whether to read the header at all couldn't.
The change.INBUXA_HTTP_USE_FORWARDED=true|false (also 1/0, yes/no, on/off) overrides the store's setting. An unparseable value logs a build warning and the store's setting applies. The trusted proxies still decide whose header is believed.
Tested
A unit test for the value parsing.
On kind with this build and the chart setting it (inbuxa-charts, K-W3): a pod forwarding 110 failed sign-ins for 110 different clients bans nobody. On rc.31 behaviour the same run banned the forwarding pod after 101.
Failed sign-ins are counted across server pods: 110 wrong passwords alternating between two front pods banned at 101.
No CHANGELOG entry here; the version PR writes it. The variable needs documenting next to the other INBUXA_HTTP_* ones.
Found while testing K-W3 (sign-in limits with several webmail replicas) on kind.
**The problem.** "Use X-Forwarded-For" is off by default, so behind a proxy the server counts every client as the proxy:
- Failed sign-ins are banned per address (100 a day, then 30 days). Enough wrong passwords between all users behind one ingress ban the ingress, and nobody can sign in on the web.
- Anonymous requests, which include the first use of each new token on each node, are limited per address (100 a minute). The webmail sends every user's tokens from its own address.
The trusted proxies and the header name could already be set from the environment (`INBUXA_HTTP_TRUSTED_PROXIES`, `INBUXA_HTTP_FORWARDED_HEADER`); whether to read the header at all couldn't.
**The change.** `INBUXA_HTTP_USE_FORWARDED=true|false` (also 1/0, yes/no, on/off) overrides the store's setting. An unparseable value logs a build warning and the store's setting applies. The trusted proxies still decide whose header is believed.
**Tested**
- A unit test for the value parsing.
- On kind with this build and the chart setting it (inbuxa-charts, K-W3): a pod forwarding 110 failed sign-ins for 110 different clients bans nobody. On rc.31 behaviour the same run banned the forwarding pod after 101.
- Failed sign-ins are counted across server pods: 110 wrong passwords alternating between two front pods banned at 101.
No CHANGELOG entry here; the version PR writes it. The variable needs documenting next to the other `INBUXA_HTTP_*` ones.
A deployment that only ever reaches the server through its own proxies
(Kubernetes, behind an ingress, with the webmail) needs the server to count
clients by the address those proxies pass on: otherwise the limits and bans
for failed sign-ins and anonymous requests charge everything to the proxy,
and a hundred wrong passwords a day between all users ban it. true or false
overrides the store's "Use X-Forwarded-For"; trusted proxies still apply.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Found while testing K-W3 (sign-in limits with several webmail replicas) on kind.
The problem. "Use X-Forwarded-For" is off by default, so behind a proxy the server counts every client as the proxy:
The trusted proxies and the header name could already be set from the environment (
INBUXA_HTTP_TRUSTED_PROXIES,INBUXA_HTTP_FORWARDED_HEADER); whether to read the header at all couldn't.The change.
INBUXA_HTTP_USE_FORWARDED=true|false(also 1/0, yes/no, on/off) overrides the store's setting. An unparseable value logs a build warning and the store's setting applies. The trusted proxies still decide whose header is believed.Tested
No CHANGELOG entry here; the version PR writes it. The variable needs documenting next to the other
INBUXA_HTTP_*ones.