The Simplest Way to Make Cloud Run and Kibana Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Teams use cloud run and kibana to run stateless apps and view their logs. Cloud Run hosts container workloads while Kibana lets engineers search and chart those log events. This setup gives your team a fast way to check app health in real time. Developers push code to Cloud Run, and the platform scales containers up or down. As containers run, they write output streams to standard log sinks. Forwarders then ship those records to an Elasticsearch cluster so teams can query them inside Kibana.

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 cloud run and kibana to run stateless apps and view their logs. Cloud Run hosts container workloads while Kibana lets engineers search and chart those log events.

This setup gives your team a fast way to check app health in real time. Developers push code to Cloud Run, and the platform scales containers up or down. As containers run, they write output streams to standard log sinks. Forwarders then ship those records to an Elasticsearch cluster so teams can query them inside Kibana.

How data and roles flow between cloud run and kibana

Getting data from your containers into your dashboards takes a clear pipeline. Cloud Run captures standard output and standard error streams from every running container instance. Cloud Logging collects these entries and routes them through a log sink to a message queue or forwarder. That forwarder then writes the structured records into Elasticsearch indices.

Once the data lands in the search cluster, Kibana reads those indices to build charts. Each step in this chain needs its own scoped identity and role. The Cloud Run service account only needs rights to run the app and write logs. The log shipper uses a separate key that can only append data to specific indices.

On the human side, engineers log in to Kibana through an identity provider. Their user group maps to a specific role inside the search cluster. That role dictates which log indices they can read and which dashboards they can edit. Keeping machine keys separate from human logins prevents privilege overlap across the two systems.

Common failure modes and how to scope roles

Many teams rush this setup and create wide security gaps between their apps and dashboards. A common mistake is sharing one static API key across all Cloud Run services for log shipping. If one container leaks that shared key, an attacker can write fake logs or read cluster data. Teams also often grant broad admin roles in Kibana so developers can fix broken queries fast.

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

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Broad human roles let anyone run heavy queries that can slow down the underlying search cluster. Unlogged queries also make audits hard when sensitive data ends up in container logs. For example, a bad deploy might print user emails, phone numbers, or card numbers into standard output. Without strict index rules and field masking, those records sit open to every Kibana user.

To fix this, give each Cloud Run service its own identity and route logs through managed sinks. Scope the shipper role so it can only write new events and never read or delete them. Place Kibana on a private network path rather than exposing its login page to the public web. Map identity provider groups to read-only Kibana roles for daily debugging work. Use data masking rules to rewrite emails, phone numbers, and national IDs in query results.

Keeping production log pipelines fast and safe

Good log hygiene starts before the container even writes a single line of text. Configure your apps to emit structured JSON so Kibana can parse fields without extra work. Drop noisy debug lines in production so you do not flood the network path or search disk. Review your Kibana role mappings every quarter to remove stale accounts and tighten index rules.

Check database and API queries on the wire

Identity tools, roles, and network rules decide who opens a session. Setup alone cannot check what each query does or mask sensitive values in a response once a session starts. When workflows touch Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, or internal HTTP APIs, hoop.dev runs beside those services as an open-source proxy, a sidecar for your Postgres or API. It inspects requests coming in and results going back on the wire.

Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run. On responses, hoop.dev data masking rewrites matched sensitive values in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and writes every query and decision to an audit trail that generates evidence for HIPAA, GDPR, and PCI DSS. See the source on GitHub.

Frequently asked questions

Can Cloud Run send logs straight to Kibana?

No, Kibana is a visual tool that reads data from an Elasticsearch cluster. Cloud Run sends logs through a sink or forwarder into Elasticsearch, and Kibana queries that store.

How do we stop sensitive data from showing up in Kibana?

First, scrub secrets in your app code before writing to standard output. Second, set up masking rules that rewrite matched fields like emails or card numbers in results.

Should Kibana be open to the public internet for remote teams?

No, exposing the dashboard to the open web invites brute force attacks and data leaks. Put the service on a private network and require single sign-on for every user.

The query runs. The emails stay hidden.