【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!

参考资料


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

相关推荐
数字工作台10 小时前
给 LangGraph 加一道可审计记忆:替换默认 Checkpointer,实现防篡改 + 崩溃不丢数据
python·agent
DKPT10 小时前
Python 的 Web 框架:选型选错的人,都踩了同一个坑
python
2401_8685347811 小时前
逻辑网络设计
网络·python
2601_9679791211 小时前
python如何组织文件?python文件操作全介绍!
python·文件操作·压缩文件·遍历文件夹·shutil模块
青少儿编程课堂12 小时前
蓝桥杯·全国青少年信息素养大赛·电子学会Python/C++考级:扫描线与线段树求矩形面积并解析
c++·python·算法·bfs·信息学竞赛
羲云网络12 小时前
GPT Image 2.6 商品图交付:用文件指纹排查错图、覆盖与版本串线
图像处理·人工智能·python·技术教程·文件校验
wuyk55512 小时前
Spider-第14讲-表单提交与CSRF
前端·爬虫·python·elasticsearch·csrf
汤姆宝库13 小时前
RoPE旋转位置编码的实现与长上下文外推
python·深度学习·机器学习
用户0190275816113 小时前
股票代码格式对照:各数据源代码转 AlphaFeed
python
__underline__14 小时前
冷门Python知识点005篇:list.sort( )的排序稳定性,是用0字节额外内存实现的
python·算法