Skip to content

proposal: support dependency cooldown in Go tooling #76485

@dbohdan

Description

@dbohdan

Proposal Details

Background

Supply chain attacks on open-source software dependencies have become a regular occurrence. Go already takes measures against supply chain attacks. While Go libraries aren't a common target, this year GitLab detected one attack that involved typosquatting.

The idea of a "dependency cooldown" is to not download dependencies that are too new. The theory behind it is that most supply chain attacks in their active phase are detected quickly, so they are possible to avoid by waiting. The blog post "We should all be using dependency cooldowns" presents empirical evidence in favor of this based on recent (non-Go) attacks.

Proposal

When a cooldown is configured, commands like go get and go mod tidy would only consider dependency versions that are at least N days, weeks, or months old.

This could be controlled with an environment variable:

GOCOOLDOWN=15d go mod tidy

With this setting, Go would skip any dependency versions published less than 15 days ago when resolving dependencies.

Alternatives

The primary alternative is to use external tools like Dependabot that already support this.

Open questions

The design naturally invites questions about scope:

  1. Should this apply to all dependencies equally?
  2. Should the cooldown interval be set in the development environment or in go.mod?

Metadata

Metadata

Assignees

No one assigned

    Labels

    ProposalToolProposalIssues describing a requested change to a Go tool or command-line program.WaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions