def rule(event):
    if all(
        [
            any(
                [
                    event.deep_get("TargetObject", default="").endswith(
                        "\\Control\\Lsa\\Security Packages"
                    ),
                    event.deep_get("TargetObject", default="").endswith(
                        "\\Control\\Lsa\\OSConfig\\Security Packages"
                    ),
                ]
            ),
            not any(
                [
                    event.deep_get("Image", default="")
                    in ["C:\\Windows\\system32\\msiexec.exe", "C:\\Windows\\syswow64\\MsiExec.exe"],
                    event.deep_get("Image", default="") == "",
                ]
            ),
        ]
    ):
        return True
    return False
