diff --git a/checks/check45 b/checks/check45 index 4d981b46..586cdef4 100644 --- a/checks/check45 +++ b/checks/check45 @@ -18,7 +18,8 @@ check45(){ # "Ensure routing tables for VPC peering are \"least access\" (Not Scored)" textInfo "Looking for VPC peering in all regions... " for regx in $REGIONS; do - LIST_OF_VPCS_PEERING_CONNECTIONS=$($AWSCLI ec2 describe-vpc-peering-connections --output text $PROFILE_OPT --region $regx --query 'VpcPeeringConnections[*].VpcPeeringConnectionId') + # Sort output so that we can diff between runs. + LIST_OF_VPCS_PEERING_CONNECTIONS=$(printf '%s\n' $($AWSCLI ec2 describe-vpc-peering-connections --output text $PROFILE_OPT --region $regx --query 'VpcPeeringConnections[*].VpcPeeringConnectionId') | sort | paste -s -d" " -) if [[ $LIST_OF_VPCS_PEERING_CONNECTIONS ]];then textInfo "$regx: $LIST_OF_VPCS_PEERING_CONNECTIONS - review routing tables" "$regx" #LIST_OF_VPCS=$($AWSCLI ec2 describe-vpcs $PROFILE_OPT --region $regx --query 'Vpcs[*].VpcId' --output text)