def rule(event):
    if any(
        [
            any(
                [
                    event.deep_get("Image", default="").endswith("\\SharPersist.exe"),
                    event.deep_get("Product", default="") == "SharPersist",
                ]
            ),
            any(
                [
                    " -t schtask -c " in event.deep_get("CommandLine", default=""),
                    " -t startupfolder -c " in event.deep_get("CommandLine", default=""),
                ]
            ),
            all(
                [
                    " -t reg -c " in event.deep_get("CommandLine", default=""),
                    " -m add" in event.deep_get("CommandLine", default=""),
                ]
            ),
            all(
                [
                    " -t service -c " in event.deep_get("CommandLine", default=""),
                    " -m add" in event.deep_get("CommandLine", default=""),
                ]
            ),
            all(
                [
                    " -t schtask -c " in event.deep_get("CommandLine", default=""),
                    " -m add" in event.deep_get("CommandLine", default=""),
                ]
            ),
        ]
    ):
        return True
    return False
