Files
W.C.A. Wijngaards 5d7ef54e1f - Add allow-proxy: netblock config that sets what peers are
allowed to use PROXYv2. This limits the proxy access to
  only the allowed netblocks. Thanks to Qifan Zhang from
  Palo Alto Networks for the report.
2026-11-19 10:48:29 +01:00

29 lines
658 B
Plaintext

# #-- proxy_disallowed.test --#
# source the master var file when it's there
[ -f ../.tpkg.var.master ] && source ../.tpkg.var.master
# use .tpkg.var.test for in test variable passing
[ -f .tpkg.var.test ] && source .tpkg.var.test
PRE="../.."
# do the test
echo "> www.example.com."
$PRE/streamtcp -p 1.2.3.4 -f 127.0.0.1@$UNBOUND_PORT www.example.com A IN | tee outfile
echo "> check answer"
if grep "remote connection gone" outfile; then
echo "OK"
else
if grep "10.20.30.40" outfile; then
echo "Not OK"
exit 1
fi
fi
if grep "proxy_protocol: 127.0.0.1 is not in allow-proxy list" unbound.log; then
echo "OK"
else
echo "Not OK"
exit 1
fi
exit 0