Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible bug in reactutils #368

Open
WildDogOne opened this issue May 31, 2022 · 0 comments
Open

Possible bug in reactutils #368

WildDogOne opened this issue May 31, 2022 · 0 comments

Comments

@WildDogOne
Copy link

WildDogOne commented May 31, 2022

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"]}):

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"]}):

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant