You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2022/04/13 00:03:48 UTC

[GitHub] [cloudstack] nvazquez opened a new pull request, #6254: Fix: Allow disabling the login attempts mechanism for disabling users

nvazquez opened a new pull request, #6254:
URL: https://github.com/apache/cloudstack/pull/6254

   ### Description
   
   This PR allows disabling the login attempts mechanism to disable users after a number of failed login attempts
   
   Fixes: #6251
   
   ### Types of changes
   
   - [ ] Breaking change (fix or feature that would cause existing functionality to change)
   - [ ] New feature (non-breaking change which adds functionality)
   - [x] Bug fix (non-breaking change which fixes an issue)
   - [ ] Enhancement (improves an existing feature and functionality)
   - [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
   
   ### Feature/Enhancement Scale or Bug Severity
   
   #### Feature/Enhancement Scale
   
   - [ ] Major
   - [x] Minor
   
   #### Bug Severity
   
   - [ ] BLOCKER
   - [ ] Critical
   - [ ] Major
   - [x] Minor
   - [ ] Trivial
   
   
   ### Screenshots (if appropriate):
   
   
   ### How Has This Been Tested?
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] weizhouapache commented on pull request #6254: Fix: Allow disabling the login attempts mechanism for disabling users

Posted by GitBox <gi...@apache.org>.
weizhouapache commented on PR #6254:
URL: https://github.com/apache/cloudstack/pull/6254#issuecomment-1098102118

   
   @blueorangutan test
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] blueorangutan commented on pull request #6254: Fix: Allow disabling the login attempts mechanism for disabling users

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on PR #6254:
URL: https://github.com/apache/cloudstack/pull/6254#issuecomment-1098051747

   Packaging result: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: debian :heavy_check_mark: suse15. SL-JID 3161


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] Pearl1594 commented on pull request #6254: Fix: Allow disabling the login attempts mechanism for disabling users

Posted by GitBox <gi...@apache.org>.
Pearl1594 commented on PR #6254:
URL: https://github.com/apache/cloudstack/pull/6254#issuecomment-1097588640

   @blueorangutan test


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] Pearl1594 commented on pull request #6254: Fix: Allow disabling the login attempts mechanism for disabling users

Posted by GitBox <gi...@apache.org>.
Pearl1594 commented on PR #6254:
URL: https://github.com/apache/cloudstack/pull/6254#issuecomment-1097588639

   @blueorangutan test


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] nvazquez commented on pull request #6254: Fix: Allow disabling the login attempts mechanism for disabling users

Posted by GitBox <gi...@apache.org>.
nvazquez commented on PR #6254:
URL: https://github.com/apache/cloudstack/pull/6254#issuecomment-1097403136

   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] blueorangutan commented on pull request #6254: Fix: Allow disabling the login attempts mechanism for disabling users

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on PR #6254:
URL: https://github.com/apache/cloudstack/pull/6254#issuecomment-1098610902

   <b>Trillian test result (tid-3898)</b>
   Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 37571 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr6254-t3898-kvm-centos7.zip
   Smoke tests completed. 90 look OK, 0 have errors
   Only failed tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] nvazquez commented on a diff in pull request #6254: Fix: Allow disabling the login attempts mechanism for disabling users

Posted by GitBox <gi...@apache.org>.
nvazquez commented on code in PR #6254:
URL: https://github.com/apache/cloudstack/pull/6254#discussion_r849434883


##########
server/src/main/java/com/cloud/user/AccountManagerImpl.java:
##########
@@ -2565,6 +2556,22 @@ private UserAccount getUserAccount(String username, String password, Long domain
         }
     }
 
+    protected void updateLoginAttemptsWhenIncorrectLoginAttemptsEnabled(UserAccount account, boolean updateIncorrectLoginCount,
+                                                                      int allowedLoginAttempts) {
+        int attemptsMade = account.getLoginAttempts() + 1;
+        if (allowedLoginAttempts > 0 && updateIncorrectLoginCount) {

Review Comment:
   Done, thanks



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] nvazquez merged pull request #6254: Fix: Allow disabling the login attempts mechanism for disabling users

Posted by GitBox <gi...@apache.org>.
nvazquez merged PR #6254:
URL: https://github.com/apache/cloudstack/pull/6254


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] weizhouapache commented on pull request #6254: Fix: Allow disabling the login attempts mechanism for disabling users

Posted by GitBox <gi...@apache.org>.
weizhouapache commented on PR #6254:
URL: https://github.com/apache/cloudstack/pull/6254#issuecomment-1098239871

   
   @blueorangutan test
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] blueorangutan commented on pull request #6254: Fix: Allow disabling the login attempts mechanism for disabling users

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on PR #6254:
URL: https://github.com/apache/cloudstack/pull/6254#issuecomment-1097589298

   @Pearl1594 a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] blueorangutan commented on pull request #6254: Fix: Allow disabling the login attempts mechanism for disabling users

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on PR #6254:
URL: https://github.com/apache/cloudstack/pull/6254#issuecomment-1097412077

   @nvazquez a 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.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] nvazquez commented on pull request #6254: Fix: Allow disabling the login attempts mechanism for disabling users

Posted by GitBox <gi...@apache.org>.
nvazquez commented on PR #6254:
URL: https://github.com/apache/cloudstack/pull/6254#issuecomment-1098011777

   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] blueorangutan commented on pull request #6254: Fix: Allow disabling the login attempts mechanism for disabling users

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on PR #6254:
URL: https://github.com/apache/cloudstack/pull/6254#issuecomment-1098205929

   <b>Trillian test result (tid-3887)</b>
   Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 33651 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr6254-t3887-kvm-centos7.zip
   Smoke tests completed. 87 look OK, 5 have errors
   Only failed tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   test_01_add_primary_storage_disabled_host | `Error` | 0.66 | test_primary_storage.py
   test_01_primary_storage_nfs | `Error` | 0.11 | test_primary_storage.py
   ContextSuite context=TestStorageTags>:setup | `Error` | 0.20 | test_primary_storage.py
   test_03_deploy_and_scale_kubernetes_cluster | `Failure` | 29.93 | test_kubernetes_clusters.py
   test_07_deploy_kubernetes_ha_cluster | `Failure` | 61.42 | test_kubernetes_clusters.py
   test_08_upgrade_kubernetes_ha_cluster | `Failure` | 40.96 | test_kubernetes_clusters.py
   test_09_delete_kubernetes_ha_cluster | `Failure` | 35.89 | test_kubernetes_clusters.py
   ContextSuite context=TestKubernetesCluster>:teardown | `Error` | 126.43 | test_kubernetes_clusters.py
   test_01_secure_vm_migration | `Error` | 154.54 | test_vm_life_cycle.py
   test_02_unsecure_vm_migration | `Error` | 270.34 | test_vm_life_cycle.py
   test_03_secured_to_nonsecured_vm_migration | `Error` | 142.91 | test_vm_life_cycle.py
   test_08_migrate_vm | `Error` | 45.80 | test_vm_life_cycle.py
   test_02_list_snapshots_with_removed_data_store | `Error` | 9.44 | test_snapshots.py
   test_02_list_snapshots_with_removed_data_store | `Error` | 9.44 | test_snapshots.py
   test_hostha_enable_ha_when_host_in_maintenance | `Error` | 304.75 | test_hostha_kvm.py
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] blueorangutan commented on pull request #6254: Fix: Allow disabling the login attempts mechanism for disabling users

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on PR #6254:
URL: https://github.com/apache/cloudstack/pull/6254#issuecomment-1098240112

   @weizhouapache a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] blueorangutan commented on pull request #6254: Fix: Allow disabling the login attempts mechanism for disabling users

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on PR #6254:
URL: https://github.com/apache/cloudstack/pull/6254#issuecomment-1097434543

   Packaging result: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: debian :heavy_check_mark: suse15. SL-JID 3150


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] blueorangutan commented on pull request #6254: Fix: Allow disabling the login attempts mechanism for disabling users

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on PR #6254:
URL: https://github.com/apache/cloudstack/pull/6254#issuecomment-1098102454

   @weizhouapache a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] weizhouapache commented on a diff in pull request #6254: Fix: Allow disabling the login attempts mechanism for disabling users

Posted by GitBox <gi...@apache.org>.
weizhouapache commented on code in PR #6254:
URL: https://github.com/apache/cloudstack/pull/6254#discussion_r849294630


##########
server/src/main/java/com/cloud/user/AccountManagerImpl.java:
##########
@@ -2565,6 +2556,22 @@ private UserAccount getUserAccount(String username, String password, Long domain
         }
     }
 
+    protected void updateLoginAttemptsWhenIncorrectLoginAttemptsEnabled(UserAccount account, boolean updateIncorrectLoginCount,
+                                                                      int allowedLoginAttempts) {
+        int attemptsMade = account.getLoginAttempts() + 1;
+        if (allowedLoginAttempts > 0 && updateIncorrectLoginCount) {

Review Comment:
   @nvazquez 
   just a suggestion: check the opposite conditions to reduce indent ?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] blueorangutan commented on pull request #6254: Fix: Allow disabling the login attempts mechanism for disabling users

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on PR #6254:
URL: https://github.com/apache/cloudstack/pull/6254#issuecomment-1098012715

   @nvazquez a 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.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] blueorangutan commented on pull request #6254: Fix: Allow disabling the login attempts mechanism for disabling users

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on PR #6254:
URL: https://github.com/apache/cloudstack/pull/6254#issuecomment-1098599186

   <b>Trillian test result (tid-3900)</b>
   Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 28608 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr6254-t3900-kvm-centos7.zip
   Intermittent failure detected: /marvin/tests/smoke/test_kubernetes_clusters.py


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org