Skip to content
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

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open

Conversation

vvas1lev
Copy link

SUMMARY

The NXOS Salt is 8 Chars, not 6.

ISSUE TYPE
  • Bugfix Pull Request
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
username test password 5 $1$.i0lhsgi$8suX0ENNqXqQ4Mp22qPKQ/ role network-operator
XXX(config)# do sh run | incl test
username test password 5 $1$.i0lhsgi$8suX0ENNqXqQ4Mp22qPKQ/ role network-operator

BEFORE
fatal: [XXX]: FAILED! => {"changed": false, "msg": "Provided hash is not valid"}

AFTER
XXX : ok=1    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0

@vvas1lev vvas1lev temporarily deployed to ack September 14, 2023 12:11 — with GitHub Actions Inactive
@softwarefactory-project-zuul
Copy link

Build succeeded.
https://ansible.softwarefactory-project.io/zuul/buildset/64814706fded464ca9bc68544d099537

✔️ ansible-galaxy-importer SUCCESS in 4m 01s
✔️ build-ansible-collection SUCCESS in 8m 44s
✔️ ansible-test-network-integration-nxos-cli-python39-scenario01 SUCCESS in 29m 33s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-scenario02 SUCCESS in 28m 30s (non-voting)
ansible-test-network-integration-nxos-cli-python39-scenario03 FAILURE in 36m 54s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-scenario04 SUCCESS in 28m 08s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-stable215-scenario01 SUCCESS in 35m 12s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-stable215-scenario02 SUCCESS in 33m 55s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-stable215-scenario03 SUCCESS in 41m 06s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-stable215-scenario04 SUCCESS in 32m 07s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-stable214-scenario01 SUCCESS in 35m 10s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-stable214-scenario02 SUCCESS in 33m 47s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-stable214-scenario03 SUCCESS in 40m 15s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-stable214-scenario04 SUCCESS in 32m 40s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-stable213-scenario01 SUCCESS in 36m 24s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-stable213-scenario02 SUCCESS in 33m 46s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-stable213-scenario03 SUCCESS in 39m 47s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-stable213-scenario04 SUCCESS in 31m 42s (non-voting)
✔️ ansible-tox-linters SUCCESS in 10m 22s

@vvas1lev vvas1lev temporarily deployed to ack September 25, 2023 13:49 — with GitHub Actions Inactive
@softwarefactory-project-zuul
Copy link

Build succeeded.
https://ansible.softwarefactory-project.io/zuul/buildset/ff07c5932d8b421dbc1e1d84de6c8327

✔️ ansible-galaxy-importer SUCCESS in 4m 48s
✔️ build-ansible-collection SUCCESS in 8m 51s
✔️ ansible-test-network-integration-nxos-cli-python39-scenario01 SUCCESS in 30m 05s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-scenario02 SUCCESS in 28m 47s (non-voting)
ansible-test-network-integration-nxos-cli-python39-scenario03 FAILURE in 36m 05s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-scenario04 SUCCESS in 28m 01s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-stable215-scenario01 SUCCESS in 35m 18s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-stable215-scenario02 SUCCESS in 34m 00s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-stable215-scenario03 SUCCESS in 40m 30s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-stable215-scenario04 SUCCESS in 32m 05s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-stable214-scenario01 SUCCESS in 35m 10s (non-voting)
ansible-test-network-integration-nxos-cli-python39-stable214-scenario02 RETRY_LIMIT in 9m 18s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-stable214-scenario03 SUCCESS in 41m 14s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-stable214-scenario04 SUCCESS in 33m 16s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-stable213-scenario01 SUCCESS in 34m 07s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-stable213-scenario02 SUCCESS in 33m 09s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-stable213-scenario03 SUCCESS in 40m 09s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-stable213-scenario04 SUCCESS in 31m 38s (non-voting)
✔️ ansible-tox-linters SUCCESS in 11m 39s

@vvas1lev vvas1lev temporarily deployed to ack October 10, 2023 07:11 — with GitHub Actions Inactive
@softwarefactory-project-zuul
Copy link

Build succeeded.
https://ansible.softwarefactory-project.io/zuul/buildset/737b96e49fbc4065b2fab2642409148b

✔️ ansible-galaxy-importer SUCCESS in 4m 42s
✔️ build-ansible-collection SUCCESS in 8m 43s
ansible-test-network-integration-nxos-cli-python39-scenario01 FAILURE in 30m 00s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-scenario02 SUCCESS in 28m 37s (non-voting)
ansible-test-network-integration-nxos-cli-python39-scenario03 FAILURE in 36m 41s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-scenario04 SUCCESS in 27m 50s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-stable215-scenario01 SUCCESS in 35m 55s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-stable215-scenario02 SUCCESS in 34m 44s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-stable215-scenario03 SUCCESS in 41m 08s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-stable215-scenario04 SUCCESS in 33m 08s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-stable214-scenario01 SUCCESS in 34m 53s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-stable214-scenario02 SUCCESS in 33m 54s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-stable214-scenario03 SUCCESS in 41m 21s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-stable214-scenario04 SUCCESS in 33m 00s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-stable213-scenario01 SUCCESS in 33m 57s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-stable213-scenario02 SUCCESS in 34m 16s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-stable213-scenario03 SUCCESS in 40m 05s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-stable213-scenario04 SUCCESS in 31m 17s (non-voting)
✔️ ansible-tox-linters SUCCESS in 10m 21s

@vvas1lev
Copy link
Author

@NilashishC, could you take a look at this PR?

@codecov
Copy link

codecov bot commented Oct 25, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.72%. Comparing base (36066cd) to head (6fff01e).
Report is 16 commits behind head on main.

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     

see 8 files with indirect coverage changes

Copy link

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.
Warning:
Error merging github.com/ansible-collections/cisco.nxos for 758,3e95efefc6ca42256a6bc5ce0b9af9108ef5f118

Copy link

Build succeeded.
https://ansible.softwarefactory-project.io/zuul/buildset/b701d13db84f4795bf9d61535ad2b08e

✔️ ansible-galaxy-importer SUCCESS in 5m 25s
✔️ build-ansible-collection SUCCESS in 9m 48s
✔️ ansible-test-network-integration-nxos-cli-python39-scenario01 SUCCESS in 29m 54s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-scenario02 SUCCESS in 28m 05s (non-voting)
ansible-test-network-integration-nxos-cli-python39-scenario03 FAILURE in 36m 00s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-scenario04 SUCCESS in 29m 50s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-stable215-scenario01 SUCCESS in 35m 05s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-stable215-scenario02 SUCCESS in 35m 00s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-stable215-scenario03 SUCCESS in 41m 01s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-stable215-scenario04 SUCCESS in 33m 31s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-stable214-scenario01 SUCCESS in 34m 39s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-stable214-scenario02 SUCCESS in 35m 04s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-stable214-scenario03 SUCCESS in 40m 49s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-stable214-scenario04 SUCCESS in 31m 38s (non-voting)
✔️ ansible-tox-linters SUCCESS in 12m 32s

@vvas1lev vvas1lev changed the title Fix Salt 6->8 Chars [bug] Fix Salt 6->8 Chars Dec 22, 2023
@vvas1lev
Copy link
Author

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

Copy link

Build succeeded.
https://ansible.softwarefactory-project.io/zuul/buildset/cfd39742565044338a70fb05cb5743a4

✔️ ansible-galaxy-importer SUCCESS in 4m 00s
✔️ build-ansible-collection SUCCESS in 10m 32s
✔️ ansible-test-network-integration-nxos-cli-python39-scenario01 SUCCESS in 28m 55s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-scenario02 SUCCESS in 28m 34s (non-voting)
ansible-test-network-integration-nxos-cli-python39-scenario03 FAILURE in 35m 56s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-scenario04 SUCCESS in 27m 59s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-stable215-scenario01 SUCCESS in 35m 26s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-stable215-scenario02 SUCCESS in 34m 04s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-stable215-scenario03 SUCCESS in 40m 56s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-stable215-scenario04 SUCCESS in 33m 03s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-stable214-scenario01 SUCCESS in 34m 17s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-stable214-scenario02 SUCCESS in 33m 29s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-stable214-scenario03 SUCCESS in 42m 02s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-stable214-scenario04 SUCCESS in 33m 04s (non-voting)
✔️ ansible-tox-linters SUCCESS in 11m 32s

@NilashishC NilashishC added the bug This issue/PR relates to a bug. label Jan 3, 2024
Copy link

Build succeeded.
https://ansible.softwarefactory-project.io/zuul/buildset/ebdbf765c8d94258b9726710c9446300

✔️ ansible-galaxy-importer SUCCESS in 4m 06s
✔️ build-ansible-collection SUCCESS in 9m 54s
✔️ ansible-test-network-integration-nxos-cli-python39-scenario01 SUCCESS in 29m 56s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-scenario02 SUCCESS in 29m 15s (non-voting)
ansible-test-network-integration-nxos-cli-python39-scenario03 FAILURE in 35m 37s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-scenario04 SUCCESS in 27m 59s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-stable215-scenario01 SUCCESS in 34m 31s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-stable215-scenario02 SUCCESS in 34m 43s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-stable215-scenario03 SUCCESS in 40m 51s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-stable215-scenario04 SUCCESS in 32m 01s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-stable214-scenario01 SUCCESS in 35m 03s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-stable214-scenario02 SUCCESS in 33m 34s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-stable214-scenario03 SUCCESS in 40m 03s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-stable214-scenario04 SUCCESS in 33m 32s (non-voting)
✔️ ansible-tox-linters SUCCESS in 11m 29s

Copy link

Build succeeded.
https://ansible.softwarefactory-project.io/zuul/buildset/105c9e3bb4154a0aa93d49cc9c11b42e

✔️ ansible-galaxy-importer SUCCESS in 4m 04s
✔️ build-ansible-collection SUCCESS in 9m 37s
✔️ ansible-test-network-integration-nxos-cli-python39-scenario01 SUCCESS in 30m 24s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-scenario02 SUCCESS in 30m 14s (non-voting)
ansible-test-network-integration-nxos-cli-python39-scenario03 FAILURE in 37m 19s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-scenario04 SUCCESS in 28m 01s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-stable215-scenario01 SUCCESS in 35m 18s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-stable215-scenario02 SUCCESS in 33m 19s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-stable215-scenario03 SUCCESS in 41m 44s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-stable215-scenario04 SUCCESS in 32m 00s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-stable214-scenario01 SUCCESS in 34m 42s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-stable214-scenario02 SUCCESS in 33m 53s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-stable214-scenario03 SUCCESS in 40m 24s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-stable214-scenario04 SUCCESS in 32m 02s (non-voting)
✔️ ansible-tox-linters SUCCESS in 11m 23s

@@ -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"]):
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants