Skip to content

Password policies - #6567

Merged
DaanHoogland merged 1 commit into
apache:mainfrom
scclouds:create-password-policies
Aug 3, 2022
Merged

DaanHoogland merged 1 commit into
apache:mainfrom
scclouds:create-password-policies

Conversation

@JoaoJandre

Copy link
Copy Markdown
Contributor

Description

Currently, ACS does not have a feature to manage user password policies. New domain-scoped settings were created to allow operators to define password policies. Configured password policies will be applied whenever a user changes their password or a new user is created. The following settings were created:

Setting Purpose
password.policy.minimum.length Minimum password length
password.policy.minimum.lowercase.letters Minimum number of lower case letters
password.policy.minimum.uppercase.letters Minimum number of upper case letters
password.policy.minimum.special.characters Minimum number of special characters
password.policy.minimum.digits Minimum number of digits
password.policy.allowPasswordToContainUsername If the password may contain the user's username
password.policy.regex A regular expression that the password must match

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • 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
  • Minor

How Has This Been Tested?

Unit tests were created for the new methods. Furthermore each configuration was individually tested in the ROOT domain. The creation of a user was tested, to ensure that verification of password policies was being called. All other tests were done by changing the user's password via the UI.

No. Test Result Expected result?
1 password.policy.minimum.length = 0 and password "abc" Password successfully changed Yes
2 password.policy.minimum.length = 5 and password "abc" Error thrown warning that the length does not reach the minimum expected Yes
3 password.policy.minimum.length = 5 and password "abcde" Password successfully changed Yes
4 password.policy.minimum.lowercase.letters = 0 and password "ABC" Password successfully changed Yes
5 password.policy.minimum.lowercase.letters = 1 and password "ABC" Error thrown warning that the number of lowercase letters does not reach the expected minimum Yes
6 password.policy.minimum.lowercase.letters = 1 and password "aBC" Password successfully changed Yes
7 password.policy.minimum.uppercase.letters = 0 and password "abc" Password successfully changed Yes
8 password.policy.minimum.uppercase.letters = 1 and password "abc" Error thrown warning that the number of uppercase letters does not reach the expected minimum Yes
9 password.policy.minimum.uppercase.letters = 1 and password "Abc" Password successfully changed Yes
10 password.policy.minimum.special.characters = 0 and password "abc" Password successfully changed Yes
11 password.policy.minimum.special.characters = 1 and password "abc" Error thrown warning that the number of special characters does not reach the minimum expected Yes
12 password.policy.minimum.special.characters = 1 and password "&bc" Password successfully changed Yes
13 password.policy.minimum.digits = 0 and password "abc" Password successfully changed Yes
14 password.policy.minimum.digits = 1 and password "abc" Error thrown warning that the number of digits does not reach the minimum expected Yes
15 password.policy.minimum.digits = 1 and password "1bc" Password successfully changed Yes
16 password.policy.allowPasswordToContainUsername = true, password "abc" and username "test" Password successfully changed Yes
17 password.policy.allowPasswordToContainUsername = true, password "testabc" and username "test" Password successfully changed Yes
18 password.policy.allowPasswordToContainUsername = false, password "abc" and username "test" Password successfully changed Yes
19 password.policy.allowPasswordToContainUsername = false, password "testabc" and username "test" Error thrown warning that password cannot contain username Yes
20 password.policy.regex = ".+" and password "abc" Password successfully changed Yes
21 password.policy.regex = "[a-z]+" and password "abc" Password successfully changed Yes
22 password.policy.regex = "[a-z]+" and password "abc1" Error thrown warning that password does not match with regex Yes
23 password.policy.minimum.length = 5, password.policy.minimum.lowercase.letters = 1, password.policy.minimum.uppercase.letters = 1, password.policy.minimum.special.characters = 1, password.policy.minimum.digits = 1, password.policy.allowPasswordToContainUsername = false, password.policy.regex = "[a-zA-Z1-9@]+ " and password " aA1@b" Password successfully changed Yes

Tests were repeated on a subdomain of the ROOT to ensure that the settings taken into account were always from the subdomain, and all tests went as expected.

@JoaoJandre JoaoJandre changed the title Create password policies configurations Password policies Jul 25, 2022
@sonarqubecloud

Copy link
Copy Markdown

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 8 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@harikrishna-patnala

Copy link
Copy Markdown
Member

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@harikrishna-patnala 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.

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✔️ el7 ✔️ el8 ✔️ debian ✔️ suse15. SL-JID 3832

@DaanHoogland

Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

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

@RodrigoDLopez RodrigoDLopez left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code lgtm. Approved based on manual tests

@blueorangutan

Copy link
Copy Markdown

Trillian test result (tid-4587)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 43261 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr6567-t4587-kvm-centos7.zip
Smoke tests completed. 99 look OK, 1 have errors
Only failed tests results shown below:

Test Result Time (s) Test File
test_08_upgrade_kubernetes_ha_cluster Failure 582.18 test_kubernetes_clusters.py

@DaanHoogland

Copy link
Copy Markdown
Contributor

@harikrishna-patnala are your concerns met?

@GutoVeronezi GutoVeronezi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, nice job @JoaoJandre!

@DaanHoogland
DaanHoogland merged commit 117ce1a into apache:main Aug 3, 2022
neogismm pushed a commit to neogismm/cloudstack that referenced this pull request Aug 6, 2022
Co-authored-by: João Paraquetti <joao@scclouds.com.br>
@weizhouapache

Copy link
Copy Markdown
Member

@JoaoJandre

Copy link
Copy Markdown
Contributor Author

This looks like a regression of the pr https://lists.apache.org/thread/tqtcwsfb0knmvqct1hlow4ty2nc2w2j2

cc @JoaoJandre @DaanHoogland @GutoVeronezi

@weizhouapache I've opened a PR to fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants