Gardience Documentation gardience.com →
Docs / Administration

Users and roles

Every person who signs in to the console holds exactly one role. The role decides what they can see and change. Gardience also uses two service identities of its own, which no person can take.

The roles

A "grant" below is a permission in the Salt master's access list. Operators, approvers and help desk users get grants written as gdn:<function>. Salt never matches these against a real function, so their own Salt session is read-only. Gardience reads the grants when they sign in, checks approvals, change windows and locks, and only then runs the change as its automation identity. The audit log records the person who asked.

RoleWhat it can do
adminEverything in the console: settings, single sign-on, the license, runbooks, workflows, users' API keys and node approval. Like every other role, an admin's changes go through Gardience (approvals, change windows, locks, audit); their own Salt session can only read. Raw Salt rights exist only in the break-glass account (below).
approverRequests any change through Gardience (gdn:.*), reads fleet data, and approves runs launched by someone else.
operatorRequests any change through Gardience (gdn:.*) and reads fleet data. Builds workflows, which an approver reviews before they can run. Cannot approve.
helpdesk-windowsOn Windows nodes only: restart a service, reboot, install a package, and ping. Sees only Windows machines (a team scope of the Windows group, unless you give it another; see Team scopes).
viewerReads only. Can ping nodes and read node details.

The read access that operators and approvers share covers: test.ping, grains.items, grains.item, grains.get, grains.ls, pkg.list_upgrades, pkg.list_pkgs, service.status, service.get_all, win_wua.list, gardience.baseline, gardience.inventory and job results.

Two rules apply to every role:

Service identities

Gardience creates these at install. They are not people and cannot be removed.

AccountRoleUsed for
gardience-scannerscannerReading patch status, baselines and the list of enrolled nodes.
gardience-automationautomationCarrying out changes after Gardience's checks pass.

Their passwords are random and stored in the install's .env file (SVC_PASS and AUTOMATION_PASS).

Team scopes

A team scope limits a person to some node groups: they see and change only the machines in them. Use it when one team runs the web servers and another the databases, or a contractor looks after one site. People without a scope see the whole fleet. Admins are never limited, because they manage scopes.

sudo /opt/gardience/gardience user scope sam "Web servers,Web staging"   # limit sam to two node groups
sudo /opt/gardience/gardience user scope sam --clear                    # the whole fleet again
sudo /opt/gardience/gardience users                                     # who is limited to what

The groups are any node groups on the Groups page, built in or your own. The new limits apply from the person's next sign-in (setting a scope ends their open sessions). For single sign-on, set Limit to node groups on the group mapping instead; see Single sign-on.

What a limited person gets:

If a group's membership cannot be worked out (the Salt master is restarting), the limited person's request is refused for a moment rather than shown unfiltered. The release check signs in as a limited person, calls every read route the console has, and fails if any machine outside the scope appears.

Manage accounts on an all-in-one install

An all-in-one install runs its own Salt master. Accounts live in config/users.yaml in the install directory. Run these commands as root (or as a user that can run Docker) from any directory, using the full path to the gardience command (/opt/gardience/gardience by default).

To list accounts:

/opt/gardience/gardience users

Each line shows the name, the role and the sign-in type (file for a local account, ldap for a directory account).

To add a local account:

  1. Run:

    /opt/gardience/gardience user add alice operator
  2. Copy the password it prints. It is 20 random characters and is shown once.
  3. Give the password to the person over a safe channel.

To add a directory (LDAP or Active Directory) account, set up the directory first (see Single sign-on), then:

/opt/gardience/gardience user add alice operator --ldap

No password is created. The person signs in with their directory password.

Everyone with a local account can change their own password in the console: select your name at the top of any page (Your account), enter the current password and the new one. The change takes effect within about 15 seconds and signs out your other open sessions. Directory and single sign-on accounts change their password in the directory.

Your account also lists where you are signed in right now (when each session started, its address, and its browser) with Sign out everywhere else, which ends every session but the one you are using. Admins see everyone's open sessions under Your account > Signed in now and can sign out any one of them; that is recorded in the audit log.

An admin can reset someone else's local password under Your account > People > Reset password. Gardience shows a one-time password once; give it to the person over a safe channel. Their open sessions end, and at their next sign-in every page asks them to choose their own password before anything else. Changes, refused attempts and resets are written to the audit log.

To set a new password for a local account from the server:

/opt/gardience/gardience user passwd alice

The new password is printed once.

To change someone's role, run user add again with the same name and the new role. This replaces the account and, for a local account, prints a new password.

To remove an account:

/opt/gardience/gardience user del alice

Removal takes effect in two steps:

Each of these commands rewrites the Salt master's permissions and restarts the Salt master and the Gardience service, then waits for the console to answer.

Password rules

Local passwords must be at least 12 characters. The commands above always generate a 20-character password. Gardience stores only a SHA-512 crypt hash.

Manage admins and approvers in attach mode

In attach mode, Gardience uses a Salt master you already run. People and their Salt rights live in that master's external_auth settings, not in Gardience (see Attach to an existing Salt master). Gardience only needs to know who administers it and who may approve runs.

To see the current lists:

/opt/gardience/gardience roles

To set them:

/opt/gardience/gardience roles --admins alice --approvers bob,carol

Points to know:

You can also set both lists at install time with the installer's --admins and --approvers options. See Installer options.

Reserved names

These names belong to Gardience. Nobody can be created with them, sign in with them, or arrive with them through single sign-on. The match ignores case.

Only gardience-scanner and gardience-automation can hold the scanner and automation roles.

One-time codes (MFA) for local accounts

Local and directory accounts can add a second factor: a 6-digit code from any authenticator app (Microsoft Authenticator, Google Authenticator, 1Password, Authy and others: the standard time-based codes, RFC 6238).

sudo /opt/gardience/gardience user mfa alice        # prints the setup key once, and an otpauth:// link
sudo /opt/gardience/gardience user mfa alice off    # remove it (for a lost phone; then set a new one)
sudo /opt/gardience/gardience mfa require admin,approver   # these roles cannot sign in without a code
sudo /opt/gardience/gardience mfa require none

Single sign-on users

People who sign in through single sign-on do not appear in users.yaml. Their role comes from their identity provider groups at each sign-in. A single sign-on name that matches a local account is refused, so the two can never be confused. See Single sign-on.

Break-glass account

For an emergency that the governed path cannot handle, root on the Gardience server can open a break-glass account with full Salt rights for a limited time:

sudo /opt/gardience/gardience breakglass on --minutes 60     # prints a one-time password
sudo /opt/gardience/gardience breakglass status
sudo /opt/gardience/gardience breakglass off                  # close it early

Sign in as gardience-breakglass with the one-time password (method: Local account). Gardience records the opening in the audit log, sends a notification, and when the time is up discards the password and ends the account's sessions. Nobody can be given the break-glass role, and single sign-on cannot map to it. Opening it needs root on the server, so a stolen console session or API key can never reach raw Salt rights.

Gardience by Bouziden Management LLC.