def rule(event):
    if all(
        [
            any(
                [
                    event.deep_get("ParentImage", default="").endswith("\\cmd.exe"),
                    event.deep_get("Image", default="").endswith("\\cmd.exe"),
                    event.deep_get("OriginalFileName", default="") == "cmd.exe",
                ]
            ),
            any(
                [
                    any(
                        [
                            "/c" in event.deep_get("ParentCommandLine", default=""),
                            "/k" in event.deep_get("ParentCommandLine", default=""),
                            "/r" in event.deep_get("ParentCommandLine", default=""),
                        ]
                    ),
                    any(
                        [
                            "/c" in event.deep_get("CommandLine", default=""),
                            "/k" in event.deep_get("CommandLine", default=""),
                            "/r" in event.deep_get("CommandLine", default=""),
                        ]
                    ),
                ]
            ),
            any(
                [
                    event.deep_get("ParentCommandLine", default="") == "/../../",
                    "/../../" in event.deep_get("CommandLine", default=""),
                ]
            ),
            not "\\Tasktop\\keycloak\\bin\\/../../jre\\bin\\java"
            in event.deep_get("CommandLine", default=""),
        ]
    ):
        return True
    return False
