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

Fix blacklisted_paths can not work on scan image feature #45

Merged

Conversation

Ethonwu
Copy link

@Ethonwu Ethonwu commented Mar 30, 2022

Hi, I try to use blacklisted_paths to ignore some dir when using image scan, but it not work.

In IsSkippableDir function, use path var to compare with skippablePathIndicator var that read from blacklisted_paths, I try to print path to I get some path problem.

For example:
If I want to ignore /bin path, code will compare both two string by use HasPrefix
But in image scan feature, path output is like this: /tmp/Deepfence/SecretScanning/df_demoimage4/ExtractedFiles/<layer_id>/bin
This is reason that I this blacklisted_paths not work
So I try use TrimPrefix to let path like this:
Original
/tmp/Deepfence/SecretScanning/df_demoimage4/ExtractedFiles/<layer_id>/bin
After TrimPrefix
/bin
It will work on IsSkippableDir function, and can successful ignore blacklisted_paths by use image scan

@Ethonwu Ethonwu mentioned this pull request Mar 30, 2022
@ramanan-ravi
Copy link
Contributor

@Ethonwu Thanks for the contribution

@ramanan-ravi ramanan-ravi merged commit b2bc6db into deepfence:master Mar 30, 2022
@Ethonwu Ethonwu deleted the fix/fix_image_scan_blacklist_problem branch April 3, 2022 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants