You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I cannot get the secureCodeBox fork of gitleaks to work.
Describe the bug
According to the instructions, the following commands should install the gitleaks fork that contains the --commit-since-duration switch that is not yet part of the main gitleaks codebase:
However, if I then run a scan, the system reports that it does not know the switch.
Steps To Reproduce
Install the gitleaks scanner as described above, then run the following scan:
apiVersion: "execution.securecodebox.io/v1"kind: Scanmetadata:
name: "scan-repo"spec:
scanType: "gitleaks"parameters:
- "--repo-url"
- "https://github.com/secureCodeBox/secureCodeBox"# Apply all available rules
- "--config-path"
- "/home/config_all.toml"# Redact secrets from log messages and leaks
- "--redact"# Only scan commits since the last 24h# (Error also occurs if you drop the =24h and place the 24h on a separate line
- "--commit-since-duration=24h"
Expected behavior
It should scan the commits in the last 24 hours.
Additional notes
I first assumed that the mistake may be that the helm command should be as follows:
However, if I use that, it fails because the image does not contain the wrapper.sh:
sh: can't open '/wrapper.sh': No such file or directory
I am unsure how the securecodebox/gitleaks image was built, so I cannot tell if it is just outdated and should be updated to contain the new wrapper script, or if the issue is somewhere else.
I think you're right. it's a mistake in the documentation, because securecodebox/scanner-gitleaks is the docker image that we build from the remote gitleaks image, not from our fork (/scanners/gitleaks/scanner/Dockerfile)
I am unsure how the securecodebox/gitleaks image was built, so I cannot tell if it is just outdated and should be updated to contain the new wrapper script, or if the issue is somewhere else.
Updating the fork gitleaks image securecodebox/gitleaks with the following Dockerfile resolves the issue. The wrapper.sh was missing.
ARG scannerVersion=latest
FROM securecodebox/gitleaks:v7.3.0 # changed from zricethezav/gitleaks:${scannerVersion}
USER root
COPY wrapper.sh /wrapper.sh
RUN chmod o+x ./wrapper.sh
#USER gitleaks Or create a gitleaks userENTRYPOINT ["./wrapper.sh" ]
Someone with Docker Hub rights can upload this image for a temporary fix (@J12934 👀 ).
The problem is, as you mentioned, is that the image is out of date and it doesn't seem like the PR that @rseedorff created is going to be merged (gitleaks/gitleaks#498). I don't know if we can support this feature efficiently.
Activity
Ilyesbdlala commentedon Nov 9, 2021
I think you're right. it's a mistake in the documentation, because securecodebox/scanner-gitleaks is the docker image that we build from the remote gitleaks image, not from our fork (/scanners/gitleaks/scanner/Dockerfile)
Updating the fork gitleaks image securecodebox/gitleaks with the following Dockerfile resolves the issue. The wrapper.sh was missing.
Someone with Docker Hub rights can upload this image for a temporary fix (@J12934 👀 ).
The problem is, as you mentioned, is that the image is out of date and it doesn't seem like the PR that @rseedorff created is going to be merged (gitleaks/gitleaks#498). I don't know if we can support this feature efficiently.