Roles & Permissions API
Infracast uses five roles. Each maps to a fixed permission set — permissions are not individually assignable, so access is granted by choosing the appropriate role.
| Role | Level | Intended for |
|---|---|---|
read-only | 1 | Stakeholders who need visibility into assets and findings |
auditor | 2 | Assessors and auditors — adds audit-log access |
security-analyst | 3 | Day-to-day operators — can run discovery and audits |
tenant-admin | 4 | Owns the tenant: users, credentials, integrations |
system-admin | 5 | Platform operators. Not used in normal customer tenants |
Levels matter: they drive the escalation rules described below.
List roles
GET /api/v1/tenants/{tenantID}/roles
Requires tenant:read. Returns an array (not an object) of every role with its permissions and
level:
[
{
"role": "read-only",
"permissions": [
"tenant:read", "nodes:read", "jobs:read", "findings:read",
"evidence:read", "poam:read", "questionnaire:read",
"assessment:read", "rules:read"
],
"level": 1
},
{
"role": "auditor",
"permissions": [
"tenant:read", "nodes:read", "jobs:read", "findings:read",
"logs:read", "evidence:read", "poam:read", "conmon:read",
"questionnaire:read", "assessment:read",
"attestation_evidence:read", "rules:read"
],
"level": 2
}
]
Permission strings are resource:action — for example nodes:read, findings:read,
users:manage. The full list per role is returned by this endpoint; treat it as the source of truth
rather than hardcoding a copy.
Change a user's role
PUT /api/v1/tenants/{tenantID}/users/{userID}/role
Requires the roles:manage permission (tenant admin or higher).
Request body:
{ "role": "security-analyst" }
Returns 200 on success. The change is written to the audit log with the previous and new role.
Guard rails
Four rules are enforced, each returning 403:
| Rule | Message |
|---|---|
| You cannot change your own role | cannot change your own role |
| You cannot grant a role above your own | cannot assign a role higher than your own |
| You cannot modify a user more privileged than you | cannot modify a user with higher role than your own |
| The target must be in your tenant | user does not belong to this tenant |
system-adminsystem-admin is level 5 and tenant-admin is level 4, so the "no role above your own" rule blocks
it. This is deliberate — system-admin is a platform-operator role that spans tenants, not a
stronger customer admin.
An unknown role returns 400 invalid role: must be one of read-only, auditor, security-analyst, tenant-admin, system-admin. An empty role returns 400 role is required.
Because nobody can change their own role, a tenant with exactly one admin cannot self-service a
change to that admin. Keep two users at tenant-admin so they can administer each other.
Related
- API Overview — authentication and common conventions
- Authentication — obtaining a token