我正在使用Snyk CLI对 python 项目运行安全扫描。不幸的是,snyk test命令返回Failed to test pip project错误。我缺少什么,在扫描项目snyk test时工作正常吗?npm
$ snyk test --file=requirements.txt
Failed to test pip project
Run Code Online (Sandbox Code Playgroud)
我发现原因基本上你需要做两件事:
$ pip3 install -r requirements.txt
$ snyk test --file=requirements.txt --command=python3
Run Code Online (Sandbox Code Playgroud)
您可以--allow-missing通过使用附加参数通过 snyk传递 pip 参数来绕过丢失的 python 包--。
$ snyk test --file=requirements.txt --command=python3 -- --allow-missing
Run Code Online (Sandbox Code Playgroud)
-- [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
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6315 次 |
| 最近记录: |