chore(duo): allow the Go module proxy in Duo sessions
What does this MR do and why?
The MR Risk Labeler is to rate the dependency bot's Go module bumps here by the diff of the two published versions. Duo sessions in this project reach only GitLab's own hosts, so it cannot fetch either version, and every module would go unread and need a person. This allows the Go module proxy and its checksum database, and nothing else.
Related issues
Related to components/agents-and-flows/gitlab-merge-request!119 (merged), which moves this project from the MR Dependency Risk Labeler to the MR Risk Labeler, and to gitlab-org/quality/triage-ops!4530 (merged), which switches the flow triage-ops starts here.
Testing
Ran the MR Risk Labeler's upstream check in sandbox-runtime 0.0.77, with only these two hosts allowed, over 10 saved bot bumps from this project. Each exited cleanly. Every module version it downloaded matched the checksum database and go.sum.
Performance analysis
None. Only Duo sessions read the file, and the build and tests never do.
- This merge request does not introduce a performance regression. If a regression is expected, explain why.
Agent context - long-form analysis, file-by-file walkthroughs, profiler output, and alternatives considered
Why the hosts are needed. This project's Duo sessions run the default image under sandbox-runtime. With no .gitlab/duo/agent-config.yml, that image allows only host.docker.internal, localhost, gitlab.com, *.gitlab.com and the Duo Workflow Service. That list comes from the SRT config the job writes; see job 17714906648, a run of the MR Dependency Risk Labeler here. The MR Risk Labeler's upstream check fetches through the sandbox's proxy, so today the proxy refuses both hosts.
What the file sets. It sets only network_policy, so the image and setup stay the defaults:
- the two hosts are added to the ones the platform always allows;
include_recommended_allowedstaysfalse, so the hundred-odd recommended domains stay out.
What stays unread. proxy.golang.org redirects a zip too large to serve to Google Cloud Storage, which this does not allow, so google.golang.org/api's zip is still not downloaded. Allowing storage.googleapis.com would open far more than one module.
A module whose testdata holds a .gitconfig, as gitaly's does, is not unpacked: the sandbox refuses to write one anywhere.
What the check does with the hosts. For each module the bot's go.mod or go.sum moves, it:
- downloads both versions' zips;
- holds each zip's
h1to the checksum database's lookup and to go.sum; - unpacks them as the go command extracts them;
- shows the rater the new version's go.mod and the diff of the two.
It decides nothing: the rubric in instructions/2953390/deps.md does, including the modules this project's maintainers agreed to review themselves.