<div dir="ltr">Hi Alex,<div><br></div><div>Even while using LDAP a browser (jxplorer) I can not login with the following user DN</div><div>uid=admin,cn=users,cn=accounts,dc=mydomain,dc=com<br></div><div><br></div><div>javax.naming.AuthenticationException: [LDAP: error code 49 - Invalid Credentials]<br></div><div><br></div><div>Only the Directory Manager cn and pwd works.</div><div>Any ideas what am I doing wrong?</div><div><br></div><div>Thanks!</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Mar 24, 2017 at 10:46 AM, Alexander Bokovoy <span dir="ltr"><<a href="mailto:abokovoy@redhat.com" target="_blank">abokovoy@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On pe, 24 maalis 2017, Maciej Drobniuch wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi All,<br>
<br>
I'm trying to integrate Freeipa with jenkins and ldap auth plugin.<br>
<br>
The thing with the Freeipa LDAP server is:<br>
* Only Directory Manager can read userPassword field (not sure yet how to<br>
create a sysaccount which can read the field. ldifs are welcome ;)<br>
</blockquote></span>
This is absolutely not needed. You should configure Jenkins to perform<br>
LDAP bind with user password against IPA LDAP server, that's all. This<br>
is supported by acegi security framework that Jenkins LDAP plugin is<br>
using. For example,<br>
<a href="https://github.com/jenkinsci/ldap-plugin/blob/master/src/main/resources/hudson/security/LDAPBindSecurityRealm.groovy" rel="noreferrer" target="_blank">https://github.com/jenkinsci/l<wbr>dap-plugin/blob/master/src/mai<wbr>n/resources/hudson/security/LD<wbr>APBindSecurityRealm.groovy</a><br>
actually uses<br>
org.acegisecurity.providers.ld<wbr>ap.authenticator.BindAuthentic<wbr>ator2 which<br>
does support normal LDAP bind.<br>
<br>
I think it is, in fact, a default setup for Jenkins LDAP auth plugin, so<br>
you actually needed to do something to disable this path.<span class=""><br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
* The userPassword field contains the password in salted SHA (SSHA) format.<br>
>From what I've observed the standard LDAP auth functions do not do the SSHA<br>
or any other type of calculations. The password is compared to the plain<br>
text that's usually(in a typical OpenLDAP server) stored in the<br>
userPassword field(correct me if I'm wrong)<br>
* I've managed to integrate CACTI with freeipa by base64 decoding the<br>
userPassword field then calculating the salted hash and comparing to the<br>
userPassword field. (php code modification was required).<br>
* I think the only way is to modify the jenkins LDAP plugin (?).<br>
<br>
The problem:<br>
* I don't want to use sssd PAM because we have OTP enabled and that would<br>
annoy users(?) additionally it's causing some unidentified build issues<br>
BTW> Can I disable OTP per server?<br>
* I can not integrate Kerberos/GSSAPI/SPNEGO because the PCs are not<br>
connected to the principal(no control over them yet)<br>
* I want simple LDAP auth ;-)<br>
</blockquote></span>
So use simple LDAP bind.<div class="HOEnZb"><div class="h5"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Ideas & suggestions are welcome!<br>
<br>
M.<br>
<br>
On Sat, Feb 11, 2017 at 4:28 PM, Michael Ströder <<a href="mailto:michael@stroeder.com" target="_blank">michael@stroeder.com</a>><br>
wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Alexander Bokovoy wrote:<br>
> On la, 11 helmi 2017, Michael Ströder wrote:<br>
>> Alexander Bokovoy wrote:<br>
>>> On la, 11 helmi 2017, Harald Dunkel wrote:<br>
>>>> On 02/11/17 11:57, Alexander Bokovoy wrote:<br>
>>>>> On la, 11 helmi 2017, Michael Ströder wrote:<br>
>>>>>><br>
>>>>>> (Personally I'd avoid going through PAM.)<br>
>>>>> Any specific reason for not using pam_sss? Remember, with SSSD<br>
involved<br>
>>>>> you get also authentication for trusted users from Active Directory<br>
>>>>> realms. You don't get that with generic LDAP way. Also, you'd be more<br>
>>>>> efficient in terms of utilising LDAP connections.<br>
>>>>><br>
>>>><br>
>>>> I would prefer if the users are not allowed to login into a<br>
>>>> shell on the Jenkins server. Surely this restriction can be<br>
>>>> implemented with pam as well.<br>
>>><br>
>>> Yes, you can use HBAC rules to prevent them from access to the host.<br>
>><br>
>> But this introduces a hard dependency on host system administration<br>
which I personally<br>
>> always try to avoid.<br>
>><br>
>> As said: Your mileage may vary.<br>
><br>
> So we are talking about FreeIPA and a system enrolled to FreeIPA. This<br>
> system is already managed in FreeIPA.<br>
<br>
Please don't get me wrong. Of course I assume that the original poster<br>
wants to integrate<br>
Jenkins with FreeIPA and make use of users and their group membership<br>
already maintained<br>
therein.<br>
<br>
Let's further assume that the service (here Jenkins) might be operated by<br>
another team<br>
than the system - not so unusual case at my customers' sites - relying on<br>
defining HBAC<br>
rules for the system's sssd might not be feasible.<br>
<br>
> Your mileage may vary, indeed, but I'd rather re-use what is available<br>
> to you than implement a parallel infrastructure, including reliability<br>
> aspects.<br>
<br>
Of course we both agree on the benefits of using what's already available.<br>
<br>
> Anyway, I think we are distancing away from the original topic.<br>
<br>
Especially since we both can only make rough assumptions about<br>
requirements and<br>
operational constraints of the original poster.<br>
<br>
Ciao, Michael.<br>
<br>
<br>
--<br>
Manage your subscription for the Freeipa-users mailing list:<br>
<a href="https://www.redhat.com/mailman/listinfo/freeipa-users" rel="noreferrer" target="_blank">https://www.redhat.com/mailman<wbr>/listinfo/freeipa-users</a><br>
Go to <a href="http://freeipa.org" rel="noreferrer" target="_blank">http://freeipa.org</a> for more info on the project<br>
<br>
</blockquote>
<br>
<br>
<br>
-- <br>
Best regards<br>
<br>
Maciej Drobniuch<br>
Network Security Engineer<br>
Collective-Sense,LLC<br>
</blockquote>
<br></div></div><span class="HOEnZb"><font color="#888888">
-- <br>
/ Alexander Bokovoy<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Best regards</div><div dir="ltr"><br><div><span style="font-size:12.8px">Maciej Drobniuch</span></div><div>Network Security Engineer</div><div><div style="font-size:small"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><div style="font-size:12.8px">Collective-Sense,LLC</div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>
</div>