Introducing a new way to review your PRs.

Read the announcement

jdx / fnox

encrypted/remote secret manager

View on GitHub

27 documents · Updated Nov 23, 2026

docs / provider-integrations

Secret provider integrations

fnox uses a common provider model to connect secret names in a project to local stores, remote secret services, or encryption keys. A provider can return a value, save a value, or protect a value for storage in fnox.toml, so one project can use different trust and access models for development, CI, and production.

Provider abstraction

The Provider contract gives fnox one way to work with unlike secret systems. Each provider reports its capabilities and handles secret reads through the same interface. The provider registry creates the selected provider from configuration and lets the rest of fnox remain independent of the backing service.

The main provider capabilities are:

CapabilityMeaning in fnoxValue kept in configuration
EncryptionProtects a value and later recovers itEncrypted value
Remote storageSaves and reads a value in a backing storeProvider name and remote key
Remote readReads an existing value but does not save itProvider name and remote reference

Encryption providers keep ciphertext in the configuration. Remote providers keep a reference instead. Read-only providers are useful when an existing service owns the secret and fnox only needs to load it.

Secret resolution

Secret resolution turns a configured secret reference into a value at the time fnox needs it. It uses the active profile and its inherited profiles, then creates the selected provider and asks it for the requested value.

The resolution path supports both project configuration and environment variables. A configured secret takes priority. If no configured value exists, fnox uses an environment variable with the same name. Provider settings can point to other secrets, so the resolver handles nested provider use and detects circular provider chains. Errors in the profile inheritance chain propagate through this lookup instead of being treated as an empty configuration.

This diagram shows how a secret request moves from a project reference to a provider result.

flowchart TD
    A[Secret request] --> B[Read active profile and inherited configuration]
    B --> C{Secret in project config?}
    C -->|No| D[Read matching environment variable]
    C -->|Yes| E{Secret has provider reference?}
    E -->|No| F[Use configured default]
    E -->|Yes| G[Resolve provider settings and nested references]
    G --> H[Create provider]
    H --> I[Read or decrypt referenced value]
    D --> J[Resolved secret value]
    F --> J
    I --> J

Provider configuration fields can also use a literal value or a named secret reference. This lets credentials for one provider come from another provider without placing those credentials directly in the provider settings.

References: crates/…/mod.rs• L298-313 crates/…/mod.rs• L483-500 crates/…/resolver.rs• L66-124 crates/…/resolver.rs• L168-235 crates/…/resolver.rs• L237-319 crates/…/secret_ref.rs• L21-32 crates/…/secret_ref.rs• L233-247

Provider selection and composition

Provider instances are named in the active profile. A secret then selects a provider by name and supplies a provider-specific reference. Profile inheritance can add or override those provider instances, which lets one profile reuse shared setup while changing the provider set for an environment.

The fnox provider command supports the provider lifecycle at a user level:

  • Add a named provider from a supported type.
  • List providers available in the active scope.
  • Test provider access and configuration.
  • Remove a provider that is no longer used.

The setup wizard groups provider types by their access model. The groups distinguish local storage, password managers, cloud key encryption, cloud secret storage, and operating system keychains. Provider definitions also supply the setup guidance and fields used by that wizard.

The same project can combine providers. For example, an encrypted local provider can serve development while a cloud secret store serves production. Profiles select the provider set for each environment, and secret references select the provider within that profile. When a selected provider comes from an inherited profile, fnox keeps its source file with that provider so relative local paths use the configuration file that defines it.

References: crates/…/mod.rs• L6-40 crates/…/mod.rs• L55-101 crates/…/mod.rs• L117-169 crates/…/mod.rs• L461-480 crates/…/resolver.rs• L184-235 docs/…/provider.md• L3-14 docs/…/overview.md• L57-74

Remote and cloud providers

Remote providers keep the secret outside the project configuration and fetch it when fnox resolves the reference. They suit shared environments where access rules, central control, audit records, or rotation belong to a service rather than to a checked-in file.

The remote and cloud family includes:

Service groupProvidersMain role
Cloud and cluster secret storesAWS Secrets Manager, AWS Parameter Store, Azure Key Vault Secrets, GCP Secret Manager, Kubernetes SecretsStore and retrieve shared secrets
Cloud key servicesAWS KMS, Azure Key Vault KMS, GCP KMSEncrypt values while keeping ciphertext in the project
Vault and encrypted storesHashiCorp Vault, FOKS, Bitwarden Secrets Manager, Doppler, Keeper Secrets ManagerRead or store values through a central service
Password managers and secret services1Password, Bitwarden, Infisical, Proton Pass, PasswordstateRetrieve values owned by an existing secret service
Azure configurationAzure App ConfigurationRead remote key-value configuration

Most cloud and vault providers can store and retrieve values. Some integrations are read-only. Azure App Configuration, Kubernetes Secrets, Keeper Secrets Manager, Passwordstate, and the password-manager style integrations are used to read existing values rather than to make fnox the owner of the stored secret. Kubernetes references can name a secret directly or select a key within a secret, with an optional namespace.

Cloud and cluster providers normally rely on the identity and access controls of their service. Kubernetes uses the selected cluster context and namespace. CLI-backed services also depend on an authenticated local CLI session or a service token. 1Password supports item references and environment variable references. The provider reference remains a name or path meaningful to that service.

See Cloud and vault providers for the remote provider families and their system-level roles.

References: crates/…/aws-sm.toml• L1-11 crates/…/aws-ps.toml• L1-11 crates/…/azure-sm.toml• L1-12 crates/…/gcp-sm.toml• L1-12 crates/…/vault.toml• L1-12 crates/…/1password.toml• L1-12 crates/…/kubernetes.rs• L158-201 crates/…/kubernetes.rs• L219-246 crates/…/onepassword.rs• L419-461 crates/…/aws_sm.rs• L256-271 crates/…/azure_ac.rs• L177-184 crates/…/keeper_sm.rs• L275-289

Local and hardware providers

Local providers keep secrets on the engineer's machine or protect them with a local key. They reduce dependence on a network service and support offline work, but the security and sharing model follows the local store or device.

The local and hardware family includes:

Provider groupProvidersMain role
Local encryptionageEncrypt values for storage in the project. Age can use a provider-backed identity for key access.
Local storesOS Keychain, KeePass, password-storeSave and retrieve values from an operating system store or local encrypted database.
Plain valuesPlainKeep non-sensitive defaults or test values as-is. An optional plaintext file makes it a read-only local source.
Hardware encryptionFIDO2, YubiKeyDerive encryption material from a physical security key.

Hardware providers require the matching device when fnox encrypts or decrypts a value. FIDO2 and YubiKey integrations therefore belong to interactive workflows and cannot provide a general replacement for a remote store in unattended work unless the required device and access flow are available. The file-backed Plain provider also remains read-only because fnox does not write its source file.

See Local and hardware providers for the local stores, encryption choices, and device-backed systems.

References: crates/…/age.toml• L1-10 crates/…/plain.toml• L1-13 crates/…/keepass.toml• L1-10 crates/…/password-store.toml• L1-10 crates/…/fido2.toml• L1-15 crates/…/yubikey.toml• L1-15 crates/…/plain.rs• L17-28 crates/…/plain.rs• L127-173 crates/…/keychain.rs• L98-105 crates/…/fido2.rs• L33-40 crates/…/yubikey.rs• L17-26

Encryption and storage boundaries

The provider capability determines where fnox places the secret value. An encryption provider returns protected text for the configuration. A storage provider writes the value to its store and returns the key that fnox can use later. Plain without a file is an explicit clear-text exception: it returns the supplied value as-is. A read-only provider rejects store operations because the external system remains the owner.

This boundary gives teams a simple way to choose between versioned ciphertext and centralized secret control:

ChoiceSecret source at read timeProject configuration
Encrypted project valueLocal or cloud-backed encryption keyCiphertext
Clear-text project valuePlain providerValue as supplied
Remote stored valueCloud, vault, password manager, or local storeReference
Remote read valueExisting external serviceReference only

The put_secret operation follows the same boundary. It encrypts for encryption providers and stores for providers that support remote storage. A provider that only supports reads reports that it cannot store the value.

References: crates/…/mod.rs• L174-256 crates/…/mod.rs• L298-313 crates/…/aws_sm.rs• L456-466 crates/…/plain.rs• L127-166 crates/…/azure_ac.rs• L177-184

Change checklist

When these files or sections are changed, remember to consider these:

  • Keep provider capability declarations aligned with the behavior of get_secret, encrypt, and put_secret. A wrong capability changes whether fnox writes ciphertext, stores a remote value, or rejects the operation.
  • Keep provider type metadata aligned with provider construction, profile deserialization, and wizard choices. A type that is present in one layer but missing from another cannot be selected or resolved reliably.
  • Preserve recursive provider-reference handling when adding a credential field. A direct secret value and a provider-backed field must resolve through the same cycle checks.
  • Preserve profile inheritance errors through provider and secret resolution. An invalid or cyclic profile chain must not become an empty provider or secret map.
  • Keep provider source tracking aligned with profile inheritance. A provider override must not use a stale source file when fnox resolves relative local paths.
  • Keep interactive-auth requirements accurate for hardware and CLI-backed providers. The non-interactive guard uses that flag before it attempts provider resolution.
  • Keep Kubernetes reference parsing aligned with namespace, secret name, data-key, context, and prefix behavior. A change in one part can redirect reads or make valid references fail.
  • Keep file-backed Plain providers read-only. Do not treat a plaintext source file as a writable secret store.
  • Update the relevant child page when a provider changes its access model from read-only to storage or encryption.

Important failure modes

TriggerConsequenceGuard
A secret names a provider that is not in the active profileResolution stops before fnox can read the secretAdd the provider to the selected profile and use the configured provider name
Provider settings refer to each other in a cycleProvider configuration cannot resolveKeep credential references acyclic
Active or inherited profiles form an invalid or cyclic inheritance chainSecret and provider lookup fails with the profile errorKeep profile inheritance valid and acyclic
A hardware provider runs without its required key or in a non-interactive contextEncryption or decryption fails before the secret is availableUse the physical key in an interactive flow or choose a provider suitable for unattended work
A remote provider loses access or its CLI session expiresSecret reads and writes fail even though the project reference is validRestore the service login, token, network path, or required permission
Plain is used for a sensitive valueThe value is exposed as clear text in project configurationLimit Plain to non-sensitive defaults and testing
A file-backed Plain provider receives a store request or lacks its file formatProvider setup or storage fails instead of updating the local sourceSet file and format together and use a writable provider when fnox must store a value
A Kubernetes reference omits a data key for a multi-key Secret, or names the wrong context or namespaceThe secret cannot be selected or fnox reads from the wrong cluster locationSelect the data key and verify the active Kubernetes context and namespace
A read-only provider receives a store requestfnox cannot save the value through that integrationStore the value in a provider with remote-storage capability

Key files

FileWhy to read it
crates/…/mod.rsDefines the shared provider capabilities and operations that connect all integrations to fnox. It also selects the source file for providers inherited by a profile.
crates/…/kubernetes.rsDefines the Kubernetes-backed read path and its secret reference model.
crates/…/resolver.rsExplains how provider settings and nested secret references become usable provider instances, including profile inheritance errors.
crates/…/secret_ref.rsShows the two kinds of references used in provider settings and secret entries.
crates/…/onepassword.rsShows how 1Password item and Environment references provide remote secret values.
crates/…/plain.rsShows the clear-text provider and its optional read-only file source.
crates/…/generate_providers.rsShows how provider metadata drives the common config, resolver, construction, and setup surfaces.
crates/…/age.tomlDefines the local encryption model.
crates/…/aws-sm.tomlDefines a central cloud storage provider.
crates/…/vault.tomlDefines a self-hosted or managed vault integration.
crates/…/fido2.tomlDefines a hardware-backed encryption provider and its interactive nature.
docs/…/cloud-and-vault-providers.mdChild page for remote cloud and vault systems.
docs/…/local-and-hardware-providers.mdChild page for local stores and hardware-backed systems.