Ad Widget

Collapse

LDAP Authentication/Account Creation

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jojo
    Member
    • Jul 2006
    • 57

    #1

    LDAP Authentication/Account Creation

    AT LAST! Updated for 2.4.x

    I know it's been a while since i updated this post. I recently had a requirement where an organisation required ldap support to be enabled as well as the ability to have any of their staff log in and use Zabbix.

    By default, you aren't able to do this because you need an account to be created in Zabbix before you can log in.

    Well, not anymore. I have updated and simplified the patch i wrote almost 5 years ago. The patch will auto create a zabbix account if it does not exist provided that the user is able to be successfully authenticated via an alternative authentication mechanism ie LDAP. The user is created as a regular Zabbix user with all of the defaults. No media etc is configured and their surname is hardcoded to "autocreated".

    Pre-installation requirements:

    Before you install the patch, you should go to Administration > Users > User groups and ensure the Guests group is enabled.

    You'll then need to edit the Guests group and ensure permissions have been appropriately applied. In my scenario, i provided read only access to all groups.

    After that you can download the patch and install it. I normally use the Zabbix rpms at repo.zabbix.com because its soooooo much easier in large scale deployments (especially with an internal yum repo) so the absolute path to the file required to be patch is /usr/share/zabbix/include/classes/api/services/CUser.php (or frontends/php/include/classes/api/services/CUser.php if your compiling from source).

    Copy the patch file the right location and patch the file using:
    patch -p0 -i CUser.php.patch

    Patch was tested against 2.4.1 but could be compatible with older versions as well.

    Have fun!
    Attached Files
    Last edited by jojo; 15-01-2015, 06:03.
  • nelsonab
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Sep 2006
    • 1233

    #2
    You may want to repost this in the patches section of the forum.
    RHCE, author of zbxapi
    Ansible, the missing piece (Zabconf 2017): https://www.youtube.com/watch?v=R5T9NidjjDE
    Zabbix and SNMP on Linux (Zabconf 2015): https://www.youtube.com/watch?v=98PEHpLFVHM

    Comment

    • r0k5t4r
      Member
      • Jun 2009
      • 91

      #3
      Hi,

      I tried this in 1.8.8 and the patch is no longer working. Would be nice to have this feature built in Zabbix by default.

      Comment

      • jojo
        Member
        • Jul 2006
        • 57

        #4
        wow, that was two years ago? time flies.

        I've just installed Zabbix 1.8.6 from some old RPM's lying around but i'll probably update to the latest stable version which at the time of writing this is 1.8.10.

        If this isn't already incorporated into the latest stable release, i'll rewrite it as i'm much more proficient with OOP PHP and MVC frameworks these days and post the patch in the appropriate section of the forums.

        Comment

        • tjyang
          Junior Member
          • Jun 2016
          • 11

          #5
          jojo , I am testing zabbix 3.4.8 and found by default valid ldap/AD user still can't be created automatically.
          Can you post your patch somewhere public I can download ?
          Thanks.

          Comment

          • mortiz
            Junior Member
            • Jan 2018
            • 13

            #6
            Originally posted by tjyang
            jojo , I am testing zabbix 3.4.8 and found by default valid ldap/AD user still can't be created automatically.
            Can you post your patch somewhere public I can download ?
            Thanks.
            8 years have passed. I don’t think the script is up-to-date, try it https://github.com/zabbix-tooling/zabbix-ldap-sync

            Comment

            Working...