Skip to content

Access control ​

Who may see and do what in Probeward, from M3 on. The same rules apply to the UI, scripts with API tokens and anything else that calls the API, because there is only one place that decides: the authorisation layer in crates/probeward-server/src/authz/. How a route declares what it needs is in declaring access on a route.

The model in three sentences ​

A grant gives a user a role (viewer, operator or admin) on one node of the tree, and the role applies to that node and everything below it, like any other inherited setting. A user's role on an object is the highest role any of their grants gives on that object or on a node above it; grants only ever add, and there are no denials. A global role is simply a grant on the root of the tree, above every probe.

To restrict someone, do not give them a global role: give them a role on the probe, group or device they look after. To see why someone can see or do something, open the node's Access panel: it lists every grant that reaches the node, the node it was made on, and whether it came from an administrator or from a group of the sign-in provider.

Roles and actions ​

The API checks actions. A role is a fixed bundle of them.

ActionWhat it covers
readSee the node and everything below it: settings, status, readings, graphs, scans, incidents, the timeline, maintenance windows, discovery jobs that target it, push sensor status.
controlInstant controls: scan now, acknowledge, timed pause and resume, simulate error and clear it; ending or extending a maintenance window.
configureChange the monitoring configuration below the node: create, edit, move and delete groups, devices and sensors, node settings (interval, limits, notification rules, schedules), dependencies, the master check, sensor state, push sensor tokens, maintenance windows, discovery jobs into the node.
manageManage the branch: see and change who has access to it (the Access panel), and edit a probe node's own name and settings.
administerEverything that is not part of the tree (below). Only an admin grant on the root gives it.
RoleActions on the node and below
viewerread
operatorread, control, configure
adminread, control, configure, manage; on the root also administer

The operator role keeps the meaning it had in M2 (operators changed the monitoring configuration, used the controls and ran discovery), so existing users and tokens behave as before.

Global roles become root grants ​

The global role of M1 and M2 (role on a user) is now the user's grant on the root. It is still set on the user (Settings, Users), and it may be none: a user with no global role sees only the parts of the tree they have grants on. Users that existed before M3 keep their role, now as a root grant, so nothing changes for them.

What stays global ​

These are not part of the tree. They need administer, which only a root admin has:

  • users, their passwords, two-factor reset and their grants on the root;
  • the OIDC configuration and the mapping of provider groups to grants;
  • the credential vault: creating, changing and deleting credentials, and their allowed address ranges;
  • notification destinations: creating, changing, deleting and test sends;
  • remote probes: creating, pairing, revoking, auto-update and deleting;
  • global settings (retention, SMTP, heartbeat, public URL) and everything backups depend on;
  • schedules (the shared weekly calendars);
  • the audit record;
  • exporting and importing configuration files, of the whole tree or of a single branch;
  • sensors that run programs on the probe host (script, nagios_plugin), the sensor that runs a program on the target over SSH (ssh_script), and the sensor that sends a WQL query of the administrator's own (win_wql, see its page), and the sensors that send a database query of the administrator's own (postgres_query, mysql_query, mssql_query, see who can attach them).

A branch admin cannot export their own branch yet. An export writes the names of the credentials, destinations and schedules the branch uses, and the import compares against the whole tree; doing that within a grant's scope is not built. This is a known limit, not a promise that it stays.

A viewer on the root reads the global settings and the system status page, as before; a user without a root grant does not.

Things that are not in the tree ​

ObjectWho sees itWho changes it
Probes, groups, devices, sensorsread on the node. The names of the nodes above a user's grants are shown as the path to them, and nothing else about those nodes: no status, no settings, no siblings, no counts.configure (structure, settings), control (controls), manage (probe name and settings)
CredentialsRoot read: all of them. Others: the names and kinds of the credentials that the nodes they can see use or inherit. Never a value.administer
Using a credentialAnyone with configure on a node polls with the credential it inherits, without seeing or changing it.See credentials stay on their targets
Notification destinationsRoot read: everything but secrets, as before. Others: id, name, kind and whether it is enabled, so they can choose one in a notification rule; never the recipients, URLs or chat ids.administer
Notification rulesPart of node settings: read and configure on the node.configure
Deliveries needing attentionThose of incidents the user can see.—
SchedulesEvery signed-in user sees the definitions, so they can attach one. Where a schedule is used is listed only for nodes the user can see.administer; attaching one to a node is configure on the node
Maintenance windowsread on the node the window hangs on.create, change, delete: configure; end early, extend: control
Discovery jobs and resultsread on the job's target (its group, or its probe). The preview names an existing device at a scanned address only if the user can see it; otherwise the address is marked as outside their access and nothing about the device is shown.create, apply, cancel: configure on the target. Applying an address that already belongs to a device also needs configure on that device: discovery merges into the device wherever it is on the probe, so an address whose device is outside the user's scope is refused, without naming the device.
Incidents and their timelinesread on the incident's sensor (or device). A probe incident ("probe not reporting") needs read on the probe; users with grants only below it see their sensors go Unknown with the reason instead.acknowledge: control
TimelineEntries about nodes the user can see. Entries about no node, or about removed nodes, are shown to root readers only.—
Audit recordadminister— (append-only)
LogsThe server's own logs are on the host, not in the API.—
System status and healthRoot read. /healthz and /readyz are public, as before, and say nothing about the tree.—
API tokensTheir owner. Root admins list and revoke anyone's.Their owner (see scoped tokens)
Push sensor tokensread on the sensor sees whether one is set; configure issues and rotates. The push endpoint itself takes no login, as before.configure
DependenciesListed with the dependent node. A health check on a node the user cannot see is shown as "a device you cannot see", without its name or id.configure on the dependent; the health check must be one the user can see
Sensor kinds and templatesEvery signed-in user.Shipped with the binary.
Usersadminister. A branch admin gets a directory of user names only, to grant access.administer (accounts); manage (grants below the root)

Aggregates ​

Everything that counts, sums or lists is computed over what the caller can see: the tree and its roll-ups, alarms and incident lists, the timeline, search and filters, metrics and series, channel names reported by sensors, deliveries needing attention, discovery jobs, maintenance windows, credential usage, schedule usage, and the live event stream. An object outside a caller's scope answers 404, the same as an object that does not exist, so a guessed id tells nothing. A caller who can see an object but lacks the action gets 403. A global endpoint the caller cannot use at all (users, the audit record, global settings) answers 403: its existence is no secret.

The live event stream ​

Each connection of GET /api/v1/events filters every event against the grants of the session at the moment the event is sent. A sensor, incident, delivery, discovery or probe event about an object outside the scope is dropped. Whenever a user's access can narrow (a grant removed or replaced, a global role changed, the provider's group mappings applied again at sign-in, the user disabled, a session ended, a node moved or deleted, an import applied), every open stream re-reads the session, the user, the grants and the tree before it judges the next event, and an event that arrives while such a change is being committed waits for it. Once the change is committed, nothing about a node outside the new scope is sent. A stream whose session ended or whose user was disabled closes; the browser's reconnect is then refused and the UI asks for a login. When the grants change, an access_changed event tells the UI, which reloads the tree at once and drops what the user lost. API tokens cannot open the stream. Tree changes are announced to everyone as tree_changed with a revision number and nothing else.

The one exception is the command-line import (probeward admin import --apply), which writes from another process: a running server picks its changes up at the next configuration poll, within five seconds. Import through the API or the UI when users are connected.

Dependencies across a scope boundary ​

A sensor can be suppressed by a health check in a branch the user cannot see (the switch in the server room above the branch office). The user sees that the sensor is suppressed, and the dependency as "a device you cannot see"; the incident facts and the timeline say the same instead of the name. Creating a dependency needs configure on the dependent and read on the health check.

Credentials stay on their targets ​

In short: only root admins decide which credentials a node inherits, and a user without administer may put a device under an inherited credential only at an address inside that credential's allowed address ranges. The ranges also bind the runtime: a credential is never used on an address outside them, whoever made the change, and the sensor fails loudly saying so.

A credential reaches a device by inheritance. A branch operator must be able to use it there, and must not be able to send it somewhere else: a device whose address is the operator's own machine, under a group that inherits the domain's SSH password, would hand that password over at the first poll.

Every sensor polls its device's address (web sensors take a path, not a host), so a credential reaches exactly the addresses of the devices below the node it is set on. A device's host name only names the device to the server it reaches (the HTTP Host, the TLS server name, the Kerberos service): the connection still goes to the stored address. For that reason a host name must be a plain DNS name, letters, digits, hyphens and dots. An IP address in any spelling a URL accepts (203.0.113.5, 3405803781, 0xcb007105, IPv6), a user name (x@...), a port, a path or any other character is refused when the device is saved or imported, and a stored host name that breaks the rule fails the poll as a configuration error without sending anything. The web clients also refuse any request whose URL could connect elsewhere than the stored address. The rule is therefore about addresses:

  1. Only root admins set, change or clear the credential fields of node settings.
  2. A user without administer may create a device, change a device's address, or move a device only if every credential the device would use at its new place allows that address. A credential allows an address when an administrator has given it allowed address ranges (Settings, Credentials) that contain it. A credential without ranges allows no new addresses for such users at all: only root admins put it on new targets.
  3. A user without administer may run discovery only with credentials whose ranges cover every address the job scans, and may apply its results only where rule 2 allows the new devices. Applying merges an address into the device that already has it on the probe, in whatever group, and writes the credentials that worked into that device's empty settings; such a user may do that only to a device they may configure, and any other address is refused.
  4. Independently of who made the change, the runtime refuses to use a credential with allowed ranges on an address outside them. The sensor is not polled and shows a configuration failure that names the credential and says the address is outside its allowed ranges, never its value. The core decides this for every sensor, so the failure is the same on the local probe and on a remote one, and a remote probe never receives the refused credential. A sensor whose credential is optional (Prometheus, REST, HTTP content and script sensors take a secret only if one is inherited) fails the same way rather than running without it, even when its parameters would not send the secret: the runtime cannot tell that from outside the sensor. Set the secret lower in the tree, or add the address to the ranges.

Rules 1 to 3 are checked when the change is made, and the API refuses it with the credential's name and the node it is set on. Only rule 4 applies at run time, because only the ranges can be wrong after the fact (an administrator narrows them, a root admin places a device outside them).

Moving the device back, renaming it or changing anything else is unaffected. A refusal says which credential is in the way and where it is set, so the operator can ask an administrator to add a range.

Scoped API tokens ​

A token from M2 has a role and acts as its owner, never above that role and never above the owner's current rights. That meaning is kept: an M2 token works on every node where its owner has a role, up to the token's role.

From M3 a token can also be limited to:

  • a subtree: one probe, group or device; nodes outside it are invisible to the token, global objects included, as if its owner had no root grant;
  • a set of actions: any of read, control, configure, manage, administer.

At creation the requested actions must be ones the creator holds on the requested subtree (or, without a subtree, somewhere). On every use the token is checked against its owner's grants as they are then: a token never outlives its owner (disabled or deleted owners stop it), and a grant removed from the owner is removed from the token at once. A token whose subtree node is deleted sees nothing. A token still cannot create tokens, change passwords or two-factor settings, or open the event stream.

Single sign-on (OIDC) ​

See single sign-on for the configuration. What it means for access:

  • Users are matched by the provider's stable subject (iss and sub), never by email.
  • First login. With just-in-time provisioning off (the default) a subject that is not linked to a Probeward user is refused. With it on, the first login creates a user with no password, no global role and no grants: they see nothing until an administrator or a group mapping gives them a grant.
  • Group mappings. An administrator can map a value of a groups claim (claim name configurable) to a role on a node or on the root. The mapping is evaluated at every login: grants from groups the user is in are added, grants from groups they left are removed. Such grants are marked with the group they came from and cannot be removed by hand.
  • Local accounts keep working beside OIDC. An administrator can require OIDC for everyone except users marked break-glass. The last administrator who can sign in locally cannot be demoted, disabled, have the break-glass mark taken away while OIDC is required, or be locked out by requiring OIDC: every such change is refused.
  • Two-factor login (TOTP) applies to local logins. For OIDC logins the provider is responsible for the second factor.
  • A login belongs to the browser that started it. Its state is bound to that browser by a cookie, works once and expires after ten minutes. A callback from any other client is refused and leaves the login in place, so it can neither sign in as the user nor cancel their sign-in.

Audit ​

Grant changes (who, on which node, which role, before and after), group mapping and OIDC configuration changes, every OIDC login (success, and refusal with the reason), and the scope and actions of every token created are written to the audit record. Tokens, codes, client secrets and ID tokens are never written.

AGPL-3.0-only