diff --git a/audit-output-creds.sh b/audit-output-creds.sh index fea6136..13a967c 100755 --- a/audit-output-creds.sh +++ b/audit-output-creds.sh @@ -19,13 +19,19 @@ then TERRAFORM="terraform" fi +INFO="$1" +if [ -z $INFO ] +then + INFO="aws_info" +fi + DATE=$(date +%Y%m%d) S_ACCOUNT=$($TERRAFORM output caller_account_id) profile=$($TERRAFORM output profile) #S_USER=$($TERRAFORM output scan_user) S_FILE="/tmp/${S_USER}.${S_ACCOUNT}.$DATE.txt" -AWS_INFO=$($TERRAFORM output -json aws_info) +AWS_INFO=$($TERRAFORM output -json $INFO) count=$(echo $AWS_INFO | jq -c 'keys' | sed -e 's/\[//' -e 's/\]//') scount=0 while [ $scount -le $count ]