我正在使用Snyk CLI为python项目运行安全扫描。不幸的是,snyk test命令返回未能测试pip项目错误。我错过了什么,snyk test在扫描npm项目时工作得很好?
$ snyk test --file=requirements.txt
Failed to test pip project发布于 2021-04-15 14:10:25
我发现原因基本上是你需要做两件事:
解决方案
$ pip3 install -r requirements.txt
$ snyk test --file=requirements.txt --command=python3信息
通过使用附加的--allow-missing参数,可以通过snyk传递--allow-missing pip参数,从而绕过缺少的python包。
$ snyk test --file=requirements.txt --command=python3 -- --allow-missing文档
-- [COMPILER_OPTIONS]
Pass extra arguments directly to Gradle or Maven. E.g. snyk test
-- --build-cache
Python options
--command=COMMAND
Indicate which specific Python commands to use based on Python
version. The default is python which executes your systems de-
fault python version. Run 'python -V' to find out what version
is it. If you are using multiple Python versions, use this pa-
rameter to specify the correct Python command for execution.
Default: python Example: --command=python3发布于 2022-04-22 04:25:50
如果snyk monitor命令没有使用
pip3 install -r requirements.txt
snyk test --file=requirements.txt --command=python3
snyk monitor --file=requirements.txt --command=python3发布于 2022-04-27 16:15:26
如果您使用的是虚拟环境,那么请确保您已经用"./ venv /Scripts/activate“激活了venv。
然后再试着运行Snyk测试。
Snyk监视器和其他cli命令应该从该命令开始工作!:)
https://stackoverflow.com/questions/67110095
复制相似问题