slimtoolkit / slim

Slim(toolkit): Don't change anything in your container image and minify it by up to 30x (and for compiled languages even more) making it secure too! (free and open source)
Apache License 2.0
19.45k stars 730 forks source link

Files deleted on probing stage aren't included in reports #405

Open iximiuz opened 2 years ago

iximiuz commented 2 years ago

Expected Behavior

When a file is deleted during probing, it should appear in the slim version of the image. Deleting a file means access, and that automatically should qualify the file as used.


Actual Behavior

When some files are deleted during probing, they aren't included in the creport.json file and the files folder. It happens because the artifact dumping logic fails to copy those files. Preserving files also don't mitigate the issue because that same logic iterates over the preserved files, but tries to check the existence of the original files too (and fails).


Steps to Reproduce the Problem

[Here is a (skipped for now) E2E test](https://github.com/docker-slim/docker-slim/blob/master/pkg/app/sensor/app_test.go) --- Specifications ================= - Version: 1.37+ - Platform: All
kcq commented 1 year ago

Good that we just need the file name... We have it in the initial file list that the agent collects before kicking off the target app.