https://blue-build.org/ logo
invalid signature when validating ASN.1 encoded si...
# questions
f
i've replaced the keys in my repository because i thought something broke and would be a possible solution, then realized nothing was actually broken but it was already too late and have changed them the images build fine, but when trying to do
rpm-ostree upgrade
or
rebase
to the unverified image, i get
error: Creating importer: Failed to invoke skopeo proxy method OpenImage: remote error: cryptographic signature verification failed: invalid signature when validating ASN.1 encoded signature
([repo link]()) https://cdn.discordapp.com/attachments/1281734650758168576/1281734650951372931/image.png?ex=66dccbea&is=66db7a6a&hm=8ab935e1914de45fee189d05731647d4709d13d513cddb3fee452d499a1e1f9f&
a
message has been deleted
g
You have 2 choices here. You can either 1. rebase to your image as an unsigned ref (
ostree-unverified-image:docker://image.registry/name
), reboot, and then rebase back to a signed ref (
ostree-image-signed:docker://image.registry/name
) 2. you can take your public key and put it somewhere in
/etc/
- Update
/etc/containers/policy.json
to point to the new public key path - Run
rpm-ostree upgrade
and reboot - Revert policy.json changes so it will use the public key that's part of your image
We do have an open issue to try to come up with a mechanism for easily moving over to a new set of keys, but haven't gotten around to that
Shit, sorry I didn't fully read your screenshot
I've not seen that before
Are you able to pull that image at all with podman?
Also a link to your repo would be helpful
f
podman seems to be pulling in the image successfully
g
I think I found the bug, I'm working on a fix
OH wait, the bug I found isn't related to this
Could you post your
/etc/containers/policy.json
?
f
Copy code
{
  "default": [
    {
      "type": "reject"
    }
  ],
  "transports": {
    "docker": {
      "ghcr.io/sneexy-boi/wuzetka": [
        {
          "type": "sigstoreSigned",
          "keyPath": "/usr/etc/pki/containers/wuzetka.pub",
          "signedIdentity": {
            "type": "matchRepository"
          }
        }
      ],
      "registry.access.redhat.com": [
        {
          "type": "signedBy",
          "keyType": "GPGKeys",
          "keyPath": "/etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release"
        }
      ],
      "registry.redhat.io": [
        {
          "type": "signedBy",
          "keyType": "GPGKeys",
          "keyPath": "/etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release"
        }
      ],
      "quay.io/toolbx-images": [
        {
          "type": "sigstoreSigned",
          "keyPath": "/etc/pki/containers/quay.io-toolbx-images.pub",
          "signedIdentity": {
            "type": "matchRepository"
          }
        }
      ],
      "ghcr.io/ublue-os": [
        {
          "type": "sigstoreSigned",
          "keyPath": "/etc/pki/containers/ublue-os.pub",
          "signedIdentity": {
            "type": "matchRepository"
          }
        }
      ],
      "": [
        {
          "type": "insecureAcceptAnything"
        }
      ]
    },
    "docker-daemon": {
      "": [
        {
          "type": "insecureAcceptAnything"
        }
      ]
    },
    "atomic": {
      "": [
        {
          "type": "insecureAcceptAnything"
        }
      ]
    },
    "containers-storage": {
      "": [
        {
          "type": "insecureAcceptAnything"
        }
      ]
    },
Copy code
"dir": {
      "": [
        {
          "type": "insecureAcceptAnything"
        }
      ]
    },
    "oci": {
      "": [
        {
          "type": "insecureAcceptAnything"
        }
      ]
    },
    "oci-archive": {
      "": [
        {
          "type": "insecureAcceptAnything"
        }
      ]
    },
    "docker-archive": {
      "": [
        {
          "type": "insecureAcceptAnything"
        }
      ]
    },
    "tarball": {
      "": [
        {
          "type": "insecureAcceptAnything"
        }
      ]
    }
  }
}
g
I'm really unsure what's happening here. @fiftydinar @Gerblesh have any idea?
f
It looks like the same error when I screwed up
g
How'd you fix it?
f
The same way that Ublue solved the issue
I'll copy my answer: For anyone who encounters this, those are the steps to solve the issue: Copy new
cosign.pub
from your repo to
/etc/pki/containers/$your_image_name.pub
sudo cp your-cosign.pub /etc/pki/containers/$your_image_name.pub
Modify
/etc/containers/policy.json
, locate your image registry link, in
keyPath
edit location to be from
/usr/etc
to
/etc
"keyPath": "/etc/pki/containers/$your_image_name.pub"
Run
rpm-ostree upgrade
& reboot Copy new policy.json
sudo cp /usr/etc/containers/policy.json /etc/containers/policy.json
Profit You can verify if new cosign & policy.json is used here. If they're not listed, then you're good. This command tracks changed files in /etc compared to /usr/etc
sudo ostree admin config-diff
f
yep, this works