So, this has always bugged me. How do you validate a Docker container? No one wants to pull a laced up container, so there has to be a way one can check. Of course, sticking to original docker containers from Docker Hub would be one method I suppose. Is there some kind of scan one can do? I do this on my Windows computer; scan before installing. Besides looking at code that I would have no idea what is going on, what protocols do you guys use?
Don’t pull containers from random sources then. If you’re working with a specific project, only pull from their official images.
Pushed images are built and verified from the maintainers, then pushed. Then you pull, each layer is verified by hash that it is the same image as was originally pushed by the maintainers.
Whether that project protects itself from supply chain attacks is a different story, but as far as ports go, you only expose what you tell it to expose. There’s no workaround for that.