Skip to content

[Phase 3] Identity broker keys from secret stores and signing services #2877

Open

Description

@ChrisJBurns

Depends on: #2538 (the broker's configuration file and keys). Coordinate with #2585 (Mecatl-wide secret management).

Problem

The identity broker, AS-1, and the embedded gateway's authorization server (AS-2) read every key and secret from files mounted into the pod. An operator can keep them in a secret manager such as Vault or AWS Secrets Manager and sync them into Kubernetes Secrets (External Secrets Operator, the Secrets Store CSI driver), but the key material still ends up on the pod's disk and in the process's memory, where anything that compromises the process can take it. #2807 requires the broker's keys to be held in a KMS that only the broker's service account can sign with, and nothing provides that yet.

Design

Requirements

  • Two kinds of source, chosen per key in the broker's configuration file:
    • a secret store returns the key's bytes at startup (Vault KV, AWS Secrets Manager), alongside today's files;
    • a signing service signs without the key leaving it (AWS KMS, Vault Transit, Google Cloud KMS). The broker only ever receives signatures and the public key.
      Adding a source is additive: existing configuration files keep working, and each provider is a separate adapter behind one interface, so supporting another provider adds an adapter, not a new configuration shape.
  • Which keys:
    • the agent issuer key and the broker client key support both kinds. The broker core already signs through a signer interface;
    • AS-1's and AS-2's signing keys support a signing service only once ToolHive's authorization server can sign through one; file the ToolHive issue for a pluggable signer. Until then they support secret stores only;
    • HMAC secrets support secret stores only, since ToolHive needs the raw secret.
  • Rotation: a secret store's earlier versions, or a signing service's earlier key versions, serve as the fallback keys the configuration file already supports, with the same rules.
  • Authentication to the provider: the pod authenticates with its workload identity (Kubernetes auth for Vault, IRSA or Pod Identity for AWS, Workload Identity for Google Cloud), never a long-lived credential in the configuration file.
  • Failure: a signing service that cannot answer fails the operation as retryable, never with a generated key or a fallback to another source. Startup fails when a configured source cannot return a key or public key.
  • Boundaries: provider SDKs stay in their own adapters under internal/identitybroker/adapter/, each with its own depguard rule, so the broker still moves into its own service as one tree.
  • Shared capability: if Design a shared Mecatl-wide secret-management capability #2585's secret-management design lands first, use its interfaces for secret stores rather than adding a second set.

How it fits

Phase 3 hardening. It provides the KMS-held keys #2807 requires, so a compromise of the process that runs the broker can request signatures while it runs but cannot take the keys.

Done when

  • The agent issuer and broker client keys can come from a file, a secret store, or a signing service, chosen per key in the configuration file, with an offline test for each source kind against a fake provider.
  • A key held in a signing service never appears in the process: the broker holds only its public key.
  • Rotation through provider key versions keeps credentials signed with the previous version verifying.
  • An unreachable signing service fails calls as retryable and never falls back to another key.
  • Existing file-based configuration files load unchanged.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions