1 Commits
Author SHA1 Message Date
alamin-br 8977543422 feat(integrations): encrypt the keys and tokens of MCP servers (#6667)
* feat(core): encrypt stored secrets with a dedicated key

A database dump or read access shouldn't reveal the credentials Baserow sends
to other services. Values say which key encrypted them, so keys can rotate.

* feat(integrations): encrypt the keys and tokens of MCP servers

They are the first secrets stored with the new encrypted field.

* docs: explain that one key encrypts every stored secret

The key, field and rotation command are shared by every secret encrypted at rest, so losing or changing the key affects all of them.

* fix(core): never decrypt written secrets and keep rows with unreadable ones loading

A written ciphertext was decrypted on save, and one unreadable value broke every query on its row.
Also reads secrets after a SECRET_KEY change, fixes the context per field, and stops the image generating a key per container.

* fix(core): keep unreadable secrets stored, never sent, and load dumps once

An unreadable secret read as empty, so moving its server skipped the credential
check and refreshing erased the tokens. Dumps were encrypted twice on load.

* fix(core): refuse encryption keys that share an id

A value names its key by id only, so the second key could never be used.

* fix(core): make reencrypt_secrets decrypt every secret and fail on any it can't

--check only counted prefixes, so missing keys and tampered values passed.

* docs: explain backups, restores and changing the encryption key

* fix(core): keep damaged secrets unusable and verify against the primary

A damaged envelope read as plain text and passed --check, and --check could
read a lagging replica instead of the database rotation writes to.

* docs: stage a first dedicated key and upgrades from development builds
2026-11-13 17:26:51 +01:00