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=""),
            " add " in event.deep_get("CommandLine", default=""),
            not any(
                [
                    'advfirewall firewall add rule name=Dropbox dir=in action=allow "program=?:\\Program Files (x86)\\Dropbox\\Client\\Dropbox.exe" enable=yes profile=Any'
                    in event.deep_get("CommandLine", default=""),
                    'advfirewall firewall add rule name=Dropbox dir=in action=allow "program=?:\\Program Files\\Dropbox\\Client\\Dropbox.exe" enable=yes profile=Any'
                    in event.deep_get("CommandLine", default=""),
                ]
            ),
        ]
    ):
        return True
    return False
