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

CONFIG_WEAKNESS_ATTACKER_PATTERN = (CONFIGURATION_PATTERN + WEAKNESS_BEFORE_STOP_WORDS + WEAKNESS_PATTERN +
                                    ATTACKER_BEFORE_STOP_WORDS + ATTACKER_PATTERN)


# configuration weakness attacker impact vector root_cause
DETAILS_6_1 = (CONFIG_WEAKNESS_ATTACKER_PATTERN + IMPACT_BEFORE_STOP_WORDS + IMPACT_PATTERN + VECTOR_BEFORE_STOP_WORDS +
               VECTOR_PATTERN + ROOT_CAUSE_BEFORE_STOP_WORD + ROOT_CAUSE_PATTERN + r'\.$')

# configuration weakness attacker impact vector
DETAILS_5_1 = (CONFIG_WEAKNESS_ATTACKER_PATTERN + IMPACT_BEFORE_STOP_WORDS + IMPACT_PATTERN + VECTOR_BEFORE_STOP_WORDS +
               VECTOR_PATTERN + r'\.$')

# configuration weakness attacker impact
DETAILS_4_1 = CONFIG_WEAKNESS_ATTACKER_PATTERN + IMPACT_BEFORE_STOP_WORDS + IMPACT_PATTERN + r'\.$'


CONFIG_WEAKNESS_ATTACKER_PATTERNS = {
    '6_1': DETAILS_6_1,
    '5_1': DETAILS_5_1,
    '4_1': DETAILS_4_1
}
