LDAP Authentification on Nagios 4

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
cocoyanouck
Posts: 96
Joined: Fri Apr 08, 2016 3:17 am

LDAP Authentification on Nagios 4

Post by cocoyanouck »

Hi,

I want to implement LDAP authentification on my Nagios 4.4.3 (Debian 9).
The goal is to connect with our windows account on the web interface instead of "nagiosadmin"

I tried to read several articles but I'm really lost ...

https://support.nagios.com/kb/article/a ... n-600.html
http://www.localhostrich.com/en/apache- ... gios-ldap/
https://blog.pythian.com/nagios-authent ... directory/
https://support.nagios.com/forum/viewto ... 16#p253463
https://itefix.net/content/nagios-authe ... -directory
https://access.redhat.com/documentation ... figuration

Could you help me to do this, step by step please ?

Thanks a lot.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: LDAP Authentification on Nagios 4

Post by ssax »

Very strange, having trouble getting it working on my end as well. I'll let you know what I find.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: LDAP Authentification on Nagios 4

Post by ssax »

Here is what worked for me:

Code: Select all

# SAMPLE CONFIG SNIPPETS FOR APACHE WEB SERVER
#
# This file contains examples of entries that need
# to be incorporated into your Apache web server
# configuration file.  Customize the paths, etc. as
# needed to fit your system.
ScriptAlias /nagios/cgi-bin "/usr/local/nagios/sbin"

<Directory "/usr/local/nagios/sbin">
#  SSLRequireSSL
   Options ExecCGI
   AllowOverride None
   <IfVersion >= 2.3>
      <RequireAll>
         Require all granted
         AuthBasicProvider ldap
         AuthType Basic
         AuthName "Nagios Access"
         AuthLDAPURL "ldap://192.168.X.X:3268/dc=contoso,dc=local?sAMAccountName?sub" NONE
         AuthLDAPBindDN "CN=Your User,CN=Users,DC=contoso,DC=local"
         AuthLDAPBindPassword "Pass"
         Require valid-user
      </RequireAll>
   </IfVersion>
   <IfVersion < 2.3>
      Order allow,deny
      Allow from all
#     Order deny,allow
#     Deny from all
#     Allow from 127.0.0.1

      AuthName "Nagios Access"
      AuthType Basic
      AuthUserFile /usr/local/nagios/etc/htpasswd.users
      Require valid-user
   </IfVersion>
</Directory>

Alias /nagios "/usr/local/nagios/share"

<Directory "/usr/local/nagios/share">
#  SSLRequireSSL
   Options None
   AllowOverride None
   <IfVersion >= 2.3>
      <RequireAll>
         Require all granted
         AuthBasicProvider ldap
         AuthType Basic
         AuthName "Nagios Access"
         AuthLDAPURL "ldap://192.168.X.X:3268/dc=contoso,dc=local?sAMAccountName?sub" NONE
         AuthLDAPBindDN "CN=Your User,CN=Users,DC=contoso,DC=local"
         AuthLDAPBindPassword "Pass"
         Require valid-user
      </RequireAll>
   </IfVersion>
   <IfVersion < 2.3>
      Order allow,deny
      Allow from all
#     Order deny,allow
#     Deny from all
#     Allow from 127.0.0.1

      AuthName "Nagios Access"
      AuthType Basic
      AuthUserFile /usr/local/nagios/etc/htpasswd.users
      Require valid-user
   </IfVersion>
</Directory>
cocoyanouck
Posts: 96
Joined: Fri Apr 08, 2016 3:17 am

Re: LDAP Authentification on Nagios 4

Post by cocoyanouck »

Hi,

Great, it's working fine, thank you so much.

You can close this ticket :)
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: LDAP Authentification on Nagios 4

Post by ssax »

That's great to hear, thanks for the update! Locking the thread.
Locked