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

Pin and verify rustup-init sha256 in builder image #6266

Merged
merged 1 commit into from
Feb 14, 2022

Conversation

legoktm
Copy link
Member

@legoktm legoktm commented Feb 11, 2022

Status

Ready for review

Description of Changes

As an extra defense, pin the rustup version used and verify the
hash of the downloaded rustup-init binary. Previously we were downloading
the hash from the same place we were downloading the binary, so it didn't
really offer any extra protection besides making sure the download wasn't
corrupted (which HTTPS does for us).

This does not completely protect us, as rustup-init downloads rustup
without verifying signatures, but that will hopefully be fixed
soon: rust-lang/rustup#2028.

This shouldn't add a significant amount of maintenance overhead, as old
rustup versions can still be used to download newer Rust versions.

Fixes https://github.com/freedomofpress/securedrop-security/issues/70.

Testing

  • Build image, see "rustup-init: OK" in output
  • Modify sha256sum in the Dockerfile, try to build, see that it fails

Deployment

Any special considerations for deployment? No

Checklist

  • I have written a test plan and validated it for this PR
  • These changes do not require documentation

As an extra defense, pin the rustup version used and verify the
hash of the downloaded rustup-init binary. Previously we were downloading
the hash from the same place we were downloading the binary, so it didn't
really offer any extra protection besides making sure the download wasn't
corrupted (which HTTPS does for us).

This does not completely protect us, as rustup-init downloads rustup
without verifying signatures, but that will hopefully be fixed
soon: <rust-lang/rustup#2028>.

This shouldn't add a significant amount of maintenance overhead, as old
rustup versions can still be used to download newer Rust versions.

Fixes freedomofpress/securedrop-security#70.
@legoktm legoktm requested a review from a team as a code owner February 11, 2022 19:56
Copy link
Contributor

@zenmonkeykstop zenmonkeykstop left a comment

Choose a reason for hiding this comment

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

Test plan checks out, 1.58.1 still installed, LGTM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants