Skip to content

Instantly share code, notes, and snippets.

@yaleman
Created August 10, 2021 05:18
Show Gist options
  • Save yaleman/1d9fe32ba381baed210e61b9139e8ce6 to your computer and use it in GitHub Desktop.
Save yaleman/1d9fe32ba381baed210e61b9139e8ce6 to your computer and use it in GitHub Desktop.
Kanidm LDAP auth for Nagios behind Apache
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName monitoring.example.com
ServerAdmin [email protected]
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/monitoring.example.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/monitoring.example.com/privkey.pem
ScriptAlias /cgi-bin "/usr/local/nagios/sbin/"
<Directory "/usr/local/nagios/sbin">
Options ExecCGI
AllowOverride None
<RequireAll>
Require all granted
AuthName "Nagios Access"
AuthType Basic
AuthLDAPURL "ldaps://kanidm.example.com:636/dc=kanidm,dc=example,dc=com?name?sub?(name=*)" TLS
AuthBasicProvider ldap
Require valid-user
</RequireAll>
</Directory>
Alias / "/usr/local/nagios/share/"
<Directory "/usr/local/nagios/share">
Options None
AllowOverride None
<RequireAll>
Require all granted
AuthName "Nagios Access"
AuthType Basic
AuthLDAPURL "ldaps://kanidm.example.com:636/dc=kanidm,dc=example,dc=com?name?sub?(name=*)" TLS
AuthBasicProvider ldap
Require valid-user
</RequireAll>
</Directory>
</VirtualHost>
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment