Installation guide
Before you begin
Lawliet runs as a set of containers on one server. Prepare that server and decide how people will reach it; the installer asks about both.
| You need | Details |
|---|---|
| A Linux server | Any current 64-bit distribution: Ubuntu, Debian, RHEL, Rocky, Alma. Intel/AMD or ARM. |
| Minimum Hardware Requirements | 4 CPU cores, 8 GB RAM, 40 GB free disk for a small estate. Give it more as the number of monitored hosts grows. |
| Docker | Docker Engine 24 or newer with the Compose plugin, installed, running, and usable by the account you install with. The bundle does not contain Docker and the installer does not install it (see below). |
| Tools | bash, curl, tar, sha256sum. openssl only if you want the installer to create a self-signed certificate. |
| Space for the bundle | The bundle is about 1.85 GB (images for both Intel/AMD and ARM). Unpacking it takes about as much again, and loading the images for your CPU needs about twice their size (about 830 MB) where Docker stores images. |
| An address | The DNS name or IP address operators and monitored hosts will use to reach the server. |
| A certificate | Recommended: a TLS certificate and private key (PEM) for that name, from your own certificate authority. Otherwise the installer can generate a self-signed one. |
| Accurate time | NTP on the server and on every monitored host. Instructions older than 10 minutes are refused, so a drifting clock silently stops a host from acting. |
Installing Docker on a server without internet
On a machine with internet access, download the Docker Engine packages for the
server's distribution, version and CPU from Docker's package site
(download.docker.com): containerd.io, docker-ce,
docker-ce-cli, docker-buildx-plugin and
docker-compose-plugin, as .deb files (Debian, Ubuntu) or
.rpm files (RHEL, Rocky, Alma). Copy them to the server on media and
install them together (dpkg -i ./*.deb or dnf install ./*.rpm),
or install from an internal package mirror that carries Docker CE. Docker also
publishes static binaries (a .tgz) for servers where packages cannot be
used; then you set up the service and the Compose plugin yourself.
Then systemctl enable --now docker, and check that
docker info and docker compose version work.
Open the network
Monitored hosts connect out to the server; the server never connects in to them. Nothing needs to be opened on the hosts you monitor.
| From | To | Port | Why |
|---|---|---|---|
| Operators' browsers | Lawliet server | 443/tcp | The console, over HTTPS |
| Operators' browsers | Lawliet server | 80/tcp | Optional: redirects to 443 |
| Monitored hosts | Lawliet server | 443/tcp | Agents report and fetch instructions |
| Server and hosts | Your NTP servers | 123/udp | Clock synchronisation |
| Devices sending syslog | Lawliet server | 5514/udp 5514/tcp | Only if you collect logs |
Keep the database private. PostgreSQL and Redis stay inside Docker and are never published. Do not open 5432 or 6379.
Using the lab mode (plain HTTP) instead
The installer offers plain HTTP on ports 3000 and 8000 for a laptop or a lab.
It sends passwords and enrolment tokens in clear text, so do not use it on a real
network. If you do: operators need both 3000/tcp and
8000/tcp (the page loads from 3000 and talks to 8000), and monitored hosts
need 8000/tcp.
Optional features that need more
Network discovery probes the ranges you give it (TCP, plus UDP 137, 161, 1900, 5353 and ICMP). Firewall import reaches devices over SSH (22) or HTTPS (443). Emailed reports use SMTP (587). Single sign-on reaches your identity provider on 443. Open these only if you use the feature.
Install
Copy the bundle to the server, unpack it and run the installer. It checks the machine, asks five questions, generates every secret and starts the platform.
$ tar xzf lawliet-docker-*.tar.gz $ cd lawliet-*/ $ ./lawliet install
What the installer asks
- Address
The DNS name or IP address from step 1. It suggests the one it detects, or
localhostwhen it finds none: check it, and type the server's address if it is not right. Agents connect to this address. - How to serve it
Choose 1, HTTPS on 443. Option 2 is the lab mode described above.
- Certificate
Give the paths to your certificate (full chain, PEM) and private key, or let it generate a self-signed certificate. A generated one names the address above, this server's own IP addresses and
localhost. You can replace it later with./lawliet tls. - Administrator username
adminunless you prefer another. - Administrator password
Let it generate a strong one (answer Y), or type your own (at least 12 characters, twice). This is a one-time password: you replace it at first sign-in.
- Confirm
It shows a summary and asks Write this configuration and start the platform? Nothing is written before you answer yes.
It then starts. The first start loads the images shipped inside the bundle and takes a few minutes. Nothing is built or downloaded. When it finishes it prints:
Copy the password now. You need it for the first sign-in. The folder you
installed from is now your deployment: keep it, and run every later
./lawliet command from it.
First sign-in
Open the console address in a browser. The first sign-in has two short, required steps. Nothing else in the platform opens until both are done.
- Sign in with the one-time password
If you used a self-signed certificate, the browser warns once. That is expected.
- Choose your own password
At least 12 characters. Common and well-known passwords are refused. The one-time password stops working.
- Set up two-factor authentication
Scan the QR code with an authenticator app (Google Authenticator, Microsoft Authenticator, 1Password or any TOTP app), or type the key shown under it.
- Save the recovery codes
Ten single-use codes that sign you in if you lose your phone. Copy or download them and keep them somewhere safe, such as your password manager. They are shown only once.
- Enter the 6-digit code from the app
From now on every sign-in asks for a code. Next comes the activation screen, step 5.
Activate your licence
Your licence is issued for this installation and works on it alone. We need one thing from you to issue it: the installation fingerprint.
- Send us the fingerprint
The installer printed it at the end. The activation screen you reach after the first sign-in shows it too, with Copy and Email it buttons, and the server shows it at any time:
$ ./lawliet licenceIt is 32 characters, like
3f9a51c0d6e84b27a1f0c9d3e5b7c21e, and identifies this installation only: no host name, address or data. You can send it as soon as the installer finishes. - Receive your licence key
We reply with a key file. The key starts with
LAWLIET-. - Install it
Paste the key on the activation screen and press Activate licence, or on the server:
$ ./lawliet licence key-file
The key is checked on the server before anything changes; nothing is sent anywhere. The platform opens straight away.
It stays with this installation. The licence survives restarts, updates and
backup restores. A new server, or a reinstall that removes the data
(./lawliet uninstall), is a new installation with a new fingerprint and needs
a new licence: send us the new fingerprint.
If your bundle was delivered with a licence already inside it, there is no activation screen and you can skip this step.
Connect your hosts
A small agent on each server or workstation reports to Lawliet. The server prints ready-to-run install commands, with its own address and enrolment token filled in.
$ ./lawliet token
Copy the command for each platform from its output and run it on the host you want to monitor. They look like this:
d="$(mktemp -d)" && curl -fsSL -o "$d/install.sh" https://your-server/api/v1/agents/download/linux \ && head -c 2 "$d/install.sh" | grep -q '^#!' \ && sudo bash "$d/install.sh" --server https://your-server --token enrolment-token; rc=$?; rm -rf "$d"; [ "$rc" -eq 0 ]
Copy the one-line command from ./lawliet token or the console's Install agent.
It carries the SHA-256 of this server's install.ps1 and runs the script only if it matches, so it
cannot be typed from this page. It exits with the installer's own status.
d="$(mktemp -d)" && curl -fsSL -o "$d/install.sh" https://your-server/api/v1/agents/download/macos \ && head -c 2 "$d/install.sh" | grep -q '^#!' \ && sudo bash "$d/install.sh" --server https://your-server --token enrolment-token; rc=$?; rm -rf "$d"; [ "$rc" -eq 0 ]
Within a minute the host appears under Environment in the console. The same commands are available there from the Install agent button. Copy them rather than typing them: the Windows command carries the SHA-256 of this server's installer.
For this release agents ran on Ubuntu 22.04 (Intel/AMD and ARM), Windows 10 22H2 and Windows 11. The macOS agent and Windows Server 2019 and 2022 have not yet run on a real host.
Using a self-signed certificate?
Each host has to trust it. Export it on the server and copy it to the host:
$ ./lawliet tls --exportThis writes lawliet-server.pem. ./lawliet token and the
console then print commands that include it at a fixed path: copy the file to
/path/to/lawliet-server.pem on Linux and macOS, or
C:\path\to\lawliet-server.pem on Windows, or change the path in the
command. On Linux and macOS the command fetches the installer with it
(--cacert) and gives it to the agent (--ca-cert). On Windows
the command checks the installer by its SHA-256 instead, then passes
-CaCert, and the installer pins that certificate for everything after.
Windows Server 2016 has no curl.exe, which the self-signed Windows command
uses. There, import lawliet-server.pem into the host's Trusted Root store
and use the command for a trusted certificate, or copy
agents\install_windows.ps1 from the bundle to the host and run it with
-Server, -Token and -CaCert.
Installing agents with a domain account
The console can install agents itself (Agents, Deploy agents remotely) with an account the hosts accept, including a domain account. The Lawliet server does not join the domain.
Enter the account as DOMAIN\user or [email protected] (a local
account as HOST\user). Windows hosts use WinRM over HTTPS (5986) with NTLM: if
the listener certificates come from your AD Certificate Services or are self-signed, paste
that CA as WinRM server CA on the credential. The account must be in each
host's local Administrators group, for example through a group added by Group Policy.
Linux hosts joined with sssd use SSH and a sudo rule for the account's group (NOPASSWD is
recommended).
A connection test and a deployment each need a second person's approval, and a deployment stops after two refused logins, so a wrong password cannot lock the domain account. Operators can also sign in to the console with domain accounts (directory sign-in, LDAPS, 2FA still required); see Directory sign-in.
Prepare Windows hosts for WinRM over HTTPS
Remote deployment talks to Windows hosts over WinRM on HTTPS (port 5986) by default, and
that is the recommended way. winrm quickconfig on its own creates only the
plain-HTTP listener on 5985: an HTTPS credential pointed at it is told that the host answered on
5985 but not with TLS. Leave the credential's port empty (5986 is used) and give each host an
HTTPS listener. Run the commands below in PowerShell as Administrator on the host.
If the agents are needed before the listeners exist, a credential can be switched to WinRM connection: HTTP 5985 (insecure) - Kerberos or NTLM, every message encrypted, never Basic, and only with a second administrator's approval. It is not protected by TLS: with NTLM the login can be captured and cracked offline, or relayed, and the host's identity is not verified. Use it only on a trusted network, temporarily, then switch back to HTTPS or use Group Policy.
1. See which listeners the host has (an HTTPS one shows Transport = HTTPS and
Port = 5986). If the WinRM service is not running, start it first with
Enable-PSRemoting -SkipNetworkProfileCheck -Force.
PS> winrm enumerate winrm/config/listener2a. In a domain with AD Certificate Services: let the hosts receive a computer certificate by auto-enrolment (a Group Policy setting), then create the listener on each host. The certificate must name the host as you will enter it in Lawliet; paste your AD CS root certificate as WinRM server CA on the credential.
PS> winrm quickconfig -transport:https2b. Without AD CS: a self-signed certificate per host. When hosts are entered by IP
address the certificate must carry that address, so set $ip to the address you
will enter in Lawliet:
$ip = 'host IP'
$c = New-SelfSignedCertificate -CertStoreLocation Cert:\LocalMachine\My -Subject "CN=$env:COMPUTERNAME" -TextExtension @("2.5.29.17={text}IPAddress=$ip&DNS=$env:COMPUTERNAME") -NotAfter (Get-Date).AddYears(3)
New-Item -Path WSMan:\localhost\Listener -Transport HTTPS -Address * -CertificateThumbPrint $c.Thumbprint -Force
New-NetFirewallRule -DisplayName "WinRM HTTPS 5986" -Direction Inbound -Protocol TCP -LocalPort 5986 -Action Allow
Export-Certificate -Cert $c -FilePath "$env:TEMP\winrm.cer"
certutil -f -encode "$env:TEMP\winrm.cer" "$env:TEMP\winrm.pem"
Get-Content "$env:TEMP\winrm.pem"Add -RemoteAddress with the Lawliet server's address to the firewall rule to
accept WinRM from that server only. Paste the PEM text the last command prints (from
-----BEGIN CERTIFICATE----- to -----END CERTIFICATE-----) as
WinRM server CA on the credential; for several hosts, paste their PEMs one
after another in the same field. The 5985 listener can stay.
3. Test the credential against the host (Test against host): the
checklist then shows the host reachable and the login accepted. If
WinRM HTTPS listener says the certificate could not be validated,
either the PEM pasted is not the one the listener uses, or the certificate does not
carry the address or name entered in Lawliet: re-create it with that address in
$ip.
Hosts that should not run WinRM at all install without it: the copy-paste command from
./lawliet token (or the console's Install agent), an offline
agent package for hosts without a route to the server, or the Windows MSI assigned by Group
Policy.
Collecting logs from firewalls and servers (syslog)
Under Logs, Sources, add a syslog source on port 5514
(UDP or TCP), then point your devices at the server on that port. It is the port the
server listens on; others are not reachable. Syslog carries no authentication, so
restrict each source to the networks your devices are on.
Keep the enrolment token private
Anyone holding it can enrol a host. If it leaks, replace it with
./lawliet token --rotate. Hosts already connected are not affected.
Add your team
Create an account for each person under Settings, Users, and give each a role. Each new user goes through the same first sign-in: their own password, then two-factor.
Give people only what they need
Built-in roles cover administrators, analysts, auditors and viewers. Create your own under Settings, Access control, and adjust individual users if needed.
Two people for critical actions
Critical actions (changing users, containment, remediation, firewall pushes, removing agents) wait for a second approver. The Left and Right Security Officer roles approve each other.
Create the second approver first. A fresh installation has one approver, so until a second one exists your critical actions run on your one signature, each recorded in the audit trail, and every page shows Four-eyes is inactive until a second approver exists. Create a second Super administrator, or a Left security officer and a Right security officer; by default a Super administrator and an LSO are not an approving pair (an LSO is approved by an RSO). Once the second approver has signed in and set up two-factor, four-eyes applies to everyone: the requester gives a reason, the other approver approves under Approvals, and the requester then runs it. Settings, Users opens once the licence is installed.
Requests waiting for a signature appear under Approvals. Which actions need one, and who approves whom, is set under Settings, Access control, Dual control.
Day-to-day care
Everything is done with ./lawliet from the deployment folder.
./lawliet help lists it all.
| Command | What it does |
|---|---|
./lawliet status | Health, licence, version and how many hosts are connected |
./lawliet backup | A database backup into ./backups. The HTTPS setup also takes one daily on its own. |
./lawliet restore file | Restore a backup, then restart. Asks before replacing anything. |
./lawliet update new-bundle | Upgrade to a newer bundle: takes a backup, installs beside the current one, verifies it |
sudo ./lawliet rollback | Go back to the version before the last update, database included. Asks first, and keeps a copy of the newer data. |
./lawliet restart | Restart and wait until healthy. stop and start also exist; data is never touched. |
./lawliet logs backend -f | Follow a service's logs |
./lawliet passwd | Reset the administrator password, for example if you are locked out |
./lawliet tls | Show or replace the certificate |
sudo ./lawliet tls repair | Re-issue a self-signed certificate that does not cover every address of this server. Asks first when agents are enrolled, and prints how to give them the new certificate. |
./lawliet licence | Show the licence and this installation's fingerprint. With a key: install a new licence. |
./lawliet doctor | Collect a diagnostics file for support. It holds no passwords and no data. |
Updating
When you receive a new bundle, copy it to the server and run this from your current deployment folder:
$ ./lawliet update lawliet-docker-new-version.tar.gz
It backs up first and refuses to continue without a backup. It installs the new version
in a folder next to the current one and brings your configuration across. From then on, run
./lawliet from the new folder. The new version then checks its certificate and
trusted addresses on its own and prints a short health summary.
The old folder is kept so you can go back. To return to the previous version, run this from the new folder:
$ sudo ./lawliet rollback
It restores the backup the update took and starts the previous version. Anything recorded
after the update is not in the restored database; it is saved in
backups/before-rollback-time in the new folder, and
nothing is deleted.
Take a copy off the server. Copy ./backups and the .env
file somewhere safe from time to time. .env holds the keys that protect stored
data, and a backup cannot be restored without it.
Troubleshooting
Start with ./lawliet status, then
./lawliet logs backend -n 200.
The installer says a deployment already exists
Lawliet is already installed on this server under the same name. To add a second one beside it, install under its own name, and use the same variable for every later command in that folder:
$ COMPOSE_PROJECT_NAME=lawliet-staging ./lawliet installThe console does not load, or sign-in does nothing
Check 443/tcp is open from your desk to the server, and
that you use the address given to the installer. In lab mode both 3000 and 8000 must be
reachable. The platform's own health check:
$ curl -k https://your-server/health
It should answer with "status": "healthy".
A host never appears after installing the agent
In order of likelihood: the enrolment token is wrong (compare with
./lawliet token); the host does not trust a self-signed certificate (see step
6); the host cannot reach the server on 443; the host's clock is wrong. On Linux,
journalctl -u lawliet-agent -f shows what the agent is doing.
Installing an agent by IP fails with curl error 60
The message is "no alternative certificate subject name matches
target ipv4 address": the server's self-signed certificate does not name the address
the host uses (a certificate made by 1.5.9.s named only the address typed at install).
./lawliet status lists each missing address. Re-issue it; this also adds
the addresses to the server's allowed host names, which removes "Invalid host
header":
$ sudo ./lawliet tls repairIf agents are already enrolled it lists them and asks first: each one goes offline
until it is given the new certificate, and the command prints how
(--refresh-ca on Linux, -RefreshCa on Windows; nothing is
re-enrolled). A certificate from your own certificate authority is never re-issued:
ask the CA for one that names every address, then install it with
sudo ./lawliet tls.
A host shows the IP address 127.0.0.1
Only an agent older than 2.1.9.s does this, on a host with no default gateway. From 2.1.9.s an agent reports the address it reaches the server from. Upgrade the agent; the host works normally either way.
Deploying an agent: Test connection takes a long time on a slow host
The test runs from Approvals once a second person has signed it. It runs in the background: the checklist fills in as each check is made, and a slow Windows host can take a few minutes. Cancel test stops it at its next step. The verdict is also in the audit trail.
A host is connected but commands never run
Almost always the clock. Instructions more than 10 minutes old are refused. Make sure NTP is running on the host and on the server.
I lost my phone
On the code screen choose Use a recovery
code and enter one of the codes you saved. Each works once. Then ask an
administrator to reset your two-factor under Settings, Users; you set it
up again on the new phone at your next sign-in. If the only administrator has neither
phone nor codes, run ./lawliet passwd on the server: it sets a new password
and can turn that account's two-factor off so it can be set up again.
The licence key is refused
"Bound to another installation": the key was issued for a
different fingerprint. The message shows this installation's fingerprint; send us that
one. "Issued before the licence in use": a newer licence is already
installed, and nothing changed. Paste the whole key, starting with
LAWLIET-, with no line breaks.
Moving to a new server
Install on the new server, restore your latest backup there
(./lawliet restore file) and send us the new
installation's fingerprint for a licence issued to it.
A module says it is not included in your licence
The screen shows what the module does. Contact us to add it. You will receive a new licence key; install it in either of two ways, and nothing needs reinstalling:
In the console, under Settings, Platform, Enter a new licence key. Or on the server, which checks the key before changing anything:
$ ./lawliet licence new-key-or-file
Asking for help
Run ./lawliet doctor and send us the file it writes, together with the
build id shown by ./lawliet status. Both identify your installation exactly
and contain no passwords or data.