-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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] Error with AWS CLI V2 with a profile's default output being changed #696
Comments
@toniblyx What branch would you like me to push the PR to? Also, where else is JSON expected in an aws command? The change to the whoami file might not be the only place the fix is needed. Once my current scan is finished I'll see if that error pops up anywhere else and test it. I'll also see if I can get the environment variable working, that might be the best fix so that it applies everywhere, not just on a few commands. It's only related to #695 if Casey has changed the default output. Otherwise that issues is seperate. |
You can send it to master, I will review it first anyway. Thanks! |
i raised #725 which fixes issues 695 and 696 |
This was fixed already. |
I discovered when I was running prowler with AWS CLI V2, I was getting the following error three times at the start of the script:
parse error: Invalid numeric literal at line 1, column 8
Since the scans still ran, I didn't think much of it, until I got to extra72, then I started getting some very odd behavior. The scan extra72 was giving a lot of unable to DescribeSnapshotAttributes errors. I took the following steps to troubleshoot:
ACCOUNT_NUM
was never being set.include/whoami
script, the one on line 16, and discovered the output was not in JSON, which caused the next few lines to fail.To fix this issue, I did the following:
--output json
to the command on line 16, and when I reran extra72, everything worked as expected.I adjusted the default output because when I'm running the commands myself, I prefer yaml, so I don't want to change the profile defaults back to yaml. I don't know where else in the project JSON output is relied on, but it seems those commands need the
--output json
flag added to them to ensure you are getting the output you expect.Steps to reproduce this error:
output = yaml
(or any other valid output) to your profile in the.aws/config
fileparse error: Invalid numeric literal at line 1, column 8
3 times right away.ACCOUNT_NUM
environment variable will not run as expectedAddition potential issues:
Anywhere JSON output is expected and needed for something to work would be effected by this, and would require the
--output json
flag added to the command. Additionally, the environment variable AWS_DEFAULT_OUTPUT could be set to json and that should override any settings from the config file.The text was updated successfully, but these errors were encountered: