def rule(event):
    if all(
        [
            event.deep_get("Image", default="").endswith("\\sc.exe"),
            event.deep_get("IntegrityLevel", default="") in ["Medium", "S-1-16-8192"],
            any(
                [
                    all(
                        [
                            "config" in event.deep_get("CommandLine", default=""),
                            "binPath" in event.deep_get("CommandLine", default=""),
                        ]
                    ),
                    all(
                        [
                            "failure" in event.deep_get("CommandLine", default=""),
                            "command" in event.deep_get("CommandLine", default=""),
                        ]
                    ),
                ]
            ),
        ]
    ):
        return True
    return False
