review(mod_whp_proxy_guard): None clears scrub/deny lists; probe test is a CI publish gate

Independent review of PR #62 (adversarial probes, combined #59+#60+#61+#62 image):
- WHPProxyScrubEnv None / WHPDenyHandler None now empty the list set so far
  in that context, as WHPProxyAllow None already did. Before, None was only
  skipped, so a later file (the WHP drop-in) could not switch an image
  default off at server scope.
- build-push.yaml: shellcheck the probe test and run it as a fatal publish
  gate against the amd64 shared-httpd image by digest (before arm64 and tag
  assembly), like #60 does for mod_whp_symlink. WHP_PGTEST_REQUIRE=1 turns
  the local SKIPs (no docker / no image) into failures there.
- probe test: `<If><If> SetHandler proxy:http://` accepts "not proxied"
  (static served) as well as 403: on the #59 image mod_proxy_http is gone and
  mod_proxy cannot canonicalise the URL; the SSRF-target hit counter still
  asserts that nothing reached the target.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0185ukXi4YX5FxJGqhi6qab6
This commit is contained in:
shadowdaoandClaude Opus 5.5 committed 2026-11-23 17:28:27 -08:00
1 parent 5f8597363e
commit c83e4d847f
3 files changed
+32 -5

No files matched your search

+9 -3
View File
@@ -6,7 +6,8 @@
# Env: WHP_FPM_IMAGE a cac-fpm image for the FastCGI environment section
# (default repo.anhonesthost.net/cloud-hosting-platform/cac-fpm:php83;
# that section is SKIPPED, not failed, when it is absent)
# SKIPs (exit 0) without docker or without the image.
# SKIPs (exit 0) without docker or without the image; with WHP_PGTEST_REQUIRE=1
# (the CI publish gate) those are failures instead.
#
# Tenant vhosts a.test / b.test / l.test on a private docker network, an HTTP
# "target" (this image's httpd, counted in its access log) and, with
@@ -18,7 +19,9 @@ ID="whp-pg-$$"; NET="$ID-net"; H="$ID-httpd"; TG="$ID-tgt"; FP="$ID-fpm"
pass=0; fail=0
ok() { pass=$((pass + 1)); printf ' ok %s\n' "$*"; }
bad() { fail=$((fail + 1)); printf ' FAIL %s\n' "$*"; }
skip() { printf 'SKIP whp-proxy-guard-module: %s\n' "$*"; exit 0; }
skip() { # WHP_PGTEST_REQUIRE=1 (CI publish gate): a missing prerequisite FAILS
if [ "${WHP_PGTEST_REQUIRE:-0}" = 1 ]; then printf 'FAIL whp-proxy-guard-module: %s (WHP_PGTEST_REQUIRE=1)\n' "$*"; exit 1; fi
printf 'SKIP whp-proxy-guard-module: %s\n' "$*"; exit 0; }
command -v docker >/dev/null 2>&1 || skip "no docker"
docker image inspect "$IMAGE" >/dev/null 2>&1 || skip "image $IMAGE not available"
T="$(mktemp -d)"
@@ -157,7 +160,10 @@ code "[P] http:// SSRF" a.test /t4/go 403
code "[P] ws:// SSRF" a.test /t5/go 403
code "[P] ajp:// SSRF" a.test /t6/go 403
code "[P] backend by IP address" a.test /t7/go 403
code "<If><If> SetHandler proxy:http://" a.test /t8/f.txt 403
# 403 from the guard; on an image without mod_proxy_http (cac #59) mod_proxy
# cannot canonicalise http:// and the static file is served instead. Both are
# fine as long as the target sees nothing (checked right below).
r="$(get a.test /t8/f.txt)"; case "$r" in 403*|"200 F"*) ok "<If><If> SetHandler proxy:http:// -> ${r:0:3} (refused or not proxied)" ;; *) bad "<If><If> SetHandler proxy:http:// -> ${r:0:40}" ;; esac
[ "$(hits)" = "$h0" ] && ok "the SSRF target saw no request" || bad "the SSRF target was reached"
r="$(get a.test /t9/f.txt)"; case "$r" in 403*|"200 F"*) ok "SetHandler proxy:unix: -> ${r:0:3} (refused or not proxied)" ;; *) bad "proxy:unix: -> ${r:0:40}" ;; esac
code "vhost without a list inherits the image default: [P] http://" b.test /t4/go 404 # no /t4 under /srv/b