fix(shared-httpd): exec-surface gate pipefail scan (CI 6352) + probe test accepts guard 403 #64
No files matched your search
@@ -128,7 +128,7 @@ cmd_check() {
|
|||||||
fi
|
fi
|
||||||
# Positive control: nothing the platform uses may have disappeared with them.
|
# Positive control: nothing the platform uses may have disappeared with them.
|
||||||
for m in $REQUIRED_MODULES; do
|
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
|
echo "gate FAIL: required module ${m} is NOT loaded" >&2; fail=1
|
||||||
fi
|
fi
|
||||||
done
|
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.
|
# 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
|
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")
|
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%%:*}/)"
|
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
|
else bad "[P] ${p##*:}://: no 'No protocol handler' for /${p%%:*}/ in the error log -> ${r: -12}"; fi
|
||||||
done
|
done
|
||||||
echo "== surfaces that must stay (reported, not failed)"
|
echo "== surfaces that must stay (reported, not failed)"
|
||||||
|
|||||||
Reference in new issue
Block a user