在 gitlab 中,我尝试启用秘密检测, 我用它来检测漏洞,但它并没有使工作失败。
这是我的“.gitlab-ci.yml”文件:
include:
- template: Security/Secret-Detection.gitlab-ci.yml
stages:
- test
secret_detection:
tags:
- secret
artifacts:
reports:
secret_detection: gl-secret-detection-report.json
variables:
SECRET_DETECTION_HISTORIC_SCAN: "true"
日志的一部分(gl-secret-detection-report.json):
"category": "secret_detection",
"name": "Stripe",
"message": "Stripe detected; please remove and revoke it if this is a leak.",
"severity": "Critical",
"confidence": "Unknown",
"raw_source_code_extract": "pk_test_TYooMQauvdEDq54NiTphI7jx",
"scanner": {
"id": "gitleaks",
"name": "Gitleaks"
但是:
在 GitLab 企业版 14.0.0-ee 上运行,入门计划
如果此作业在扫描时发现某些内容,我如何让它在合并请求时失败?