gitlab ci 中的 trufflehog

我正在尝试在 GitLab CI 中手动设置 truffleHog 以扫描我的 GitLab 存储库中的秘密。我想我错误地配置了我的工作。我的猜测是我传递给 trufflehog 的文件路径是错误的,因为作业运行很快并且以“作业成功”结束,尽管事实上我有一个带有“----BEGIN PGP PRIVATE KEY BLOCK-”的虚拟文本文件----" 和 "EAACEdEose0cBA23456gfde4567hgf" 来测试它是否按预期工作。


我的.gitlab-ci.yml样子:


stages:

  - secrets


trufflehog:

  stage: secrets

  image: python:3-alpine

  script:

    - apk add --no-cache git

    - pip install trufflehog

    - adduser -S truffleHog

    - trufflehog --entropy true "file://$PWD"

trufflehog 命令的原始输出如下所示:


$ trufflehog --entropy true "file://$PWD" 

[0Ksection_end:1570219434:build_script 

[0Ksection_start:1570219434:after_script 

[0Ksection_end:1570219435:after_script 

[0Ksection_start:1570219435:archive_cache 

[0Ksection_end:1570219437:archive_cache 

[0Ksection_start:1570219437:upload_artifacts_on_success

[0Ksection_end:1570219438:upload_artifacts_on_success 

[0KJob succeeded

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


梦里花落0921
浏览 122回答 1
1回答

慕姐4208626

正如TruffleHog 文档中所说:对于扫描repo你不应该使用“文件”选项:truffleHog --regex --entropy=False https://github.com/dxa4481/truffleHog.git无论如何,如果您想使用文件选项扫描本地目录,调用似乎没有引号: truffleHog file:///user/dxa4481/codeprojects/truffleHog/如果目录上没有空格,或者只是这个,你可以不带引号试试吗?trufflehog --entropy true file:"//$PWD"
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Python