-
Notifications
You must be signed in to change notification settings - Fork 109
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
[bug] Fix Salt 6->8 Chars #758
base: main
Are you sure you want to change the base?
Conversation
@NilashishC, could you take a look at this PR? |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #758 +/- ##
==========================================
- Coverage 84.77% 84.72% -0.05%
==========================================
Files 215 215
Lines 18360 18394 +34
==========================================
+ Hits 15564 15584 +20
- Misses 2796 2810 +14 |
Merge Failed. This change or one of its cross-repo dependencies was unable to be automatically merged with the current state of its repository. Please rebase the change and upload a new patchset. |
for more information, see https://pre-commit.ci
@NilashishC - this PR is related to a bug; I don't have triage access to be able to apply a label. I've updated the change log. |
@@ -473,7 +473,7 @@ def main(): | |||
|
|||
# check if provided hashed password is infact a hash | |||
if module.params["hashed_password"] is not None: | |||
if not re.match(r"^\$5\$......\$.*$", module.params["hashed_password"]): | |||
if not re.match(r"^\$5\$........\$.*$", module.params["hashed_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.
@vvas1lev Thank you for the PR. But I'm unsure if what you're proposing in this is valid for all NX-OS versions. For example:
nexus9300# show version | in NXOS:
NXOS: version 10.3(1) [Feature Release]
nexus9300# show running-config | in username
username admin password 5 $5$EJHAFP$eDk9h6gmq9A4.krEm//hHe.uDDlNXTLZfUaMQVWyWZ8
role network-admin
username cisco password 5 $5$JHNODB$9nuq8XjLNpYOrCJ9D6CdBbS31THfsLWp6Yq3LzfUZ78
role network-admin
The hash seems to be 6 characters here. IMO, the ideal solution should be something more generic like \$5\$.+\$.*$
, which accounts for both the cases.
SUMMARY
The NXOS Salt is 8 Chars, not 6.
ISSUE TYPE
COMPONENT NAME
cisco.nxos.nxos_user
ADDITIONAL INFORMATION
Tested on NX-OS:
version 6.0(2)U5(2)
version 7.0(3)I7(9)
XXX(config)# username test password test$1$ .i0lhsgi$8suX0ENNqXqQ4Mp22qPKQ/ role network-operator$1$ .i0lhsgi$8suX0ENNqXqQ4Mp22qPKQ/ role network-operator
username test password 5
XXX(config)# do sh run | incl test
username test password 5