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=""),
            "tcp " in event.deep_get("CommandLine", default=""),
            "3389" in event.deep_get("CommandLine", default=""),
            any(
                [
                    "portopening" in event.deep_get("CommandLine", default=""),
                    "allow" in event.deep_get("CommandLine", default=""),
                ]
            ),
        ]
    ):
        return True
    return False
