def rule(event):
    if all(
        [
            any(
                [
                    any(
                        [
                            event.deep_get("ImageLoaded", default="").endswith("\\credui.dll"),
                            event.deep_get("ImageLoaded", default="").endswith("\\wincredui.dll"),
                        ]
                    ),
                    event.deep_get("OriginalFileName", default="")
                    in ["credui.dll", "wincredui.dll"],
                ]
            ),
            not any(
                [
                    any(
                        [
                            event.deep_get("Image", default="").startswith(
                                "C:\\Program Files (x86)\\"
                            ),
                            event.deep_get("Image", default="").startswith("C:\\Program Files\\"),
                            event.deep_get("Image", default="").startswith(
                                "C:\\Windows\\System32\\"
                            ),
                            event.deep_get("Image", default="").startswith(
                                "C:\\Windows\\SysWOW64\\"
                            ),
                            event.deep_get("Image", default="").startswith(
                                "C:\\Windows\\SystemApps\\"
                            ),
                        ]
                    ),
                    event.deep_get("Image", default="")
                    in [
                        "C:\\Windows\\explorer.exe",
                        "C:\\Windows\\ImmersiveControlPanel\\SystemSettings.exe",
                        "C:\\Windows\\regedit.exe",
                    ],
                ]
            ),
            not any(
                [
                    event.deep_get("Image", default="").endswith("\\opera_autoupdate.exe"),
                    any(
                        [
                            event.deep_get("Image", default="").endswith("\\procexp64.exe"),
                            event.deep_get("Image", default="").endswith("\\procexp.exe"),
                        ]
                    ),
                    all(
                        [
                            event.deep_get("Image", default="").startswith("C:\\Users\\"),
                            "\\AppData\\Local\\Microsoft\\Teams\\"
                            in event.deep_get("Image", default=""),
                            event.deep_get("Image", default="").endswith("\\Teams.exe"),
                        ]
                    ),
                    all(
                        [
                            event.deep_get("Image", default="").startswith("C:\\Users\\"),
                            "\\AppData\\Local\\Microsoft\\OneDrive\\"
                            in event.deep_get("Image", default=""),
                        ]
                    ),
                ]
            ),
        ]
    ):
        return True
    return False
