The Simplest Way to Make Spanner and Ubiquiti Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Teams use spanner and ubiquiti together to link office networks to cloud databases. Ubiquiti hardware routes local traffic while Google Cloud Spanner stores global app data. This setup lets engineers query production data from secure office sites or remote links. When you pair them well, network rules and cloud roles work as one system. When you rush the setup, wide network paths and shared keys create big risks. How spanner and ubiquiti share identity and traffic Ubiquiti gear manages your

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

Teams use spanner and ubiquiti together to link office networks to cloud databases. Ubiquiti hardware routes local traffic while Google Cloud Spanner stores global app data.

This setup lets engineers query production data from secure office sites or remote links. When you pair them well, network rules and cloud roles work as one system. When you rush the setup, wide network paths and shared keys create big risks.

How spanner and ubiquiti share identity and traffic

Ubiquiti gear manages your local networks, site links, and firewall rules at the edge. Google Cloud Spanner runs as a managed relational database inside your cloud project. To make them work together, traffic must cross from your local site to Google.

Most teams build a private tunnel from their Ubiquiti router to their cloud network. This path keeps database queries off the public web during daily work. Once traffic reaches the cloud, Google Identity and Access Management checks who is calling.

A network link alone does not grant database rights to a user or app. The person or service must also hold a valid cloud identity token. Spanner checks this token against database roles before it runs any read or write.

Good setups bind both layers together so neither side trusts the other blindly. Your Ubiquiti firewall only allows known local subnets to reach the cloud tunnel. Your cloud project only lets specific roles run queries once that traffic arrives.

Common failure modes and how to fix them

The biggest mistake is trusting the office network as a proof of user identity. Teams often open a full site tunnel and give everyone one shared service key. If a guest device joins the office network, it can reach the database path.

Shared service keys also destroy your audit logs inside the cloud console. When ten engineers use one key, every bad query looks the same in logs. You cannot tell who dropped a table or read customer emails and phone numbers.

Long-lived keys stored on laptops make this risk even worse for your team. If an engineer leaves the office, that static key still works from anywhere. Rotating that shared key breaks scripts and slows down every team at once.

End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Start your fix by shrinking the network paths on your Ubiquiti router today. Do not let general office wireless networks route traffic into your cloud database tunnel. Create a small network segment just for engineering staff who need data access.

Next, stop handing out static service account files to humans on your team. Tie every cloud role to a real person through your main identity provider. Give each person the smallest role needed for their daily job, like read-only rights.

Scoping roles and protecting data in results

Even with tight network rules, engineers still need to debug live database issues fast. Giving full database admin rights to fix one bug creates a huge safety gap. You should split roles into daily read roles and rare write roles for fixes.

Production tables in Spanner often hold sensitive records like card numbers and national IDs. Standard cloud roles work at the database or table level, which is very broad. If a user can read a table, they get every column in the output by default.

To protect user privacy, teams need ways to limit what comes back in queries. Data masking rewrites matched fields like emails and phone numbers in query results. This lets engineers fix app bugs while keeping private user details safe from exposure.

You should also turn on data access logs in your cloud project right away. Match those query logs with connection logs from your Ubiquiti network controller each week. This gives your security team a clear view of every query from start to finish.

Add runtime guardrails and masking beside your databases and APIs

Login rules, role grants, and CI checks govern who connects to your stack. Yet any allowed script, engineer, or AI agent still runs commands with the full scope of its role. For workloads on Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes, SSH, or internal HTTP services, hoop.dev sits beside the service as an open-source proxy, a sidecar for your database or API.

Before a query runs, hoop.dev guardrails check the statement against your rules. An AI Analyzer you configure can score intent or hold risky calls for human review. Next, hoop.dev data masking rewrites sensitive fields in responses, and each verdict is logged per listener. Explore the MIT-licensed project on GitHub.

Frequently asked questions

Can Ubiquiti routers log in to Spanner on their own?

No, Ubiquiti hardware only handles network routing, firewall rules, and site tunnels. Apps and users still need valid Google Cloud identity tokens to query Spanner.

Should we allow all office traffic to reach our cloud database tunnel?

No, you should block general office and guest networks from the cloud tunnel. Put engineers on a separate local VLAN with strict firewall rules to the cloud.

How do we stop shared service keys on engineer laptops?

Remove static key files and make users log in with their own work accounts. Grant short-term roles to single users and log every query by user identity.

The query runs. The emails stay hidden.