Modern software engineering is collaborative, and based on reusing Open Source software. That exposes targets to supply chain attacks, where software

How Go Mitigates Supply Chain Attacks - The Go Programming Language

submited by
Style Pass
2024-04-03 13:00:08

Modern software engineering is collaborative, and based on reusing Open Source software. That exposes targets to supply chain attacks, where software projects are attacked by compromising their dependencies.

Despite any process or technical measure, every dependency is unavoidably a trust relationship. However, the Go tooling and design help mitigate risk at various stages.

There is no way for changes in the outside world—such as a new version of a dependency being published—to automatically affect a Go build.

Unlike most other package managers files, Go modules don’t have a separate list of constraints and a lock file pinning specific versions. The version of every dependency contributing to any Go build is fully determined by the go.mod file of the main module.

Since Go 1.16, this determinism is enforced by default, and build commands (go build, go test, go install, go run, …) will fail if the go.mod is incomplete. The only commands that will change the go.mod (and therefore the build) are go get and go mod tidy. These commands are not expected to be run automatically or in CI, so changes to dependency trees must be made deliberately and have the opportunity to go through code review.

Leave a Comment