用于自动程序分析的Gitaware实用程序

bento-headless的Python项目详细描述


[alpha]一个支持Git的CLI,用于在开发人员和CI工作流中运行semgrep模式。

Installation··Usage··Help & Community

PyPIPyPI - DownloadsIssues welcome!Follow @r2cdev

安装

需要Python 3.6+和{a9}。它可以在macOS和Linux上运行。在

在Git项目目录中:

$ pip3 install bento-headless

使用

升级

^{pr2}$

命令行选项

$ bentoh --help
Usage: bentoh [OPTIONS] COMMAND [ARGS]...

Options:
  -h, --help  Show this message and exit.
  --version   Show the version and exit.

Commands:
  archive  Suppress current findings.
  check    Checks for new findings.

  To get help for a specific command, run `bentoh COMMAND --help`

对暂存差异运行自定义semgrep检查

有关如何编写自定义规则文件,请参阅semgrep Configuration

vi .bento/semgrep.yml
bentoh check

将输出格式化为JSON

bentoh check -f json

在文件系统当前状态下运行

bentoh check --all

在目录

bentoh check src

忽略当前发现

bentoh archive

对分段差异运行公共semgrep检查

BENTO_REGISTRY=r/r2c.python bentoh check

从扩展运行检查

bentoh check -t gosec -t r2c.registry.latest

退出代码

bentoh check可以使用以下退出代码退出:

  • 0:Bento运行成功,没有发现错误
  • 2:Bento运行成功并在代码中发现问题
  • 3:Bento或其底层工具之一无法运行

扩展

bentoh附带以下扩展:

ExtensionDescription
banditFinds common security issues in Python code
dlintA tool for encouraging best coding practices and helping ensure Python code is secure
eslintIdentifies and reports on patterns in JavaScript and TypeScript
flake8Finds common bugs in Python code
gosecFinds security bugs in Go code
hadolintFinds bugs in Docker files (requires Docker)
r2c.boto3Checks for the AWS boto3 library in Python
r2c.flaskChecks for the Python Flask framework
r2c.jinjaFinds common security issues in Jinja templates
r2c.registry.latestRuns checks from r2c's check registry (experimental; requires Docker)
r2c.requestsChecks for the Python Requests framework
shellcheckFinds bugs in shell scripts (requires Docker)

帮助和社区

需要帮助还是想分享反馈?我们很想听到你的消息!在

我们不断推出新功能和改进。在

许可证和法律

请参考terms and privacy document。在



r2c logo

版权所有r2c。 在

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java如何在没有代码气味的情况下编写遵循Liskov替代和其他可靠原则的不可变映射?   java最新jre上的压缩字符串对旧编译代码有好处吗?   java是否可以在javascript中取消PrimeFaces menuitem onclick函数   mysql从SQL数据库中访问java中xml名称空间标记的值   从java程序打开excel文件   java在方法中使用“var”是否会使执行(并发)线程不安全?   java使搜索视图以一种关于AndroidManifest的通用方式可用。xml   java对如何准确使用正则表达式感到困惑?   mule如何访问java文件中的记录变量   java在从2D数组引发异常后继续   枚举当前设置为的java值   java当listview只有几个项目时,如何使alert对话框显示listview的所有项目?   java getTableRow()返回大于项大小的索引   c用java传输二进制文件(数据)   java更改多选列表项复选框颜色