Remote deployment and domain accounts
Install the agent on many hosts from the console, with a technical account the hosts already accept, such as a domain account, instead of logging in to each one. In the console: Environment > Hosts, panel Deploy agents remotely below the agent list (the Install agent > Remote deployment tab scrolls to it), or Deploy an agent to this host on an unmanaged host in the network map or in the review queue.
Full procedure: 13. Remote deployment from the console.
Credentials
| Type | For | Needs |
|---|---|---|
| SSH, password | Linux, macOS, Windows with OpenSSH | Account and password |
| SSH, private key | The same | Account and an RSA, ECDSA or Ed25519 key, with its passphrase if it has one |
| SSH, key and certificate | The same | The key and the OpenSSH user certificate signed for it |
| WinRM, password | Windows | Account and password, over HTTPS on 5986 (or plain HTTP on 5985, with a second signature), logging in with Kerberos or NTLM; optionally the CA that issued the listener's certificate |
| WinRM, client certificate | Windows | A client certificate and key mapped to an account, HTTPS only |
Enter the account as the hosts know it: DOMAIN\user or [email protected] for a domain account, HOST\user (or .\user) for an account local to each host.
For SSH, say how the account becomes root: it is root, it has passwordless sudo, or its sudo asks for a password (the login password, or a separate one). With "sudo with a password", the preflight first asks sudo without a password; where that works (a NOPASSWD rule) no password is sent at all. Where sudo asks, the password goes only to sudo's own prompt on standard input, never on the command line, and the command run under sudo reads nothing from that stream. On Windows the account must be an administrator.
Secrets are encrypted at rest and write-only: the console shows only whether each one is set. Creating, replacing, testing and deleting a credential are recorded in the audit trail, without their values, and failure reasons and the server log are scrubbed of the credential's secrets on every path.
Domain accounts
The Lawliet server does not need to be joined to your domain to use a domain account. It authenticates to each host directly, and the host checks the account with its domain controller.
Windows hosts (WinRM)
- Use a WinRM, password credential. The connection is HTTPS on port 5986 by default. Its Login is Kerberos first, NTLM if Kerberos is not possible (the default), Kerberos only for domains that restrict NTLM, or NTLM only for workgroup hosts and local accounts. Kerberos needs the domain's realm and domain controllers under Kerberos realms; the server does not join the domain. Once a domain controller has answered, NTLM is never tried for that login.
- The listener's certificate is validated. If it comes from your AD Certificate Services, paste the AD CS root (and any intermediate) as WinRM server CA on the credential; for a self-signed listener certificate, paste that certificate. The certificate must name the host as you enter it.
- The account must be in the host's local Administrators group, directly or through a domain group. A local account other than the built-in Administrator loses its administrator rights over the network (UAC remote restrictions,
LocalAccountTokenFilterPolicy), and the deployment says so. Use a domain account. - Creating a credential that uses plain HTTP on 5985 or switching one to it, turning certificate validation off (API only), replacing the WinRM CA, moving a credential from Kerberos only to a mode that allows NTLM, and changing Kerberos realms each need a second signature. Switching back to HTTPS needs none.
Linux hosts joined to a domain (SSH)
- Log in as
[email protected]orDOMAIN\user, whichever form sssd is configured to accept. - Give the deployment account's group a sudo rule. NOPASSWD is recommended: no password is then sent for sudo at all. With a password rule, choose "sudo with a password".
A least-privilege deployment account
- Create a dedicated account, for example
svc-lawliet-deploy, and a group that holds only it. Do not use a Domain Admins account. - Windows: with Group Policy, add that group to the local Administrators group of the target OUs only, and deny it interactive and Remote Desktop logon on those hosts.
- Linux: a sudo rule for the group, for example
%lawliet-deployers ALL=(root) NOPASSWD: ALLin/etc/sudoers.d/lawliet-deployers. - Give it a long random password, store it once in the credential, and disable it or remove it from the group when the rollout is done.
To roll the agent out with Group Policy instead, with no deployment credential at all, use the Windows MSI for Group Policy (12.4 Group Policy). In 1.5.13.s the Deploy agents via GPO button of AD assessment sends no installer address, so the GPO it links does not install the agent; use the MSI.
Full procedure: 12.8 Preparing hosts for remote deployment over WinRM.
Kerberos realms
For Windows hosts that must be logged in to with Kerberos, add the realm under Deploy agents remotely > Kerberos realms: the realm (the AD DNS domain in capitals), the NetBIOS domain, the domain controllers to ask on TCP 88 (nothing is looked up in DNS) and, optionally, the DNS domains whose host names belong to it. Every change needs a second signature, because the domain controllers receive every WinRM login. Check KDCs then shows whether each one answers and whether its clock is in step; it uses a non-existent account, so no account is touched. Anyone who can block TCP 88 between the server and the domain controllers can push Kerberos first down to NTLM; where that matters, use Kerberos only.
Full procedure: 13.4 Configure Kerberos realms.
Test before deploying
Test connection (the Test button on a credential) connects to one host and runs the preflight. It installs nothing. Because a test logs in with the stored secret, it is a four-eyes action like a deployment: it is sent for approval with the host and the credential's revision, and the requester runs it from Approvals > My requests > Execute now. Without that, anyone allowed to manage credentials could point a test at a host of their own and receive the password. A credential changed after the request refuses the approved test.
The test runs in the background: the checklist fills in as each check is made, a slow Windows host can take a few minutes, and Cancel test stops it at its next step. The verdict is kept for 30 days and is also in the audit trail. One test runs at a time per credential, and at most four on the server.
The SSH host key is pinned on first contact. A host that later presents a different key is refused with both fingerprints shown: either it was rebuilt, or something else answers on that address.
The checklist
A test, and every host of a deployment, ends in a checklist rather than a single error: one verdict per check, ok, warning or failed, with one line saying what it means and the exact fix. A host with two problems shows both, and any failed check stops that host before anything is installed.
| Check | Examples of a verdict |
|---|---|
| Host reachable | Refused (start sshd or enable WinRM over HTTPS, or open the port); timeout (a firewall drops it); no route; the name does not resolve; WinRM certificate not trusted |
| Connection | Only for a credential on plain HTTP 5985: always a warning, "WinRM over plain HTTP (insecure)" |
| WinRM HTTPS listener | Only when the port answered in plain HTTP: add an HTTPS listener, or switch the credential to HTTP 5985 (four-eyes) |
| Login accepted | Refused (a wrong password or key, or a locked, disabled or expired account; the host does not say which); password expired; the host does not accept this kind of login |
| Administrator rights | Not in sudoers; sudo asks for a password the credential does not have; sudo refused the password; a Windows local account stripped of its rights remotely (UAC) |
| Operating system supported | Linux x86_64 and aarch64 and Windows x64 are ok; another CPU falls back to the Python agent (warning) |
| Free disk space | Under 200 MB fails, under 1 GB warns |
| No agent installed yet | An agent already runs there: upgrade it from Environment > Agent versions instead |
| Host reaches this server | The certificate does not name the address (sudo ./lawliet tls repair); untrusted or a different certificate; not yet valid (the host clock is behind); refused; timeout; HTTP 403 "Invalid host header" (add the address to TRUSTED_HOSTS) |
| Clock in step with the server | Over 1 minute warns, over 5 minutes Kerberos logons fail too. Never fails the install. |
With Kerberos, the checklist also shows Server clock in step with the domain. The checklist is shown with the test result, on the approval request once an approved test has run, and per host of a deployment (Checks). The check that the host can reach this server asks for TLS 1.2 over WinRM, as the installer does, so Windows 10 hosts pass it with their default TLS settings.
Deploy
Under New deployment, pick a credential and list the hosts, one per line as host or host,os (linux, macos, windows). A range in CIDR form expands to its addresses. A deployment takes at most 1024 hosts.
The address hosts enrol with comes from the server's public address setting, or else the address the console was reached at; change it when hosts reach the server differently. The console warns when it is a loopback address, which no host can reach.
A deployment is a four-eyes action: it waits for a second person to approve it, with the credential, the server address and every host on the list, and the requester starts it from Approvals. A credential changed after the request refuses the deployment, so an approval cannot be spent on a different secret.
On each host the deployment connects, runs the preflight, then runs the same installer the console offers for manual installs, with a one-time token in place of the enrolment secret. The token is valid for two hours and for one enrolment. A host is done when its agent enrols. Failed hosts show the step and the reason; Retry runs one again with its own approval, and Cancel what has not started stops hosts that have not begun.
Full procedure: 13.5 Deploy agents.
Lockout protection
A wrong or expired password must not lock a domain account. Hosts are logged in to one at a time until the credential has been accepted once (with "sudo with a password", until sudo has accepted it too). After that at most two logins run at once, while installs run 10 at a time.
If the login is refused twice in one deployment, or sudo refuses the password twice, the hosts not yet started are not attempted. They fail with "Not attempted: the credential was refused 2 times in this deployment", so a wrong domain password costs two failed logons, not one per host. A host that cannot be reached does not count. Fix the account, then retry the hosts.
Because logins run at most two at a time (one after a refusal), unreachable or hung hosts are handled one after another: up to 15 seconds each over SSH and up to about 120 seconds each over WinRM. A large deployment with many unreachable hosts therefore takes longer, by design. A Windows host that does not answer a PowerShell command within 60 seconds is asked once more, then reported in plain words.
A refused login says what it can mean (a wrong password, or a locked, disabled or expired account) and that repeated tries lock a domain account. WinRM answers a domain account that is not an administrator on the host exactly as it answers a wrong password, so that refusal names this case too. Over SSH, an expired password is reported as expired.
If you deployed before 1.5.11.s with "sudo with a password" to hosts whose sudo needs no password, the password could have been written into /etc/lawliet/server-ca.pem on those hosts. Check that file: a first line that is not -----BEGIN CERTIFICATE----- is the password. Delete that line and change the password. The installers now accept a certificate file only if it holds PEM certificates and nothing else.
Permissions
Manage deployment credentials shows the panel, adds, edits and deletes credentials, shows deployments and cancels hosts not yet started; the weakening changes listed above need a second signature. Deploy agents remotely starts deployments and retries hosts, each with a second signature. Test connection needs both permissions and a second signature. Deployment is part of the agents feature of the licence.
Full procedure: 13.1 Permissions and four-eyes.
Signing in to the console with Active Directory accounts is a separate feature: see directory sign-in.
Hosts stop at 403
On 1.5.9.s, every remote deployment to a server with an enrolment secret, which ./lawliet install always sets, stops at the installing step with HTTP 403: the agent download refused the deployment's one-time token. Upgrade to 1.5.11.s, which accepts a valid deployment token for the download; see Upgrading. Until then, install those hosts with the command from Install agent in the console or ./lawliet token, which is not affected.