I am trying to integrate gitleaks in gitlab cicd pipeline. I am using the following code and it works.
In the parameter, I am passing the branch as a committed branch. However that branch is created from the master branch so, gitleak searches the commit history of the master branch and it provides history of secrets written and removed on the master branch as well which I don’t want.
I am expecting only the secrets written on the current branch which should be reported.
How could this be achieved?
Here is my .gitlab-ci.yml file.
stages:
- test
secret_scan:
stage: test
image:
name: “zricethezav/gitleaks”
entrypoint: [“”]
script:
– gitleaks detect –source . –verbose branch=$CI_COMMIT_BRANCH –report-format json –report-path gitleaks-report.json || true
artifacts:
paths:
– gitleaks-report.json
Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.
Your Answer
Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.
Your Answer
Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.
Your Answer
Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.
Your Answer
Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.
Your Answer
Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.
Your Answer
asdsd is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.