def rule(event):
    if all(
        [
            event.deep_get("EventID", default="") == 1121,
            event.deep_get("Path", default="").endswith("\\lsass.exe"),
            not any(
                [
                    all(
                        [
                            event.deep_get("ProcessName", default="").startswith(
                                "C:\\Windows\\Temp\\asgard2-agent\\"
                            ),
                            any(
                                [
                                    event.deep_get("ProcessName", default="").endswith(
                                        "\\thor64.exe"
                                    ),
                                    event.deep_get("ProcessName", default="").endswith(
                                        "\\thor.exe"
                                    ),
                                ]
                            ),
                        ]
                    ),
                    event.deep_get("ProcessName", default="")
                    in [
                        "C:\\Windows\\System32\\atiesrxx.exe",
                        "C:\\Windows\\System32\\CompatTelRunner.exe",
                        "C:\\Windows\\System32\\msiexec.exe",
                        "C:\\Windows\\System32\\nvwmi64.exe",
                        "C:\\Windows\\System32\\svchost.exe",
                        "C:\\Windows\\System32\\Taskmgr.exe",
                        "C:\\Windows\\System32\\wbem\\WmiPrvSE.exe",
                        "C:\\Windows\\SysWOW64\\msiexec.exe",
                    ],
                    any(
                        [
                            event.deep_get("ProcessName", default="").startswith(
                                "C:\\Windows\\System32\\DriverStore\\"
                            ),
                            event.deep_get("ProcessName", default="").startswith(
                                "C:\\WINDOWS\\Installer\\"
                            ),
                            event.deep_get("ProcessName", default="").startswith(
                                "C:\\Program Files\\"
                            ),
                            event.deep_get("ProcessName", default="").startswith(
                                "C:\\Program Files (x86)\\"
                            ),
                        ]
                    ),
                ]
            ),
        ]
    ):
        return True
    return False
