def rule(event):
    if all(
        [
            "\\Control\\WMI\\Autologger\\" in event.deep_get("TargetObject", default=""),
            any(
                [
                    "\\EventLog-" in event.deep_get("TargetObject", default=""),
                    "\\Defender" in event.deep_get("TargetObject", default=""),
                ]
            ),
            any(
                [
                    event.deep_get("TargetObject", default="").endswith("\\Enabled"),
                    event.deep_get("TargetObject", default="").endswith("\\Start"),
                ]
            ),
            event.deep_get("Details", default="") == "DWORD (0x00000000)",
            not any(
                [
                    event.deep_get("Image", default="") == "C:\\Windows\\system32\\wevtutil.exe",
                    all(
                        [
                            any(
                                [
                                    event.deep_get("Image", default="").startswith(
                                        "C:\\ProgramData\\Microsoft\\Windows Defender\\Platform\\"
                                    ),
                                    event.deep_get("Image", default="").startswith(
                                        "C:\\Program Files\\Windows Defender\\"
                                    ),
                                    event.deep_get("Image", default="").startswith(
                                        "C:\\Program Files (x86)\\Windows Defender\\"
                                    ),
                                ]
                            ),
                            event.deep_get("Image", default="").endswith("\\MsMpEng.exe"),
                            any(
                                [
                                    "\\DefenderApiLogger\\"
                                    in event.deep_get("TargetObject", default=""),
                                    "\\DefenderAuditLogger\\"
                                    in event.deep_get("TargetObject", default=""),
                                ]
                            ),
                        ]
                    ),
                ]
            ),
        ]
    ):
        return True
    return False
