Skip to content

fix(agent): install gh from its pinned release so deploys need no Go proxy - #1078

Merged
krokoko merged 1 commit into
mainfrom
fix/1077-agent-image-go-proxy
Nov 24, 2026
Merged

krokoko merged 1 commit into
mainfrom
fix/1077-agent-image-go-proxy

Conversation

@isadeks

@isadeks isadeks commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Closes #1077

Problem

Since #1052 (fe2d61cb), agent/Dockerfile builds gh from source through the Go module proxy, proxy.golang.org. That was needed: github.com/microsoft/dev-tunnels v0.2.0 has no Go tags left, so a direct fetch fails everywhere.

A deploy machine that cannot reach proxy.golang.org cannot build the agent image. Corporate networks often block or redirect that host. mise //cdk:deploy then stops at the go install step, before CloudFormation changes anything.

Change

gh is installed from its official GitHub release, checked against a SHA-256 pinned per architecture in agent/Dockerfile. The Go builder stage is gone.

  • No Go proxy and no setting is needed. The image build already depends on github.com.
  • The checksums are pinned in the Dockerfile, copied from the release's gh_2.103.3_checksums.txt. They are not fetched at build time, so a changed release asset fails the build. Bump them with GH_VERSION.
  • The cost is one Go patch release. The 2.103.3 release binary is built with Go 1.27.3; the previous builder used 1.27.4. Trivy reports no fixable HIGH or CRITICAL finding for the binary beyond the gh entry that agent/.trivyignore already holds (CVE-2026-78661, which expires 2026-12-16). No ignore entry is added.
  • Tests: agent-image-pins.test.ts drops the golang image from its expected pins. A new test requires both pinned checksums, the sha256sum -c check, and no go install.

An earlier version of this PR made GOPROXY and GOSUMDB configurable. That only helped where an organization runs its own Go proxy, so this version needs none.

Verification

  • On a network that resolves proxy.golang.org to a DNS sinkhole, mise //agent:security:image builds the image and passes the trivy scan:

    • gh_2.103.3_linux_amd64.tar.gz: OK
    • gh version 2.103.3 (2026-10-26)

    The same scan fails on main.

  • arm64: the same release archive passed the same SHA-256 check during a live deploy of an AgentCore runtime image, using a local equivalent of this change. The pinned arm64 checksum matches the release's checksum file.

  • mise run build passes: cdk 8,885, cli 1,504, agent 3,139, web 30 files.

…proxy (#1077)

Since #1052 the agent image builds gh from source through proxy.golang.org:
a direct fetch fails because github.com/microsoft/dev-tunnels v0.2.0 has no
Go tags left. A deploy machine that cannot reach proxy.golang.org, as on
many corporate networks, then cannot build the image.

Install gh from its official GitHub release instead, checked against a
SHA-256 pinned per architecture in agent/Dockerfile. The image build
already depends on github.com, so this needs no proxy and no setting. The
release binary of 2.103.3 is built with Go 1.27.3, one patch behind the
previous builder; trivy reports no new fixable HIGH or CRITICAL finding.
A test holds the pinned checksum check in place.
@isadeks
isadeks force-pushed the fix/1077-agent-image-go-proxy branch from cf2b7b0 to c017304 Compare November 23, 2026 22:44
@isadeks isadeks changed the title fix(agent): let the agent image build name its Go module proxy fix(agent): install gh from its pinned release so deploys need no Go proxy Nov 23, 2026
@krokoko
krokoko added this pull request to the merge queue Nov 24, 2026
Merged via the queue into main with commit b2c2d29 Nov 24, 2026
10 of 11 checks passed
@krokoko
krokoko deleted the fix/1077-agent-image-go-proxy branch November 24, 2026 01:59
krokoko pushed a commit that referenced this pull request Nov 24, 2026
…weep

main gained #1078 after the first merge: the agent image installs gh
from its pinned release, so a deploy needs no Go proxy. A reviewer of
this pull request could not build the image without it.

No conflict. The merge changes agent/Dockerfile and
cdk/test/constructs/agent-image-pins.test.ts. This branch does not
touch either file, so both are as on main.

Refs #1074
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Agent image build fails where proxy.golang.org is unreachable

2 participants