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

docs: verify integrity of image hash sums #85

Closed
pohly opened this issue Jun 6, 2018 · 12 comments
Closed

docs: verify integrity of image hash sums #85

pohly opened this issue Jun 6, 2018 · 12 comments

Comments

@pohly
Copy link

pohly commented Jun 6, 2018

https://clearlinux.org/documentation/clear-linux/get-started/bare-metal-install#verify-the-integrity-of-the-clear-linux-image documents how to verify the integrity of the downloaded image file. What's missing is documentation on how to verify the integrity of the SHA512SUMS file.

The files are signed, so presumably some gpg invocation will do that. But what key needs to be trusted?

@phmccarty
Copy link
Contributor

I'm not sure where the actual documentation exists for this on clearlinux.org, but this blog post describes how to verify the SHA512SUMS file:

https://clearlinux.org/blogs/security-software-update-clear-linux-os-intel-architecture

$ openssl smime -verify -in [image]-SHA512SUMS.sig -inform der -content sha512sum.out -CAfile ClearLinuxRoot.pem -out /dev/null

@pohly
Copy link
Author

pohly commented Jun 6, 2018 via email

@phmccarty
Copy link
Contributor

The right place to document this IMHO is the link I had in my initial description. That's also what the download directory links to.

I agree. I will prepare a PR to update the docs accordingly.

@pohly
Copy link
Author

pohly commented Jun 7, 2018 via email

@phmccarty
Copy link
Contributor

Am I the first one who is paranoid enough to try this, or is it related to my version of OpenSSL? ;-}

I see the verification fail with openssl 1.1.0h on Arch Linux, and it succeeds with openssl 1.0.2o on Clear Linux. My guess is that it's an incompatibility between 1.0.x and 1.1.x :-(

@ahkok
Copy link
Contributor

ahkok commented Jun 11, 2018

Why can't sha512sum be used instead? That should hopefully not be affected by openssl versions.

@pohly
Copy link
Author

pohly commented Jun 12, 2018

sha512sum does get used to verify the integrity of the image. But to prevent attacks, one first has to verify the integrity of the checksum file. Otherwise an attacker could modify the image and then update the checksum file accordingly.

I'm not sure how important it is to have these signatures. But apparently they were considered important enough to set up something, so probably it is worth fixing the mechanism.

@pohly
Copy link
Author

pohly commented Jun 27, 2018

The sha512sum -c command from https://clearlinux.org/documentation/clear-linux/get-started/bare-metal-install#verify-the-integrity-of-the-clear-linux-image also no longer works because the SHA512SUMS from release 23290 (current latest) contains an absolute path. It used to contain just the file name:

$ sha512sum -c clear-$version-kvm.img.xz-SHA512SUMS
sha512sum: /home/releases/www/23290/clear/clear-23290-kvm.img.xz: No such file or directory
/home/releases/www/23290/clear/clear-23290-kvm.img.xz: FAILED open or read
sha512sum: WARNING: 1 listed file could not be read

@alexjch
Copy link

alexjch commented Jun 27, 2018

A change to speed up the build caused the inclusion of the file path. We fixed the issue in the tree and this will be working as documented this afternoon after the late morning build goes out (any valid release version >= 23310 will work as documented)

@iphutch
Copy link
Contributor

iphutch commented Jul 9, 2018

Closing as docs PR was merged

@mcastelino
Copy link

@phmccarty @iphutch I see this issue happening again with clear-29690-cloud.img.xz

/cc @pohly

@phmccarty
Copy link
Contributor

@mcastelino The verification of clear-29690-cloud.img.xz-SHA512SUMS.sig passes for me on Clear. I see from the referenced issue that your environment is Ubuntu 18.04, so that may the reason for verification failure, due to the (likely) different versions of openssl in use.

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

No branches or pull requests

6 participants