ABRoot icon indicating copy to clipboard operation
ABRoot copied to clipboard

Add support for image verification through cosign

Open axtloss opened this issue 1 year ago • 4 comments

We currently make no efforts to verify the downloaded images, this is very insecure and can be a huge downside in enterprise applications. There are multiple solutions to signing the images, but the easiest would be to simply use cosign as it is made for the purpose of signing and verifying oci images. It's also written in go so it would be even easier for us to integrate it with abroot and vib.

axtloss avatar Apr 19 '24 17:04 axtloss

+1

On atomic Fedora (rpm-ostree and bootc), the standard file /etc/containers/policy.json is used to configure verification, so I suggest also using that. The cosign public key needs to be copied into /etc/pki/containers/ on the image and the policy.json can be edited to reference that. See below for an example for how it's configured in my custom image of Universal Blue.

{
   "transports": {
      "docker": {
         "ghcr.io/xynydev/linuxyz": [
            {
               "type": "sigstoreSigned",
               "keyPath": "/usr/etc/pki/containers/linuxyz.pub",
               "signedIdentity": {
                  "type": "matchRepository"
               }
            }
         ]
      }
   }
}    

This process can be easily scripted, the image maker just has to provide the cosign keys in a standard location.

xynydev avatar Jul 25 '24 10:07 xynydev

Btw, what do you think about keyless signing in cosign, is it something we could explore to eliminate the need for public/private keys?

kbdharun avatar Jul 25 '24 10:07 kbdharun

We've looked into OIDC keyless signing with BlueBuild but the upstream support for it is not quite there yet AFAIK, and containers/image cannot verify images signed like that. For ABRoot, it could be technically possible to implement the verification through cosign directly, I guess.

xynydev avatar Jul 25 '24 10:07 xynydev

It would probably be easier to stick with key based signing instead of implementing a (possibly insecure) verification method manually

axtloss avatar Jul 25 '24 10:07 axtloss