fix(shared-httpd): exec-surface gate pipefail scan (CI 6352) + probe test accepts guard 403 #64

Merged
jknapp merged 1 commits from fix/exec-surface-gate-pipefail-2026-11-24 into trunk 2026-11-24 18:50:45 +00:00
2 changed files with 6 additions and 1 deletions
Showing only changes of commit 0e2a066968 - Show all commits

No files matched your search

+1 -1
View File
@@ -128,7 +128,7 @@ cmd_check() {
fi
# Positive control: nothing the platform uses may have disappeared with them.
for m in $REQUIRED_MODULES; do
if ! printf '%s\n' "$mods" | grep -qE "^ ${m} "; then
if ! grep -qE "^ ${m} " <<<"$mods"; then
echo "gate FAIL: required module ${m} is NOT loaded" >&2; fail=1
fi
done
@@ -124,7 +124,12 @@ for p in pa:ajp pf:ftp ps:scgi pu:uwsgi; do
# error log, which names the missing scheme handler only when the module is gone.
if [ "$EXPECT_OPEN" = 1 ]; then ok "[P] ${p##*:}:// : not asserted on an unhardened image"; continue; fi
l=$(docker exec "$N" sh -c "grep -c 'No protocol handler was valid for the URL /${p%%:*}/' /var/log/httpd/a.test-error.log 2>/dev/null || true")
# The server-scope proxy guard now answers 403 BEFORE mod_proxy picks a handler, so the
# request never reaches the scheme lookup and AH01144 is no longer logged. A 403 is the
# secure outcome (the [P] is refused); AH01144 is the older one (module removed). Anything
# else (502/503/500/200, i.e. a proxy attempt or served content) is a failure.
if [ "${l:-0}" -ge 1 ]; then ok "[P] ${p##*:}:// has no protocol handler (AH01144 for /${p%%:*}/)"
elif [ "$(printf %s "${r: -5}" | tr -d '\n')" = "[403]" ]; then ok "[P] ${p##*:}:// refused by the proxy guard (403) before any handler lookup"
else bad "[P] ${p##*:}://: no 'No protocol handler' for /${p%%:*}/ in the error log -> ${r: -12}"; fi
done
echo "== surfaces that must stay (reported, not failed)"