def rule(event):
    if all(
        [
            event.deep_get("Image", default="").endswith(".exe"),
            event.deep_get("TargetFilename", default="").endswith(".exe"),
            not any(
                [
                    any(
                        [
                            event.deep_get("Image", default="").endswith(
                                ":\\Windows\\System32\\msiexec.exe"
                            ),
                            event.deep_get("Image", default="").endswith(
                                ":\\Windows\\system32\\cleanmgr.exe"
                            ),
                            event.deep_get("Image", default="").endswith(
                                ":\\Windows\\explorer.exe"
                            ),
                            event.deep_get("Image", default="").endswith(
                                ":\\WINDOWS\\system32\\dxgiadaptercache.exe"
                            ),
                            event.deep_get("Image", default="").endswith(
                                ":\\WINDOWS\\system32\\Dism.exe"
                            ),
                            event.deep_get("Image", default="").endswith(
                                ":\\Windows\\System32\\wuauclt.exe"
                            ),
                        ]
                    ),
                    all(
                        [
                            event.deep_get("Image", default="").endswith(
                                ":\\WINDOWS\\system32\\svchost.exe"
                            ),
                            ":\\Windows\\SoftwareDistribution\\Download\\"
                            in event.deep_get("TargetFilename", default=""),
                        ]
                    ),
                    all(
                        [
                            event.deep_get("Image", default="").endswith(
                                ":\\Windows\\system32\\svchost.exe"
                            ),
                            ":\\WUDownloadCache\\" in event.deep_get("TargetFilename", default=""),
                            "\\WindowsUpdateBox.exe"
                            in event.deep_get("TargetFilename", default=""),
                        ]
                    ),
                    all(
                        [
                            ":\\WINDOWS\\SoftwareDistribution\\Download\\"
                            in event.deep_get("Image", default=""),
                            event.deep_get("Image", default="").endswith("\\WindowsUpdateBox.Exe"),
                            ":\\$WINDOWS.~BT\\Sources\\"
                            in event.deep_get("TargetFilename", default=""),
                        ]
                    ),
                    all(
                        [
                            ":\\Windows\\WinSxS\\" in event.deep_get("Image", default=""),
                            event.deep_get("Image", default="").endswith("\\TiWorker.exe"),
                        ]
                    ),
                    any(
                        [
                            any(
                                [
                                    ":\\Program Files\\" in event.deep_get("Image", default=""),
                                    ":\\Program Files (x86)\\"
                                    in event.deep_get("Image", default=""),
                                ]
                            ),
                            any(
                                [
                                    ":\\Program Files\\"
                                    in event.deep_get("TargetFilename", default=""),
                                    ":\\Program Files (x86)\\"
                                    in event.deep_get("TargetFilename", default=""),
                                ]
                            ),
                        ]
                    ),
                    any(
                        [
                            ":\\ProgramData\\Microsoft\\Windows Defender\\"
                            in event.deep_get("Image", default=""),
                            ":\\Program Files\\Windows Defender\\"
                            in event.deep_get("Image", default=""),
                        ]
                    ),
                    "\\AppData\\Local\\Microsoft\\WindowsApps\\"
                    in event.deep_get("TargetFilename", default=""),
                    all(
                        [
                            event.deep_get("Image", default="").endswith(
                                "\\AppData\\Local\\Microsoft\\Teams\\Update.exe"
                            ),
                            any(
                                [
                                    event.deep_get("TargetFilename", default="").endswith(
                                        "\\AppData\\Local\\Microsoft\\Teams\\stage\\Teams.exe"
                                    ),
                                    event.deep_get("TargetFilename", default="").endswith(
                                        "\\AppData\\Local\\Microsoft\\Teams\\stage\\Squirrel.exe"
                                    ),
                                    event.deep_get("TargetFilename", default="").endswith(
                                        "\\AppData\\Local\\Microsoft\\SquirrelTemp\\tempb\\"
                                    ),
                                ]
                            ),
                        ]
                    ),
                    all(
                        [
                            any(
                                [
                                    ":\\Windows\\Microsoft.NET\\Framework\\"
                                    in event.deep_get("Image", default=""),
                                    ":\\Windows\\Microsoft.NET\\Framework64\\"
                                    in event.deep_get("Image", default=""),
                                    ":\\Windows\\Microsoft.NET\\FrameworkArm\\"
                                    in event.deep_get("Image", default=""),
                                    ":\\Windows\\Microsoft.NET\\FrameworkArm64\\"
                                    in event.deep_get("Image", default=""),
                                ]
                            ),
                            event.deep_get("Image", default="").endswith("\\mscorsvw.exe"),
                            ":\\Windows\\assembly\\NativeImages_"
                            in event.deep_get("TargetFilename", default=""),
                        ]
                    ),
                    all(
                        [
                            "\\AppData\\Local\\" in event.deep_get("Image", default=""),
                            event.deep_get("Image", default="").endswith(
                                "\\Microsoft VS Code\\Code.exe"
                            ),
                            "\\.vscode\\extensions\\"
                            in event.deep_get("TargetFilename", default=""),
                        ]
                    ),
                    all(
                        [
                            event.deep_get("Image", default="").endswith(
                                "\\AppData\\Local\\GitHubDesktop\\Update.exe"
                            ),
                            "\\AppData\\Local\\SquirrelTemp\\"
                            in event.deep_get("TargetFilename", default=""),
                        ]
                    ),
                    any(
                        [
                            ":\\WINDOWS\\TEMP\\" in event.deep_get("Image", default=""),
                            ":\\WINDOWS\\TEMP\\" in event.deep_get("TargetFilename", default=""),
                        ]
                    ),
                    any(
                        [
                            "\\AppData\\Local\\Temp\\" in event.deep_get("Image", default=""),
                            "\\AppData\\Local\\Temp\\"
                            in event.deep_get("TargetFilename", default=""),
                        ]
                    ),
                    all(
                        [
                            ":\\Windows\\Microsoft.NET\\Framework"
                            in event.deep_get("Image", default=""),
                            event.deep_get("Image", default="").endswith("\\mscorsvw.exe"),
                            ":\\Windows\\assembly" in event.deep_get("TargetFilename", default=""),
                        ]
                    ),
                ]
            ),
            not any(
                [
                    all(
                        [
                            "\\Python27\\python.exe" in event.deep_get("Image", default=""),
                            any(
                                [
                                    "\\Python27\\Lib\\site-packages\\"
                                    in event.deep_get("TargetFilename", default=""),
                                    "\\Python27\\Scripts\\"
                                    in event.deep_get("TargetFilename", default=""),
                                    "\\AppData\\Local\\Temp\\"
                                    in event.deep_get("TargetFilename", default=""),
                                ]
                            ),
                        ]
                    ),
                    all(
                        [
                            "\\AppData\\Local\\SquirrelTemp\\Update.exe"
                            in event.deep_get("Image", default=""),
                            "\\AppData\\Local" in event.deep_get("TargetFilename", default=""),
                        ]
                    ),
                    all(
                        [
                            event.deep_get("Image", default="").endswith("\\ChromeSetup.exe"),
                            "\\Google" in event.deep_get("TargetFilename", default=""),
                        ]
                    ),
                ]
            ),
        ]
    ):
        return True
    return False
