-
Notifications
You must be signed in to change notification settings - Fork 252
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ldap: add 'exop_force' value for ldap_pwmodify_mode #7614
Conversation
Sorry for the ignorant question, but how does this differ from SDAP_PPOLICY_PWD_CHANGE_THRESHOLD in https://github.com/SSSD/sssd/blob/master/src/providers/ldap/ldap_auth.c#L243-L249 ? |
Hi, it is related but not the same. The threshold value should make sure that there are a sufficient number of grace logins left to properly change the password. Due to the nature of the two-step PAM flow for password changes and that we do not keep the LDAP connection open between the two steps, a password change requires multiple binds/grace logins. This option is currently only evaluated in the code path where we explicitly check as part of the access control if the password is about to expired, e.g. when using an ssh key for authentication. The current change affects the code path where we already get the information that the password is expired during authentication from the LDAP server, i.e. when authenticating with a password with HTH bye, |
Thank you for the explanation, it makes sense to me now. Ack. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Sumit, would it be possible for you to write a system test? There are already few in test_ldap.py that tests "exop".
Hi, sure, I can add bye, |
That's one option, but that won't hit "grace logins exhausted", right? It might be better to add a new test for this case. |
b36e10d
to
1467fe1
Compare
I added a test, please check if I followed all rules and used proper meta-data. |
1467fe1
to
40897dc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sorry, I missed that this is only for OpenLDAP. We could add OpenLDAP instance to the containers and new topology that would run tests against it, do you think it is worth it? Otherwise, we can just drop this test, I suppose.
Hi, so far (after spending quite some time to find the right settings) I'm not able to reproduce the issue with OpenLDAP but I got logs which shows that OpenLDAP can be configured to act in this way (allow password change exop if no grace logins left and bind failed). Having a test which shows that SSSD will ask for a new password with So I think there is no need so far to add an OpenLDAP instance and if you agree we can keep the test. bye, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, ok, let's keep the test. But see some suggestions inline.
40897dc
to
b7c640e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, this looks great.
Could you run black .
and fix pep8 errors?
./tests/test_ldap.py:458:1: E302 expected 2 blank lines, found 1
./tests/test_ldap.py:461:25: E128 continuation line under-indented for visual indent
black is an autoformatter, that will format the code using pep8 rules.
b7c640e
to
7e16b79
Compare
Hi, new version includes formatted code. bye, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack. Thank you for working on the test.
I have two minor comments, but you can ignore them if you want to. Let me know, I'll approve afterwards.
7e16b79
to
8a8873f
Compare
@sumit-bose, could you please add |
In case the LDAP server allows to run the extended operation to change a password even if an authenticated bind fails due to missing grace logins the new option 'exop_force' can be used to run the extended operation to change the password anyways. :config: Added `exop_force` value for configuration option `ldap_pwmodify_mode`. This can be used to force a password change even if no grace logins are left. Depending on the configuration of the LDAP server it might be expected that the password change will fail.
The new value for the ldap_pwmodify_mode option 'exop_force' is added to existing test. A new test to illustrate the different behavior of 'exop' and 'exop_force' is added.
8a8873f
to
7c8564c
Compare
so please open explicit backport PR if C9S needs this. I didn't check, maybe conflict was in the test only. |
Hi, no. it is mainly about missing bye, |
In case the LDAP server allows to run the extended operation to change a
password even if an authenticated bind fails due to missing grace logins
the new option 'exop_force' can be used to run the extended operation to
change the password anyways.