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

Can't sign Teleport binary for Mac due to malformed Mach-O binary #3158

Closed
webvictim opened this issue Nov 14, 2019 · 7 comments · Fixed by #5935
Closed

Can't sign Teleport binary for Mac due to malformed Mach-O binary #3158

webvictim opened this issue Nov 14, 2019 · 7 comments · Fixed by #5935
Assignees
Milestone

Comments

@webvictim
Copy link
Contributor

webvictim commented Nov 14, 2019

Signing the tsh and tctl binaries works fine, but attempts to sign the teleport binary on MacOS are failing with the error main executable failed strict validation

Apparently this error is raised when the executable being signed does not conform to Apple's strict Mach-O layout rules (vercel/pkg#128) - I highly suspect that this is because of the way we zip the web assets and tack them onto the end of the binary as part of the build process. We had a similar sort of problem when initially building RPMs - when you run rpmbuild, the default config tries to strip symbols from the binary. In our case, it ended up stripping the web assets because they just look like junk stuck on the end of the file.

Apple will only notarize a package which has a signed payload, so for now we can't sign a full teleport archive (although the client only tsh package I'm working on should be fine)

One idea would be to use something like https://github.com/shurcooL/vfsgen to build the assets directly into the binary rather than the current method.

@webvictim
Copy link
Contributor Author

cc @benarent

@webvictim
Copy link
Contributor Author

Related to #2979

@Zenithar
Copy link

It can be linked to this issue - golang/go#11887

@Zenithar
Copy link

PIE and Upxified teleport binary can be signed successfully.

@webvictim webvictim added the mac label Nov 21, 2019
@russjones
Copy link
Contributor

golang/go#35950

@webvictim
Copy link
Contributor Author

Waiting for the release of Go 1.16 which should have support for packaging the webassets inside the binary.

@awly
Copy link
Contributor

awly commented Feb 16, 2021

What a coincidence https://blog.golang.org/go1.16 :)

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

Successfully merging a pull request may close this issue.

4 participants