def rule(event):
    if any(
        [
            all(
                [
                    any(
                        [
                            event.deep_get("Image", default="").endswith("\\wscript.exe"),
                            event.deep_get("OriginalFileName", default="") == "wscript.exe",
                        ]
                    ),
                    "manage-bde.wsf" in event.deep_get("CommandLine", default=""),
                ]
            ),
            all(
                [
                    any(
                        [
                            event.deep_get("ParentImage", default="").endswith("\\cscript.exe"),
                            event.deep_get("ParentImage", default="").endswith("\\wscript.exe"),
                        ]
                    ),
                    "manage-bde.wsf" in event.deep_get("ParentCommandLine", default=""),
                    not event.deep_get("Image", default="").endswith("\\cmd.exe"),
                ]
            ),
        ]
    ):
        return True
    return False
