Security
Who can see and change a map, the threat model, and the checklist.
Who can see and change a map
- Membership and roles decide everything (roles). The API checks them on every request, and checks the role again inside the transaction of an approval. The server’s own Postgres role owns its tables; versions and the audit refuse every change and deletion by trigger.
- Reviewers you invite see the plain level only: no table names, no code, no production data.
- Links read each product as you. Cases never shows you a table, a trace or a commit you could not open in that product. In Sypnia Cloud, the Cases server and Sypnia Data’s control plane share a key, kept in AWS Systems Manager. Cases calls the control plane with it (
Authorization: Service <key>) and the id of the person it verified, so every kind of session works, those bound to a key included. The control plane accepts such a call only on the routes Cases needs (who you are, the Data project, its link to the map, its schema and the SQL that reads deliveries), and still checks your role in that project. The control plane forwards a map uploaded to Data to its Cases map the same way. A server you run yourself presents your own token to the other product. A Telemetry read token you link to a map is kept encrypted (AES-256-GCM, withCASES_SECRET_KEY). - Tokens: a session bound to a key is accepted only with its DPoP proof, so a copied one is useless; a personal access token is checked with its issuer; a Cases project token (
syp_cpt_…) works on one map, as an editor, and never approves. Project tokens are shown once and kept as a SHA-256 hash and their last 4 characters (API). - Rate limit: 600 requests a minute per credential by default (
CASES_RATE_LIMIT), then429withRetry-After.
In Sypnia Cloud
A workspace is a Sypnia organization. The server reads your role from Sypnia (GET /v1/me of the control plane, on your behalf), keeps it for 60 seconds, and reads it again for every approval. Roles map like this:
| Role in the organization | Role in Cases |
|---|---|
| owner | owner |
| admin | approver |
| developer | editor |
| viewer | reviewer (plain level, comments) |
Members and their roles are managed in the organization; Cases only invites reviewers.
Threat model
| Threat | What stops it |
|---|---|
| Someone approves beyond their role | the role is checked inside the transaction that creates the version |
| An agent rewrites the scope | agents and project tokens can only open proposals; approval needs a person with the role |
| A leaked repository token | encrypted with KMS, the least access the sync needs (one repository, contents only), revocable from Settings |
| Malicious text in a case (script, Markdown tricks) | case text is data: never rendered as HTML, escaped in every export |
| A map reveals sensitive internals | the plain level hides data and code; table names show only to members |
| History rewritten to hide a change | versions are insert-only, enforced by a trigger; the audit table records every action and refuses changes too |
| A request that skips CloudFront | with CASES_ORIGIN_SECRET set, the server answers only requests that carry the shared header |
Checklist for self-hosting
- Put the server behind TLS; set
CASES_PUBLIC_URLto the HTTPS address. - Use a dedicated Postgres role for the server, without superuser, that owns the database (the compose file does this).
- Set
CASES_SECRET_KEY(32 bytes) so tokens of other products are kept encrypted. - Point
CASES_AUTH_ISSUERonly at an issuer you control. - Give the repository token access to one repository’s contents only.