Page 2 of 2

Re: LDAP integration

Posted: Fri Aug 05, 2016 2:49 pm
by Linuxlogger
Found the BasicLDAP.php file but it does not contain the referenced section. PM sent with file contents.

Re: LDAP integration

Posted: Fri Aug 05, 2016 2:55 pm
by Linuxlogger
The BasicLDAP.php is contained below and I see no

Code: Select all

"public function findBaseDn() 
    {
        $namingContext = $this->getRootDse(array('namingcontexts'));
        return $namingContext[0]['namingcontexts'][0];
    }"

Code: Select all


#more  /var/www/html/nagioslogserver/application/libraries/BasicLDAP.php
<?php @"SourceGuardian"; //v10.1.6 ?><?php // Copyright (c) 2008-2016 Nagios Enterprises, LLC.  All rights reserved. ?><?php
if(!function_exists('sg_load')){$__v=phpversion();$__x=explode('.',$__v);$__v2=$__x[0].'.'.(int)$__x[1];$__u=strtolower(substr(php_uname(),0,3));$__ts=(@constant('PHP_ZTS') || @constan
t('ZEND_THREAD_SAFE')?'ts':'');$__f=$__f0='ixed.'.$__v2.$__ts.'.'.$__u;$__ff=$__ff0='ixed.'.$__v2.'.'.(int)$__x[2].$__ts.'.'.$__u;$__ed=@ini_get('extension_dir');$__e=$__e0=@realpath($
__ed);$__dl=function_exists('dl') && function_exists('file_exists') && @ini_get('enable_dl') && !@ini_get('safe_mode');if($__dl && $__e && version_compare($__v,'5.2.5','<') && function
_exists('getcwd') && function_exists('dirname')){$__d=$__d0=getcwd();if(@$__d[1]==':') {$__d=str_replace('\\','/',substr($__d,2));$__e=str_replace('\\','/',substr($__e,2));}$__e.=($__h
=str_repeat('/..',substr_count($__e,'/')));$__f='/ixed/'.$__f0;$__ff='/ixed/'.$__ff0;while(!file_exists($__e.$__d.$__ff) && !file_exists($__e.$__d.$__f) && strlen($__d)>1){$__d=dirname
($__d);}if(file_exists($__e.$__d.$__ff)) dl($__h.$__d.$__ff); else if(file_exists($__e.$__d.$__f)) dl($__h.$__d.$__f);}if(!function_exists('sg_load') && $__dl && $__e0){if(file_exists(
$__e0.'/'.$__ff0)) dl($__ff0); else if(file_exists($__e0.'/'.$__f0)) dl($__f0);}if(!function_exists('sg_load')){$__ixedurl='http://www.sourceguardian.com/loaders/download.php?php_v='.u
rlencode($__v).'&php_ts='.($__ts?'1':'0').'&php_is='.@constant('PHP_INT_SIZE').'&os_s='.urlencode(php_uname('s')).'&os_r='.urlencode(php_uname('r')).'&os_m='.urlencode(php_uname('m'));
$__sapi=php_sapi_name();if(!$__e0) $__e0=$__ed;if(function_exists('php_ini_loaded_file')) $__ini=php_ini_loaded_file(); else $__ini='php.ini';if((substr($__sapi,0,3)=='cgi')||($__sapi=
='cli')||($__sapi=='embed')){$__msg="\nPHP script '".__FILE__."' is protected by SourceGuardian and requires a SourceGuardian loader '".$__f0."' to be installed.\n\n1) Download the req
uired loader '".$__f0."' from the SourceGuardian site: ".$__ixedurl."\n2) Install the loader to ";if(isset($__d0)){$__msg.=$__d0.DIRECTORY_SEPARATOR.'ixed';}else{$__msg.=$__e0;if(!$__d
l){$__msg.="\n3) Edit ".$__ini." and add 'extension=".$__f0."' directive";}}$__msg.="\n\n";}else{$__msg="<html><body>PHP script '".__FILE__."' is protected by <a href=\"http://www.sour
ceguardian.com/\">SourceGuardian</a> and requires a SourceGuardian loader '".$__f0."' to be installed.<br><br>1) <a href=\"".$__ixedurl."\" target=\"_blank\">Click here</a> to download
 the required '".$__f0."' loader from the SourceGuardian site<br>2) Install the loader to ";if(isset($__d0)){$__msg.=$__d0.DIRECTORY_SEPARATOR.'ixed';}else{$__msg.=$__e0;if(!$__dl){$__
msg.="<br>3) Edit ".$__ini." and add 'extension=".$__f0."' directive<br>4) Restart the web server";}}$msg.="</body></html>";}die($__msg);exit();}}return sg_load('52C4625FB82E51A9AAQAAA
AWAAAABHAAAACABAAAAAAAAAD/yt88Lix74mYuqruyoH8iJljDerPjNZr0misv9Sgtb+nOAWYZp2u3T/pYwMoT3qHb16nHr0yuw0bk6GMqZkitC5xU80kk2Xx/Tx0CSMWPTO7+k87nvZsLtFgRkIBKhY/vTd3/L3tT3rUh2dC+g5gujwUAAAC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RwjsVw8/6y7F3o4+f/UlCL5k9idH+DAggsqDo0RwEVL6WvB56t21vFgOONA7laKAA+Wmki8SbgrSXdBFc8oe71QUdsIQ75AtnAZ/hV/TJgjgskirX942pmM9BK/A8qFEV39haFsQSnMQvT5G5GArqpDmMXWJVfs+iEVlN9+9NL+LrOe2e
/rNQbZjgopDHm6680zZ2QJyQZ7ZE3tsJ+l0VOx9BuXmPxCnBTUAqHubjDrbuzmoYyH40pkv5K81GX0f3xFag5eCfiFYko4ddJA8bdH3HawvQCzVYDINkNfmrl+1k/d64z4pSag+tVEDz95uVIF0fCKv4wCNuh3KmeUxfTXwXJZQpp/Hb+Pn67HXb
JHNkKLtXr/MJvepJGRc4S+hMGVvXGd4xiAS7Sjf+p33PS6ANqV832ArubNzhlJZz3aHNEFcffPqemLVnrPCcXXw6qcrPQ5mymyYm82JpJcYDUP/R7ucSUzIeBgqKRx6ew3Y9PHzaXPOkrcSN7nhULL1JaWaVVUCeU/9DfVCS+q1TB50IG3/tMVDv
W4h+Wkivk1chgC9ojHFI5WNt4BKRV0KLtcvUCo6bRK/v0GzuVkwFGHLwii/Su1zjVp/JUTGmVFOryrzETh2qLxyK4csTQ4MS76uGjW0fjQ8GegrPZUaDV+5RAhwKdjysn0uzvqtX96m2tGGWvDQx0iyFKB0KbRFiXu0It8xMMBe6lI1kzjNKWJ4C
v4JioKlHfQdrZfHE5ZZ5xBbtGMXkmOELAaxkGzLoafQs6/QCwDs7o9aiHAvgb0BNxfXoDF4Xhv13DELy0hGsOWqCOp2o3kyfLvYJwzYaA1XzWoxiC0c+7Lx7ZoCPtCb+Fa2N2WszkuI3AXiKbdZCdOLIQ9stY0W3SlD3OjNmor+RL4jAdnzFIMHF

Re: LDAP integration

Posted: Fri Aug 05, 2016 3:53 pm
by Linuxlogger
Not sure why my reply's are not getting through or showing up here but the BasicLDAP.php file did not contain the section mentioned.

Re: LDAP integration

Posted: Mon Aug 08, 2016 12:53 pm
by ssax
Sorry about that, it looks like the files are encrypted, the developers will need to look into this.

Did you try this?
One thing to try is to go up a level with the Base DN, so try o=ops,dc=mycompany,dc=com (also try just dc=mycompany,dc=com) instead of cn=users,o=ops,dc=mycompany,dc=com.

Re: LDAP integration

Posted: Tue Aug 09, 2016 12:00 pm
by Linuxlogger
When I go up a level in the context my bind user is no longer able to log in.

Re: LDAP integration

Posted: Tue Aug 09, 2016 2:06 pm
by Linuxlogger
My bind user resides in the same container with all my other users, if that makes any difference.

Re: LDAP integration

Posted: Tue Aug 09, 2016 5:08 pm
by ssax
Ok, I've reached out to the developers so that they can look into this.

I believe that the LDAP code was written against OpenLDAP though, I'm not sure what is different in IBM Security Directory.

Re: LDAP integration

Posted: Thu Aug 18, 2016 9:52 am
by Linuxlogger
Since I am doing some LDAP logging with NLS I was able to get the exact LDAP DN for a user. I went into the "Create User" screen and selected LDAP user as type. I entered the full user DN but was still unable to add the LDAP user. I know the config is correct because of the LDAP logging but I am still confused as to why I cannot add an LDAP user to NLS.

Re: LDAP integration

Posted: Thu Aug 18, 2016 5:03 pm
by tmcdonald
Being an encrypted portion of the codebase, we're going to need to make some changes on our end and provide you with updated code to run. Unfortunately this means getting the developers involved which can take some time. We'll get back to you when we know more.

Re: LDAP integration

Posted: Tue Aug 23, 2016 2:00 pm
by ssax
First, make a backup of your current files:

Code: Select all

cp /var/www/html/nagioslogserver/application/libraries/BasicLDAP.php /var/www/html/nagioslogserver/application/libraries/BasicLDAP.php.old
cp /var/www/html/nagioslogserver/application/helpers/ldap_ad_helper.php /var/www/html/nagioslogserver/application/helpers/ldap_ad_helper.php.old
Replace these files with the ones I've attached (unzip them first):

Code: Select all

/var/www/html/nagioslogserver/application/libraries/BasicLDAP.php
/var/www/html/nagioslogserver/application/helpers/ldap_ad_helper.php
Then go into the interface for importing users, after you type your credentials, click on the OU/container/group and then expand it as far as you can go. Please copy all of the text for the entire page and PM me the output.

Then when you're done you can revert the changes:

Code: Select all

cp /var/www/html/nagioslogserver/application/libraries/BasicLDAP.php.old /var/www/html/nagioslogserver/application/libraries/BasicLDAP.php
cp /var/www/html/nagioslogserver/application/helpers/ldap_ad_helper.php.old /var/www/html/nagioslogserver/application/helpers/ldap_ad_helper.php
Thank you