Replies: 1 comment 2 replies
-
Yup! Makes sense. There are a few places where the original location of images are stored:
We could add a flag to Note that there isn't a way to reuse the original invocation image without having docker modify it and create a new image with a new content digest. The values that you want to replace are inside the invocation image. |
Beta Was this translation helpful? Give feedback.
-
Hi all. Here's the scenario. I am building bundles for a public repo like GHCR or DockerHub. When I copy them to a private registry, Porter is going to create an imageMapping that will contain references back to the originating registry layers. When going from a public to a private registry, this is fine! Those original layers can be used for verification.
It also enables some information "leakage" when going back the other direction, whether intentionally or unintentionally. Let's image that I'm saving the bundle in a private ECR. Then I
porter copy
the bundle to GHCR. Now I'm going to have animageMapping
section with references to layers in a private registry. Although no one can reach those layers without the proper credentials, it does expose internal paths to malicious parties who if they gain the proper access can now spelunk because they have the map to those layers.So this first question is, how to "copy" an image but exclude the imageMapping information? This shouldn't be default, but it should be a switch that basically says, "do not rebuild the artifacts -- I want precisely those ones. But I do not wish to include this metadata along with it, as I intend to 'verify' them another way."
We could, of course, merely retag and rebuild the bundle to publish to another registry. However, the objection here is that at some level we have to then trust that the image was built in precisely the same environment and that the underlying base image did not change between building moments. If we were able to build on a baseimage tagged by digest rather than tag, then "retag" would be fine.
Am I explaining the problem? We must either a) use the same artifact in both locations but without "information leakage", or b) be able to build and retag but ensure using a digest reference that the underlying baseimage is precisely the same, not "probably" the same.
Beta Was this translation helpful? Give feedback.
All reactions