-
Notifications
You must be signed in to change notification settings - Fork 795
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
Create new user with a random password #1174
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #1174 +/- ##
===========================================
- Coverage 28.77% 28.75% -0.03%
===========================================
Files 414 415 +1
Lines 12752 12760 +8
===========================================
- Hits 3670 3669 -1
- Misses 9082 9091 +9
Continue to review full report at Codecov.
|
from infection_monkey.utils.users import get_commands_to_add_user | ||
|
||
|
||
class BackdoorUser(PBA): | ||
def __init__(self): | ||
remote_user_pwd = get_random_password() |
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.
Would be more readable if called random_password
, because that's what it is in this context. It's not a password of remote user yet and pwd
is not consistent (also means print working directory), either ..._pass
or ..._password
@@ -0,0 +1,6 @@ | |||
import secrets | |||
|
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.
Create a constant here, called SECRET_BYTE_LENGTH
and set it to 32. Then use this constant as a default parameter in get_random_password
. 12 bytes is not enough.
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.
Small changes
Fixes #1169
PR Checklist
Was the documentation framework updated to reflect the changes?Testing Checklist
Added relevant unit tests?If applicable, add screenshots or log transcripts of the feature working