Skip to main content
Version: Dev

RBAC

The deployed Role on the console's ServiceAccount is its entire authority. There are three Roles — one always, two opt-in — and none grants anything cluster-scoped or anything on secrets.

Read-only Role (always)

The default authority. Namespace-scoped, no mutating verb.

PurposeAPI groupResourcesVerbs
Cluster statuspostgresql.cnpg.ioclustersget (pinned by resourceNames)
Cluster watchpostgresql.cnpg.ioclusterswatch (consumed via a metadata.name field selector)
Backupspostgresql.cnpg.iobackups, scheduledbackupsget, list, watch
Instance pods""podsget, list, watch
Log tail""pods/logget (omit when ALLOW_LOGS=false)
Events""eventslist, watch
Repository reference (optional)barmancloud.cnpg.ioobjectstoresget

RBAC cannot pin list/watch by resourceNames, so the namespace plus application-side selection is the honest scope for listing; the cluster get is pinned by name. A missing optional grant degrades one panel to unknown.

Operations Role (ALLOW_OPERATIONS=true)

Exactly the four enumerated writes, pinned where the verb allows.

OperationAPI groupResourcesVerbs
On-demand backuppostgresql.cnpg.iobackupscreate
Reload / rolling restartpostgresql.cnpg.ioclusterspatch (pinned by resourceNames)
Promote (switchover)postgresql.cnpg.ioclusters/statuspatch (pinned by resourceNames)

There is no delete, no spec-replace, and nothing on secrets.

Access-review Role (ALLOW_ACCESS_REVIEW=true)

Reads on the two pgToolBox CRDs plus one status write.

PurposeAPI groupResourcesVerbs
List and follow access requestspgtoolbox.fyannk.devpgtoolboxaccessrequestsget, list, watch
Record a decisionpgtoolbox.fyannk.devpgtoolboxaccessrequests/statusupdate
Populate the role pickerpgtoolbox.fyannk.devpgtoolboxrolesget, list, watch

The console never creates or modifies users, roles, or proxy configuration; the operator's controller materializes the PgToolBoxUser after an approval.

Enforcement

The Role — not application logic — is the enforcement boundary. Apply an opt-in Role only when you set its flag: with the flag off, RBAC alone denies the writes; with the Role absent, the capability cannot act even if the flag is set. A static scan holds each example Role to exactly the shape above.