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

Use -buildmode=pie (position independence executable) #24323

Closed
tonymeehan opened this issue Mar 3, 2021 · 3 comments · Fixed by #24964
Closed

Use -buildmode=pie (position independence executable) #24323

tonymeehan opened this issue Mar 3, 2021 · 3 comments · Fixed by #24964
Assignees
Labels
Team:Automation Label for the Observability productivity team Team:Elastic-Agent Label for the Agent team Team:Observability

Comments

@tonymeehan
Copy link

tonymeehan commented Mar 3, 2021

Describe the enhancement:

Add a buildmode flag to enable our Go binaries to support ASLR. This should be included in Elastic Agent, Beats and Fleet Server.

A few years ago Golang added support for -buildmode=pie. This enables Go binaries to take advantage of ASLR and helps us mitigate the potential for someone to create a reliable exploit if we one day discover a vulnerability. There are a few resources online to learn more about why ASLR is important, like this blog.

I noticed a few other Go projects have successfully added this, like Cloud Foundry's go-buildpack.

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Mar 3, 2021
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Mar 3, 2021
@ruflin ruflin added the Team:Elastic-Agent Label for the Agent team label Mar 3, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/agent (Team:Agent)

@mostlyjason
Copy link

Its possible that golang 1.15 already adds ASLR support by default. @urso offered to double check

@urso
Copy link

urso commented Apr 7, 2021

Checking the release notes, it seems position independent code is enabled by default for Windows and Linux targets. Anyways, I made the buildmode=pie more explicit for platforms that support this feature (including AIX and macOS) in #24964. Let's see what our build environment thinks about it.

@urso urso self-assigned this Apr 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Automation Label for the Observability productivity team Team:Elastic-Agent Label for the Agent team Team:Observability
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants