zulip/docs
Alex Vandiver 694c4dfe8f puppet: Admit we leave epmd port 4369 open on all interfaces.
The Erlang `epmd` daemon listens on port 4369, and provides
information (without authentication) about which Erlang processes are
listening on what ports.  This information is not itself a
vulnerability, but may provide information for remote attackers about
what local Erlang services (such as `rabbitmq-server`) are running,
and where.

`epmd` supports an `ERL_EPMD_ADDRESS` environment variable to limit
which interfaces it binds on.  While this environment variable is set
in `/etc/default/rabbitmq-server`, Zulip unfortunately attempts to
start `epmd` using an explicit `exec` block, which ignores those
settings.

Regardless, this lack of `ERL_EPMD_ADDRESS` variable only controls
`epmd`'s startup upon first installation.  Upon reboot, there are two
ways in which `epmd` might be started, neither of which respect
`ERL_EPMD_ADDRESS`:

 - On Focal, an `epmd` service exists and is activated, which uses
   systemd's configuration to choose which interfaces to bind on, and
   thus `ERL_EPMD_ADDRESS` is irrelevant.

 - On Bionic (and Focal, due to a broken dependency from
   `rabbitmq-server` to `epmd@` instead of `epmd`, which may lead to
   the explicit `epmd` service losing a race), `epmd` is started by
   `rabbitmq-server` when it does not detect a running instance.
   Unfortunately, only `/etc/init.d/rabbitmq-server` would respects
   `/etc/default/rabbitmq-server` -- and it defers the actual startup
   to using systemd, which does not pass the environment variable
   down.  Thus, `ERL_EPMD_ADDRESS` is also irrelevant here.

We unfortunately cannot limit `epmd` to only listening on localhost,
due to a number of overlapping bugs and limitations:

 - Manually starting `epmd` with `-address 127.0.0.1` silently fails
   to start on hosts with IPv6 disabled, due to an Erlang bug ([1],
   [2]).

 - The dependencies of the systemd `rabbitmq-server` service can be
   fixed to include the `epmd` service, and systemd can be made to
   bind to `127.0.0.1:4369` and pass that socket to `epmd`, bypassing
   the above bug.  However, the startup of this service is not
   guaranteed, because it races with other sources of `epmd` (see
   below).

 - Any process that runs `rabbitmqctl` results in `epmd` being started
   if one is not currently running; these instances do not respect any
   environment variables as to which addresses to bind on.  This is
   also triggered by `service rabbitmq-server status`, as well as
   various Zulip cron jobs which inspect the rabbitmq queues.  As
   such, it is difficult-to-impossible to ensure that some other
   `epmd` process will not win the race and open the port on all
   interfaces.

Since the only known exposure from leaving port 4369 open is
information that rabbitmq is running on the host, and the complexity
of adjusting this to only bind on localhost is high, we remove the
setting which does not address the problem, and document that the port
is left open, and should be protected via system-level or
network-level firewalls.

[1]: https://bugs.launchpad.net/ubuntu/+source/erlang/+bug/1374109
[2]: https://github.com/erlang/otp/issues/4820
2022-01-25 01:46:51 +00:00
..
_static readthedocs: Add proper backlink to the Zulip homepage. 2021-07-06 10:59:59 -07:00
_templates docs: Follow Sphinx 4 rename of master_doc to root_doc. 2021-08-31 14:24:16 -07:00
contributing portico: Update contributor count from 700 to 1000. 2022-01-24 12:41:49 -08:00
development Remove Ubuntu 18.04 support. 2022-01-21 17:26:14 -08:00
documentation documentation: Expand documentation processes in new feature tutorial. 2021-11-02 14:03:34 -07:00
git dev docs: Update Tig link. 2021-11-30 14:36:29 -08:00
images docs: Add missing width to Zulip logo. 2021-02-05 09:49:33 -08:00
overview docs: Consistently hyphenate “self-host” and “self-service”. 2022-01-05 16:21:35 -08:00
production puppet: Admit we leave epmd port 4369 open on all interfaces. 2022-01-25 01:46:51 +00:00
subsystems Remove Ubuntu 18.04 support. 2022-01-21 17:26:14 -08:00
testing external links: Migrate the rest of /developer-community links. 2021-12-09 12:14:26 -08:00
translating external links: Migrate the rest of /developer-community links. 2021-12-09 12:14:26 -08:00
tutorials external links: Migrate the rest of /developer-community links. 2021-12-09 12:14:26 -08:00
.gitignore
Makefile docs: Replace Makefile based on output of newer sphinx-quickstart. 2019-12-02 18:39:33 -08:00
README.md docs: Capitalize Markdown consistently. 2020-08-11 10:23:06 -07:00
THIRDPARTY nagios: Replace check_website_response with standard check_http plugin. 2021-07-09 16:47:03 -07:00
code-of-conduct.md
conf.py docs: Enable sphinx_rtd_theme as an extension. 2021-11-04 11:55:15 -07:00
index.md external links: Migrate the rest of /developer-community links. 2021-12-09 12:14:26 -08:00
requirements.readthedocs.txt

README.md

Zulip Markdown documentation hosted elsewhere

The Markdown files in this directory ( /zulip/docs ) are not intended to be read on GitHub. Instead, visit our ReadTheDocs to read the Zulip documentation.