populated checks

This commit is contained in:
Toni de la Fuente
2018-03-23 10:05:20 -04:00
parent a98fdf7679
commit a2806ad86b
98 changed files with 2034 additions and 81 deletions

View File

@@ -0,0 +1,23 @@
CHECK_ID_check_extra710=""
CHECK_TITLE_check_extra710=""
CHECK_SCORED_check_extra710=""
CHECK_TYPE_check_extra710=""
CHECK_ALTERNATE_check_extra710="check_extra710"
extra710(){
# "Check for internet facing EC2 Instances (Not Scored) (Not part of CIS benchmark)"
textTitle "$ID710" "$TITLE710" "NOT_SCORED" "EXTRA"
textNotice "Looking for instances in all regions... "
for regx in $REGIONS; do
LIST_OF_PUBLIC_INSTANCES=$($AWSCLI ec2 describe-instances $PROFILE_OPT --region $regx --query 'Reservations[*].Instances[?PublicIpAddress].[InstanceId,PublicIpAddress]' --output text)
if [[ $LIST_OF_PUBLIC_INSTANCES ]];then
while read -r instance;do
INSTANCE_ID=$(echo $instance | awk '{ print $1; }')
PUBLIC_IP=$(echo $instance | awk '{ print $2; }')
textWarn "$regx: Instance: $INSTANCE_ID at IP: $PUBLIC_IP is internet-facing!" "$regx"
done <<< "$LIST_OF_PUBLIC_INSTANCES"
else
textOK "$regx: no Internet Facing EC2 Instances found" "$regx"
fi
done
}