The file system vault reads secrets from files on the Kong Gateway data plane’s local filesystem. This vault type doesn’t require any external services or credentials.
You can set up a file system vault in one of the following ways:
- Using the Vault entity
- Using environment variables, set at Kong Gateway startup
- Using parameters in
kong.conf, set at Kong Gateway startup
The Vault entity can only be used once the database is initialized. Secrets for values that are used before the database is initialized can’t make use of the Vaults entity.
Cloud Gateway limitations: The file system vault backend is not supported on Dedicated Cloud Gateways or Serverless Gateways. These gateways don’t provide access to the data plane’s local filesystem, so secret files can’t be stored there.
Secrets can be plain text files or JSON files. Set vaults.config.prefix to the directory containing your secret files, then reference secrets relative to that directory:
|
Format |
Example |
Reference format |
|---|---|---|
| JSON file (multiple secrets) |
|
{vault://VAULT_PREFIX/filename.json/key}
|
| Plain text file (single secret) |
|
{vault://VAULT_PREFIX/filename.txt}
|