def rule(event):
    if all(
        [
            any(
                [
                    "\\Control\\SafeBoot\\Minimal\\" in event.deep_get("TargetObject", default=""),
                    "\\Control\\SafeBoot\\Network\\" in event.deep_get("TargetObject", default=""),
                ]
            ),
            event.deep_get("TargetObject", default="").endswith("\\(Default)"),
            event.deep_get("Details", default="") == "Service",
            not any(
                [
                    all(
                        [
                            event.deep_get("Image", default="")
                            == "C:\\WINDOWS\\system32\\msiexec.exe",
                            any(
                                [
                                    event.deep_get("TargetObject", default="").endswith(
                                        "\\Control\\SafeBoot\\Minimal\\SAVService\\(Default)"
                                    ),
                                    event.deep_get("TargetObject", default="").endswith(
                                        "\\Control\\SafeBoot\\Network\\SAVService\\(Default)"
                                    ),
                                ]
                            ),
                        ]
                    ),
                    all(
                        [
                            event.deep_get("Image", default="").endswith(
                                "\\MBAMInstallerService.exe"
                            ),
                            event.deep_get("TargetObject", default="").endswith(
                                "\\MBAMService\\(Default)"
                            ),
                            event.deep_get("Details", default="") == "Service",
                        ]
                    ),
                    all(
                        [
                            event.deep_get("Image", default="")
                            == "C:\\Hexnode\\Hexnode Agent\\Current\\HexnodeAgent.exe",
                            any(
                                [
                                    event.deep_get("TargetObject", default="").endswith(
                                        "\\Control\\SafeBoot\\Minimal\\Hexnode Updater\\(Default)"
                                    ),
                                    event.deep_get("TargetObject", default="").endswith(
                                        "\\Control\\SafeBoot\\Network\\Hexnode Updater\\(Default)"
                                    ),
                                    event.deep_get("TargetObject", default="").endswith(
                                        "\\Control\\SafeBoot\\Minimal\\Hexnode Agent\\(Default)"
                                    ),
                                    event.deep_get("TargetObject", default="").endswith(
                                        "\\Control\\SafeBoot\\Network\\Hexnode Agent\\(Default)"
                                    ),
                                ]
                            ),
                            event.deep_get("Details", default="") == "Service",
                        ]
                    ),
                ]
            ),
        ]
    ):
        return True
    return False
