atc-react icon indicating copy to clipboard operation
atc-react copied to clipboard

Possible bug in reactutils

Open WildDogOne opened this issue 3 years ago • 0 comments

For some reason the initialisation does not work like this: def normalize_react_title(title,fmtrules={"abbreviations": ["ip", "dns", "ms", "ngfw", "ips", "url", "pe", "pdf","elf", "dhcp", "vpn", "smb", "ftp", "http"],"capitalizeWords":["unix", "windows", "proxy", "firewall", "mach-o"]}): https://github.com/atc-project/atc-react/blob/323c3274a9c801e72ef6a88e101e83be236028c2/scripts/reactutils.py#L462

I get some really hard to understand errors, because it should work

Err message: 'NoneType' object is not subscriptable
------------------------------------------------------------
Traceback (most recent call last):
  File "XXXXXXXXX\atomic-threat-coverage\response\atc_react\scripts\populatemarkdown.py", line 89, in response_action
    ra.render_template("markdown")
  File "XXXXXXXXX\atomic-threat-coverage\response\atc_react\scripts\responseaction.py", line 76, in render_template
    {'title': REACTutils.normalize_react_title(self.ra_parsed_file
  File "XXXXXXXXX\atomic-threat-coverage\response\atc_react\scripts\reactutils.py", line 472, in normalize_react_title
    if word.lower() in fmtrules["abbreviations"]:
TypeError: 'NoneType' object is not subscriptable
------------------------------------------------------------

When I initialise like this it works perfectly:

    @staticmethod
    def normalize_react_title(title, fmtrules=None):
        """Normalize title if it is a RA/RP title in the following format:
        RP_0003_identification_make_sure_email_is_a_phishing
        """

        if fmtrules is None:
            fmtrules = {
                "abbreviations": ["ip", "dns", "ms", "ngfw", "ips", "url", "pe", "pdf", "elf", "dhcp", "vpn", "smb",
                                  "ftp", "http"], "capitalizeWords": ["unix", "windows", "proxy", "firewall", "mach-o"]}

I am not sure why this is happening to me, I feel it could be because of a python version conflict

WildDogOne avatar May 31 '22 15:05 WildDogOne