from ...common import (CONFIGURATION_PATTERN, ATTACKER_PATTERN, ATTACKER_BEFORE_STOP_WORDS, ROOT_CAUSE_PATTERN,
                       ROOT_CAUSE_BEFORE_STOP_WORD, ATTACKER_AFTER_STOP_WORDS, WEAKNESS_BEFORE_STOP_WORDS,
                       WEAKNESS_PATTERN, WEAKNESS_AFTER_STOP_WORDS)


# configuration root_cause
CONFIG_CAUSE_WEAKNESS_PATTERN = (r'(?:The |)' + CONFIGURATION_PATTERN + ROOT_CAUSE_BEFORE_STOP_WORD +
                                 ROOT_CAUSE_PATTERN + WEAKNESS_BEFORE_STOP_WORDS + WEAKNESS_PATTERN +
                                 WEAKNESS_AFTER_STOP_WORDS)


# configuration root_cause weakness attacker
DETAILS_4_1 = (CONFIG_CAUSE_WEAKNESS_PATTERN + ATTACKER_BEFORE_STOP_WORDS + ATTACKER_PATTERN +
               ATTACKER_AFTER_STOP_WORDS + r'\.$')


CONFIG_CAUSE_WEAKNESS_PATTERNS = {
    '4_1': DETAILS_4_1
}
