Security model
What Rivergate protects, how, and what remains your responsibility when you run it.
Objectives
- Prevent unauthorized secret disclosure and cross-tenant access.
- Protect the confidentiality and integrity of stored secret versions and wrapped keys.
- Make every secret access attributable, and make audit failure impossible to ignore.
- Limit the blast radius if the API, database, Redis, dashboard or a Kubernetes cluster is compromised.
- Support safe rotation, recovery, upgrades and incident response.
Encryption at rest does not protect against a compromised authorized process that can itself decrypt values. Defence is layered for that reason.
Threats and controls
| Threat | Controls |
|---|---|
| Cross-tenant reads or writes | Policy checks, tenant-scoped SQL, composite foreign keys, non-enumerating errors, and ciphertext bound to its tenant and resource. |
| Unauthorized secret read | A distinct read-value permission, exact resource authorization, short-lived credentials, and audit-before-disclosure. |
| Stolen database snapshot | Per-version AES-256-GCM, layered key wrapping (root, organization, project, data key), and a root key held outside the database. |
| Redis loss or compromise | Redis holds no secrets, keys or audit data; sign-in state is short-lived, single-use and encrypted. |
| Token theft or replay | High-entropy, expiring, user-bound tokens stored only as hashes; immediate revocation; HttpOnly, SameSite cookies and CSRF checks. |
| Telemetry or log leakage | Body redaction, allowlisted attributes, bounded labels and no secret capture in traces, metrics or logs. |
| Key compromise | Scoped key hierarchy, versioned keys, rewrap jobs and a documented containment procedure. |
| Audit history rewrite | Append-only triggers, canonical hash chains, separately held signing keys and signed checkpoints. |
| Operator abuse | Audited bootstrap and handoff, time-limited out-of-band recovery, least privilege. |
| Kubernetes exposure | Exact workload identity, namespaced RBAC, scoped policies, and a no-list, no-cross-namespace Operator. |
Authentication and authorization
- Authorization is enforced on the backend for every protected operation, including background jobs and the Operator. It is default-deny and scoped by organization, project, environment and secret.
- Metadata and value access are different actions. The system administrator role grants no secret access.
- OIDC identities are keyed on
(issuer, subject); email, groups and frontend claims never grant access. - Browser sessions use HttpOnly,
SameSite=Laxcookies,Securein production, and CSRF headers on mutations. Rivergate stores only verifiers of sessions, CSRF values, API tokens and workload tokens. - Personal tokens expire within 90 days and inherit their owner’s live permissions. Workload tokens last five minutes and are issued only after their exchange is audited.
See Authentication and Secrets and access.
Encryption and keys
- AES-256-GCM envelope encryption with a fresh data key per version and associated data binding each value to its organization, project, environment, secret and version.
- The root key lives outside PostgreSQL and Redis; only wrapped keys are stored.
- Rivergate uses vetted standard-library cryptography and implements no primitives of its own. It makes no claim of FIPS validation or quantum safety.
See Keys and encryption.
Audit
- Security events are recorded in a hash-chained, append-only log, with signed checkpoints.
- A secret value is never returned unless its read event is durably committed. There is no bypass.
- The audit log never contains values, credentials, private keys or raw tokens.
See Audit log.
Secure handling rules
- Secret values appear only in request and response bodies of value endpoints — never in URLs, headers, logs, traces, metrics, audit records, Redis or error messages.
- Value responses disable caching. Encryption happens before persistence; decryption happens only after authorization.
- Request size, timeouts and page sizes are bounded. SQL is parameterized.
- Use TLS for clients, PostgreSQL, Redis and any key provider in production, with certificate validation.
- Use separate database credentials for migrations and for runtime. Rivergate does not create database grants for you.
- Do not expose debug, metrics or worker-health endpoints outside a private administrative network.
Kubernetes delivery
- Rivergate validates projected workload JWTs against an explicitly configured issuer, JWKS and audience, mapped to an exact cluster, namespace, ServiceAccount name and UID.
- The Operator is namespaced, cannot list Secrets, and never stores source values in custom resources or status.
- A delivered value is plaintext inside Kubernetes. Enable etcd encryption at rest and restrict namespace and node access. Revoking Rivergate access stops future reads but does not erase delivered values.
See Kubernetes Operator.
Incident response
Prepare runbooks for: a leaked machine or personal token, suspected database exfiltration, root, organization or project key compromise, audit checkpoint failure, a malicious insider, a Redis outage, corrupted ciphertext, a failed key rotation and lost key material.
- Revoke sessions and tokens, and disable affected integrations and identities.
- Preserve forensic metadata without copying secret content into tickets.
- Rewrapping after containment protects future storage; it does not undo plaintext or keys already copied. Rotate affected real credentials too.
- Key loss can be unrecoverable. See Backup and recovery.
Your responsibilities as the operator
| Area | You provide |
|---|---|
| Keys | Protected, separately backed-up root-key and signing-key material; host access controls and disk encryption. |
| Database | TLS, encrypted backups, restricted runtime role, failover and restore testing. |
| Audit | An independent place for signed checkpoints and public keys, and monitoring of audit health. |
| Network | TLS termination, private metrics, egress control and log redaction. |
| Kubernetes | etcd encryption at rest, namespace RBAC, a cleanup procedure for revoked workloads. |
| Identity | Your OIDC provider, its MFA and lifecycle policy, and prompt disabling of departed users in Rivergate. |