this post was submitted on 07 May 2025
22 points (95.8% liked)
Golang
2434 readers
9 users here now
This is a community dedicated to the go programming language.
Useful Links:
Rules:
- Posts must be relevant to Go
- No NSFW content
- No hate speech, bigotry, etc
- Try to keep discussions on topic
- No spam of tools/companies/advertisements
- It’s OK to post your own stuff part of the time, but the primary use of the community should not be self-promotion.
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
You're right that it's crucial to review dependencies. Vendoring does help, in a few ways:
vendor
directoryhg diff
will show you what code changed in the dependencies, whereas go.mod will only tell you which packages changed. You can use your regular code review process to audit. With non-vendored dependencies, you have to go in, one by one, andhg diff -r old-dep-tag:new-dep-tag
every dependency. It is far, far harder to do with non-vendored dependencies.I have always been opposed to vendoring, even when it briefly was becoming the standard package management before go mod; but we can't have nice things in this world because of the human refuse doing these kinds of exploits, and vendoring is the suspenders for your security belt.
What I want is a robust static analysis auditing tool like
govulncheck
, but which looks for intentionally malicious code and not just programming SNAFUs. I'd be more comfortable not vendoring if such a thing existed, but I'm not aware of one and not certain it'd win the perpetual security arms race. It would certainly be hell maintaining such a tool.All true, but regarding #1: the size of the go.sum and all the indirect deps in the go.mod are also telling me a lot already :)
Oh, absolutely. I think it's just more visceral with vendoring.