The Simplest Way to Make Cloud Run and Google Workspace Work Like They Should
Pairing cloud run and google workspace lets your team run web apps with company logins. This setup links serverless containers to your existing user directory and group rules. Teams use this pair to host internal tools and automate office tasks. Your apps check who a user is before they run any job. You do not need to build a custom login database for your staff. Instead, your containers trust the user accounts that your IT team manages every day. How logins and data flow between cloud run an
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.
Pairing cloud run and google workspace lets your team run web apps with company logins. This setup links serverless containers to your existing user directory and group rules.
Teams use this pair to host internal tools and automate office tasks. Your apps check who a user is before they run any job. You do not need to build a custom login database for your staff. Instead, your containers trust the user accounts that your IT team manages every day.
How logins and data flow between cloud run and google workspace
The link between these two tools starts with a shared cloud project. Each container runs under a specific cloud service account with its own identity. When a staff member opens your web app, they sign in with their work email. Google checks their login and sends a signed token to your running container.
Your app reads this token to see who the person is. You can also check which team groups they belong to in the directory. Sometimes the container needs to read calendars, drive files, or user lists on its own. To do this, admins set up domain-wide delegation or scoped OAuth consent screens.
With delegation, the service account acts on behalf of a workspace user. The workspace admin approves exact API scopes for that one service account client ID. Then the container asks for a short token to read or write office data. Every API call flows over encrypted web traffic between the cloud and office servers.
Common permission mistakes and how to scope roles
Many teams make the mistake of sharing one service account across many apps. If one app has a bug, all other apps share that same risk. Another big mistake is turning on domain-wide delegation with wide API scopes. If a service account can read all mail, a leaked key exposes every inbox.
Teams also download static JSON keys and store them in code repos. Static keys do not expire on their own and are easy to steal. Unlogged API queries create another blind spot for your security team. When five developers share one admin role, you cannot tell who changed a setting.
End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
You can fix these issues by giving each app its own service account. Never download static service account keys to run your cloud containers. Instead, let the cloud platform attach the identity to the container at runtime. Avoid domain-wide delegation unless your app must act when users are offline.
For human apps, ask the logged-in user to grant access through a consent screen. This ensures the container only sees files that the active user can already see. Restrict who can invoke your cloud service by checking workspace group memberships first. Turn on audit logs in both consoles so you can track every data request.
Keeping sensitive office data safe in container logs
When your container reads office files or directories, raw user data passes through memory. Developers often print API responses to standard output to debug a failing job. This habit puts private emails, phone numbers, and card numbers into plain text logs. Anyone with log viewer roles can then read sensitive records from your staff directory.
Good teams strip sensitive fields before writing any status line to the log sink. You should also mask emails and national IDs when returning data to test tools. Keep production workspace data separate from your test cloud projects by using separate domains. Review your active service accounts every month and delete unused ones right away.
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
Do I need a static JSON key for my container to read workspace data?
No, you do not need a static JSON key when running on Google Cloud. The runtime attaches a managed service account identity to your container without key files.
When should I avoid domain-wide delegation for my service account?
Avoid domain-wide delegation whenever a real user is present to log in. Use standard user OAuth consent so the app only uses that person's own permissions.
How do I limit which employees can open my internal cloud app?
Grant the invoker role only to specific workspace groups in your cloud project settings. Users outside those groups will get an access denied page before reaching your container.
Related guides
In this post