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

tsh.exe is from unknown publisher. #3012

Closed
Tracked by #7445
benarent opened this issue Sep 24, 2019 · 12 comments
Closed
Tracked by #7445

tsh.exe is from unknown publisher. #3012

benarent opened this issue Sep 24, 2019 · 12 comments
Assignees
Labels
devrel OSS relevant issues release-engineering tsh tsh - Teleport's command line tool for logging into nodes running Teleport. ux windows

Comments

@benarent
Copy link
Contributor

What happened:
When testing Teleport on Windows, I've had this error message, I had to click More info to run Teleport.

While we don't provide a UI, it's very common for Windows users to directly click an .exe ( I'm not 100% sure on a fresh install if you don't approve it )

Windows-defender

unknown-publisher

What you expected to happen:
Similar to #2979 we'll need to sign the package after we compile it. https://docs.microsoft.com/en-us/dotnet/framework/tools/signtool-exe?redirectedfrom=MSDN

Environment:

  • Tsh version (use tsh version): 4.1
  • OS (e.g. from /etc/os-release): Windows
@benarent benarent added ux tsh tsh - Teleport's command line tool for logging into nodes running Teleport. labels Sep 24, 2019
@webvictim
Copy link
Contributor

It'll be interesting to see whether this happens when running from the CLI. I don't think I had that issue. Either way, though, we should probably sign the binaries just to make sure.

@benarent
Copy link
Contributor Author

@webvictim Windows isn't super clear for our use case, but let me know if you need help acquiring a .net license. https://stackoverflow.com/questions/84847/how-do-i-create-a-self-signed-certificate-for-code-signing-on-windows

@webvictim
Copy link
Contributor

The issue we might have is that we don't build on Windows. I'll see whether anyone else has tried to sign Go Windows binaries when building on Linux.

@benarent
Copy link
Contributor Author

It looks like this is a Windows step, https://stackoverflow.com/questions/51717409/is-there-any-way-to-sign-the-windows-executables-generated-by-the-go-compiler might . I guess we'll need another Windows box to sign this. Maybe do the same setup at our MacOS Apps

@webvictim
Copy link
Contributor

Yeah - we don't currently build the binaries on a Windows box so we'd need to explicitly get one to do this.

@benarent
Copy link
Contributor Author

I ran into this again today. It seems we don't need a windows box but do need to purchase an EV Code Signing Cert to pass the Microsoft SmartScreen Filter. I'll work internally to obtain this certificate and we can use http://manpages.ubuntu.com/manpages/trusty/en/man1/signcode.1.html to sign on a linux box.

@benarent
Copy link
Contributor Author

Thanks to @TravisGary we now have a code signing cert. It's shared in our internal secrets system, with password and .pfx file.

@benarent
Copy link
Contributor Author

benarent commented Apr 9, 2021

While recording the Windows video I encountered this again. I tried the signtool.exe method and it worked well.

If we install https://www.mono-project.com/docs/tools+libraries/tools/#security we should be able to run this on Linux

./signtool.exe sign /f gravitational-code-sigining-cert.pfx /t http://timestamp.digicert.com/scripts/timstamp.dll  /p "PASSWORD" /fd SHA256 tsh.exe

image

@benarent
Copy link
Contributor Author

benarent commented Apr 13, 2021

I've made more progress on this, just out of interest.

I was able to sign using https://github.com/mtrojnar/osslsigncode, I had to pass in the password as a text file as it has a comma in it. osslsigncode can run on Linux, so we should be able to easily add it our build process.

osslsigncode sign -pkcs12  /teleport-sign/gravitational-code-sigining-cert.pfx -readpass password.txt  -n "Teleport" -i https://goteleport.com -t http://timestamp.digicert.com -h sha2 -in tsh.exe  -out signtsh.exe
# Succeeded

@benarent benarent added the devrel OSS relevant issues label Jun 9, 2021
@russjones russjones assigned timothyb89 and unassigned webvictim and timothyb89 Jun 9, 2021
@russjones russjones removed this from the Release Engineering milestone Jul 1, 2021
@russjones russjones mentioned this issue Jul 1, 2021
6 tasks
@russjones
Copy link
Contributor

@timothyb89 This is complete right? Has it been merged into master and backported to branch/v7?

@timothyb89
Copy link
Contributor

Nearly, it's just getting final approval now: #7897

I'll backport it as soon as the PR is merged!

@russjones
Copy link
Contributor

@timothyb89 No problem, thank you for the update!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
devrel OSS relevant issues release-engineering tsh tsh - Teleport's command line tool for logging into nodes running Teleport. ux windows
Projects
None yet
Development

No branches or pull requests

4 participants