-
Notifications
You must be signed in to change notification settings - Fork 96
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
Checksum in sum.golang.org is different from download without proxy/checksum database (GOPRIVATE=*) #176
Comments
I have no idea where to even begin to debug something like that. |
I tried running the script in your gist on 3 different networks (home, cellular, coffeeshop) to try and reproduce. First, I tried with no other dependencies besides berglas (removed "github.com/sirupsen/logrus"). On all three networks, I go no diff. Next, I tried adding "github.com/sirupsen/logrus" back in, but got the same result. My suspicion is that your proxy, network, ISP, or something higher up the chain is modifying the response. |
Logrus has nothing to do with the issue. It presents a completely other dependency that does not seem to have different checksum, whether the Also, because we start blaming someone's other network, which likely has nothing to do with my problem, I have prepared you two GitHub workflows, one with Without
|
Alright, I reworked your example a bit to eliminate as many variables as possible and was still able to reproduce it (workflow). I downloaded the cached binary from https://proxy.golang.org/github.com/%21google%21cloud%21platform/berglas/@v/v0.6.2.zip, unzipped it, and compared it to the v0.6.2 tag. It looks like none of the
This makes me think that the proxy doesn't include that directory, either because it declares its own go.sum/mod files, or because it is named Nonetheless, I don't see anything malicious here. If you believe the Go module proxy is modifying packages in ways that it shouldn't, I would recommend using the contact information at the bottom of https://proxy.golang.org/. |
Okay, that sounds great! I have strong suspicion towards
$ export GOPRIVATE=*
$ go mod download -json -x github.com/piotrkubisa/berglas@v0.6.4
{
"Path": "github.com/piotrkubisa/berglas",
"Version": "v0.6.4",
"Info": "/home/piotr/go/pkg/mod/cache/download/github.com/piotrkubisa/berglas/@v/v0.6.4.info",
"GoMod": "/home/piotr/go/pkg/mod/cache/download/github.com/piotrkubisa/berglas/@v/v0.6.4.mod",
"Zip": "/home/piotr/go/pkg/mod/cache/download/github.com/piotrkubisa/berglas/@v/v0.6.4.zip",
"Dir": "/home/piotr/go/pkg/mod/github.com/piotrkubisa/berglas@v0.6.4",
"Sum": "h1:d6xGda/YPfMBD3q6Qbpgqi5slRlQ4ULJ5w/8nPW4fK4=",
"GoModSum": "h1:LEKpytS5wf+P8OGenFlsVmi/uwqcjkFQTH8wZABaCgI="
}
$ unset GOPRIVATE
$ go mod download -json -x github.com/piotrkubisa/berglas@v0.6.4
{
"Path": "github.com/piotrkubisa/berglas",
"Version": "v0.6.4",
"Info": "/home/piotr/go/pkg/mod/cache/download/github.com/piotrkubisa/berglas/@v/v0.6.4.info",
"GoMod": "/home/piotr/go/pkg/mod/cache/download/github.com/piotrkubisa/berglas/@v/v0.6.4.mod",
"Zip": "/home/piotr/go/pkg/mod/cache/download/github.com/piotrkubisa/berglas/@v/v0.6.4.zip",
"Dir": "/home/piotr/go/pkg/mod/github.com/piotrkubisa/berglas@v0.6.4",
"Sum": "h1:d6xGda/YPfMBD3q6Qbpgqi5slRlQ4ULJ5w/8nPW4fK4=",
"GoModSum": "h1:LEKpytS5wf+P8OGenFlsVmi/uwqcjkFQTH8wZABaCgI="
} Would the rename from |
This issue is stale because it has been open for 14 days with no |
It's possible, but I "examples" is a pretty common name. I really think a bug should be opened against the module registry for this. |
References
What?
Whether
GOPRIVATE=*
environment has been set, the checksum ingo.sum
forberglas
dependency is different than if I would not setGOPRIVATE
(standard Go installation). This issue makes unable to have defined customGOPRIVATE
across the team and/or CI environments, because Go compiler will deny any further operations.While, I rely on numerous go-modules (including various Gcloud SDKs) I have only encountered this problem in
berglas
. The fact that theberglas
manages secrets, this issue might be a security-related problem, because defaultsum.golang.org
offers different version ofberglas
than actually is distributed overgithub.com
.How to reproduce?
In a secret gist I have prepared a sample project that imports
github.com/GoogleCloudPlatform/berglas
and prints out thego.sum
, depending whetherGOPRIVATE=*
was or wasn't defined.In the
diff(1)
output presented below, I compare the computedgo.sum
file withGOPRIVATE=*
set and without respectively.If you would like to test it on your machine, please take a look in my gist - https://gist.github.com/piotrkubisa/4dbba8d36bf3748944489dc523eefead. I hope example presenting sample code will be more clear for you.
main.go
Dockerfile
The text was updated successfully, but these errors were encountered: