Page MenuHomeFreeBSD

lang/erlang: enhance epmd security
ClosedPublic

Authored by olgeni on Jun 16 2025, 12:17 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Jul 14, 1:57 AM
Unknown Object (File)
Sun, Jul 13, 10:47 AM
Unknown Object (File)
Sat, Jul 12, 12:38 AM
Unknown Object (File)
Mon, Jul 7, 7:47 AM
Unknown Object (File)
Mon, Jul 7, 1:28 AM
Unknown Object (File)
Sun, Jul 6, 8:28 PM
Unknown Object (File)
Sun, Jul 6, 8:03 PM
Unknown Object (File)
Sun, Jul 6, 6:52 PM
Subscribers

Details

Summary
  • Add dedicated beam user (UID/GID 372) for non-root execution
  • Use daemon(8) for epmd process supervision and auto-restart

This addresses security concerns with epmd running as root by
providing privilege separation and automatic restart capability.

PR: 213001

Diff Detail

Repository
R11 FreeBSD ports repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

olgeni created this revision.

\o/ a long overdue improvement! thanks!

This revision is now accepted and ready to land.Jun 17 2025, 10:06 AM
dch requested changes to this revision.Jun 17 2025, 10:27 AM

service start|stop epmd fails when flags are provided:

# /etc/rc.conf.d/epmd
epmd_enable=YES
epmd_flags="-address 100.64.0.0"
# service epmd start
/usr/local/etc/rc.d/epmd: DEBUG: run_rc_command: doit:  limits -C daemon  su -m beam -c 'sh -c " /usr/sbin/daemon -address 100.64.0.0 -f -r -P /var/run/epmd/epmd.pid /usr/local/bin/epmd -address 100.64.0.0"'
daemon: invalid option -- a

A solution is to s/flags/opts/ and then the flags are not passed through to daemon itself.

Otherwise LGTM!

lang/erlang/files/epmd.in
39

probably install -m 644 -g ${epmd_user} -o ${epmd_user} ${pidfile} is tidier than touch+chown.

This revision now requires changes to proceed.Jun 17 2025, 10:27 AM

{F120959715} perfect, ship it!

This revision is now accepted and ready to land.Sun, Jun 22, 11:45 AM
This revision was automatically updated to reflect the committed changes.