Repository navigation
server: skip password policies check on empty password - #8370
Conversation
|
I'm not sure if this is significant enough for 4.19, if not, I can target 4.18.2. |
|
@JoaoJandre would be good to fix in 4.18 branch but it seems it needs a DB change in the upgrade path. Not sure if it is desired at this point to have a 4181to4182 upgrade path |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## 4.18 #8370 +/- ##
=============================================
+ Coverage 13.12% 30.65% +17.52%
- Complexity 9141 33788 +24647
=============================================
Files 2720 5341 +2621
Lines 257723 374864 +117141
Branches 40177 54518 +14341
=============================================
+ Hits 33838 114905 +81067
- Misses 219595 244804 +25209
- Partials 4290 15155 +10865
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
|
is it wise to allow for empty passwords? I may be misinterpreting this code, but I would not want this in a default install. Or is this only applicable for LDAP logins? BTW, the update is not necessary if the workaround is mentioned in the release notes. To my knowledge this fix is directed only at installations using LDAP, as mentioned in https://lists.apache.org/thread/tqtcwsfb0knmvqct1hlow4ty2nc2w2j2, is it? these are questions/discussion points, no comments on the code. |
As the password is a required field when creating users using createAccount and createUser APIs, blank passwords are not allowed. Furthermore, on the updateUser API the password we check if the password is blank as well. The password policies were created on #6567 with the intention of being optional to keep backwards compatibility; therefore, I'd say that it makes sense to not block the operation using the default regex.
Yes this fix is directed only on installations using LDAP, from the code inspection that I did, the only instance of an empty password is on that method I mentioned on the description, the rest of the code will not allow a password that does not have at least one character. Anyway, do you think that a note on the release notes is all that is needed on this case @DaanHoogland @weizhouapache @shwstppr ? |
|
@JoaoJandre |
I'd rather keep the feature agnostic and avoid adding different workflows. If the consensus is that changing the configuration value is not the best solution, I'd rather either document the behavior, or change the call on |
I agree, certainly if the LDAP autentication is the only one that suffers. I do not remember exactly how this works, but LDAP should put its own requirements on passwords. |
weizhouapache
left a comment
There was a problem hiding this comment.
code lgtm
@JoaoJandre
can you rebase with 4.18 ?
e1d5604 to
e8b74f7
Compare
|
@blueorangutan package |
|
@shwstppr a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 8120 |
|
@blueorangutan test |
|
@weizhouapache a [SL] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
[SF] Trillian test result (tid-8658)
|
|
testing result look ok |
This PR changes the password.policy.regex default value to empty. With an empty value for the configuration, it is skipped during the password policy check, only when the configuration is set to something different than a blank string, the regex will get checked. This way, when creating a user on org.apache.cloudstack.ldap.LdapAuthenticator#authenticate() we won't get an error by default, as an empty value for the password is passed.
…pache#396) This PR changes the password.policy.regex default value to empty. With an empty value for the configuration, it is skipped during the password policy check, only when the configuration is set to something different than a blank string, the regex will get checked. This way, when creating a user on org.apache.cloudstack.ldap.LdapAuthenticator#authenticate() we won't get an error by default, as an empty value for the password is passed. Co-authored-by: João Jandre <48719461+JoaoJandre@users.noreply.github.com>
Description
This PR changes the
password.policy.regexdefault value to empty. With an empty value for the configuration, it is skipped during the password policy check, only when the configuration is set to something different than a blank string, the regex will get checked.This way, when creating a user on
org.apache.cloudstack.ldap.LdapAuthenticator#authenticate()we won't get an error by default, as a empty value for the password is passed.Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?