跳转到主要内容

Git感知自动化程序分析工具

项目描述

[alpha] Git感知的CLI,用于在开发人员和CI工作流程中运行semgrep模式。

安装 · 使用 · 帮助 & 社区

PyPI PyPI - Downloads Issues welcome! Follow @r2cdev

安装

需要Python 3.6+和Docker 19.03+。它可以在macOS和Linux上运行。

在Git项目目录中

$ pip3 install bento-headless

使用方法

升级

$ pip3 install --upgrade bento-headless

命令行选项

$ 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配置

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自带以下扩展

扩展 描述
bandit 在Python代码中查找常见的安全问题
dlint 一个鼓励最佳编码实践并帮助确保Python代码安全的工具
eslint 识别并报告JavaScript和TypeScript中的模式
flake8 在Python代码中查找常见的错误
gosec 在Go代码中查找安全错误
hadolint 在Docker文件中查找错误(需要Docker)
r2c.boto3 检查Python中的AWS boto3库
r2c.flask 检查Python Flask框架
r2c.jinja 在Jinja模板中查找常见的安全问题
r2c.registry.latest 运行r2c的检查注册表中的检查(实验性;需要Docker)
r2c.requests 检查Python Requests框架
shellcheck 在shell脚本中查找错误(需要Docker)

帮助和社区

需要帮助或想分享反馈?我们很高兴听取您的意见!

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

许可证和法规

请参阅条款和隐私文件



r2c logo

版权(c)r2c

项目详情


下载文件

下载您平台的文件。如果您不确定选择哪个,请了解有关安装包的更多信息。

源分发

bento-headless-0.11.2.tar.gz (88.2 kB 查看散列)

上传时间

构建分发

bento_headless-0.11.2-py3-none-any.whl (120.2 kB 查看散列)

上传时间 Python 3

由以下机构支持