如何使用poutine检测代码库构建管道中的安全缺陷

关于poutine

poutine是一款功能强大的缺陷检测工具,该工具基于Go语言开发,可以帮助广大研究人员快速扫描和检测代码存储库构建管道中的错误配置和安全漏洞。

该工具支持解析来自 GitHub Actions 和 Gitlab CI/CD 的 CI 工作流。当获得具有读取级别访问权限的访问令牌时,poutine可以分析组织的所有存储库,以快速了解组织软件供应链的安全状况。

支持的平台

GitHub Actions

GitHub管道

Azure DevOps

Pipelines As Code Tekton

工具安装

源码构建

由于该工具基于Go语言开发,因此我们首先需要在本地设备上安装并配置好最新版本的Go运行环境。

接下来,广大研究人员可以直接使用下列命令将该项目源码克隆至本地:

git clone https://github.com/boostsecurityio/poutine.git

然后切换到项目目录中,使用make命令构建项目代码即可:

cd poutine

make build

发布版本

广大研究人员可以直接访问该项目【Releases页面】下载poutine的最新预编译版本,并将二进制文件添加到您的 $PATH。

Homebrew

brew install poutine

Docker

docker run -e GH_TOKEN ghcr.io/boostsecurityio/poutine:latest

GitHub Actions

...

jobs:

  poutine:

    runs-on: ubuntu-latest

    permissions:

      security-events: write

      contents: read

    steps:

    - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

#################################################################################################

    - name: poutine - GitHub Actions SAST

      uses: boostsecurityio/poutine-action@main # We recommend to use a tagged version and pin it

#################################################################################################

    - name: Upload poutine SARIF file

      uses: github/codeql-action/upload-sarif@4355270be187e1b672a7a1c7c7bae5afdc1ab94a # v3.24.10

      with:

        sarif_file: results.sarif

工具使用

poutine [command] [arguments] [options]

分析一个本地库:

poutine analyze_local .

分析一个远程GitHub库:

poutine analyze_repo org/repo --token "$GH_TOKEN"

分析GitHub中一个组织的所有库:

poutine analyze_org org --token "$GH_TOKEN"

分析一个自托管Gitlab实例中的所有项目:

poutine analyze_org my-org/project --token "$GL_TOKEN" --scm gitlab --scm-base-uri https://gitlab.example.com

配置参数选项

--token          SCM访问令牌

--format          输出格式(默认:pretty、json、sarif)

--ignore-forks     忽略组织中的fork存储库(analyze_org)

--scm            SCM平台(默认:github、gitlab)

--scm-base-uri   自托管SCM实例的URI基地址

--threads        要使用的线程数(默认:2)

--config         配置文件的路径(默认:.poultine.yml)

--verbose        启用调试日志记录

更新构建平台CVE数据库

go test -tags build_platform_vuln_database ./...

opa fmt -w opa/rego/external/build_platform.rego

工具运行演示

许可证协议

本项目的开发与发布遵循Apache-2.0开源许可协议。

项目地址

poutine:【GitHub传送门

参考资料

https://boostsecurity.io/

https://en.wikipedia.org/wiki/Poutine

https://github.com/messypoutine

  • 17
    点赞
  • 15
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值