A Keyring is a mechanism that encrypts sensitive data fields, such as consumer secrets, before storing them in the database. The Keyring stores keys used to encrypt and decrypt data.
This functionality provides transparent, symmetric encryption of sensitive data fields at rest. When enabled, encryption and decryption of data are done on-the-fly by Kong Gateway immediately before writing to the database and after reading from the database. Responses containing sensitive fields generated by the Admin API continue to show data as plain text. Kong Gateway runtime elements, such as plugins, can access sensitive fields transparently, without requiring additional configuration.
For wider stability, security, and more granular control over encrypted values, we recommend using Vaults and database encryption at rest for secret management:
- Whenever possible, use Vaults for any secret values. Vaults are supported in Konnect, have less performance impact on your Kong Gateway deployment, and support encrypting a wider range of values than Keyring.
- Use database encryption at rest for your PostgreSQL database. Cloud vendors such as Amazon RDS normally enable this by default.