Skip to content
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

Failed to exclude missing files from scan #5512

Closed
liorj-orca opened this issue Jun 22, 2022 · 1 comment · Fixed by #5533
Closed

Failed to exclude missing files from scan #5512

liorj-orca opened this issue Jun 22, 2022 · 1 comment · Fixed by #5533
Labels
bug Something isn't working community Community contribution

Comments

@liorj-orca
Copy link
Contributor

when you have a symbolic link to a file that is either missing(removed for some reason) or link to a file that is out of the attached docker volume, kics stops the scan and throw some error such as:

Preparing Scan Assets: Done
Error: failed to read sources: failed to walk directory: failed to open file: open blabla.json: no such file or directory

I would prefer that in that case, we will just show a log that the file is missing and continue with the scan.
In addition, the bug is when I tried to exclude that file from the scan using '-e' flag I get the same error like it wasn't affecting at all.

for example, let's say we have a file named a.yaml and we create a symlink to that file called b.yaml(in the same directory). if for some reason a.yaml is removed and we run kics like:
kics scan --disable-secrets -p $PWD -e $PWD/b.yaml
then we are getting the error like above.

@liorj-orca liorj-orca added bug Something isn't working community Community contribution labels Jun 22, 2022
@kaplanlior
Copy link
Contributor

Thanks @liorj-orca for reporting. I agree we should ignore broken symlinks,
except for the case it's the only scan target.

Notice that in your in both a.yaml & b.yaml are in the same dir,
exclude only one of them would mean the other still gets scanned.

Can I challenge you to also suggest the code fix for the symlink traversal?
(we'll be happy to help if needed)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working community Community contribution
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants