The Simplest Way to Make GCP Secret Manager and Tekton Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

You pair gcp secret manager and tekton to pull cloud keys into build steps. This setup lets pipelines deploy apps without saving plain text passwords in git. Tekton runs build tasks inside Kubernetes pods. Those pods need database passwords, API keys, and signing certs to finish their work. Google Cloud stores these values in a central vault. When the two tools link up, each task pulls only the keys it needs. The pod uses the key in memory and wipes it when the build ends. How gcp secret mana

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.

You pair gcp secret manager and tekton to pull cloud keys into build steps. This setup lets pipelines deploy apps without saving plain text passwords in git.

Tekton runs build tasks inside Kubernetes pods. Those pods need database passwords, API keys, and signing certs to finish their work. Google Cloud stores these values in a central vault. When the two tools link up, each task pulls only the keys it needs. The pod uses the key in memory and wipes it when the build ends.

How gcp secret manager and tekton share keys and roles

Data flow between gcp secret manager and tekton starts with identity. Each Tekton task runs under a Kubernetes service account inside your cluster. You bind that cluster account to a Google Cloud service account. Workload identity handles this link without static key files.

When a pipeline starts, the pod asks Google Cloud for a short token. Google checks the identity binding and sends the token back to the pod. Next, the build step calls the secret store API using that token. Google checks if the cloud role allows read rights for that specific key. If the check passes, the secret value flows into the pod memory.

Many teams also run an external operator inside the cluster. The operator watches the cloud vault and writes values into Kubernetes secret objects. Tekton then mounts those local objects as files or variables during the task run. Both paths depend on strict cloud role mappings to stay safe.

Common failure modes and how to scope roles

The biggest risk in this setup is a shared service account. Teams often attach one broad cloud role to the default cluster account. Every Tekton pipeline in that namespace then gets read rights to every cloud key. A bad script in a test build can read production database passwords.

Static service account JSON files cause another major failure mode. Engineers sometimes paste a long-lived Google key into a cluster secret to save time. That key never expires on its own. If someone steals it from a build log, they own the cloud project.

GCP Secret Manager + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Unlogged secret reads also hurt security teams during an audit. When ten pipelines share one identity, cloud logs cannot show which build took a key. You see the cloud account name, not the Tekton pipeline run name.

To fix this, create one Kubernetes service account for each pipeline. Bind each one to a dedicated Google Cloud account with a narrow role. Grant read access to single keys, never to the whole project. Lock down network paths so build pods only talk to required cloud endpoints. Turn on data access audit logs in Google Cloud to track every key read.

Managing database tasks and live data in pipelines

Pipelines do more than compile code and push containers. Many Tekton tasks run schema changes or check live data in production databases. Pulling a raw database password from the secret store gives the pod full access. If a build script prints variables for debug, that password lands in plain logs.

Teams should separate build secrets from live data tasks. Keep registry keys in the cloud vault, but guard direct database sessions with stricter controls. When a task queries user tables, data masking can rewrite emails, phone numbers, and card numbers. This keeps sensitive records out of build logs while the task finishes its check.

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

How should Tekton pods log in to Google Cloud?

Use workload identity to link a Kubernetes service account to a Google Cloud service account. This method avoids static JSON keys and uses short tokens instead.

Should I sync cloud secrets into Kubernetes secret objects?

Syncing works well for simple tasks, but it saves plain values in cluster storage. Pulling keys straight into pod memory during the task run reduces exposure inside the cluster.

How do I stop test pipelines from reading production keys?

Run test and production pipelines in separate namespaces with distinct service accounts. Grant each account read rights only to the specific keys its own tasks need.

The query runs. The emails stay hidden.