private boolean isIPAddressRange(String hostSpec) {
    return IP_ADDRESS_RANGE_PATTERN.matcher(hostSpec).matches();
  }
Determines if an IP address is in the subnet specified by the CIDR value.
<p>
The logic for ths method comes from an example found at
https://stackoverflow.com/questions/4209760/validate-an-ip-address-with-mask.
<p>
A CIDR is an IP address with a mask, denoting a subnet.  For example, <code>192.168.1.0/24</code> contains all
IP addresses in the range of <code>192.168.1.0</code> through <code>192.168.1.255</code>. See https://www.ipaddressguide.com/cidr
for an on-line calculator.

@param cidr      a CIDR
@param ipAddress the IP address to test
@return <code>true</code> if the IP Address is withing the range specified by the CIDR; <code>false</code> otherwise.
ambari-server/src/main/java/org/apache/ambari/server/security/authentication/kerberos/AmbariProxiedUserDetailsService.java