Go
Configure the Go toolchain to download modules through your firewall with GOPROXY. Authentication, the checksum database, CI, and troubleshooting.
A Go firewall implements the GOPROXY protocol. The standard Go toolchain downloads modules through it; no extra client is involved. The operations it covers are listed in Client operations.
The examples use <namespace-id> and <firewall-id> placeholders. Replace them with IDs, not with namespace or firewall names. The firewall's Setup tab shows these snippets with both values already filled in.
Proxy endpoint
https://eu-sov-1.bytesafecloud.eu/v1/<namespace-id>/go/<firewall-id>The namespace ID and firewall ID are part of the URL. Authentication is HTTP basic auth with the access token as the password; the username can be anything.
Configure the toolchain
Set GOPROXY with the credentials embedded:
export BYTESAFE_TOKEN=<your token>
export GOPROXY="https://go:${BYTESAFE_TOKEN}@eu-sov-1.bytesafecloud.eu/v1/<namespace-id>/go/<firewall-id>"Do not append ,direct or another proxy as a fallback. Go falls back to the next GOPROXY entry on errors, which would turn every firewall block into a silent bypass.
go env -w GOPROXY=... persists the setting per machine, but it writes the token to the Go env file in plain text. Prefer the environment variable so the token stays in your shell or CI secret store.
The checksum database
The Go toolchain verifies downloaded modules against the public checksum database (sum.golang.org). Modules served through the firewall are byte-identical to upstream, so public modules verify as usual. Modules from an internal upstream are not in the public database and fail verification; exempt them:
export GONOSUMDB="go.acme.internal/*"Use GONOSUMDB, not GOPRIVATE: GOPRIVATE also excludes the modules from GOPROXY, which would fetch them directly from version control and bypass the firewall.
Verify
go mod download golang.org/x/textAfter the download, check the firewall log with bsfw for decisions recorded for that package.
CI
Use a Service Access Token (SAT) stored as a CI secret, as described in Set up CI/CD pipelines, and build GOPROXY from it before build steps. To tag the run's requests with its run ID, put the suffix after the token inside the URL:
export GOPROXY="https://go:${BYTESAFE_TOKEN}::${CI_PIPELINE_ID}@eu-sov-1.bytesafecloud.eu/v1/<namespace-id>/go/<firewall-id>"The ID shows up on each log entry generated by a matching logging rule or exception from that run.
Publishing
There is nothing to publish to a Go firewall. Go modules are distributed from version control, not uploaded to registries, so the firewall's upload phase does not apply to the Go ecosystem.
What a blocked download looks like
Rules on the versions phase filter versions out of the proxy's version list. The effect depends on how the module is requested:
go get module@latestand queries like@v1resolve to the newest version that passed the rules.- A
go.modrequirement on an exact filtered version fails with HTTP 403.
When a rule blocks a module download, the firewall returns HTTP 403. This also stops Go from falling back to the module's source repository when GOPROXY uses ,direct.
golang.org/x/text@v0.3.7 is blocked by the firewall. Check firewall log entries for request <request-id> for detailsTake the request ID to the logs to see which rule fired. See Investigate a blocked install.
Troubleshooting
The token in GOPROXY is unset, expired, or revoked. Confirm GOPROXY is set in the environment that runs the build, and that the token is still listed and unexpired in the dashboard.
GOPROXY carries the token inside the URL, so go env GOPROXY prints a live credential. Keep that output out of tickets, chat, and CI logs.
Most likely a versions rule filtered it. Because go.mod pins exact versions, a filtered version fails the build instead of resolving to an older one. Check the firewall logs before assuming an upstream problem.
If a rule expected to log the download but no matching entry appears, check go env GOPROXY for extra entries (,direct, ,https://proxy.golang.org) and go env GOPRIVATE GONOPROXY, all of which route modules around the firewall. Also check for a GOFLAGS=-mod=vendor setup; vendored builds do not contact the proxy at all.
Internal modules are not in the public checksum database. Add them to GONOSUMDB (see above). If the error concerns a public module, investigate it rather than disabling GOSUMDB: modules served through the firewall are byte-identical to upstream, so a mismatch is not explained by the firewall being in the path.
Containers (OCI)
Route Docker, crane, and oras through a container firewall and every image you pull or push is checked for vulnerable OS packages, malware, and leaked credentials. Setup, Docker Hub, how rules apply to images, and troubleshooting.
Maven
Configure Maven and Gradle to resolve dependencies through your firewall. Mirror setup, authentication, CI, publishing, and troubleshooting.