<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    On 11/25/2013 12:38 PM, Viviano, Brad wrote:<br>
    <span style="white-space: pre;">&gt; Some additional information on
      my problem.<br>
      &gt;<br>
      &gt; I've confirmed that for ssh, I am going through pam_sss.so
      just fine. If I set the following in my sssd.conf:<br>
      &gt;<br>
      &gt; ldap_access_order = filter<br>
      &gt; ldap_access_filter = (!(pwdAccountLockedTime=*))<br>
      &gt;<br>
      &gt; Then the user doesn't get access if their account is locked:<br>
      &gt;<br>
      &gt; $ ssh bviviano@somehost<br>
      &gt; Connection closed<br>
      &gt;<br>
      &gt; Since this is a filter, it can't really give the user a
      reason, they just get disconnected. It isn't an ideal situation,
      but it works. My question to the sssd developers is, am I missing
      something in sssd.conf that would make this work better and be
      more useful to the user. As I said in a previous message, I don't
      see anything in the manual pages or the WIKI that lists
      OpenLDAP/ppolicy specific configurations or even if they are
      supported.<br>
      &gt;<br>
    </span><br>
    Couple thoughts:<br>
    1) May be you can create a virtual attribute in OpenLDAP using some
    plugin/overlay that would be true/false based on the presence of the
    pwdAccountLockedTime. Then you would be able to point to it as an
    attribute rather than use a filter.<br>
    2) I do not recall this issue discussed on the list before. You
    might want to file an RFE. However I am not sure how soon we would
    be able to get to it. But help is always welcome!<br>
    <br>
    <br>
    <span style="white-space: pre;">&gt; Thanks,<br>
      &gt; -Brad Viviano<br>
      &gt;<br>
      &gt; ===================================================<br>
      &gt; Brad Viviano<br>
      &gt; High Performance Computing &amp; Scientific Visualization<br>
      &gt; Lockheed Martin, Supporting the EPA<br>
      &gt; Research Triangle Park, NC<br>
      &gt; 919-541-2696<br>
      &gt;<br>
      &gt; HSCSS Task Order Lead - Ravi Nair<br>
      &gt; 919-541-5467 - <a class="moz-txt-link-abbreviated" href="mailto:Nair.Ravi@epa.gov">Nair.Ravi@epa.gov</a><br>
      &gt; High Performance Computing Subtask Lead - Durward Jones<br>
      &gt; 919-541-5043 - <a class="moz-txt-link-abbreviated" href="mailto:Jones.Durward@epa.gov">Jones.Durward@epa.gov</a><br>
      &gt; Environmental Modeling and Visualization Lead - Heidi Paulsen<br>
      &gt; 919-541-1834 - <a class="moz-txt-link-abbreviated" href="mailto:Paulsen.Heidi@epa.gov">Paulsen.Heidi@epa.gov</a><br>
      &gt;<br>
      &gt; ________________________________________<br>
      &gt; From: <a class="moz-txt-link-abbreviated" href="mailto:sssd-devel-bounces@lists.fedorahosted.org">sssd-devel-bounces@lists.fedorahosted.org</a>
      <a class="moz-txt-link-rfc2396E" href="mailto:sssd-devel-bounces@lists.fedorahosted.org">&lt;sssd-devel-bounces@lists.fedorahosted.org&gt;</a> on behalf of
      Viviano, Brad <a class="moz-txt-link-rfc2396E" href="mailto:Viviano.Brad@epa.gov">&lt;Viviano.Brad@epa.gov&gt;</a><br>
      &gt; Sent: Monday, November 25, 2013 10:29 AM<br>
      &gt; To: Development of the System Security Services Daemon<br>
      &gt; Subject: Re: [SSSD] Configuring SSSD expire policy with
      OpenLDAP and SSH.<br>
      &gt;<br>
      &gt; I turned debugging in sssd on at a high level for the LDAP
      section and found the following in the log when I try and login
      with a locked account, that has an SSH public key:<br>
      &gt;<br>
      &gt; (Mon Nov 25 09:18:12 2013) [sssd[be[default]]]
      [sdap_attrs_add_ldap_attr] (0x2000): Adding nsAccountLock
      [20131125140156Z] to attributes of [bviviano].<br>
      &gt;<br>
      &gt;<br>
      &gt; This directly corresponds to the pwdAccountLockedTime set on
      my account, which is what I set ldap_ns_account_lock to:<br>
      &gt;<br>
      &gt; [root@smtools ldap]# ldapsearch -x -ZZ cn=bviviano
      pwdAccountLockedTime<br>
      &gt; # extended LDIF<br>
      &gt; #<br>
      &gt; # LDAPv3<br>
      &gt; # base &lt;dc=epa,dc=gov&gt; (default) with scope subtree<br>
      &gt; # filter: cn=bviviano<br>
      &gt; # requesting: pwdAccountLockedTime<br>
      &gt; #<br>
      &gt;<br>
      &gt; # bviviano, users, epa.gov<br>
      &gt; dn: cn=bviviano,cn=users,dc=epa,dc=gov<br>
      &gt; pwdAccountLockedTime: 20131125140156Z<br>
      &gt;<br>
      &gt; # search result<br>
      &gt; search: 3<br>
      &gt; result: 0 Success<br>
      &gt;<br>
      &gt; # numResponses: 2<br>
      &gt; # numEntries: 1<br>
      &gt;<br>
      &gt; From reading, "nsAccountLock" is expecting a true/false
      field. OpenLDAP ppolicy doesn't seem to provide a locked/unlocked
      true/false in any field. It only provides pwdAccountLockedTime,
      which has the form of a time stamp. Is there anything in sssd.conf
      that would allow me to check no the value of
      "pwdAccountLockedTime" but if that value exists or not. I might be
      able to craft an LDAP filter and search on that not existing, but
      thought I'd ask if anyone else has been able to get OpenLDAP
      w/ppolicy to work with SSSD.<br>
      &gt;<br>
      &gt; Thanks,<br>
      &gt; -Brad Viviano<br>
      &gt;<br>
      &gt; ===================================================<br>
      &gt; Brad Viviano<br>
      &gt; High Performance Computing &amp; Scientific Visualization<br>
      &gt; Lockheed Martin, Supporting the EPA<br>
      &gt; Research Triangle Park, NC<br>
      &gt; 919-541-2696<br>
      &gt;<br>
      &gt; HSCSS Task Order Lead - Ravi Nair<br>
      &gt; 919-541-5467 - <a class="moz-txt-link-abbreviated" href="mailto:Nair.Ravi@epa.gov">Nair.Ravi@epa.gov</a><br>
      &gt; High Performance Computing Subtask Lead - Durward Jones<br>
      &gt; 919-541-5043 - <a class="moz-txt-link-abbreviated" href="mailto:Jones.Durward@epa.gov">Jones.Durward@epa.gov</a><br>
      &gt; Environmental Modeling and Visualization Lead - Heidi Paulsen<br>
      &gt; 919-541-1834 - <a class="moz-txt-link-abbreviated" href="mailto:Paulsen.Heidi@epa.gov">Paulsen.Heidi@epa.gov</a><br>
      &gt;<br>
      &gt; ________________________________________<br>
      &gt; From: <a class="moz-txt-link-abbreviated" href="mailto:sssd-devel-bounces@lists.fedorahosted.org">sssd-devel-bounces@lists.fedorahosted.org</a>
      <a class="moz-txt-link-rfc2396E" href="mailto:sssd-devel-bounces@lists.fedorahosted.org">&lt;sssd-devel-bounces@lists.fedorahosted.org&gt;</a> on behalf of
      Stephen Gallagher <a class="moz-txt-link-rfc2396E" href="mailto:sgallagh@redhat.com">&lt;sgallagh@redhat.com&gt;</a><br>
      &gt; Sent: Monday, November 25, 2013 7:20 AM<br>
      &gt; To: Development of the System Security Services Daemon<br>
      &gt; Subject: Re: [SSSD] Configuring SSSD expire policy with
      OpenLDAP and SSH.<br>
      &gt;</span><br>
    <blockquote type="cite">On 11/24/2013 04:19 PM, Jakub Hrozek wrote:<br>
      &gt; On Fri, Nov 22, 2013 at 03:16:16PM -0500, Dmitri Pal wrote:<br>
      &gt;&gt; On 11/22/2013 02:51 PM, Viviano, Brad wrote:<br>
      &gt;&gt;&gt; Hello, I've searched extensively and haven't found an
      answer to<br>
      &gt;&gt;&gt; this.  I have a RHEL6.4 system running slapd version<br>
      &gt;&gt;&gt; 2.4.23-32.el6_4.1 with sssd version
      1.9.2-82.11.el6_4.  I've<br>
      &gt;&gt;&gt; configured OpenLDAP to use ppolicy.  Everything
      (password<br>
      &gt;&gt;&gt; expires, account locked, grace periods, etc) is
      working<br>
      &gt;&gt;&gt; beautifully if the user logs in with their password.
      But if<br>
      &gt;&gt;&gt; they have an SSH public key, then even if the account
      in<br>
      &gt;&gt;&gt; OpenLDAP is locked, the user can still login. I can't
      seem to<br>
      &gt;&gt;&gt; find a FAQ on configuring OpenLDAP and SSSD in
      regards to<br>
      &gt;&gt;&gt; ppolicy settings for this case.  I hope I am just
      missing<br>
      &gt;&gt;&gt; something simple.  Any suggestions or pointers would
      be much<br>
      &gt;&gt;&gt; appreciated.<br>
      &gt;&gt;<br>
      &gt;&gt; You want to use account policies when log using SSH keys?<br>
      &gt;&gt;<br>
      &gt;&gt; I am not an expert so I am not sure exactly how to do or
      whether<br>
      &gt;&gt; it is possible but I think you need to make sure that
      when you<br>
      &gt;&gt; log into the system via SSH the PAM accounting phase is<br>
      &gt;&gt; performed. Please check SSH config to invoke pam
      accounting for<br>
      &gt;&gt; access control checks then you can use SSSD in the pam
      stack and<br>
      &gt;&gt; use its access control provider configuration for LDAP to
      do the<br>
      &gt;&gt; checks. At least this is the direction I would try to
      dig.<br>
      &gt;&gt;<br>
      &gt;&gt; HTH Dmitri<br>
      <br>
      &gt; Dmitri is completely right.<br>
      <br>
      &gt; When you log in with your public key the authentication is<br>
      &gt; performed by sshd, so the SSSD's pam_sss doesn't come to play
      in<br>
      &gt; the authentication.<br>
      <br>
      &gt; Some password policies (eg shadow) would be possible to check
      later<br>
      &gt; during the account phase, but typically the expiration data
      is<br>
      &gt; returned by the LDAP server during authentication, so this
      solution<br>
      &gt; wouldn't be generic.<br>
      <br>
      &gt; Also, by using public keys, you are logging in with another<br>
      &gt; authentication token then your password, so it would seem
      strange a<br>
      &gt; bit to warn about password properties.<br>
      <br>
      &gt; Account expiration is a different matter than password
      policy.<br>
      &gt; Expiration should always be checked during account phase. I'm
      not<br>
      &gt; sure which mechanism is most prevalent in OpenLDAP
      deployments, but<br>
      &gt; please check the sssd-ldap man page, option<br>
      &gt; 'ldap_account_expire_policy'. If there is some widely used
      overlay<br>
      &gt; or other mechanism which is not supported by the SSSD, let us<br>
      &gt; know.<br>
      <br>
      Two other things to check:<br>
      <br>
      1) Is /etc/ssh/sshd_config set with "Use PAM = yes"?<br>
      2) What do you have set in sssd.conf for access_provider? If
      you're<br>
      not using "access_provider = ldap" and the appropriate<br>
      "ldap_access_order" settings, the expiration policy may not be
      checked.<br>
      <br>
    </blockquote>
    <span style="white-space: pre;">&gt;
      _______________________________________________<br>
      &gt; sssd-devel mailing list<br>
      &gt; <a class="moz-txt-link-abbreviated" href="mailto:sssd-devel@lists.fedorahosted.org">sssd-devel@lists.fedorahosted.org</a><br>
      &gt; <a class="moz-txt-link-freetext" href="https://lists.fedorahosted.org/mailman/listinfo/sssd-devel">https://lists.fedorahosted.org/mailman/listinfo/sssd-devel</a><br>
      &gt; _______________________________________________<br>
      &gt; sssd-devel mailing list<br>
      &gt; <a class="moz-txt-link-abbreviated" href="mailto:sssd-devel@lists.fedorahosted.org">sssd-devel@lists.fedorahosted.org</a><br>
      &gt; <a class="moz-txt-link-freetext" href="https://lists.fedorahosted.org/mailman/listinfo/sssd-devel">https://lists.fedorahosted.org/mailman/listinfo/sssd-devel</a><br>
      &gt; _______________________________________________<br>
      &gt; sssd-devel mailing list<br>
      &gt; <a class="moz-txt-link-abbreviated" href="mailto:sssd-devel@lists.fedorahosted.org">sssd-devel@lists.fedorahosted.org</a><br>
      &gt; <a class="moz-txt-link-freetext" href="https://lists.fedorahosted.org/mailman/listinfo/sssd-devel">https://lists.fedorahosted.org/mailman/listinfo/sssd-devel</a></span><br>
    <br>
    -- <br>
    Thank you,<br>
    Dmitri Pal<br>
    <br>
    Sr. Engineering Manager for IdM portfolio<br>
    Red Hat Inc.<br>
    <br>
    <br>
    -------------------------------<br>
    Looking to carve out IT costs?<br>
    <a class="moz-txt-link-abbreviated" href="http://www.redhat.com/carveoutcosts/">www.redhat.com/carveoutcosts/</a><br>
    <br>
    <br>
    <br>
  </body>
</html>