SecurityFTW / cs-suite

Cloud Security Suite - One stop tool for auditing the security posture of AWS/GCP/Azure infrastructure.
GNU General Public License v3.0
1.13k stars 217 forks source link

Error while running for azure #33

Closed exrme18 closed 4 years ago

exrme18 commented 5 years ago

Hey @challs1 @shivankar-madaan can you please tell what exact command do I need to run from command line as I am getting the same error on running following command: python cs.py -env azure

File "cs.py", line 55, in main() File "cs.py", line 50, in main from modules import azureaudit File "/root/cs-suite/modules/azureaudit.py", line 9, in subprocess.call(['az', 'login']) File "/usr/lib/python2.7/subprocess.py", line 172, in call return Popen(*popenargs, **kwargs).wait() File "/usr/lib/python2.7/subprocess.py", line 394, in init errread, errwrite) File "/usr/lib/python2.7/subprocess.py", line 1047, in _execute_child raise child_exception

"For azure, the first command az login requires a browser interaction to authenticate with Azure subscription" What exactly you are referring here. thanks

Originally posted by @exrme18 in https://github.com/SecurityFTW/cs-suite/issues/21#issuecomment-470865355

challs1 commented 5 years ago

@exrme18 Have u tried to install azure cli?

shivankar-madaan commented 5 years ago

@exrme18

After the you run the az login There a browser which opens up for doing the authentication/login. From which the tokens are received and further calls are made to audit the Azure. Hence I would ask you to run the azure audit, from your local pc.

exrme18 commented 5 years ago

@shivankar-madaan I have installed the az cli and successfully authenticated the Azure portal. However, on running the azureaudit.py and cs.py I am getting the same error.

Do I need to make any other changes in the configuration? thanks

shivankar-madaan commented 5 years ago

@exrme18 did the script open https://login.microsoftonline.com for the authentication on your browser?

exrme18 commented 5 years ago

@shivankar-madaan No when I run the script it gave me the error but when I used the az login command the login page was opened.

shivankar-madaan commented 5 years ago

Oh ok So the script is basically failing in running az login checking on it

exrme18 commented 5 years ago

@shivankar-madaan I think yes. Please update me once you are done.

shivankar-madaan commented 5 years ago

@exrme18 can you share the complete error stack trace It seems to be working on my system

shivankar-madaan commented 4 years ago

Adding headless login feature now Should work without any browser interaction Please re-open the issue, if you're stuck