Repository navigation
Remove snyk-broker; gRPC tunnel is the only relay transport - #212
Merged
Merged
Conversation
The agent now always relays through the gRPC tunnel. - Remove the snyk-broker package: supervisor, relay instance manager, reflector, WebSocket proxy, event tracker and watchdog. - Remove the relay mode switch at startup: relaymode, the registration-driven restart, ForcedRelayMode, and the AXON_RELAY_TRANSPORT / RELAY_MODE, ENABLE_RELAY_REFLECTOR, REFLECTOR_WEBSOCKET_UPGRADE, RELAY_IDLE_TIMEOUT and SNYK_BROKER_PORT settings. - Move agent/server/snykbroker/acceptfile to agent/server/acceptfile, with accept_files/ and plugins/ as children. - Move Registration into grpctunnel, which is its only user. - Build one go-only image: no Node, no snyk-broker, no VARIANT. Stop publishing the -grpc tags. - Run the relay E2E suite (formerly relay_test.grpc.sh) as relay-test. - /__axon/info keeps relay_mode, now always "grpc-tunnel". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
shawnburke
commented
Dec 3, 2026
| Token string `json:"token"` | ||
| // TunnelMode is the relay mode Cortex selects for this tenant: | ||
| // "snyk-broker" or "grpc-tunnel". Empty when Cortex has no preference. | ||
| TunnelMode string `json:"tunnelMode,omitempty"` |
Collaborator
Author
There was a problem hiding this comment.
actually here jsut hard code grpc-tunnel please
Collaborator
Author
There was a problem hiding this comment.
Done in 896e0b6: TunnelMode stays on RegistrationInfoResponse. Register always sets it to grpc-tunnel (TunnelModeGrpcTunnel) and ignores the value from Cortex. A new test covers the cases where Cortex sends grpc-tunnel, sends snyk-broker, or sends nothing.
Code that reads TunnelMode keeps getting a value. Register sets it to grpc-tunnel and ignores the value from Cortex. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
shawnburke
marked this pull request as ready for review
December 3, 2026 02:28
keithfz
approved these changes
Dec 3, 2026
ashiramin
approved these changes
Dec 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
Rather than continue to fix
snyk-brokervulns, this takes the much-anticipated step of just nuking it altogether. We are ready - there are no known problems with the grpc tunnel and we can fix forward.Rollout flow for this is:
mainwhich will cause it to be picked up by our internal agent deployments which are pinned tomain=> make sure thats finelatest) which will cause the prod agent instances to pick it up => at this point we've validated its all OKThen as customers upgrade they'll pick this up naturally (note: all environments already default to
grpc-tunnelso this should be a no-op.Summary
The gRPC tunnel is now the default transport and works well, so this PR removes snyk-broker completely. After this merges, a release has no snyk-broker code, Node runtime or mode switch.
Removed
agent/server/snykbroker/: supervisor, relay instance manager, reflector, WebSocket proxy, event tracker,watchdog.sh, and their tests.agent/server/relaymode,cmd/relay_mode.go(resolve at start, watch, re-exec on change),config.ForcedRelayMode,IsGRPCTunnel/RelayModePinned.AXON_RELAY_TRANSPORT/RELAY_MODE,ENABLE_RELAY_REFLECTOR,REFLECTOR_WEBSOCKET_UPGRADE,RELAY_IDLE_TIMEOUT,SNYK_BROKER_PORT. If these are set, the agent ignores them.NODE_OPTIONS, and theVARIANTfull/grpc split. The result is one go-only image.relay_test.sh, its compose files,Dockerfile.snyk-broker-server, the nginx TLS proxy and the cert generation.gorilla/websocketfromgo.mod, which is now unused.AcceptFile.Render's extra render steps andSetOrigin, which only the reflector used.Moved
agent/server/snykbroker/acceptfile→agent/server/acceptfile, withaccept_files/andplugins/as children.Registration(the/relay/registercall) →agent/server/grpctunnel/registration.go. The tunnel is its only user.RegistrationInfoResponse.TunnelModeis dropped.relay_test.grpc.sh→relay_test.sh,docker-compose.grpc*.yml→docker-compose*.yml,make grpc-relay-test*→make relay-test*.CI / publishing
docker.ymlbuilds one image. The-grpctags (<version>-grpc,main-grpc,latest-grpc) are no longer published. Deployments pinned to them stop getting updates and must move to the plain tags.ci.yml:docker-tests-grpcis folded intodocker-tests, which now checks that the image has no Node or snyk-broker and runs the gRPC relay suite.trivy.yml: the dailymain-grpcscan is removed.Kept on purpose
BrokerTokenproto field,BROKER_SERVER_URL/BROKER_TOKEN, and the/__axon/broker/...paths. Changing them would break compatibility with the tunnel server and Cortex.relay_modein/__axon/info: the backend reads it, so it stays and is always"grpc-tunnel".server/(tunnel server): no changes. Its snyk-broker mentions document compatibility with the dispatcher API.acceptfile: the accept-file format comes from snyk-broker, and many rules match its semantics on purpose. Comments that described the removed snyk-broker code path are rewritten. Comments that explain parity stay.docs/design/grpc-tunnel-v2.md: a historical record. It gets a note at the top that says snyk-broker mode is removed.Reviewer notes
docker-tests-grpcandAgent image (go-only)no longer exist. If branch protection requires them, update the required checks.README.relay.md, check thatrelay.cortex.iois the correct host to allowlist for the gRPC tunnel. The address comes from/register.AcceptFileRuleWrapper.Origin()andAcceptFile.GetPrivateRules()now have no non-test callers.GetPrivateRules()was already unused before this PR. A follow-up can remove them, but tests useOrigin(), so I did not remove them here.Test plan
go build ./...,go vet ./...andgo test ./...inagent/: all 13 packages pass.go test -raceon the race-clean package set, withserver/acceptfilereplacingserver/snykbroker.docker-tests(scaffold + relay E2E with and without proxy), helm render, Trivy.🤖 Generated with Claude Code