security(shared-httpd): remove cgid/lua/include/actions/dav/userdir + exec-surface build gate

One Apache serves every tenant in shared-httpd and everything it executes runs as
the shared `apache` user. mod_lua cannot be closed from the WHP vhost side
(RewriteRule [H=lua-script] binds the handler after any config pin), so the
modules are removed from the image: scripts/httpd-exec-surface-gate.sh
remove|check, run as the last package step of Dockerfile.shared-httpd. check
fails the build if a banned module is loadable/loaded, the global INCLUDES filter
or a cgi-bin ScriptAlias is configured, httpd -t fails, or a module the platform
needs (rewrite, proxy_fcgi, ssl, headers, ...) is not loaded. Test + CI wiring.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0185ukXi4YX5FxJGqhi6qab6
This commit is contained in:
shadowdaoandClaude Sonnet 5.5 committed 2026-11-22 21:48:51 -08:00
1 parent d4ec8b526c
commit 8fbbd6d160
4 files changed
+187

No files matched your search

+8
View File
@@ -32,6 +32,7 @@ COPY ./scripts/entrypoint-shared-httpd.sh /scripts/entrypoint-shared-httpd.sh
COPY ./scripts/stop-services.sh /scripts/stop-services.sh
COPY ./scripts/tune-mpm.sh /scripts/tune-mpm.sh
COPY ./scripts/httpd-h2-md-gate.sh /scripts/httpd-h2-md-gate.sh
COPY ./scripts/httpd-exec-surface-gate.sh /scripts/httpd-exec-surface-gate.sh
RUN chmod +x /scripts/*
# Generate self-signed SSL cert (same as main CAC image)
@@ -56,6 +57,13 @@ RUN echo "15 */12 * * * root /scripts/log-rotate.sh" >> /etc/crontab
RUN /scripts/httpd-h2-md-gate.sh remove && /scripts/httpd-h2-md-gate.sh check
LABEL org.whp.httpd-h2-md="removed"
# Tenant isolation (WHP 2026-11-22): this one Apache serves every tenant, so nothing that
# can execute code or follow DAV/userdir/SSI/CGI/Lua may exist in it. Build fails if any of
# it returns, or if a module the platform needs went missing.
# scripts/httpd-exec-surface-gate.sh. Last package step on purpose.
RUN /scripts/httpd-exec-surface-gate.sh remove && /scripts/httpd-exec-surface-gate.sh check
LABEL org.whp.httpd-exec-surface="removed"
EXPOSE 80 443
HEALTHCHECK --interval=30s --timeout=5s --start-period=60s --retries=3 \