randomly generated passwords must obey some constraints
The password constraints of security.py require at least one digit, one lower case, one upper case and one special character. https://github.com/wazuh/wazuh/blob/master/framework/wazuh/security.py#L22 Fixes: https://github.com/wazuh/wazuh-ansible/issues/518
This commit is contained in:
parent
fc67b96b63
commit
0440e5dce9
@ -69,13 +69,20 @@ if __name__ == "__main__":
|
|||||||
# set a random password for all other users
|
# set a random password for all other users
|
||||||
for name, id in initial_users.items():
|
for name, id in initial_users.items():
|
||||||
if name != username:
|
if name != username:
|
||||||
|
specials = "@$!%*?&-_"
|
||||||
random_pass = "".join(
|
random_pass = "".join(
|
||||||
|
[
|
||||||
|
random.choice(string.ascii_uppercase),
|
||||||
|
random.choice(string.ascii_lowercase),
|
||||||
|
random.choice(string.digits),
|
||||||
|
random.choice(specials),
|
||||||
|
] +
|
||||||
random.choices(
|
random.choices(
|
||||||
string.ascii_uppercase
|
string.ascii_uppercase
|
||||||
+ string.ascii_lowercase
|
+ string.ascii_lowercase
|
||||||
+ string.digits
|
+ string.digits
|
||||||
+ "@$!%*?&-_",
|
+ specials,
|
||||||
k=16,
|
k=14,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
update_user(
|
update_user(
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user