Skip to main content
On this page

Access Control

Manage users, roles, policies, and OIDC sign-in under Access Control. OIDC can replace or complement local password authentication and is available in Community (see Licensing). The workspace has three tabs:

TabCovers
Access RulesPolicies, grants, reason codes, and the access check — the rules that decide who can open which protocol on which host
DirectoryUsers, groups, and roles
SSOOIDC single sign-on configuration

Capability-gated UI

The UI hides or makes actions read-only according to the caller’s RBAC capabilities, including connection launch, custom-field editing, audit views, and session controls. The backend checks permissions independently.

Core concepts

TermMeaning
UserA local or OIDC-provisioned account
GroupA named collection of users
RoleA named collection of policies
PolicyAn allow/deny rule: effect × actions[] × resource_types[] × optional constraints
PolicyBindingAttaches a role to a user or group, optionally scoped to a specific resource
RoleAssignmentAssigns a role directly to a user (bypasses the group step)
API tokenA per-user bearer credential with its own explicit action/resource-type scope

Policies

A policy defines a rule that either allows or denies a set of actions on a set of resource types:

Policy {
  name:           "Allow SSH to production"
  effect:         "allow"          // or "deny"
  actions:        ["CONNECT"]
  resource_types: ["CONNECTION_TARGET"]
  subjects:       ["group:<group-id>"]
  resources:      ["connection_target:<target-id>"]
  constraints:    { "device_role": "server" }   // optional JSON
}

Available actions

ActionMeaning
CREATECreate a new resource
READRead a resource
UPDATEModify an existing resource
DELETERemove a resource
CONNECTOpen a session to a connection target
OBSERVEObserve a target through a read-only visual surface (used by MCP VNC capture)
EXECUTERun commands (MCP SSH tools, playbook runs)
MANAGE_ROLESAdminister roles and role assignments
MANAGE_POLICIESAdminister policies and policy bindings
VIEW_AUDITAudit-level review (e.g. other users' assistant conversations)
SECRETRead secret values (used by MCP and session credential resolution)
WRITEGeneric write access (used by some admin operations)

CCTV actions

Cameras and recorders use the dedicated resource type CCTV with six actions: CCTV_VIEW, CCTV_RECORDINGS, CCTV_EXPORT, CCTV_USERS, CCTV_SETTINGS, and CCTV_PTZ.

Only these six actions pair with CCTV; they cannot be used with other resource types.

Watching recorded footage (CCTV_RECORDINGS) and downloading a copy (CCTV_EXPORT) are separate grants. See CCTV.

The seeded cctv-operator role includes all six actions; admin:full-access covers CCTV automatically. In personal API tokens, CCTV scopes render as cctv:<operation> (cctv:view, cctv:ptz).

Evaluation rules

  • A deny policy beats any allow — if any matching policy has effect: "deny", the result is Deny.
  • The evaluator collects all policies reachable from the requesting user (via groups, role assignments, and direct bindings) and returns Allow only if at least one allow rule matches and no deny rule matches.
  • Constraints are optional JSON conditions that narrow when the policy fires. For example, restrict CONNECT to targets with a specific device_role or tenant.
  • The access check under Access Rules (backed by POST /api/v1/admin/access-control/access-evaluations) simulates a user × action × resource triple and shows the resulting decision — use it to debug policy stacks.

Define broad allows at the group or role level, and use deny policies for explicit exceptions.

Groups and roles

Users are organised into groups. Roles bundle policies. There are three binding paths, all evaluated together:

User → Group → Role → Policy
User → RoleAssignment → Role → Policy
User → PolicyBinding → Policy   (direct policy bind, no role intermediary)

The union of all matching policies from all three paths forms the effective permission set for a request.

Assign roles to groups rather than individual users; use RoleAssignment for one-off exceptions.

SSO / OIDC

OIDC single sign-on is configured in Access Control → SSO. Once enabled, users can sign in through any OIDC-compatible provider (Keycloak, Authentik, Azure AD, Okta, etc.).

Key settings:

SettingDescription
enabledMaster switch for the OIDC login path
issuer_urlOIDC issuer URL (e.g., https://keycloak.your-company.com/realms/piping)
client_idRegistered client ID
client_secretClient secret — stored through the secrets layer, never in plain config
redirect_urlCallback URL registered with the provider
scopesRequested OIDC scopes
group_claimToken claim used for group mapping
provisioning_modemanual or jit — how OIDC users are mapped to local users on first login

With jit provisioning, OIDC users are created automatically on first login. The local password login path can coexist with OIDC or be disabled. The SSO tab includes a Test connection check (POST /api/v1/admin/auth/oidc/test-connection) to validate issuer discovery before enabling.

# Example: minimal OIDC config (set via API or the SSO tab)
issuer_url: 'https://keycloak.your-company.com/realms/piping'
client_id: 'piping'
client_secret: '<stored-as-secret>'
provisioning_mode: 'jit'

API tokens

Each user can create personal API tokens in Account → Settings → API Tokens (see User settings), scoped to specific actions and resource types. Tokens are the authentication mechanism for the MCP server and for programmatic API access.

UserApiToken {
  name:         "ci-pipeline-token"
  token_prefix: "pat_..."
  scopes: [
    { action: "read",    resource_type: "inventory",         resource_pattern: "*" },
    { action: "connect", resource_type: "connection_target", resource_pattern: "*" }
  ]
  status:       "active"      // or "revoked"
  expires_at:   null          // optional RFC3339 timestamp
  last_used_at: "2025-06-01T10:00:00Z"
}

The supported action/resource pairs are listed by GET /api/v1/user/settings/api-tokens/scope-catalog. The optional resource_pattern narrows a scope from all objects (*) to specific ones (e.g. connection_target:<id>).

A request authenticated by token is subject to both the token's explicit scopes and the user's policy-derived permissions; effective access is the intersection of both.

Tokens are stored hashed. The plaintext is shown once at creation time. If a token is lost, revoke it and create a replacement.

To create a token:

POST /api/v1/user/settings/api-tokens
{
  "name": "my-token",
  "scopes": [
    { "action": "read",    "resource_type": "inventory" },
    { "action": "connect", "resource_type": "connection_target" }
  ],
  "expires_in_seconds": 2592000
}
# Action/resource strings are case-insensitive; an omitted resource_pattern defaults to "*"
# Response includes the full plaintext token — copy it now

Audit

The audit context records session lifecycle events and resource-access events as an append-only log. Each AuditEvent carries:

AuditEvent {
  event_type:  "connection.session.created"   // e.g., connection.session.*, mcp.tool.invoked
  actor_id:    "<user-uuid>"
  target_type: "connection_target"
  target_id:   "<target-uuid>"
  metadata:    { "protocol": "ssh", "session_id": "..." }
  created_at:  "2025-06-01T10:00:00Z"
}

Key event types:

Event typeMeaning
connection.session.createdA session record was created
connection.session.activatedThe session went active
connection.session.disconnectedThe client disconnected
connection.session.terminatedThe session was terminated
connection.session.failedThe session failed to establish
mcp.tool.invokedAn MCP tool was called
secrets.resolveA secret value was resolved
inventory.<entity>.created / .updated / .deletedInventory mutations

Audit events are immutable. Viewing the audit log requires VIEW_AUDIT on AUDIT_EVENT. Query and filter via GET /api/v1/audit/events; see Audit log.

REST API reference

MethodPathPurpose
GET / POST/api/v1/admin/access-control/usersList / create users
GET / PUT / DELETE/api/v1/admin/access-control/users/{id}Read / update / delete user
PUT/api/v1/admin/access-control/users/{id}/passwordRotate password
GET / POST/api/v1/admin/access-control/groupsList / create groups
GET / POST/api/v1/admin/access-control/rolesList / create roles
GET/api/v1/admin/access-control/roles/{id}/grantsEffective grants of a role
GET / POST/api/v1/admin/access-control/role-assignmentsList / create role assignments
GET / POST/api/v1/admin/access-control/policiesList / create policies
POST/api/v1/admin/access-control/policies/{id}/enable (/disable)Toggle a policy
POST/api/v1/admin/access-control/access-evaluationsSimulate an access decision
GET / POST/api/v1/user/settings/api-tokensList / create own API tokens
GET/api/v1/user/settings/api-tokens/scope-catalogSupported token scopes
POST/api/v1/user/settings/api-tokens/{id}/revokeRevoke API token
GET/api/v1/audit/eventsQuery audit log
GET / PUT/api/v1/admin/auth/oidc/settingsRead / update OIDC settings

Users, groups, roles, and policies also expose /bulk endpoints. The authoritative route list is the OpenAPI contract — see API reference.