def rule(event):
    if all(
        [
            any(
                [
                    event.deep_get("Image", default="").endswith("\\netsh.exe"),
                    event.deep_get("OriginalFileName", default="") == "netsh.exe",
                ]
            ),
            "firewall" in event.deep_get("CommandLine", default=""),
            "delete " in event.deep_get("CommandLine", default=""),
            not any(
                [
                    all(
                        [
                            event.deep_get("ParentImage", default="").endswith("\\Dropbox.exe"),
                            "name=Dropbox" in event.deep_get("CommandLine", default=""),
                        ]
                    ),
                    all(
                        [
                            event.deep_get("ParentImage", default="").endswith("\\instup.exe"),
                            'advfirewall firewall delete rule name="Avast Antivirus Admin Client"'
                            in event.deep_get("CommandLine", default=""),
                        ]
                    ),
                ]
            ),
        ]
    ):
        return True
    return False
