MUNGE - Slurm Authentication Service
HPC
MUNGE (MUNGE Uid ‘N’ Gid Emporium)…
- …authentication service for creating and validating credentials
- …highly scalable…designed for HPC clusters
- …hosts form a security realm…defined by a shared cryptographic key
- …clients create/validate credentials without root privileges
- …process to authenticate the UID/GID of another local/remote process
References…
- GitHub Repository
- Wiki - Installation Guide & Man-Pages
- Fedora EPEL Package
- RPM SPEC & Systemd Service Unit
munged.service
Create a munge.service
Systemd unit…
cat > /etc/systemd/system/munge.service <<'EOF'
[Unit]
Description=munged authentication service
[Service]
Type=forking
User=munge
Group=munge
RuntimeDirectory=munge
RuntimeDirectoryMode=0755
EnvironmentFile=-/etc/default/munge
ExecStart=munged $MUNGE_OPTIONS
[Install]
WantedBy=default.target
EOF
# load new unit file...restart...check state
systemctl daemon-reload && systemctl restart munge
systemctl status --full --lines=50 munge
Configuration
Fore-ground daemon for debugging…
# overwrite nologin and run munged in foreground
su -s /bin/bash munge -c "$MUNGE_PATH/sbin/munged $OPTIONS -Fv"
# ...with logging to a file /var/log/... don't foreground
su -s /bin/bash munge -c "$MUNGE_PATH/sbin/munged $OPTIONS"
ps -p $(pgrep munged) -fH ; pkill munged
Use a dedicated user…
groupadd -r munge
useradd -c "MUNGE authentication service" \
-d "/var/lib/munge" \
-g munge \
-s /sbin/nologin \
-r munge
munged
enforces files permissions…
# PRNG Seed...
mkdir -p /var/lib/munge \
&& chown munge:munge /var/lib/munge \
&& chmod 0700 /var/lib/munge
# socket configuration...
cat > /usr/lib/tmpfiles.d/munge.conf <<EOF
d /run/munge 0755 munge munge -
EOF
systemd-tmpfiles --create /usr/lib/tmpfiles.d/munge.conf
# log-files...
mkdir /var/log/munge \
&& chown munge:munge /var/log/munge \
&& chmod 0700 /var/log/munge
Non-Default Paths
Path to the socket is set by a compile time option…
- …MUNGE Installation Guide
- …specifically
--runstatedir=/run
# options to configure the build
./configure --sysconfdir=/etc --localstatedir=/var --runstatedir=/run
Custom paths to all files…
munged \
--seed-file=/var/lib/munge/munge.seed \
--key-file=/etc/munge/munge.key \
--pid-file=/run/munge/munged.pid \
--socket /run/munge/munge.socket.2 \
--log-file=/var/log/munge/munged.log
Slurm is configured with --with-munge=$path
…
slurmctld
& slurmdbd
require socket=
for non-default path…
>>> grep Auth /etc/slurm/slurm*
/etc/slurm/slurm.conf:AuthType=auth/munge
/etc/slurm/slurm.conf:AuthInfo=socket=/run/munge/munge.socket.2
/etc/slurm/slurmdbd.conf:AuthType=auth/munge
/etc/slurm/slurmdbd.conf:AuthInfo=socket=/run/munge/munge.socket.2
It is likely that Slurm uses the MUNGE API man 3 munge
…
- …with a context format described in
man 3 munge_ctx
- …which support
MUNGE_OPT_SOCKET
- …depends on propagation of the socket location by the caller
- …seams that
sacct*
commands are not support a non-default socket
Thread Count
Munge daemon runs with two threads by default…
- …higher thread count can improve its throughput.
- …start with
munged --num-threads 10
- …thread count to 10 will not have negative effects