Skip to content

Repository GPG keys are not used for image builds via Cloud API #1343

Open
@thozza

Description

@thozza

When images are built via Cloud API, the list of repositories to be used for the image build is part of the ImageRequest. However the Repository object does not include GPGKey property:

type Repository struct {
Baseurl *string `json:"baseurl,omitempty"`
Metalink *string `json:"metalink,omitempty"`
Mirrorlist *string `json:"mirrorlist,omitempty"`
Rhsm bool `json:"rhsm"`
}

As a result, no GPG key is copied over to rpmmd.RepoConfig structures when a new Cloud API compose request is processed:

repositories := make([]rpmmd.RepoConfig, len(ir.Repositories))
for j, repo := range ir.Repositories {
repositories[j].RHSM = repo.Rhsm
if repo.Baseurl != nil {
repositories[j].BaseURL = *repo.Baseurl
} else if repo.Mirrorlist != nil {
repositories[j].MirrorList = *repo.Mirrorlist
} else if repo.Metalink != nil {
repositories[j].Metalink = *repo.Metalink
} else {
http.Error(w, "Must specify baseurl, mirrorlist, or metalink", http.StatusBadRequest)
return
}
}

Such rpmmd.RepoConfig list is then passed to imageType.Manifest(), which produces Manifest to be used by osbuild. As a result, no GPG keys are used in the resulting org.osbuild.rpm stage of the Manifest and the GPG signatures of the installed RPMs are not checked at all when osbuild builds the image. Also no GPG keys are imported into the RPM database during the image build.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions