def rule(event):
    if all(
        [
            event.deep_get("IntegrityLevel", default="") in ["Medium", "S-1-16-8192"],
            "ControlSet" in event.deep_get("CommandLine", default=""),
            "services" in event.deep_get("CommandLine", default=""),
            any(
                [
                    "\\ImagePath" in event.deep_get("CommandLine", default=""),
                    "\\FailureCommand" in event.deep_get("CommandLine", default=""),
                    "\\ServiceDll" in event.deep_get("CommandLine", default=""),
                ]
            ),
        ]
    ):
        return True
    return False
