The Simplest Way to Make Crossplane and Hashicorp Vault Work Like They Should
Crossplane and HashiCorp Vault work together to build cloud resources and store secrets. Crossplane creates databases and clusters, while the secret store holds the keys they produce. Platform teams use this pair to automate cloud setups through Kubernetes APIs. Instead of passing raw passwords in text files, teams route keys straight into secure storage. Apps can then read the keys they need to run without human help. How Crossplane and HashiCorp Vault share roles and data Crossplane runs i
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.
Crossplane and HashiCorp Vault work together to build cloud resources and store secrets. Crossplane creates databases and clusters, while the secret store holds the keys they produce.
Platform teams use this pair to automate cloud setups through Kubernetes APIs. Instead of passing raw passwords in text files, teams route keys straight into secure storage. Apps can then read the keys they need to run without human help.
How Crossplane and HashiCorp Vault share roles and data
Crossplane runs inside a Kubernetes cluster and acts as a central control plane. It watches custom definitions and talks to cloud APIs to build new servers or databases. When a cloud provider builds a new database, it returns a root key and user name.
By default, Crossplane writes those new database keys into standard Kubernetes secret objects. Many teams prefer not to leave sensitive keys inside basic cluster storage. They set up Crossplane to send those outputs to an external secret store instead.
To make this work, the cluster must log in to Crossplane and HashiCorp Vault with a valid role. The Kubernetes cluster sends a signed service account token to verify its identity. HashiCorp Vault checks this token against the cluster public keys and returns a short session token.
Once logged in, the Crossplane controller can read cloud API keys to start its work. After the cloud build finishes, Crossplane writes the new database keys back to a dedicated path. Workloads and apps then read from that path using their own separate roles.
Common failure modes and how to scope permissions
A common mistake happens when teams give Crossplane one giant admin role for all paths. If one controller role can read and write every secret, a small bug can expose all keys. Teams also fail when they share one service account across many different app namespaces.
Another problem starts when teams use long-lived static tokens to link the two systems. If a static token expires without warning, Crossplane stops syncing cloud state and builds fail. Worse, if a static token leaks in a log file, an attacker can read every stored key.
HashiCorp Vault + Crossplane Composition Security: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Unlogged secret reads also create blind spots for security teams during an audit. If audit logs are off, you cannot see which controller wrote or changed a database key. You should turn on detailed audit logs in your secret store before running production workloads.
To fix permissions, create a separate role for each provider and each team namespace. Give the database provider permission to write only to the database secret path. Never let an app role read the cloud provider keys that Crossplane uses to build servers.
You should also lock down network paths between the Kubernetes cluster and the secret store. Use strict network rules so only specific controller pods can talk to the secret API port. Block normal app pods from reaching admin paths or provider secret engines.
Keeping day-two secret rotation and state in sync
Building a cloud resource on day one is only half of the puzzle. Over time, security rules require teams to rotate database passwords and cloud API keys. If one tool changes a password without telling the other, apps will fail to log in.
Crossplane checks the state of cloud resources in a continuous loop. When you rotate the cloud provider key in HashiCorp Vault, Crossplane must pick up the new key. Teams use external secret sync tools or native secret store plugins to refresh these keys on time.
Keep secret lease times short so controllers fetch fresh keys on a regular schedule. Test your rotation flow in a staging setup to make sure controllers handle key updates cleanly. Clear role boundaries and clean logs keep both tools running without surprise outages.
Govern statements and responses across databases and APIs
Good config and scoped roles are needed setup. They do not check single queries in flight or mask sensitive fields in returned rows. Across Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, and internal HTTP endpoints, hoop.dev runs beside each supported service as an open-source proxy, a sidecar for your database or API.
First, hoop.dev guardrails block banned queries before they run. Then hoop.dev data masking rewrites matched sensitive values in responses in memory. The audit trail records every statement and verdict per resource. Furthermore, hoop.dev holds SOC 2 Type II and is open source on GitHub.
Frequently asked questions
Why use an external secret store with Crossplane instead of Kubernetes secrets?
Standard Kubernetes secrets only use basic encoding by default and lack deep audit logs. Storing keys in HashiCorp Vault gives teams central encryption, lease timers, and clear audit trails.
How should Crossplane authenticate to HashiCorp Vault in production?
Use the Kubernetes login method bound to the specific service account of the Crossplane controller. This method uses short-lived tokens instead of static keys that someone could copy or lose.
What happens if the secret store goes offline while Crossplane is running?
Crossplane cannot read cloud provider keys or write new resource outputs while the store is down. Existing cloud resources keep running, and Crossplane retries the sync loop once the store returns.
Related guides
In this post