Skip to content

docs: state the catalog trust boundary for the credential encryption key - #228

Open
LeeroyHannigan wants to merge 1 commit into
mainfrom
docs/catalog-trust-boundary
Open

docs: state the catalog trust boundary for the credential encryption key#228
LeeroyHannigan wants to merge 1 commit into
mainfrom
docs/catalog-trust-boundary

Conversation

@LeeroyHannigan

Copy link
Copy Markdown
Collaborator

What

State the catalog trust boundary for the credential encryption key in the security model. The doc noted that the key lives in the catalog database and that a catalog backup includes it, but left the consequence to inference and did not mention that no rotation path exists.

  • Add the catalog database contents as an explicit trust boundary: the encryption key and the ciphertext it protects share one trust domain, so catalog read access yields every stored access key secret.
  • Scope that boundary to direct database access — the management API and console redact encryption_key from settings responses.
  • Record that there is no key rotation path; re-keying means re-creating the affected access keys.
  • Replace the vague "use a KMS-backed encryption layer at the PostgreSQL level" guidance with what extenddb does and does not do, and what below-extenddb protection can and cannot achieve.
  • State that a catalog dump is credential-equivalent and should not be copied to less-protected environments.

Why

The security model understated a real trust boundary. Making it explicit lets operators
protect the catalog database and its backups to the standard the credentials require,
and sets up a follow-up RFC on key wrapping / rotation.

Closes #

Testing done

Documentation only, no code change:

  • Key storage location and unwrapped form: bootstrapper.rs:261 (INSERT INTO settings ... VALUES ('encryption_key', $1)).
  • encryption_key redacted from settings API/console responses: settings.rs:19-25 (REDACTED_KEYS).
  • No rotation path: grep of crates/ for rotation/re-key logic returns nothing.

Checklist

  • I have read CONTRIBUTING.md
  • All tests pass (cargo test --workspace)
  • Code is formatted (cargo fmt --check)
  • Clippy is clean (cargo clippy -- -W clippy::pedantic)
  • I have added or updated tests for new functionality
  • I have updated documentation if behavior changed
  • Breaking changes are noted below (if any)
  • If this changes the wire protocol, Storage trait, auth model, on-disk
    format, or public CLI surface, an RFC has been accepted or is linked
    below. Otherwise, an ADR captures the decision (link below).

ADR / RFC: n/a — documentation only, no behavior change.

Breaking changes

None.


By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache License 2.0 and I agree to the Developer Certificate of
Origin (DCO). See CONTRIBUTING.md for details.

The security model noted that the encryption key lives in the catalog
database and that a catalog backup includes it, but left the consequence for
the reader to infer and did not mention that no rotation path exists.

- Add the catalog database contents as an explicit trust boundary: the key
  and the ciphertext it protects share one trust domain, so catalog read
  access yields every stored access key secret.
- Scope that boundary to direct database access — the management API and
  console redact `encryption_key` from settings responses.
- Record that there is no key rotation path; re-keying means re-creating the
  affected access keys.
- Replace the vague "use a KMS-backed encryption layer at the PostgreSQL
  level" guidance with what extenddb does and does not do, and what
  below-extenddb protection can and cannot achieve.
- State that a catalog dump is credential-equivalent and should not be copied
  to less-protected environments.
- **PostgreSQL security**: extenddb relies on PostgreSQL access controls and network security. Securing the PostgreSQL instance (firewall rules, TLS, authentication) is the operator's responsibility.
- **Operating system security**: File permissions on `extenddb.toml`, TLS keys, and the PID file are the operator's responsibility.
- **Key management**: Access key secrets are encrypted with a locally generated AES key stored in the catalog database. For HSM-grade key management, use a KMS-backed encryption layer at the PostgreSQL level.
- **Key management**: extenddb generates the credential encryption key locally and stores it unwrapped in the catalog database. It does not wrap the key with an external KMS or HSM, derive it from an operator passphrase, or rotate it. Deployments that require any of those must add protection below extenddb — for example PostgreSQL transparent data encryption, an encrypted volume, or a managed database with a customer-managed KMS key — which protects the key at rest but not from a principal that can query the catalog.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe something for the backlog here: pluggable support for generating/managing credential encryption keys. Seems like this would be important for a lot of users.

@jcshepherd jcshepherd left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for documenting this. I think it'd be good to cut an issue to support other, more secure, mechanisms for handling the credential encryption key like the ones you mentioned: HSM, passcodes, etc. Status quo is probably not sufficient for many production uses.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants