mirror of
https://github.com/ghndrx/prowler.git
synced 2026-02-10 23:05:05 +00:00
changed outputs to the new ones
This commit is contained in:
@@ -10,39 +10,39 @@ check14(){
|
||||
C14_NUM_USERS1=0
|
||||
C14_NUM_USERS2=0
|
||||
if [[ $LIST_OF_USERS_WITH_ACCESS_KEY1 ]]; then
|
||||
# textWarn "Users with access key 1 older than 90 days:"
|
||||
# textFail "Users with access key 1 older than 90 days:"
|
||||
for user in $LIST_OF_USERS_WITH_ACCESS_KEY1; do
|
||||
# check access key 1
|
||||
DATEROTATED1=$(cat $TEMP_REPORT_FILE | grep -v user_creation_time | grep "^${user},"| awk -F, '{ print $10 }' | grep -v "N/A" | awk -F"T" '{ print $1 }')
|
||||
HOWOLDER=$(how_older_from_today $DATEROTATED1)
|
||||
|
||||
if [ $HOWOLDER -gt "90" ];then
|
||||
textWarn " $user has not rotated access key1 in over 90 days "
|
||||
textFail " $user has not rotated access key1 in over 90 days "
|
||||
C14_NUM_USERS1=$(expr $C14_NUM_USERS1 + 1)
|
||||
fi
|
||||
done
|
||||
if [[ $C14_NUM_USERS1 -eq 0 ]]; then
|
||||
textOK "No users with access key 1 older than 90 days."
|
||||
textPass "No users with access key 1 older than 90 days."
|
||||
fi
|
||||
else
|
||||
textOK "No users with access key 1."
|
||||
textPass "No users with access key 1."
|
||||
fi
|
||||
|
||||
if [[ $LIST_OF_USERS_WITH_ACCESS_KEY2 ]]; then
|
||||
# textWarn "Users with access key 2 older than 90 days:"
|
||||
# textFail "Users with access key 2 older than 90 days:"
|
||||
for user in $LIST_OF_USERS_WITH_ACCESS_KEY2; do
|
||||
# check access key 2
|
||||
DATEROTATED2=$(cat $TEMP_REPORT_FILE | grep -v user_creation_time | grep "^${user},"| awk -F, '{ print $10 }' | grep -v "N/A" | awk -F"T" '{ print $1 }')
|
||||
HOWOLDER=$(how_older_from_today $DATEROTATED2)
|
||||
if [ $HOWOLDER -gt "90" ];then
|
||||
textWarn " $user has not rotated access key2. "
|
||||
textFail " $user has not rotated access key2. "
|
||||
C14_NUM_USERS2=$(expr $C14_NUM_USERS2 + 1)
|
||||
fi
|
||||
done
|
||||
if [[ $C14_NUM_USERS2 -eq 0 ]]; then
|
||||
textOK "No users with access key 2 older than 90 days."
|
||||
textPass "No users with access key 2 older than 90 days."
|
||||
fi
|
||||
else
|
||||
textOK "No users with access key 2."
|
||||
textPass "No users with access key 2."
|
||||
fi
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user