Users, groups and roles
Visibility in Zabbix is two questions asked separately: what may you see — answered by user groups and their permissions on host groups — and what may you do — answered by your role. The lab built a limited user who could see exactly one host and change nothing, and then it watched both halves hold.
The cast of a fresh install is small: users Admin and guest; user groups for the administrators, the disabled, the guests, and the enabled debug mode; and four roles — User (1), Admin (2), Super admin (3, worn by Admin), Guest (4). Roles govern the controls: which menus exist, whether you may create hosts, acknowledge problems, run scripts, use the API. They never grant sight of a host. Sight is the other machinery.
That machinery runs through user groups: a group of users is granted a permission — read, or read-write — on a group of hosts. The lab created a Lab viewers group (usrgrpid 14) with read on the host group Linux servers (group 2), and then created its limited user into that group:
{"username": "rookie", "name": "Lab Rookie", "passwd": "…",
"roleid": "1", "usrgrps": [{"usrgrpid": "14"}]}
roleid 1 is the User role: see the
monitoring pages, acknowledge
problems, and no administration at
all. The creation survived one refusal
first, and the refusal is worth
quoting because it is the password
policy introducing itself: the
password the lab first chose
contained the user name, and user
creation came back with the policy's
own words — passwords must not contain
the user name or surname, must vary
their characters, must not be among
the commonest passwords on the
system's list. A longer, unconnected
passphrase (Valve-Watch-42, in this
guide's invented vein) was accepted,
and rookie became userid 3.
The proof was run from both sides:
- Seeing: logged in as rookie,
host.getreturned one host —lab-server, hostid 10683, the only member of Linux servers. Every other host in the system — and the server keeps a few of its own — was simply absent from the answer, not redacted, not forbidden: invisible. - Doing: the same token asked to
host.createa machine of its own, and the API answered, in its flat way:No permissions to call "host.create".The User role does not merely hide the button; the method itself refuses.
That pairing is the model to remember. Groups draw the map of what exists for you; the role decides which verbs you may use on the part of the map you can see; and the API enforces both identically to the web pages, so a script holding a limited user's token is limited in exactly the user's ways. Two warnings ride along, both structural. Admin's powers are total: the super admin role sees every host group by right, which is why chapter 4 changed its password before doing anything else. And API tokens — the alternative to passwords for scripts — inherit their user's limits and deserve the same filing as passwords; a token pasted into a script on a shared machine is a key left in a door. The lab used a password login and a token file in a scratch directory for exactly that reason.
The check. The user question has a yes/no test: log in as the limited user and ask for everything — you should receive exactly your group's slice and a refusal when you reach beyond it, which is transcript t07 in one sentence. An installation where every account can see every host has skipped this chapter, and its audit trail will show it.