Rivergate

Secrets and access

How secrets are created, versioned and retired, and how roles and scoped policies decide who can read or change them.

Secret types and fields

A secret is created inside an environment with a JSON body:

{
  "name": "database-password",
  "type": "database",
  "value": "…",
  "description": "Primary database credential",
  "tags": ["payments", "prod"],
  "expires_at": "2027-06-30T00:00:00Z"
}
FieldRequiredNotes
nameyesValidated and unique within the environment.
typeyesgeneric, database, api_key, password, certificate or json.
valueyesUp to 1 MiB. For json it must parse as JSON. Sent only in a request body.
descriptionnoFree text metadata.
tagsnoValidated labels.
expires_atnoExpiration metadata. Expired secrets fail closed on read.

The certificate type stores certificate or key material as an ordinary secret. Rivergate does not issue certificates.

The secret lifecycle

ActionEffect
CreateCreates the secret and immutable version 1. Returns metadata only.
UpdateReplaces metadata and value and appends a new immutable version.
Read metadataReturns the record and its current version number. No value.
Read valueDecrypts and returns the current value, or a chosen version. Authorized and audited first.
List versionsVersion numbers, creator and timestamps. Paginated with before and limit. No values.
RollbackRe-encrypts a chosen historical value as a new current version. History is not rewound or overwritten.
DeleteSoft-deletes the secret. Retained versions stay in PostgreSQL but are unavailable through the API.
Retention

Soft deletion keeps encrypted history. Rivergate does not purge historical ciphertext automatically; plan retention as part of your backup policy.

Roles and permissions

Authorization is default-deny. A role is a fixed set of actions; if a role does not list an action, it cannot perform it.

RoleRead metadataRead valueWrite secretsManage policyRead auditManage keysManage org
owner✓✓✓✓✓✓✓
admin✓✓✓✓✓✓
developer✓✓
secret_reader✓✓
auditor✓✓
operator✓
machineMembership marker only. Grants no action; needs a scoped policy.
system_adminIdentity and platform administration only. No secret access.

Note that developer can write a secret but not read its value back, and only owner and admin can manage policy.

Memberships and scoped policies

Access has two layers.

  1. Organization membership gives a person an organization-wide role.
  2. Scoped policy bindings grant a role at a narrower scope: a project, an environment or a single secret.

Bindings inherit downward: a project binding applies to its environments and secrets; an environment binding applies to its secrets; a secret binding applies only to that secret. There is no way to bind a role across organizations.

// POST /api/v1/organizations/{organization}/members
{ "principal_id": "PRINCIPAL_ID", "role": "developer" }

// POST /api/v1/organizations/{organization}/policies
{ "principal_id": "PRINCIPAL_ID", "scope_type": "environment", "scope_id": "ENVIRONMENT_ID", "role": "secret_reader" }

Machine principals

Workloads such as the Kubernetes Operator authenticate as machine principals. A machine joins an organization with the machine role, which grants nothing by itself; you then give it the narrowest scoped policy that does the job, ideally secret_reader on one secret. Machine principals cannot receive organization-wide bindings and can never become system administrators. See workload identity.

Least-privilege patterns