Ejemplo n.º 1
0
    def __init__(self,
                 auth,
                 lp=False,
                 dn=False,
                 en=False,
                 auto=False,
                 atc_dir=False,
                 lp_path=False,
                 dn_path=False,
                 en_path=False,
                 init=False):
        """Desc"""

        self.auth = auth

        self.space = ATCconfig.get('confluence_space_name')
        self.apipath = ATCconfig.get('confluence_rest_api_url')
        self.root_name = ATCconfig.get('confluence_name_of_root_directory')

        # Check if atc_dir provided
        if atc_dir:
            self.atc_dir = atc_dir

        else:
            self.atc_dir = ATCconfig.get('md_name_of_root_directory')

        # Check if init switch is used
        if init:
            if init_main(self.auth):
                print("[+] Created initial confluence pages successfully")
            else:
                print("[-] Failed to create initial confluence pages")
                raise Exception("Failed to init pages")

        # Main logic
        if auto:
            self.logging_policy(lp_path)
            self.data_needed(dn_path)
            self.enrichment(en_path)

        if lp:
            self.logging_policy(lp_path)

        if dn:
            self.data_needed(dn_path)

        if en:
            self.enrichment(en_path)
Ejemplo n.º 2
0
    def __init__(self,
                 auth,
                 ra=False,
                 rp=False,
                 rs=False,
                 auto=False,
                 ra_path=False,
                 rp_path=False,
                 rs_path=False,
                 init=False):
        """Desc"""

        self.auth = auth
        self.space = REACTConfig.get('confluence_space_name')
        self.apipath = REACTConfig.get('confluence_rest_api_url')
        self.root_name = REACTConfig.get('confluence_name_of_root_directory')

        # Check if init switch is used
        if init:
            if init_main(self.auth):
                print("[+] Created initial confluence pages successfully")
            else:
                print("[-] Failed to create initial confluence pages")
                raise Exception("Failed to init pages")

        # Main logic
        if auto:
            self.response_stage(rs_path)
            self.response_action(ra_path)
            self.response_playbook(rp_path)
            self.response_stage(rs_path)

        if ra:
            self.response_action(ra_path)

        if rp:
            self.response_playbook(rp_path)

        if rs:
            self.response_stage(rs_path)
Ejemplo n.º 3
0
    def __init__(self,
                 auth,
                 dr=False,
                 tg=False,
                 cu=False,
                 ms=False,
                 mp=False,
                 hp=False,
                 uc=False,
                 auto=False,
                 art_dir=False,
                 atc_dir=False,
                 dr_path=False,
                 tg_path=False,
                 cu_path=False,
                 hp_path=False,
                 ms_path=False,
                 mp_path=False,
                 uc_path=False,
                 init=False):
        """Desc"""

        self.auth = auth

        self.space = ATCconfig.get('confluence_space_name')
        self.apipath = ATCconfig.get('confluence_rest_api_url')
        self.root_name = ATCconfig.get('confluence_name_of_root_directory')

        # Check if atc_dir provided
        if atc_dir:
            self.atc_dir = atc_dir

        else:
            self.atc_dir = ATCconfig.get('md_name_of_root_directory')

        # Check if art_dir provided
        if art_dir:
            self.art_dir = art_dir

        else:
            self.art_dir = ATCconfig.get('triggers_directory')

        # Check if init switch is used
        if init:
            if init_main(self.auth):
                print("[+] Created initial confluence pages successfully")
            else:
                print("[-] Failed to create initial confluence pages")
                raise Exception("Failed to init pages")

        # Main logic
        if auto:
            self.hardening_policy(hp_path)
            self.mitigation_system(ms_path)
            self.mitigation_policy(mp_path)
            self.triggers(tg_path)
            self.detection_rule(dr_path)
            self.customer(cu_path)
            self.usecases(uc_path)

        if hp:
            self.hardening_policy(hp_path)

        if ms:
            self.mitigation_system(ms_path)

        if mp:
            self.mitigation_policy(mp_path)

        if dr:
            self.detection_rule(dr_path)

        if tg:
            self.triggers(tg_path)

        if cu:
            self.customer(cu_path)

        if uc:
            self.usecases(uc_path)