def rule(event):
    if all(
        [
            event.deep_get("TargetObject", default="").endswith("TreatAs\\(Default)"),
            not any(
                [
                    all(
                        [
                            event.deep_get("Image", default="").startswith(
                                "C:\\Program Files\\Common Files\\Microsoft Shared\\ClickToRun\\"
                            ),
                            event.deep_get("Image", default="").endswith("\\OfficeClickToRun.exe"),
                        ]
                    ),
                    event.deep_get("Image", default="")
                    in [
                        "C:\\Program Files\\Microsoft Office\\root\\integration\\integrator.exe",
                        "C:\\Program Files (x86)\\Microsoft Office\\root\\integration\\integrator.exe",
                    ],
                    event.deep_get("Image", default="") == "C:\\Windows\\system32\\svchost.exe",
                    event.deep_get("Image", default="")
                    in ["C:\\Windows\\system32\\msiexec.exe", "C:\\Windows\\SysWOW64\\msiexec.exe"],
                ]
            ),
        ]
    ):
        return True
    return False
