reshapr icon indicating copy to clipboard operation
reshapr copied to clipboard

Add local Secret resolution on the proxy

Open lbroudoux opened this issue 5 months ago • 1 comments

Currently, secrets (passwords, tokens, OAuth2 client secrets, certificates) are persisted in the control-plane (ciphered at rest) and transferred to the proxies/gateways via gRPC so they can be used when proxying MCP calls to backend APIs.

This means the actual secret values leave the control-plane and reside in the gateway's memory. In a hybrid deployment (SaaS control-plane + customer-hosted gateway), this prevents us from giving customers the guarantee that their backend credentials never leave their premises. It also increases the surface area for credential leakage.

The idea here is to allow the control-plane to store secret references instead of actual values, and delegate the resolution of real values to the gateway, locally, at call time.

Rather than introducing a new "is local" flag on the Secret model, we rely on a naming convention: if a secret value (e.g. password, token) is expressed as ${env:MY_ENV_VAR}, the proxy resolves it locally from its environment.

The scheme prefix (env:) is extensible by design - future resolvers can be added without any model/proto/DB change:

  • ${env:VAR} for environment variable (MVP)
  • ${file:/path} for mounted file (Docker/K8s secrets)
  • ${vault:...} for local HashiCorp Vault
  • ${k8s:...} for Kubernetes Secret Values that don't match the pattern stay literal (full backward compatibility).

We'd like to have just-in-time resolution on the proxy (at the point where the proxy builds backend auth, for REST/GraphQL and gRPC). This:

  • guarantees secret values are never materialized outside the duration of a call,
  • supports rotating/renewing secrets with no MCP server redeploy (hot-reload),
  • keeps the control-plane free of the real credentials in hybrid setups.

Benefits

🔒 Customer credentials never leave the customer's environment in hybrid deployments. 🔁 Rotating secrets supported transparently (no redeploy / no re-sync). 🧩 Extensible resolver mechanism (env → file → vault → …) with zero schema impact. ♻️ Backward compatible: existing literal secrets keep working.

Scope

The proxy must then introduce a secret reference resolver, invoked just-in-time when building backend security (REST/GraphQL headers, gRPC call credentials, TLS cert).

For this issue, we'll focus on ${env: } scheme only. Others to be added incrementally on top of the same mechanism depending on users feedback.

lbroudoux avatar Jun 16 '26 15:06 lbroudoux

Working fine! Available in the nightly release!

lbroudoux avatar Jun 17 '26 14:06 lbroudoux