Nagios + openldap auth + apache 2.4

Esta vez, vamos a integrar la authenticación de usuarios de nuestro nagios con nuestro openLDAP.

Primero de todo, habilitamos los módulos ldap / authnz_ldap

a2enmod authnz_ldap
a2enmod ldap

Modificamos el fichero de sites del nagios:

#nano /etc/apache2/sites-available/nagios.conf

Y lo dejamos tal que:

# 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"


# SSLRequireSSL
Options ExecCGI
AllowOverride None
"<"IfVersion >= 2.3>

AuthType Basic
Require all granted
AuthName "Nagios Access"
AuthLDAPURL "ldap://ldap.miserver.local/dc=miserver,dc=local?uid?sub?(objectClass=*)"
AuthBasicprovider ldap
AuthUserFile /dev/null
Require valid-user


"<"IfVersion < 2.3>
Order allow,deny
Allow from all
AuthType Basic
Require all granted
AuthName "Nagios Access"
AuthLDAPURL ldap://ldap.miserver.local/dc=miserver,dc=local?uid?sub?(objectClass=*)
AuthBasicprovider ldap
AuthUserFile /dev/null
Require valid-user


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


# SSLRequireSSL
Options None
AllowOverride None
"<"IfVersion >= 2.3>

AuthType Basic
Require all granted
AuthName "Nagios Access"
AuthLDAPURL ldap://ldap.miserver.local/dc=miserver,dc=local?uid?sub?(objectClass=*)
AuthBasicprovider ldap
AuthUserFile /dev/null
Require valid-user



"<"IfVersion < 2.3>
Order allow,deny
Allow from all
AuthType Basic
Require all granted
AuthName "Nagios Access"
AuthLDAPURL ldap://ldap.miserver.local/dc=miserver,dc=local?uid?sub?(objectClass=*)
AuthBasicprovider ldap
AuthUserFile /dev/null
Require valid-user



Ahora modificamos el nagios para que acepte los usuarios:

/
#nano /usr/local/nagios/etc/cgi.cfg

Y dejamos las siguientes líneas así:


authorized_for_system_information=*
authorized_for_configuration_information=*
authorized_for_system_commands=*
authorized_for_all_services=*
authorized_for_all_hosts=*
authorized_for_all_service_commands=*
authorized_for_all_host_commands=*

Reiniciamos apache + nagios y a probar !!!!!!!!

Deja un comentario

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *

*