From 94efa3028a78dfd8e7e97ea8b4e9ed721dabc63f Mon Sep 17 00:00:00 2001 From: Ben Allen Date: Tue, 27 Jun 2017 09:06:29 -0500 Subject: [PATCH] clean up CSV output for 1.23 when multiple users match --- prowler | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/prowler b/prowler index d23f90dd..0ad7f0fb 100755 --- a/prowler +++ b/prowler @@ -755,8 +755,9 @@ check123(){ LIST_USERS_KEY1_NA=$(for user in $LIST_USERS; do grep $user $TEMP_REPORT_FILE|awk -F, '{ print $1,$11 }'|grep N/A |awk '{ print $1 }'; done) LIST_USERS_KEY1_ACTIVE=$(for user in $LIST_USERS_KEY1_NA; do grep $user $TEMP_REPORT_FILE|awk -F, '{ print $1,$9 }'|grep "true$"|awk '{ print $1 }'|sed 's/[:blank:]+/,/g' ; done) if [[ $LIST_USERS_KEY1_ACTIVE ]]; then - # textNotice "List of users with Access Key 1 never used:" - textNotice "Users who never used Access Key 1: $LIST_USERS_KEY1_ACTIVE" + for user in $LIST_USERS_KEY1_ACTIVE; do + textNotice "$user has never used Access Key 1" + done else textOK "No users found with Access Key 1 never used" fi @@ -764,8 +765,9 @@ check123(){ LIST_USERS_KEY2_NA=$(for user in $LIST_USERS; do grep $user $TEMP_REPORT_FILE|awk -F, '{ print $1,$16 }'|grep N/A |awk '{ print $1 }' ; done) LIST_USERS_KEY2_ACTIVE=$(for user in $LIST_USERS_KEY2_NA; do grep $user $TEMP_REPORT_FILE|awk -F, '{ print $1,$14 }'|grep "true$" |awk '{ print $1 }' ; done) if [[ $LIST_USERS_KEY2_ACTIVE ]]; then - # textNotice "List of users with Access Key 2 never used:" - textNotice "Users who never used Access Key 2: $LIST_USERS_KEY2_ACTIVE" + for user in $LIST_USERS_KEY2_ACTIVE; do + textNotice "$user has never used Access Key 2" + done else textOK "No users found with Access Key 2 never used" fi