server/api/pages/fail2ban.py [140:166]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            me = plugins.worker.to_block(ip) # queried IP as IPNetwork object
            # Find all whitelist entries that touch on this
            for block in whitelist:
                if me in block or block in me or me == block:
                    rule = find_rule(session.DB, 'whitelist', str(block))
                    if rule:
                        doc = rule['_source']
                        doc['rid'] = rule['_id']
                        found['whitelist'].append(doc)

            # Find all banlist entries that touch on this
            for block in banlist:
                if me in block or block in me or me == block:
                    rule = find_rule(session.DB, 'ban', str(block))
                    if rule:
                        doc = rule['_source']
                        doc['rid'] = rule['_id']
                        if not 'ip' in doc:
                            doc['ip'] = doc['rid'].replace('_', '/')
                        found['banlist'].append(doc)

            # Find any iptables rules that may have it as well (max 10)
            found_iptables = 0
            anything = netaddr.IPNetwork("0.0.0.0/0")
            for host in iptables:
                for rule in host['rules']:
                    block = rule['ip']
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



server/api/pages/search.py [93:120]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        me = plugins.worker.to_block(ip) # queried IP as IPNetwork object

        # Find all whitelist entries that touch on this
        for block in whitelist:
            if me in block or block in me or me == block:
                rule = find_rule(session.DB, 'whitelist', str(block))
                if rule:
                    doc = rule['_source']
                    doc['rid'] = rule['_id']
                    found['whitelist'].append(doc)

        # Find all banlist entries that touch on this
        for block in banlist:
            if me in block or block in me or me == block:
                rule = find_rule(session.DB, 'ban', str(block))
                if rule:
                    doc = rule['_source']
                    doc['rid'] = rule['_id']
                    if not 'ip' in doc:
                        doc['ip'] = doc['rid'].replace('_', '/')
                    found['banlist'].append(doc)

        # Find any iptables rules that may have it as well
        found_iptables = 0
        anything = netaddr.IPNetwork("0.0.0.0/0")
        for host in iptables:
            for rule in host['rules']:
                block = rule['ip']
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



