aboutsummaryrefslogtreecommitdiff
path: root/src/internal
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2020-10-29 10:57:38 -0400
committerRuss Cox <rsc@golang.org>2020-11-05 00:21:39 +0000
commitc018eec1f3ab3af28dae0bdf588e25d5e2ba3418 (patch)
tree36b675aae18493cfb1ec44f1a620f078cb070b79 /src/internal
parent63fd764502e08d067293a93d6d1a566951255ce5 (diff)
downloadgo-c018eec1f3ab3af28dae0bdf588e25d5e2ba3418.tar.gz
go-c018eec1f3ab3af28dae0bdf588e25d5e2ba3418.zip
cmd/go: add GOVCS setting to control version control usage
The go command runs commands like git and hg to download modules. In the past, we have had problems with security bugs in version control systems becoming security bugs in “go get”. The original modules draft design removed use of these commands entirely, saying: > We want to move away from invoking version control tools such as bzr, > fossil, git, hg, and svn to download source code. These fragment the > ecosystem: packages developed using Bazaar or Fossil, for example, are > effectively unavailable to users who cannot or choose not to install > these tools. The version control tools have also been a source of > exciting security problems. It would be good to move them outside the > security perimeter. The removal of these commands was not possible in the end: being able to fetch directly from Git repos is too important, especially for closed source. But the security exposure has not gone away. We remain vulnerable to problems in VCS systems, especially the less scrutinized ones. This change adds a GOVCS setting to let users control which version control systems are allowed by default. It also changes the default allowed version control systems to git and hg for public code and any version control system for private code (import path or module path matched by the GOPRIVATE setting). See the changes in alldocs.go for detailed documentation. See #41730 for proposal and discussion. Fixes #41730. Change-Id: I1999ddf7445b36a7572965be5897c7a1ff7f4265 Reviewed-on: https://go-review.googlesource.com/c/go/+/266420 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com>
Diffstat (limited to 'src/internal')
-rw-r--r--src/internal/cfg/cfg.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/internal/cfg/cfg.go b/src/internal/cfg/cfg.go
index bdbe9df3e7..553021374d 100644
--- a/src/internal/cfg/cfg.go
+++ b/src/internal/cfg/cfg.go
@@ -58,6 +58,7 @@ const KnownEnv = `
GOSUMDB
GOTMPDIR
GOTOOLDIR
+ GOVCS
GOWASM
GO_EXTLINK_ENABLED
PKG_CONFIG