Skip to content

fix(roles/apache_httpd)!: stop enabling mod_info by default - #316

Merged
NavidSassan merged 2 commits into
mainfrom
fix/apache-httpd-disable-mod-info
Aug 19, 2026
Merged

fix(roles/apache_httpd)!: stop enabling mod_info by default#316
NavidSassan merged 2 commits into
mainfrom
fix/apache-httpd-disable-mod-info

Conversation

@markuslf

Copy link
Copy Markdown
Member

What

mod_info is no longer enabled by default, on both RedHat and Debian.

Why

mod_info serves the complete Apache configuration on /server-info, including the credentials other modules carry in their directives. Nothing consumes the endpoint:

  • The Linuxfabrik Monitoring Plugins read mod_status (/server-status?auto); apache-httpd-version queries endoflife.date; the Apache security and disclosure checks read the local configuration and the HTTP response headers.
  • No LFOps role, playbook or Telegraf input queries /server-info.

The upcoming apache-httpd-security check warns about a loaded info_module for exactly this reason, so every LFOps-managed httpd would report a warning for a module we switch on ourselves.

How

enabled: false with state: 'present' unchanged: mods-available/info.conf keeps being deployed and only the mods-enabled symlink is removed on every run. The disable is idempotent, and a host that needs the endpoint re-enables it with one inventory entry:

apache_httpd__mods__host_var:
  - filename: 'info'
    enabled: true
    state: 'present'
    template: 'info'

The /server-info block stays in the localhost vHost, so re-enabling the module is all it takes.

Verified

Rocky 9, httpd 2.4.62-13.el9_8.5, podman, in the Debian-style layout this role deploys on RedHat (httpd.conf includes mods-enabled/*.conf only, so the LoadModule info_module line the httpd package ships in conf.modules.d/00-base.conf is never read):

State info_module httpd -t curl /server-info
New default not loaded Syntax OK 200, 0 bytes
enabled: true loaded Syntax OK 200, 38899 bytes (Server Settings + Loaded Modules)

An unresolved SetHandler server-info is not a configuration error, so the vHost block is inert while the module is off.

mod_info serves the complete Apache configuration on /server-info,
including the credentials other modules carry in their directives.
Nothing consumes the endpoint: the Monitoring Plugins read mod_status
(/server-status?auto), and no role or Telegraf input queries /server-info.

The module config stays in mods-available, only the mods-enabled symlink
is removed, so hosts that need the endpoint re-enable it with a single
inventory entry.

Verified on Rocky 9 (httpd 2.4.62) in the Debian-style layout this role
deploys: httpd.conf includes mods-enabled only, so the LoadModule line
the httpd package ships in conf.modules.d stays unread. Without the
module the vHost's /server-info block still passes `httpd -t` and answers
with an empty 200; linking info.conf back into mods-enabled restores the
full page.
@NavidSassan
NavidSassan merged commit 6eb5a76 into main Aug 19, 2026
9 checks passed
@NavidSassan
NavidSassan deleted the fix/apache-httpd-disable-mod-info branch August 19, 2026 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants