def rule(event):
    if all(
        [
            event.deep_get("QueryName", default="").startswith("_ldap."),
            not any(
                [
                    any(
                        [
                            ":\\Program Files\\" in event.deep_get("Image", default=""),
                            ":\\Program Files (x86)\\" in event.deep_get("Image", default=""),
                            ":\\Windows\\" in event.deep_get("Image", default=""),
                        ]
                    ),
                    all(
                        [
                            ":\\ProgramData\\Microsoft\\Windows Defender\\Platform\\"
                            in event.deep_get("Image", default=""),
                            event.deep_get("Image", default="").endswith("\\MsMpEng.exe"),
                        ]
                    ),
                    event.deep_get("Image", default="") == "<unknown process>",
                    event.deep_get("Image", default="") == "",
                ]
            ),
            not any(
                [
                    event.deep_get("Image", default="").startswith("C:\\WindowsAzure\\GuestAgent"),
                    any(
                        [
                            event.deep_get("Image", default="").endswith("\\chrome.exe"),
                            event.deep_get("Image", default="").endswith("\\firefox.exe"),
                            event.deep_get("Image", default="").endswith("\\opera.exe"),
                        ]
                    ),
                ]
            ),
        ]
    ):
        return True
    return False
