Skip to content

fix(gcp-install): trustedProxies is 2 behind the GKE Ingress, not 1 - #479

Merged
miyaontherelay merged 2 commits into
mainfrom
fix/gke-trusted-proxies
Nov 19, 2026
Merged

miyaontherelay merged 2 commits into
mainfrom
fix/gke-trusted-proxies

Conversation

@miyaontherelay

@miyaontherelay miyaontherelay commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Why

The GKE install guide's values.yaml set relay-control.auth.trustedProxies: 1 ("one hop: the Google load balancer"). That is one short.

layered-infra-ops measured it on a live GKE install, read-only (three GETs of the dashboard, then the pod's access log):

Request X-Forwarded-For the pod received
no header sent <client>, <load balancer forwarding-rule address>
client sent 198.51.100.7 198.51.100.7, <client>, <load balancer address>

The Google external Application Load Balancer appends two entries. relay-control takes the Nth entry from the right, so with 1 it uses the load balancer's own address for every client. Sign-in works, but all users share one per-address rate limit and one password lockout, so a few wrong passwords from anyone can lock everyone out for a while.

What changes

  • docs/gcp-install/values.yaml: trustedProxies: 2, with the reason in the comment.
  • docs/gcp-install/0-START-HERE.md: a new section for installs made from an earlier copy of the guide. It shows how to read the header from the relay-webapp access log, the value to set, and a "Done when" check on the rendered SELFHOST_TRUSTED_PROXIES.
  • charts/relay-control/README.md, charts/agent-relay/README.md: count the entries a proxy appends, not the proxies; 2 behind the GKE Ingress.

Docs and the guide's values template only. No chart template or default changes (the relay-control default of 1 stays right for a single appending proxy, such as the AWS ALB), so there is no chart version bump.

Limits of the measurement

Existing installs

Any GKE install made from the earlier guide still runs with 1 until its operator changes the value and upgrades. The new guide section is the upgrade note.

🤖 Generated with Claude Code


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Measured on a live GKE install (read-only): the Google external Application
Load Balancer appends two X-Forwarded-For entries, "<client>, <load balancer
address>". relay-control takes the Nth entry from the right, so the guide's
trustedProxies: 1 selected the load balancer's address for every client: all
users shared one per-address sign-in rate limit and one password lockout.

- docs/gcp-install/values.yaml: trustedProxies: 2, with the reason.
- docs/gcp-install/0-START-HERE.md: a section for installs made from an
  earlier copy of the guide: how to read the header from the relay-webapp
  access log, the value to set, and a "Done when" check.
- relay-control and agent-relay READMEs: count the entries a proxy appends,
  not the proxies.

Docs and the guide's values template only; no chart template or default
changes, so no chart version bump.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@miyaontherelay miyaontherelay added the merge-train:hold Do not merge without Khaliq's direct OK label Nov 18, 2026
@coderabbitai

coderabbitai Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 89d7101e-ae9a-478b-a6fe-833b7dce6ead
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@greptile-apps

greptile-apps Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

Corrects the GKE install guide to use trustedProxies: 2 and explains how existing installs can apply it.

  • GKE sign-in limits now use each caller's address.

Reviews (2) · Last reviewed commit: "fix(gcp-install): raise trustedProxies f..." · Reviewed by Greptile

Comment thread docs/gcp-install/0-START-HERE.md Resolved
…uests are refused

Review feedback on #479: with a count one higher for a fronting proxy, a
caller who connects to the load balancer directly can put any address in
X-Forwarded-For and have the API trust it. The guide and the values template
now say to raise the count only after the load balancer refuses requests that
skip the proxy.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@miyaontherelay

Copy link
Copy Markdown
Contributor Author

Second measurement, from the API's own view: the GKE proof install was moved from trustedProxies: 1 to 2, and a sign-in audit row now records the real client address where it used to record the load balancer's. That removes the first limit listed in the description (the header had only been read from the relay-webapp access log).

@miyaontherelay
miyaontherelay merged commit fc98758 into main Nov 19, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-train:hold Do not merge without Khaliq's direct OK

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant