CiscoDevNet / DNAC-AURA

MIT License
37 stars 14 forks source link

UI- and maglev-passwords with space character #8

Open joachimtingvold opened 2 years ago

joachimtingvold commented 2 years ago

Hi,

Does not seem like the AURA tool handles UI- and maglev-passwords that contains spaces in them. It complains for both of them when I try, either passing them as arguments (--admin-pass and --maglev-pass) or when prompted. Updating the passwords to something that does not contain spaces works just fine (on the same DNAC nodes/cluster, using same AURA version).

aradford123 commented 2 years ago

This is a function of the linux shell, not AURA.. The shell is responsible for treating space as a delimiter. You can over come this by using quotes. Similar issues apply for special characters like "!" which have special meaning for the linux shell.

joachimtingvold commented 2 years ago

Of course I know that, but the prompt for UI password should handle space characters fine, but alas, it does not. The "maglev'-prompt might work fine (as that is the normal sudo password prompt), but since it does not accept for the UI user, you never get to the point where it asks for the maglev password.

As for passing the password as arguments, that was of course attempted with both single and double quotes, but does not work.

Both cases clearly shows that the error is not in the shell. It might not be in AURA, but at least it's either that or the API endpoint itself that AURA attempts to login to.

To rule out typos, the password(s) where copy-pasted each time, and verified both before and after. The same "paste" works perfectly when logging in through GUI, sudo/ssh, or through maglev commands requiring UI login.

$ ./dnac_aura 
/tmp/_MEIBMB0Ik/subprocess32.py:149: RuntimeWarning: The _posixsubprocess module is not being used. Child process reliability may suffer if your program uses threads.

####################################################
###                                              ###
###   Welcome to the Cisco DNA Center AURA Tool  ###
###             version:1.5.9                    ###
###                                              ###
####################################################
### 
###  Please visit us at www.cisco.com - 'Enhanced Visibility into the Cisco DNA Center using AURA'
### 
###
###   All Cisco DNA Center based Health,Scale,Upgrade Readiness,Assurance & SDA checks will be run ###
###

#01:Checking:Latest version of AURA
 INFO:AURA is up to date
 INFO:Performing login... [please provide UI admin level password]
[administration] username for 'https://kong-frontend.maglev-system.svc.cluster.local:443': admin
[administration] password for 'admin': 

RETRY ATTEMPT #1 
[administration] username for 'https://kong-frontend.maglev-system.svc.cluster.local:443': admin
[administration] password for 'admin': 

RETRY ATTEMPT #2 
[administration] username for 'https://kong-frontend.maglev-system.svc.cluster.local:443': admin
[administration] password for 'admin': 

RETRY ATTEMPT #3 
[administration] username for 'https://kong-frontend.maglev-system.svc.cluster.local:443': ^CTraceback (most recent call last):
  File "dnac_aura.py", line 10115, in <module>

$   ./dnac_aura --admin-pass 'Foo bar baz!' --maglev-pass 'Foo bar baz!'
/tmp/_MEIz34GjU/subprocess32.py:149: RuntimeWarning: The _posixsubprocess module is not being used. Child process reliability may suffer if your program uses threads.
 *Error:#01:cannot login to maglev, check admin password [UI password]