def rule(event):
    if all(
        [
            any(
                [
                    event.deep_get("Image", default="").endswith("\\mstsc.exe"),
                    event.deep_get("OriginalFileName", default="") == "mstsc.exe",
                ]
            ),
            any(
                [
                    event.deep_get("CommandLine", default="").endswith(".rdp"),
                    event.deep_get("CommandLine", default="").endswith('.rdp"'),
                ]
            ),
            not all(
                [
                    event.deep_get("ParentImage", default="")
                    == "C:\\Windows\\System32\\lxss\\wslhost.exe",
                    "C:\\ProgramData\\Microsoft\\WSL\\wslg.rdp"
                    in event.deep_get("CommandLine", default=""),
                ]
            ),
        ]
    ):
        return True
    return False
