Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sign rpm repo metadata #9027

Merged
merged 6 commits into from
Jan 7, 2022
Merged

Sign rpm repo metadata #9027

merged 6 commits into from
Jan 7, 2022

Conversation

wadells
Copy link
Contributor

@wadells wadells commented Nov 17, 2021

Note: Do not merge until the backports are ready. We need all branches that publish RPMs to sign, lest we have an old branch regenerate metadata, invalidating a signature from a newer branch.

Also, as of 2021-12-19, the testing for this PR is now complete.

Summary

This PR introduces signing for RPM repo metadata in addition to the RPMs themselves.

This helps support zypper on Suse (#6445), and improves our general RPM
distribution security posture. The threat model is someone compromises
AWS, but not our signing keys. In this case, they could update repo
metatdata to point to an unsigned package. With metadata signed, this
is no longer possible -- both the index and the package are verified by
the various yum clients.

For more info on this change, see this very helpful blog post:

https://blog.packagecloud.io/eng/2014/11/24/howto-gpg-sign-verify-rpm-packages-yum-repositories/

Contributes to #6445.

Testing Done

In progress. I've tested this workflow with the following dockerfiles, but I've not tested the Drone implementation yet.

FROM registry.suse.com/suse/sle15
RUN zypper addrepo --gpgcheck-strict https://rpm.walt.local/teleport.repo
RUN zypper --non-interactive --gpg-auto-import-keys install teleport
RUN teleport version
FROM centos
RUN yum -y update && yum -y install yum-utils && yum -y clean all && rm -rf /var/cache
RUN yum-config-manager --add-repo https://rpm.walt.local/teleport.repo
RUN yum -y install teleport
RUN yum -y --showduplicates list teleport

I removed the S3 upload for deb, rpm, and regular artifacts from the publishing job in a private branch. I then pushed v9.0.0-dev.1 and tried a publish to make sure everything runs to completion. Good thing too, as I caught a couple failures related to gpg 2.0 vs gpg 2.2. See the final, successful test run here:

https://drone.teleport.dev/gravitational/teleport/9603/1/9

@wadells wadells requested review from webvictim and russjones and removed request for webvictim November 17, 2021 02:58
@github-actions github-actions bot requested a review from r0mant November 17, 2021 02:58
@wadells wadells requested review from webvictim, quinqu and tcsc and removed request for r0mant November 17, 2021 02:59
Copy link
Contributor

@webvictim webvictim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, although it's been a while since I edited Drone YAMLs in anger...

.drone.yml Outdated Show resolved Hide resolved
@wadells
Copy link
Contributor Author

wadells commented Jan 4, 2022

Backports are up: #9623, #9624, #9625.

Once those are approved (and we're not actively releasing anything for a day or two), I'll merge all of these in the same window.

This helps support zypper on Suse, and improves our general RPM
distribution security posture.  The threat model is someone compromises
AWS, but not our signing keys.  In this case, they could update repo
metatdata to point to an unsigned package.  With metadata signed, this
is no longer possible -- both the index and the package are verified.

For more info on this change, see this very helpful blog post:

  https://blog.packagecloud.io/eng/2014/11/24/howto-gpg-sign-verify-rpm-packages-yum-repositories/
@wadells
Copy link
Contributor Author

wadells commented Jan 4, 2022

The force push/new commit was to resolve a conflict with the .drone.yml signature.

@wadells wadells enabled auto-merge (squash) January 6, 2022 23:57
@wadells wadells merged commit 4e324e7 into master Jan 7, 2022
@wadells wadells deleted the walt/rpm-sign branch January 7, 2022 01:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants