import re


def make_scanner(regex):
    """
    Make log scanner for scanning potential attack using regex rule.

    :param regex: regex rule for detecting attack in the log line
    :return: function that scan for the attack in log file using the regex
    """
    def scanner(line):
        return True if re.search(regex, line) else False
    return scanner