Updated check_extra778 to exclude 0.0.0.0/0 edge case

This commit is contained in:
Philipp Zeuner
2020-03-08 09:21:17 +01:00
parent f585ca54d1
commit f5d083f781

View File

@@ -47,6 +47,9 @@ extra778(){
for CIDR_IP in ${CIDR_IP_LIST}; do
if [[ ! ${CIDR_IP} =~ ${RFC1918_REGEX} ]]; then
CIDR=$(echo ${CIDR_IP} | cut -d"/" -f2 | xargs)
# Edge case "0.0.0.0/0" for RDP and SSH are checked already by check41 and check42
if [[ ${CIDR} < ${CIDR_THRESHOLD} && 0 < ${CIDR} ]]; then
textFail "${REGION}: ${SECURITY_GROUP} has potential wide-open non-RFC1918 address ${CIDR_IP} in ${DIRECTION} rule." "${REGION}"
fi
fi