-
Notifications
You must be signed in to change notification settings - Fork 18k
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
cmd/go: fallback to direct sum calculation for private modules #34344
Comments
Ignoring the checksum database whenever it returns an unauthenticated 404 would undermine its security: any untrusted proxy could just serve fake contents, declare it can proxy the sumdb, and return a 404 for that version.
|
@FiloSottile would not it be more appropriate so solve potential security issue authenticating 404 responses (so that no proxy can spoof it) rather than hard-failing on private modules? |
There is no way for a sumdb mirror to provide 404s authenticated by the central log for arbitrary names without contacting the central log, and it would be very hard to make those 404s auditable and accountable like the rest of the tree. The ability of proxies to mirror the whole sumdb is an important design goal, because it allows proxies not to leak any information to the sumdb if they decide not to. |
I think it is not that complicated. Authenticated 404 can be built on top of latest entry (referenced in payload) without being added to log. Auditor could check if 404 is valid any time by using referenced state of log and resolved module name. |
Auditors wouldn't get to see most 404s, because they are not part of the tree. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Having private repo available in
github.com/private-org/lib
and git configured to use token:And having a clear environment without module cache and
GO*
env vars.And not having a
go.sum
file.I was building a new app for first time.
What did you expect to see?
I expect to see successful build.
What did you see instead?
Build failed with error message:
Build failed when I've set up
GOPROXY=direct
.Build was successful after I've set up
GOPRIVATE=github.com/private-org
.I think build should not be failed for modules that were explicitly not found (404 for private repos) and especially if
direct
value is set forGOPROXY
.The text was updated successfully, but these errors were encountered: