def rule(event):
    if all(
        [
            event.deep_get("ParentImage", default="").endswith("\\Velociraptor.exe"),
            any(
                [
                    all(
                        [
                            "code.exe" in event.deep_get("CommandLine", default=""),
                            "tunnel" in event.deep_get("CommandLine", default=""),
                            "--accept-server-license-terms"
                            in event.deep_get("CommandLine", default=""),
                        ]
                    ),
                    all(
                        [
                            "msiexec" in event.deep_get("CommandLine", default=""),
                            "/i" in event.deep_get("CommandLine", default=""),
                            "http" in event.deep_get("CommandLine", default=""),
                        ]
                    ),
                    all(
                        [
                            any(
                                [
                                    event.deep_get("Image", default="").endswith(
                                        "\\powershell.exe"
                                    ),
                                    event.deep_get("Image", default="").endswith(
                                        "\\powershell_ise.exe"
                                    ),
                                    event.deep_get("Image", default="").endswith("\\pwsh.exe"),
                                ]
                            ),
                            any(
                                [
                                    "Invoke-WebRequest "
                                    in event.deep_get("CommandLine", default=""),
                                    "IWR " in event.deep_get("CommandLine", default=""),
                                    ".DownloadFile" in event.deep_get("CommandLine", default=""),
                                    ".DownloadString" in event.deep_get("CommandLine", default=""),
                                ]
                            ),
                        ]
                    ),
                ]
            ),
        ]
    ):
        return True
    return False
