Skip to content

External secret references are resolved at read time

Accepted. Built; the platform’s task role permissions are granted outside this repository.

2026-11-04.

The same credential often has to live in several places: an application’s configuration, a function setting and an ingestion secret. Setting and rotating it in each is repetitive and error-prone. Teams that already keep secrets in AWS asked for the platform to take a pointer instead.

There were two ways to honour that. Resolve the pointer when it is written, and store the secret. Or store the pointer and resolve it every time a consumer needs the secret.

A secret value may be a reference: aws-sm://<name-or-arn>[#<key>] for Secrets Manager (with #key selecting a field of a JSON secret) or aws-ps://<parameter> for Parameter Store. The platform stores the reference, never the secret, and resolves it at read time.

  • Three places resolve it: the function runner’s desired document (function secret and database settings), the ingestor runtime’s fetch of an ingestion’s bound secrets, and the audited reveal of a configuration secret. A shared resolver is used at all three.
  • A short cache. Values are fresh for FC_SECRET_REFERENCE_TTL (5 minutes by default), so a rotation in AWS reaches every consumer within that time with no change to the platform. Concurrent misses share one AWS call.
  • Stale on error. If a refresh fails, the last good value is served for up to FC_SECRET_REFERENCE_MAX_STALE (1 hour by default), with a warning logged. A failure with nothing cached is remembered briefly so a re-render loop does not hammer AWS.
  • An allow-list is required. FC_SECRET_REFERENCE_ALLOW is a list of reference prefixes. Without it the feature is off. It is checked at write time and at resolve time. Without one, anyone who could set a secret could point it at any secret the platform’s role can read, such as its own database credentials, and have it delivered.
  • Only the two AWS schemes resolve. gcp-sm://, vault:// and env:// are refused. env:// in particular would hand the platform’s own environment to a caller.
  • A reference is not a secret. It is shown in lists and the console, and in reveal of the stored value, where a real secret shows as masked. The resolved value is never logged.
  • Failures are loud, with codes: not found, denied, key missing, not allowed (a conflict), and unavailable (retryable, 503). A function whose secret cannot be resolved has the key left out of its secrets, so it fails at the point of use rather than receiving the reference text as if it were the value.

Good:

  • A secret is set and rotated once, in AWS.
  • The platform’s database never holds the secret behind a reference.
  • A narrowed allow-list stops existing references too, because it is checked at resolve time.

Bad:

  • The platform depends on AWS availability for these secrets. The stale window softens short outages, not long ones.
  • Rotation is not instant: it reaches readers within the cache lifetime.
  • The platform’s role needs read access to the allowed names, which is an infrastructure change per environment.
  • Name-based allow entries do not match ARN-form references; both must be listed.
  • Other holders of secrets (identity provider client secrets, service accounts) keep their existing behaviour.
Alternative Why not
Resolve at write time and store the secret Copies the secret and does not follow rotation, which is the problem being solved.
Resolve in each consumer Every runtime would need AWS access and its own cache and allow-list.
Support every secret manager now Only the two in use are built; the scheme list is closed on the write side so others fail clearly.