From 8e35e63359f8ea54022d9c4532e0864cb5171fff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0lyas=20Apayd=C4=B1n?= Date: Thu, 14 Jan 2021 13:38:33 +0300 Subject: [PATCH 1/2] fix regex in check43 --- checks/check43 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/checks/check43 b/checks/check43 index 9c1f5d49..78c47f92 100644 --- a/checks/check43 +++ b/checks/check43 @@ -23,7 +23,7 @@ check43(){ for regx in $REGIONS; do CHECK_SGDEFAULT_IDS=$($AWSCLI ec2 describe-security-groups $PROFILE_OPT --region $regx --filters Name=group-name,Values='default' --query 'SecurityGroups[*].GroupId[]' --output text) for CHECK_SGDEFAULT_ID in $CHECK_SGDEFAULT_IDS; do - CHECK_SGDEFAULT_ID_OPEN=$($AWSCLI ec2 describe-security-groups $PROFILE_OPT --region $regx --group-ids $CHECK_SGDEFAULT_ID --query 'SecurityGroups[*].{IpPermissions:IpPermissions,IpPermissionsEgress:IpPermissionsEgress,GroupId:GroupId}' --output text |egrep '0.0.0.0|\:\:\/0') + CHECK_SGDEFAULT_ID_OPEN=$($AWSCLI ec2 describe-security-groups $PROFILE_OPT --region $regx --group-ids $CHECK_SGDEFAULT_ID --query 'SecurityGroups[*].{IpPermissions:IpPermissions,IpPermissionsEgress:IpPermissionsEgress,GroupId:GroupId}' --output text |egrep ' 0.0.0.0|\:\:\/0') if [[ $CHECK_SGDEFAULT_ID_OPEN ]];then textFail "Default Security Groups ($CHECK_SGDEFAULT_ID) found that allow 0.0.0.0 IN or OUT traffic in Region $regx" "$regx" else From f7e4a1f6a4ddc650dbdb69d4fed9513cc2c6074d Mon Sep 17 00:00:00 2001 From: soffensive <9149004+soffensive@users.noreply.github.com> Date: Mon, 18 Jan 2021 16:41:18 +0100 Subject: [PATCH 2/2] Update check_extra7130 Profile was not set --- checks/check_extra7130 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/checks/check_extra7130 b/checks/check_extra7130 index 06e6465d..0894e2f9 100644 --- a/checks/check_extra7130 +++ b/checks/check_extra7130 @@ -22,11 +22,11 @@ CHECK_ALTERNATE_check7130="extra7130" extra7130(){ textInfo "Looking for SNS Topics in all regions... " for regx in $REGIONS; do - LIST_SNS=$($AWSCLI sns list-topics --region $regx --query 'Topics[*].TopicArn' --output text) + LIST_SNS=$($AWSCLI sns list-topics $PROFILE_OPT --region $regx --query 'Topics[*].TopicArn' --output text) if [[ $LIST_SNS ]];then for topic in $LIST_SNS; do SHORT_TOPIC=$(echo $topic | awk -F ":" '{print $NF}') - SNS_ENCRYPTION=$($AWSCLI sns get-topic-attributes --region $regx --topic-arn $topic --query 'Attributes.KmsMasterKeyId' --output text) + SNS_ENCRYPTION=$($AWSCLI sns get-topic-attributes $PROFILE_OPT --region $regx --topic-arn $topic --query 'Attributes.KmsMasterKeyId' --output text) if [[ "None" == $SNS_ENCRYPTION ]]; then textFail "$regx: $SHORT_TOPIC is not encrypted!" "$regx" else