【Azure Function】在Azure上的 Python Function 资源被扫描出包含安全漏洞

问题描述

在Azure Function App服务资源中部署/创建的Python Function被扫描出包含安全漏洞。

漏洞描述为:

The library `cryptography ` version `3.1.1` was detected in `PIP library manager` located at `/requirements.txt` on line `6` and is vulnerable to `CVE-2023-5363`, which exists in versions `<41.0.5`.

The vulnerability was found in the [Pyup.io Safety DB](https://data.safetycli.com/v/62452/52d) with vendor severity: `High` ([NVD](https://nvd.nist.gov/vuln/detail/CVE-2023-5363) severity: `High`).

The vulnerability can be remediated by updating the library to version `41.0.5` or higher, using `pip install --upgrade cryptography`.

如果是本地开发Python代码后部署到Azure中,可以在本地项目的requirements.txt 中对cryptography的版本修改为41.0.5 及更高就可以。

但是,如果是在Azure门户中,直接通过页面创建的Python Function,如何来修改 cryptography 版本呢?

问题解答

Azure Function App提供一个高级工具(kudu站点:https://<your function app name>.scm.chinacloudsites.cn/newui/filemanager/site/wwwroot/ )可以直接查看Function的代码文件及requirements.txt和host.json等配置文件:

1: 进入Advanced Tools页面,点击Go进入Kudu站点

2: 在kud页面的URL后手动加上 \newui 进入新版ui界面,然后点击左侧的 File Manger

3: 一层层进入目录 site/wwwroot,打开requirements.txt 文件,直接修改 cryptography 的版本号

保存修改后重启Function App!

参考资料


当在复杂的环境中面临问题,格物之道需:浊而静之徐清,安以动之徐生。 云中,恰是如此!

相关推荐
zone77391 天前
001:简单 RAG 入门
后端·python·面试
F_Quant1 天前
🚀 Python打包踩坑指南:彻底解决 Nuitka --onefile 配置文件丢失与重启报错问题
python·操作系统
允许部分打工人先富起来1 天前
在node项目中执行python脚本
前端·python·node.js
IVEN_1 天前
Python OpenCV: RGB三色识别的最佳工程实践
python·opencv
haosend1 天前
AI时代,传统网络运维人员的转型指南
python·数据网络·网络自动化
曲幽1 天前
不止于JWT:用FastAPI的Depends实现细粒度权限控制
python·fastapi·web·jwt·rbac·permission·depends·abac
IVEN_2 天前
只会Python皮毛?深入理解这几点,轻松进阶全栈开发
python·全栈
Ray Liang2 天前
用六边形架构与整洁架构对比是伪命题?
java·python·c#·架构设计
AI攻城狮2 天前
如何给 AI Agent 做"断舍离":OpenClaw Session 自动清理实践
python
千寻girling2 天前
一份不可多得的 《 Python 》语言教程
人工智能·后端·python