gitlab-ci - gitlab ci 中的 gitleaks

标签 gitlab-ci gitlab-ce

我正在尝试在 GitLab CI 中手动设置 gitleaks 来扫描我的 GitLab 存储库以获取 secret 。我想我的工作配置错误。作业通过,但输出一个未知标志“c”,并且 gitleaks 帮助对话,但没有预期的基于 gitleaks 的实际输出。

我的`.gitlab-ci.yml'看起来像:

stages:
  - security

gitleaks:
  stage: security
  image: zricethezav/gitleaks
  script:
    - gitleaks --verbose --repo-path=$PWD

有什么建议我可能会出错吗?

最佳答案

看看是否this example works better

stages:
  - leaks
  - test

leaks:gitleaks:
  stage: leaks
  image: 
    name: "zricethezav/gitleaks"
    entrypoint: [""]
  script:
    - gitleaks -v --repo-path=./ --config=gitleaks.toml

您可以调整阶段名称,但添加一个空入口点和 config file可能有帮助。


请注意,GitLab 14.7 (2022 年 1 月),Gitleaks 性能有了一些重大改进。

Building on the large rule expansion included in GitLab 14.5, we are updating our GitLab Secret Detection analyzer, Gitleaks, to the next major version 8.

This new, major version includes massive performance updates and a complete rewrite of its core detection engine.

Secret Detection historical scans should now run much faster, with a large reduction in memory usage.
This means both faster detection and shorter (and more efficient) pipelines.
This change also sets us up to make more performance improvements that will improve all non-historical Secret Detection job runs in the future.

See Documentation and Issue.

关于gitlab-ci - gitlab ci 中的 gitleaks,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58211902/

相关文章:

node.js - 找不到 Docker Node flow-bin libelf.so.1 (gitlab ci)

GitLab CE : How to restore or repair repos with issues/merge requests that are suddenly missing?

git - 如何在 gitlab 中更改现有 merge 请求的源分支?

Flutter 分析发现 Gitlab CI/CD 管道中存在本地未发现的问题

continuous-integration - 使用 Deploy Token 下载 GitLab 通用包文件

python - 如何使用 gitlab-ci 管理相互依赖的轮子的测试/构建

gitlab - 如何在 GitLab CI/CD 期间从 AWS Secret Manager 检索 key

gitlab-ci-runner - 获取执行 gitlab 作业的容器 id

gitlab-ce - gitlab:如何更新到最新的次要版本

docker - docker运行后gitlab中的错误权限