Authentication modes
lowtide has three authentication modes. You set the mode with auth.methods in the Helm chart. The Terraform module turns on Cloud IAM authorization when you list Pub/Sub projects in gcp_iam_projects.
| Mode | auth.methods |
Who decides | What you set up |
|---|---|---|---|
| Off | [] |
Nobody: every caller that reaches the port may do everything | NetworkPolicy and network controls only |
| Cloud IAM | [gcp-iam] |
Cloud IAM, with the caller’s own token | Grant roles as you do for Pub/Sub. See Cloud IAM and shadows. |
| lowtide policy | [static, google], or one of them |
A policy file in the chart: Pub/Sub roles on resource patterns | Write the policy |
Use Cloud IAM for production. Your existing bindings, groups, custom roles, IAM conditions and deny policies apply, and you manage access in one place for Pub/Sub and lowtide. Every cluster lowtide sets up with Pub/Sub projects uses it.
All modes need TLS for clients that send credentials: the client libraries send tokens only over TLS.
Any client that can reach the gateway may do anything. Keep the plaintext port closed with the chart’s NetworkPolicy (networkPolicy.enabled: true). By default it lets only gateway pods reach the plaintext port. Use this mode for development, or for a cluster that only trusted workloads can reach.
Cloud IAM
Section titled “Cloud IAM”lowtide asks Google, with the caller’s own token, whether the caller holds the permission Pub/Sub would require for the call. It needs TLS on and an internal token. Cloud IAM and shadows explains how it works and what to grant.
lowtide policy
Section titled “lowtide policy”Two ways to identify callers, which you can combine:
static: bearer tokens from a Secret. Each line isprincipal token. Setauth.tokensSecret.google: Google OAuth access tokens, the ones the client libraries send under Workload Identity or Application Default Credentials. lowtide verifies them with Google’s token info endpoint and uses the token’s email as the principal.
The policy lists bindings of roles to principals on resource patterns:
auth: methods: [google] internalTokenSecret: name: lowtide-internal-token policy: bindings: - principals: ["orders-api@acme.iam.gserviceaccount.com"] roles: ["publisher"] resources: ["projects/acme/topics/orders-*"] - principals: ["billing@acme.iam.gserviceaccount.com"] roles: ["subscriber"] resources: ["projects/acme/subscriptions/orders-billing"] - principals: ["*"] roles: ["viewer"] resources: ["projects/acme/*"]| Role | Allows |
|---|---|
publisher |
Publish |
subscriber |
Pull, streaming pull, ack, modify ack deadline, seek, attach a subscription |
viewer |
Get and list |
editor, admin |
Everything |
* in a pattern matches any run of characters. projects/acme/* also matches projects/acme itself, which project-level list calls need. A caller with no matching binding gets PERMISSION_DENIED. A missing or invalid token gets UNAUTHENTICATED.
The internal token
Section titled “The internal token”Pods call each other to forward consumers, read recent messages from peers and route ordered messages. These calls carry a shared token from auth.internalTokenSecret, and the entry pod has already authorized the caller. The same token protects the gateways’ admin endpoints on the metrics port, which the agent uses. Set it whenever authentication is on.
Pod-to-pod traffic is authenticated by this token but not encrypted. If you need encryption inside the cluster, use a service mesh.