from ...common import (CONFIGURATION_PATTERN, ATTACKER_PATTERN, ATTACKER_BEFORE_STOP_WORDS, ROOT_CAUSE_PATTERN,
                       ROOT_CAUSE_BEFORE_STOP_WORD, CONDITION_BEFORE_STOP_WORDS, CONDITION_PATTERN,
                       IMPACT_BEFORE_STOP_WORDS, IMPACT_PATTERN, VECTOR_BEFORE_STOP_WORDS, VECTOR_PATTERN)


# configuration condition root_cause
CONFIG_CONDITION_CAUSE_PATTERN = (
        r'(?:The |)' + CONFIGURATION_PATTERN + CONDITION_BEFORE_STOP_WORDS + CONDITION_PATTERN +
        ROOT_CAUSE_BEFORE_STOP_WORD + ROOT_CAUSE_PATTERN
)


# configuration condition root_cause attacker impact vector
DETAILS_5_1 = (
        CONFIG_CONDITION_CAUSE_PATTERN + ATTACKER_BEFORE_STOP_WORDS + ATTACKER_PATTERN + IMPACT_BEFORE_STOP_WORDS +
        IMPACT_PATTERN + VECTOR_BEFORE_STOP_WORDS + VECTOR_PATTERN + r'\.$'
)


CONFIG_CONDITION_CAUSE_PATTERNS = {
    '5_1': DETAILS_5_1
}
