Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign uprustup-init.exe needs to be code-signed #1568
Comments
This comment has been minimized.
This comment has been minimized.
eddyp
commented
Dec 24, 2018
|
I agree, all official releases should be signed, ideally with keys which have a good chain of trust. |
This comment has been minimized.
This comment has been minimized.
|
We discussed this in an infra team meeting. In summary:
(other open questions involve things like: What about OSX signing? Does the approach we choose for rustup generalise to other binaries we distribute?) |
aidanhs
referenced this issue
Jan 1, 2019
Closed
Windows Defender SmartScreen triggering on rustup-init.exe downloaded from the website #56815
This comment has been minimized.
This comment has been minimized.
eddyp
commented
Jan 1, 2019
|
@aidanhs I have no experience with signing of Windows binaries (I have with signing packages and repositories for Debian based Linux distros), but I expect the approach to take on one binary to work on the all others on that same platform. Typically the platform specific docs should provide exact details, and automation should be possible for all, but the exact details will probably be different. BTW, if individual binary/file signing is not possible, the second best thing is to sign the packaging format and files with checksums for each file. This is a good idea no matter what to make sure tool chains are not corrupted, infected or modified and some commands could allow verification. |
This comment has been minimized.
This comment has been minimized.
|
@jseyfried can you share Windows binary signing best practices? |
This comment has been minimized.
This comment has been minimized.
|
I have some slight idea on how it works. You get a code signing cert and you would invoke signtool.exe from the Windows SDK somewhere in the build/packaging process to sign the output executables (.exe/.dll). Some interest points I can think of:
If all you care is for the initial SmartScreen warning on To have Note: When most (if not all) browsers on Windows download a file, they add an NTFS alternate data stream |
This comment has been minimized.
This comment has been minimized.
eddyp
commented
Jan 3, 2019
|
Regarding secure storage of the keys, I think a Yubikey device or something similar can do this. For instance, at EuroBSD 2018 the gift package contained a microcontroller based key storage device. The device was sponsored by Modirum and is using the Gnuk OpenPGP firmware from the Free Software Initiative of Japan and it looks like a USB stick. |
This comment has been minimized.
This comment has been minimized.
eddyp
commented
Jan 4, 2019
|
An update on the secure key storage, on the Gnuk project page there is a list of compatible devices, and one of them, Nitrokey Start, looks quite cheap (29€) and looks nice, comes pre-installed with all needed SW, and it seems the company has very big names as clients: Google, BBC, SuSE, Redhat, Mozilla, Nvidia, ABB, Adobe... (link to pdf). |
This comment has been minimized.
This comment has been minimized.
|
How would a USB dongle be connected to the CI infrastructure? It seems to me a cloud-based HSMaaS solution such as SDKMS would be more convenient. We can provide a free account for the Rust project, someone from the infra team please contact me to set this up. |
This comment has been minimized.
This comment has been minimized.
|
Be careful about types of hardware keys and their software. I've got one that on every signing pops up a GUI that asks for a PIN. There's no CLI version. It doesn't work over SSH and gets in the way of build automation. |
This comment has been minimized.
This comment has been minimized.
notriddle
commented
Jan 18, 2019
|
signtool.exe is a PITA; I know, I've tried it.
The easy way to do it is osslsigncode, which can run under any platform that can run basic C code and OpenSSL. |
This comment has been minimized.
This comment has been minimized.
Isn't this simply a matter of trying to access the machine keystore when you should be using the user keystore? |
alvinhochun commentedDec 11, 2018
rustup-init.exe(downloaded from https://win.rustup.rs/) is not signed with an EV code signing certificate. As a result, there isn't an obvious way for Windows users to verify the download. (Neither https://www.rust-lang.org/tools/install nor https://rustup.rs/ shows any gpg keys or even checksums for use.)Moreover, the
rustup-init.execan get blocked by SmartScreen. Even though users can bypass it by clicking on "More Info" then "Run anyway", it doesn't bring any confidence.SmartScreen operates on the basis of reputation. The SmartScreen warning might eventually go away when the
rustup-init.exegets used by more users, but it resets whenever a new version is built and published. Ifrustup-init.exeis code-signed, the reputation will be inherited by any programs signed with the same certificate, which should make SmartScreen happy. (See: https://blogs.msdn.microsoft.com/ie/2012/08/14/microsoft-smartscreen-extended-validation-ev-code-signing-certificates/)