freedomofpress / dangerzone

Take potentially dangerous PDFs, office documents, or images and convert them to safe PDFs
https://dangerzone.rocks/
GNU Affero General Public License v3.0
3.39k stars 155 forks source link

Reduce Container Dependencies (round #2) #691

Open deeplow opened 5 months ago

deeplow commented 5 months ago

We've done this in the past, but according to the auditors, we can further slim down the image (and thus removing potential attacker gadgets). They found nc and wget but they mention these are probably not the only ones. Probably many other executables from busybox are in reality not needed.

deeplow commented 5 months ago

While looking into seccomp policies generation (I can't find the specific reference) I came across an interesting approach: execute over a test set and find all the binaries called. Then remove everything else. Not sure how risky that is in this case, but it feels like something we can explore. But maybe that's overkill here.