def rule(event):
    if all(
        [
            event.deep_get("EventID", default="") == 854,
            not any(
                [
                    any(
                        [
                            ":/Program%20Files" in event.deep_get("Path", default=""),
                            ":/Windows/System32/" in event.deep_get("Path", default=""),
                            ":\\Program Files (x86)\\" in event.deep_get("Path", default=""),
                            ":\\Program Files\\" in event.deep_get("Path", default=""),
                            ":\\Windows\\ImmersiveControlPanel\\"
                            in event.deep_get("Path", default=""),
                            ":\\Windows\\PrintDialog\\" in event.deep_get("Path", default=""),
                            ":\\Windows\\SystemApps\\" in event.deep_get("Path", default=""),
                            "AppData/Local/Temp/WinGet/Microsoft.Winget.Source"
                            in event.deep_get("Path", default=""),
                            "x-windowsupdate://" in event.deep_get("Path", default=""),
                        ]
                    ),
                    any(
                        [
                            "https://installer.teams.static.microsoft/"
                            in event.deep_get("Path", default=""),
                            "https://res.cdn.office.net" in event.deep_get("Path", default=""),
                            "https://statics.teams.cdn.live.net/"
                            in event.deep_get("Path", default=""),
                            "https://statics.teams.cdn.office.net/"
                            in event.deep_get("Path", default=""),
                            "microsoft.com" in event.deep_get("Path", default=""),
                        ]
                    ),
                ]
            ),
            not any(
                [
                    "AppData\\Local\\Microsoft\\OneDrive\\" in event.deep_get("Path", default=""),
                    any(
                        [
                            "AppData/Local/Temp/WinGet/Microsoft.Winget.Source"
                            in event.deep_get("Path", default=""),
                            "AppData\\Local\\Temp\\WinGet\\Microsoft.Winget.Source"
                            in event.deep_get("Path", default=""),
                        ]
                    ),
                    "x-windowsupdate://" in event.deep_get("Path", default=""),
                ]
            ),
        ]
    ):
        return True
    return False
