-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Running with docker image generates empty baseline file #131
Comments
Hi @cyrusfurtado, the team is aware of this issue. In the meantime, the recommendation is to use the pip package as it does not have this empty baseline file issue: https://github.com/IBM/detect-secrets#installupgrade-module |
@victoria-miltcheva thanks for the update. Since this is presently a known issue is there some timeline as to when the issue could be addressed. |
Hi, I am hitting this issue also, any updates or workaround for the docker image? |
I bumped into the same issue.
=> as a result, none of the files are considered git files, and scan returns empty result. Workarround:
|
We were also facing this issue and @frederic-pesquet-work already figured out the cause, as he explained above. Another finding: mounting volumes to docker running on Linux seems to work differently on Docker desktop (some colleagues using Docker Desktop on MacOS don't experience this bug). When a volume is mounted in docker running on Linux, the file's ownership and permissions are kept "as is" inside of the container. For example, if the files in your On the other hand, in Docker Desktop the files mounted volume inside of the container already shows up owned by uid |
I have a couple thoughts. I suspect there's a reason for that, but I'd be happy to submit a PR to change the behavior to fail (at least in some cases). I think it would be preferable to fail instead of generating an empty baseline file. |
@dleehr Oh so this loops back to the same thing we were talking about last week re: Looking at the output above: But for the purposes of the
|
@rossgrady Yep, I was reviewing the pipeline discussion yesterday and that's how I found may way here. I totally agree it's a good idea to update the documentation so that users can get valid results. I wasn't bringing pipeline questions here though :) My suggestion here is that a failure in Now that we know about this, we can work around it (both in the docs and in pipeline). But it seems like it would be safer to fail rather than quietly succeeding with invalid results.
Yes, the
should fix the issue too. |
Reading through this thread now, as just put a PR for #148 up (#150), which seems as a related to this issue (problems with The PR still doesn't fail if it detects a git failure, though (but at least logs it now, so is more evident what went wrong if something fails) |
Describe the bug
Running the docker image of the tool generates a
.secrets.baseline
file with an empty result for the secrets.To reproduce
Steps to reproduce the behavior
detect-secrets scan --update .secrets.baseline --exclude-files="go.sum"
.secrets.baseline
json file. The result property will have some entries.docker run -it --rm -v $(pwd):/code icr.io/git-defenders/detect-secrets:redhat-ubi scan --update .secrets.baseline --exclude-files="go.sum"
.secrets.baseline
json file. It will have an empty result property.Screenshots
Local tool run
Docker container run
Impact
High
Additional context:
The text was updated successfully, but these errors were encountered: