def rule(event):
    if all(
        [
            any(
                [
                    "\\Software\\Microsoft\\Office\\Outlook\\Addins\\"
                    in event.deep_get("TargetObject", default=""),
                    "\\Software\\Microsoft\\Office\\Word\\Addins\\"
                    in event.deep_get("TargetObject", default=""),
                    "\\Software\\Microsoft\\Office\\Excel\\Addins\\"
                    in event.deep_get("TargetObject", default=""),
                    "\\Software\\Microsoft\\Office\\Powerpoint\\Addins\\"
                    in event.deep_get("TargetObject", default=""),
                    "\\Software\\Microsoft\\VSTO\\Security\\Inclusion\\"
                    in event.deep_get("TargetObject", default=""),
                ]
            ),
            not any(
                [
                    event.deep_get("Image", default="")
                    in [
                        "C:\\Windows\\System32\\msiexec.exe",
                        "C:\\Windows\\SysWOW64\\msiexec.exe",
                        "C:\\Windows\\System32\\regsvr32.exe",
                        "C:\\Windows\\SysWOW64\\regsvr32.exe",
                    ],
                    all(
                        [
                            any(
                                [
                                    event.deep_get("Image", default="").startswith(
                                        "C:\\Program Files\\Common Files (x86)\\Microsoft Shared\\ClickToRun\\"
                                    ),
                                    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 (x86)\\Microsoft Office\\root\\integration\\integrator.exe",
                        "C:\\Program Files\\Microsoft Office\\root\\integration\\integrator.exe",
                    ],
                    all(
                        [
                            any(
                                [
                                    event.deep_get("Image", default="").startswith(
                                        "C:\\Program Files\\Microsoft Office\\OFFICE"
                                    ),
                                    event.deep_get("Image", default="").startswith(
                                        "C:\\Program Files (x86)\\Microsoft Office\\OFFICE"
                                    ),
                                    event.deep_get("Image", default="").startswith(
                                        "C:\\Program Files\\Microsoft Office\\Root\\OFFICE"
                                    ),
                                    event.deep_get("Image", default="").startswith(
                                        "C:\\Program Files (x86)\\Microsoft Office\\Root\\OFFICE"
                                    ),
                                    event.deep_get("Image", default="").startswith(
                                        "C:\\PROGRA~2\\MICROS~2\\Office"
                                    ),
                                ]
                            ),
                            any(
                                [
                                    event.deep_get("Image", default="").endswith("\\excel.exe"),
                                    event.deep_get("Image", default="").endswith(
                                        "\\Integrator.exe"
                                    ),
                                    event.deep_get("Image", default="").endswith("\\OneNote.exe"),
                                    event.deep_get("Image", default="").endswith("\\outlook.exe"),
                                    event.deep_get("Image", default="").endswith("\\powerpnt.exe"),
                                    event.deep_get("Image", default="").endswith("\\Teams.exe"),
                                    event.deep_get("Image", default="").endswith("\\visio.exe"),
                                    event.deep_get("Image", default="").endswith("\\winword.exe"),
                                ]
                            ),
                        ]
                    ),
                    all(
                        [
                            any(
                                [
                                    event.deep_get("Image", default="").startswith(
                                        "C:\\Program Files\\Common Files\\Microsoft Shared\\VSTO\\"
                                    ),
                                    event.deep_get("Image", default="").startswith(
                                        "C:\\Program Files (x86)\\Microsoft Shared\\VSTO\\"
                                    ),
                                ]
                            ),
                            event.deep_get("Image", default="").endswith("\\VSTOInstaller.exe"),
                        ]
                    ),
                ]
            ),
            not any(
                [
                    all(
                        [
                            event.deep_get("Image", default="")
                            in [
                                "C:\\Program Files\\AVG\\Antivirus\\RegSvr.exe",
                                "C:\\Program Files (x86)\\AVG\\Antivirus\\RegSvr.exe",
                            ],
                            "\\Microsoft\\Office\\Outlook\\Addins\\Antivirus.AsOutExt\\"
                            in event.deep_get("TargetObject", default=""),
                        ]
                    ),
                    all(
                        [
                            event.deep_get("Image", default="")
                            in [
                                "C:\\Program Files\\Avast Software\\Avast\\RegSvr.exe",
                                "C:\\Program Files (x86)\\Avast Software\\Avast\\RegSvr.exe",
                            ],
                            "\\Microsoft\\Office\\Outlook\\Addins\\Avast.AsOutExt\\"
                            in event.deep_get("TargetObject", default=""),
                        ]
                    ),
                ]
            ),
        ]
    ):
        return True
    return False
