nixpkgs/pkgs
Raito Bezarius 69bb0f94de nixos/nginx: first-class PROXY protocol support
PROXY protocol is a convenient way to carry information about the
originating address/port of a TCP connection across multiple layers of
proxies/NAT, etc.

Currently, it is possible to make use of it in NGINX's NixOS module, but
is painful when we want to enable it "globally".
Technically, this is achieved by reworking the defaultListen options and
the objective is to have a coherent way to specify default listeners in
the current API design.
See `mkDefaultListenVhost` and `defaultListen` for the details.

It adds a safeguard against running a NGINX with no HTTP listeners (e.g.
only PROXY listeners) while asking for ACME certificates over HTTP-01.

An interesting usecase of PROXY protocol is to enable seamless IPv4 to
IPv6 proxy with origin IPv4 address for IPv6-only NGINX servers, it is
demonstrated how to achieve this in the tests, using sniproxy.

Finally, the tests covers:

- NGINX `defaultListen` mechanisms are not broken by these changes;
- NGINX PROXY protocol listeners are working in a final usecase
  (sniproxy);
- uses snakeoil TLS certs from ACME setup with wildcard certificates;

In the future, it is desirable to spoof-attack NGINX in this scenario to
ascertain that `set_real_ip_from` and all the layers are working as
intended and preventing any user from setting their origin IP address to
any arbitrary, opening up the NixOS module to bad™ vulnerabilities.

For now, it is quite hard to achieve while being minimalistic about the
tests dependencies.
2023-05-26 19:48:26 +02:00
..
applications Merge pull request #233851 from ConnorBaker/feat/cudnn_8_9_1 2023-05-26 10:26:30 -07:00
build-support Merge pull request #234072 from ShamrockLee/write-script-bin-mainprogram 2023-05-26 17:07:42 +03:00
common-updater
data papirus-nord: init at 3.2.0 (#232965) 2023-05-25 21:39:37 +02:00
desktops Merge pull request #233906 from bobby285271/add/nemo-emblems 2023-05-26 11:15:07 +08:00
development Merge pull request #233851 from ConnorBaker/feat/cudnn_8_9_1 2023-05-26 10:26:30 -07:00
games Merge pull request #234184 from wegank/gnushogi-fix 2023-05-26 13:35:36 +03:00
misc Merge pull request #233687 from yayayayaka/cups-filters-fix-cve-2023-24805 2023-05-26 15:20:23 +03:00
os-specific kernelPatches.make-maple-state-reusable-after-mas_empty_area: drop 2023-05-26 15:19:03 +00:00
pkgs-lib
servers nixos/nginx: first-class PROXY protocol support 2023-05-26 19:48:26 +02:00
shells murex: 4.1.5200 -> 4.1.6140 2023-05-25 03:33:03 +00:00
stdenv
test
tools Merge pull request #234241 from r-ryantm/auto-update/angle-grinder 2023-05-26 12:49:03 -04:00
top-level Merge pull request #233286 from wegank/ueberzugpp-bump 2023-05-26 17:40:41 +03:00