Integrate LibreNMS with FreeIPA Authentication

LibreNMS supports multiple authentication modules,but LibreNMS doesn’t support multiple authentication mechanisms at the same time.To enable a particular authentication module you need to set this up in config.php.

To use ldap freeipa for authentication LibreNMS we need Install php_ldap or php7.0-ldap, making sure to install the same version as PHP.

Prequisite : LibreNMS installed

Before install update repository package

#apt update
#apt install Install php_ldap

Go to LibreNMS installation directory and edit file config.php

#cd /opt/librenms
#nano config.php

add configuration for LDAP Authentication

#LDAP Auth
$config['auth_mechanism'] = 'ldap';
$config['auth_ldap_debug'] = false;
$config['auth_ldap_server'] = 'ldap://<ldap_server>'; //ip or domain Freeipa Server
$config['auth_ldap_suffix'] = ',cn=users,cn=accounts,dc=exaple,dc=com';
$config['auth_ldap_groupbase'] = 'cn=groups,cn=accounts,dc=example,dc=com';
$config['auth_ldap_groups']['monitoring']['level'] = 10; //maping user group to user role LibreNMS
$config['auth_ldap_groupmemberattr'] = 'member';
$config['auth_ldap_userdn'] = true;
$config['auth_ldap_binduser'] = 'bind_user'; 
$config['auth_ldap_binddn'] = 'uid=bind_user,cn=users,cn=accounts,dc=example,dc=com';
$config['auth_ldap_bindpassword'] = 'password';

Test auth with authtest.php

#cd /opt/librenms/script
# ./auth_test.php -u librenms
Authentication Method: ldap
Password:
Authenticate user librenms:
AUTH SUCCESS

now we can login to librenNMS with LDAP user

Leave a Reply

Your email address will not be published. Required fields are marked *