mirror of
https://github.com/ghndrx/prowler.git
synced 2026-02-11 07:15:15 +00:00
fix(check13): should not pass if user never logged in
This commit is contained in:
@@ -21,11 +21,16 @@ check13(){
|
||||
if [[ $COMMAND12_LIST_USERS_WITH_PASSWORD_ENABLED ]]; then
|
||||
for i in $COMMAND12_LIST_USERS_WITH_PASSWORD_ENABLED; do
|
||||
DATEUSED=$($AWSCLI iam list-users --query "Users[?UserName=='$i'].PasswordLastUsed" --output text $PROFILE_OPT --region $REGION | cut -d'T' -f1)
|
||||
HOWOLDER=$(how_older_from_today $DATEUSED)
|
||||
if [ $HOWOLDER -gt "90" ];then
|
||||
if [ "$DATEUSED" == "" ]
|
||||
then
|
||||
textFail "User \"$i\" has not logged in during the last 90 days "
|
||||
else
|
||||
textPass "User \"$i\" found with credentials used in the last 90 days"
|
||||
HOWOLDER=$(how_older_from_today $DATEUSED)
|
||||
if [ $HOWOLDER -gt "90" ];then
|
||||
textFail "User \"$i\" has not logged in during the last 90 days "
|
||||
else
|
||||
textPass "User \"$i\" found with credentials used in the last 90 days"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user