def salt_ip_verify_tool():
    '''
    If there is a list of restricted IPs, verify current
    client is coming from one of those IPs.
    '''
    # This is overly cumbersome and crude,
    # But, it's also safe... ish...
    salt_config = cherrypy.config.get('saltopts', None)
    if salt_config:
        cherrypy_conf = salt_config.get('rest_cherrypy', None)
        if cherrypy_conf:
            auth_ip_list = cherrypy_conf.get('authorized_ips', None)
            if auth_ip_list:
                logger.debug('Found IP list: %s', auth_ip_list)
                rem_ip = cherrypy.request.headers.get('Remote-Addr', None)
                logger.debug('Request from IP: %s', rem_ip)
                if rem_ip not in auth_ip_list:
                    logger.error('Blocked IP: %s', rem_ip)
                    raise cherrypy.HTTPError(403, 'Bad IP')
If there is a list of restricted IPs, verify current
    client is coming from one of those IPs.