-
Notifications
You must be signed in to change notification settings - Fork 91
Code Signing InVEST Installation Media
We shouldn't need to this manually anymore, it's automated as part of our build process. But here are the instructions anyway.
- Set up your yubikey by ensuring your PUK is not set to the default and that you have the Yubikey smart card minidriver installed. See the yubico docs for complete steps.
- On a Windows computer, download the Windows installer for the Workbench from the release page on GitHub.
- Open a command prompt (recommended: use "Developer Command Prompt for VS 2019") and navigate to the directory where the downloaded installer is located.
- Follow the steps on the yubico docs under "Procedure"
to sign the installer. If you're using a Developer Command Prompt,
signtool.exewill already be on yourPATH. - Upload the signed installer to the release page on GitHub and to Google Cloud, overwriting the binaries that are already there.
- InVEST Windows Installers version 3.8.0 and later
- InVEST DMGs version for 3.9.0 and later
Assuming everything is working, installers and disk images on the main natcap/invest repository are all automatically signed as a part of the regular Github Actions binary build workflows.
- See instructions at https://uit.stanford.edu/service/ssl/codesigning.
- When submitting a support request, make sure they do not revoke the old certificate
- If prior binaries have not been timestamped, revoking the certificate will cause problems.
- Stanford's certificate issuer can handle keeping expired certs around (according to a UIT rep), so let's do that.
- When you have the certificate, upload it to GCP and update
Makefileand our github actions to use the new cert and password.
When a certificate is revoked (as it was in January, 2021), the revocation will also prevent Gatekeeper (Mac OS) and SmartScreen (Windows) from opening the installers if the binaries are not timestamped. The only known way around this is to re-sign the installation media.
If the binaries were timestamped at the time of signing, there should be no problem with launching the old binaries.
-
Download the current certificate (
.pfxor.p12) and retrieve the password. -
Download the InVEST installer to sign
-
Execute the following
signtool.execalls to re-sign and re-timestamp the binary:signtool.exe sign /f "<path to certificate>" /p "<certificate password>" <path to InVEST installer> signtool.exe timestamp -t http://timestamp.sectigo.com <path to InVEST installer>For me,
signtool.exeis located atC:\Program Files (x86)\Windows Kits\10\App Certification\signtool.exe. If that doesn't work for you, try running afind "C:\Program Files (x86)" -name "signtool.exe", as the binary might have moved.See this help page about why timestamping matters.
-
Upload the re-signed installer file to the target distribution locations:
- Google Cloud
- The Github Release for this version
-
Repeat for each affected version of InVEST
The codesign binary may require XCode developer tools.
-
Download the
.pfxor.p12certificate file and retrieve the certificate password -
Double-click the certificate to install it to your local key store. You'll need to enter the certificate password to do so. The key will be identified in your key store as
"Stanford University" -
Download the InVEST DMG to sign.
-
Execute the following command to re-sign the binary:
codesign --force --timestamp --verbose --sign "Stanford University" <path to InVEST DMG>The
--forceis needed to overwrite the existing signature. -
Upload the re-signed DMG to the target distribution locations:
- Google Cloud
- The Github Release for this version
-
Repeat for each affected version of InVEST