Slurm — Authentication Service
Overview
Authentication mechanisms1 — Verify legitimacy & integrity of RPC requests
| Mechanism | AuthType | Description | 
|---|---|---|
| MUNGE | auth/munge | External mungedservice to authenticate | 
| Slurm | auth/slurm | Slurm internal authentication plugin | 
| JWT | Authentication using JSON Web Tokens (JWT)2 | 
MUNGE
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 mungeConfiguration
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 mungedUse a dedicated user…
groupadd -r munge
useradd -c "MUNGE authentication service" \
        -d "/var/lib/munge" \
        -g munge \
        -s /sbin/nologin \
        -r mungemunged 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/mungeNon-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=/runCustom 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.logSlurm 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.2It 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
Slurm
Configure the Slurm authentication type:
slurm.conf
AuthType=auth/slurm
CryptoType=crypto/slurmFootnotes
- Authentication Plugins, SchedMD Documentation 
 https://slurm.schedmd.com/authentication.html↩︎
- JSON Web Tokens (JWT) Authentication, SchedMD Documentation 
 https://slurm.schedmd.com/jwt.html↩︎