Repository navigation
v0.4.13
追加
- PROXY protocol(v1 / v2)を、信用する前段から受け取れるようになりました(#296)。
tcpのルールにproxy_protocol: {"from": ["10.2.0.0/16"], "required": true}を書くと、fromの接続元(ロードバランサ・別の rproxy など)が付けたヘッダを読み、本当のクライアントのアドレスとして扱います。allow_from・geoip・crowdsec・送信元ごとのlimits・bandwidth、ログのclient・http.access・X-Forwarded-For/X-Real-IP、転送先へのsource_ip(proxy_v1/proxy_v2のヘッダ、transparent)が、本当のクライアントのアドレスを使います。前段のアドレスはログのproxy_peerに残ります。fromは必須で、空や0.0.0.0/0・::/0は書けません。required(既定 true)が true なら、fromからヘッダなしで来た接続を断ります。fromの外からヘッダで始まる接続も断ります(conn.deniedのreasonはproxy_protocol/proxy_protocol_untrusted)。- ヘッダは受け付けてから 5 秒以内に届かなければ断ります。大きさの上限は v1 が 107 バイト、v2 が 16 + 4096 バイトです。
- PATCH・ルールセットの PUT・設定ファイルの再読み込みで、接続を切らずに付け外しできます。
GET /capabilitiesのfeatures.proxy_protocol_in。 - Traefik からの変換(
rproxy-traefik-convert)は、entryPoint のproxyProtocol.trustedIPsをproxy_protocol: {from, required: false}にします。
tls.routes[]ごとにsource_ipを指定できるようになりました(#297)。1 つのポートのterminate(httpのルールを含む)で、passthrough: trueの route だけsource_ip: proxy_v2を付けて、クライアントの IP を転送先へ渡せます。sniのルールの route にも書けます(udp の sni はproxy・proxy_v2)。- 書ける値は
proxy・proxy_v1・proxy_v2で、省けばルールのsource_ipを使います。TLS を終端する route とtransparentはunsupportedです。 - 接続を切らずに変えられます。
GET /capabilitiesのfeatures.route_source_ip。 - Traefik からの変換は、ルーターごとの
proxyProtocol.versionを、TLS を終端しないルーターでは route のsource_ipにします。
- 書ける値は
どちらも省略したときの動きは v0.4.12 と同じです。v0.4.12 に戻すときは、先にこの 2 つの設定を外してください。
UI: TCP-UDP-rproxy-ui v0.4.6 · Kubernetes: rproxy-gateway v0.4.12
Added
- PROXY protocol (v1 / v2) can now be accepted from trusted upstreams (#296). With
proxy_protocol: {"from": ["10.2.0.0/16"], "required": true}on atcprule, rproxy reads the header sent by a peer infrom(a load balancer, another rproxy, …) and treats its address as the real client.allow_from,geoip,crowdsec, per-sourcelimits,bandwidth, theclientof the logs,http.access,X-Forwarded-For/X-Real-IPand the outboundsource_ip(proxy_v1/proxy_v2headers,transparent) use the real client's address. The upstream's address stays in the logs asproxy_peer.fromis required and cannot be empty,0.0.0.0/0or::/0. Withrequired(default true), a connection fromfromwithout a header is refused. A connection from outsidefromthat starts with a header is refused too (conn.deniedwithreasonproxy_protocol/proxy_protocol_untrusted).- The header must arrive within 5 seconds of accepting; at most 107 bytes for v1 and 16 + 4096 bytes for v2.
- It can be added and removed without cutting connections (PATCH, rule set PUT, settings reload).
features.proxy_protocol_ininGET /capabilities. - The Traefik converter (
rproxy-traefik-convert) turns an entryPoint'sproxyProtocol.trustedIPsintoproxy_protocol: {from, required: false}.
source_ipcan now be set pertls.routes[]entry (#297). On one port'sterminaterule (includinghttprules), only thepassthrough: trueroutes can getsource_ip: proxy_v2and pass the client's IP to their backends. Routes ofsnirules take it too (proxyandproxy_v2for udp sni).- Values are
proxy,proxy_v1andproxy_v2; without it the rule'ssource_ipis used. Terminating routes andtransparentareunsupported. - It changes without cutting connections.
features.route_source_ipinGET /capabilities. - The Traefik converter turns a router's own
proxyProtocol.versioninto the route'ssource_ipon routers that do not terminate TLS.
- Values are
Without them, everything works as in v0.4.12. Remove both settings before going back to v0.4.12.
UI: TCP-UDP-rproxy-ui v0.4.6 · Kubernetes: rproxy-gateway v0.4.12