+6
-6
nixos/tests/all-tests.nix
+6
-6
nixos/tests/all-tests.nix
···
+144
-146
nixos/tests/nginx-proxyprotocol/default.nix
+144
-146
nixos/tests/nginx-proxyprotocol/default.nix
···+log_format pcombined '(proxy_protocol=$proxy_protocol_addr) - (remote_addr=$remote_addr) - (realip=$realip_remote_addr) - (upstream=) - (remote_user=$remote_user) [$time_local] '-log_format pcombined '(proxy_protocol=$proxy_protocol_addr) - (remote_addr=$remote_addr) - (realip=$realip_remote_addr) - (upstream=) - (remote_user=$remote_user) [$time_local] '-def check_origin_ip(src_ip: str, dst_url: str, failure: bool = False, proxy_protocol: bool = False, expected_ip: str | None = None):+def check_origin_ip(src_ip: str, dst_url: str, failure: bool = False, proxy_protocol: bool = False, expected_ip: str | None = None):-return check(f"curl {'--haproxy-protocol' if proxy_protocol else '''} --interface {src_ip} --fail -L {dst_url} | grep '{expected_ip}'")+return check(f"curl {'--haproxy-protocol' if proxy_protocol else '''} --interface {src_ip} --fail -L {dst_url} | grep '{expected_ip}'")-# Connecting through sniproxy to a non-PROXY protocol enabled listener should not pass the originating IP address.+# Connecting through sniproxy to a non-PROXY protocol enabled listener should not pass the originating IP address.-# FIXME(RaitoBezarius): rewrite it using Python + (Scapy|something else) as this is too much broken unfortunately.+# FIXME(RaitoBezarius): rewrite it using Python + (Scapy|something else) as this is too much broken unfortunately.-# def spoof(original_ip: str, target_ip: str, dst_url: str, tls: bool = False, expect_failure: bool = True):-# print(webserver.execute(f"cat <<EOF | nc {target_ip} {port}\n{generate_attacker_request(original_ip, target_ip, dst_url)}\nEOF"))-# return method(f"cat <<EOF | nc {target_ip} {port} | grep {original_ip}\n{generate_attacker_request(original_ip, target_ip, dst_url)}\nEOF")+# def spoof(original_ip: str, target_ip: str, dst_url: str, tls: bool = False, expect_failure: bool = True):+# print(webserver.execute(f"cat <<EOF | nc {target_ip} {port}\n{generate_attacker_request(original_ip, target_ip, dst_url)}\nEOF"))+# return method(f"cat <<EOF | nc {target_ip} {port} | grep {original_ip}\n{generate_attacker_request(original_ip, target_ip, dst_url)}\nEOF")
+2
-1
nixos/tests/nginx-pubhtml.nix
+2
-1
nixos/tests/nginx-pubhtml.nix
+23
-25
nixos/tests/nginx-redirectcode.nix
+23
-25
nixos/tests/nginx-redirectcode.nix
···
+13
-4
nixos/tests/nginx-sso.nix
+13
-4
nixos/tests/nginx-sso.nix
············"curl -sSf -H 'Authorization: Token MyToken' -H 'X-Application: MyApp' http://localhost:8080/auth"
+62
-64
nixos/tests/nginx-status-page.nix
+62
-64
nixos/tests/nginx-status-page.nix
···