Repository navigation
Closed
Labels
priority: mediumMedium prioritystatus: in progressCurrently being worked ontype: featureNew feature or requesttype: securityRelated to securityworkload: daysLikely takes days to resolve
Milestone
Description
Problem
PluginStore.key_for() (foca/plugins/store.py) derives keys for parts that may be personal data (e.g. ctx.store.key_for("budget", subject_type, subject)) as an unkeyed SHA-256 of the namespace and the parts. Anyone with access to the database or a backup who knows a user's identifier (e.g. an LS Login sub, which appears in tokens, logs and other services) can hash it again and find that user's entries. The design of the store asked for a keyed hash; the docs currently say the hash "pseudonymizes, doesn't anonymize". Found in the v0.19.0 pre-release review.
Decision (maintainer, 2026-10-31)
Optional HMAC secret, in v0.20.0:
- New setting for the secret (e.g.
plugins.defaults.store.key_secret), meant to be set from an environment variable or a mounted secret, never committed. - With a secret,
key_for()returns HMAC-SHA256 keys with their own prefix (e.g.hk:), so they never collide with the plainh:keys. - Without a secret, keys stay plain SHA-256 (
h:), and FOCA logs a warning once at startup when a database-backed store is used. - Changing or adding the secret makes existing entries unreachable until they expire (bounded by
max_ttl); document this. - All replicas of a deployment must share the secret; the Helm library chart gets a value for it (secret reference, not a plain value).
Acceptance criteria
- Setting, HMAC keys with their own prefix, plain fallback with a one-time warning
- The secret never appears in logs, the plugin listing or error messages
- Tests for both modes, the prefix, the warning and secret rotation
- Docs: configuration reference, plugin author guide (
key_for()), operator guide (secret handling, rotation, replicas), upgrade notes - Helm library chart value and docs
Metadata
Metadata
Assignees
Labels
priority: mediumMedium prioritystatus: in progressCurrently being worked ontype: featureNew feature or requesttype: securityRelated to securityworkload: daysLikely takes days to resolve
Activity
feat(chart): pass the plugin store key secret