-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add serverVersion var set via ldflags #5650
Conversation
Setting this helps security scanners like syft detect the version when inspecting the binary. Signed-off-by: Waldemar Quevedo <wally@nats.io>
d02a048
to
5f0a6ad
Compare
Nevermind, it works |
Funny it kind of went full circle to the original PR. Thank you so much for being open to this change! |
@wallyqs is this going to be backported for 2.9.x? |
@LaurentGoderre no, there are no releases planned for v2.9 series |
@wallyqs the |
@LaurentGoderre yes we need the
|
With the default Syft config yes but it gets them by doing a regex for anything that looks like a version in the binary. With Docker Scout we use a stricter rule and rely on the ldflag in the binary. |
Ha!! seems like you ran into this too!! golang/go#63432 |
@LaurentGoderre yes... that is what I was afraid we would stumble upon eventually (#5599 (comment)), but at least now situation has improved since |
Setting a
serverVersion
variable which is set via ldflags to help security scanners likesyft
detect the version when inspecting the binary. Goreleaser is modified to set this ldflag and a test is added to make sure that theVERSION
constant matches the tag from the release.Result: