From f26625364d9a901993ecd36a71c992f62491c914 Mon Sep 17 00:00:00 2001 From: badra001 Date: Mon, 14 Jun 2021 17:08:12 -0400 Subject: [PATCH] update script --- audit-output-creds.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 ]