Lawliet LAWLIET
Book a demo

10. Agents: what they are and how they are managed

This guide describes Lawliet 1.5.13.s (the current release). Screens, commands and procedures may change in later versions; the usage guide is updated with each release. Check the version your server runs under Settings > Platform or with ./lawliet version, and see the Releases page for what changed.

This chapter explains the Lawliet agent: what it does on each operating system, how it talks to the server, how you see it in the console, and how it is upgraded. The chapters that follow give the install procedures:

ChapterCovers
11. Install agents on Linux (and macOS)Copy-paste command, offline package, uninstall
12. Install agents on WindowsCopy-paste command, offline package, Group Policy (MSI), WinRM, Kerberos
13. Remote deployment from the consoleCredentials, Test connection, deployments, approvals
16. Agent securitySelf-protection, uninstall codes, tokens, certificate changes

10.1 What the agent is#

The agent is a small compiled program that runs on each monitored host. One agent per host. It enrols once with the server, then sends a heartbeat every 15 seconds. The heartbeat carries the host's health and collects any work the server has for it.

The agent version in this release is 2.1.9.s.

PlatformRuns asInstalled toSupported CPUs
Linuxtwo systemd services, lawliet-agent and lawliet-watchdog, as root/opt/lawliet-agent/amd64 (x86_64), arm64 (aarch64)
Windowstwo scheduled tasks, LawlietAgent and LawlietWatchdog, as SYSTEM at startupC:\Program Files\Lawliet Agent\x64 (the same binary also runs on Windows on ARM)
macOStwo LaunchDaemons, com.lawliet.agent and com.lawliet.watchdog/usr/local/lawliet-agent/Apple silicon (arm64), Intel (amd64)

The watchdog checks that the agent is running and starts it again when it is not. It also restores the agent program from a known-good local copy if the program file is deleted or changed.

The compiled agent needs no Python, no package manager and no internet access. The only thing a host must reach is the Lawliet server. This is what makes the agent suitable for an air-gapped site. A Python version of the agent exists as a fallback, used only when the server has no compiled agent for the host's CPU, or when you ask for it (--python). The Python fallback needs python3 and access to a Python package mirror.

10.2 What the agent does#

FunctionWhat it means for you
Heartbeat and telemetryCPU, memory and disk use, shown on Environment > Hosts
Compliance checksRuns the checks a compliance scan sends and returns the results
File integrity monitoring (FIM)Watches the paths in your FIM policies and reports changes
Data loss prevention (DLP)Scans local files for the patterns in your DLP policies; matches are stored redacted
Hardening and response actionsRuns approved remediation and containment actions sent by the server
Domain awarenessReports whether the host is in an Active Directory domain and its role (member, domain controller)
Self-protection (optional)Resists being stopped or removed; see chapter 16

The agent reports which modules it supports on that host as Capabilities (FIM, FIM real-time, FIM attribution, DLP). The server sends DLP or FIM work only to hosts that report the capability.

10.3 How the agent talks to the server#

How a host gets enrolled#

A host can enrol in one of three ways. The console shows all three under Environment > Hosts > Install agent.

MethodUse it whenWhat authorises the enrolment
Install commandThe host can reach the server. You run one command on it.The server's enrolment secret, carried in the command
Remote deploymentThe server can log in to the hosts over SSH or WinRMA one-time token, valid 2 hours, for one enrolment
Offline packageThe host cannot download anything. You carry a package to it.An enrolment code with an expiry and a host limit

Windows domains have a fourth way, the Windows MSI for Group Policy. It is an offline package made for Group Policy; see chapter 12.

The enrolment secret is shown by ./lawliet token on the server. After an agent enrols and saves its own token, it removes the secret from its configuration file.

10.4 The Environment page#

Environment > Hosts is the fleet list.

Required permission: View agents.

What you see:

The page refreshes every 15 seconds.

The agent drawer#

Click a row to open the agent's drawer. It shows:

SectionContent
DetailsAgent ID, Platform, OS Type, IP Address, MAC Address, CPU, Memory, Disk, Telemetry sampled, Version, Clock, Domain, Domain role, Realm, Domain site, Tamper state
CapabilitiesFIM, FIM real-time, FIM attribution, DLP (yes / no)
Proof of protectionResults of the periodic detection drills on this host, and Run drills now
Self-protectionState and the protection controls (chapter 16)
Remove agentRemoves the host from the console (see 10.7)
Compliance scanA pointer to Compliance, where you run a scan of this host (choose Single agent)

Agent status values#

StatusMeaningWhat to do
onlineRecent heartbeatNothing
offlineNo heartbeat within the timeoutSee If a host does not appear or goes offline
errorThe agent reported an errorRead the agent log on the host
updatingAn upgrade is in progressWait; see 10.8
stale chipNo heartbeat within the timeout, status not yet switched to offlineSame as offline

CPU, Memory and Disk come from the last heartbeat. When that sample is old, the meter is grey and marked old.

10.5 Agent configuration on the host#

The installer writes the configuration. Change it only when support asks you to.

ItemLinuxWindowsmacOS
Settings file/opt/lawliet-agent/config.envC:\Program Files\Lawliet Agent\config.env/usr/local/lawliet-agent/config.env
Identity (agent id and token)/etc/lawliet/agent.confC:\ProgramData\Lawliet\agent.conf/var/root/Library/Application Support/Lawliet/agent.conf
Trusted server certificate/etc/lawliet/server-ca.pemC:\Program Files\Lawliet Agent\server-ca.pem/etc/lawliet/server-ca.pem
Logjournalctl -u lawliet-agent, /var/log/lawliet-agent.logC:\ProgramData\Lawliet\lawliet-agent.log/var/log/lawliet-agent.log

Settings in config.env:

VariableMeaning
LAWLIET_API_URLThe server address
LAWLIET_AGENT_NAMEThe host name shown in the console
LAWLIET_HEARTBEAT_INTERVALSeconds between heartbeats. Default 15. Keep it at 15 or lower: compliance scans wait about 40 seconds for results
LAWLIET_REGISTRATION_SECRETThe enrolment secret or code. Emptied automatically after the agent enrols
REQUESTS_CA_BUNDLE, SSL_CERT_FILEThe trusted server certificate, when one was given at install

Reinstalling the agent on the same host keeps agent.conf, so the host keeps its identity and history.

Procedure: change a setting in config.env#

Risk: a wrong server address or certificate path cuts the host off from the server. Rollback: put the previous value back and restart the agent.

  1. If self-protection is on, turn it off first (16.2); otherwise the watchdog may restore the files.
  2. As root (Administrator on Windows), edit the settings file for the platform (table above). Keep a copy of the original.
  3. Restart the agent: sudo systemctl restart lawliet-agent (Linux), sudo launchctl kickstart -k system/com.lawliet.agent (macOS), Stop-ScheduledTask -TaskName LawlietAgent; Start-ScheduledTask -TaskName LawlietAgent (Windows).
  4. What you see: the host shows online under Environment > Hosts within a minute, with a fresh Last heartbeat. If it goes offline, read the agent log (table above) and undo the change.
  5. Turn self-protection on again.

10.6 Host clocks#

Each heartbeat carries the host's time, so the server knows how far each host's clock is from its own. The Clock column shows a chip such as clock +7m 12s.

OffsetShown asEffect
under 1 minuteoknone
1 to 5 minuteswarningA host more than 60 seconds behind refuses the server's commands and policies
5 minutes or morecriticalAs above, and domain (Kerberos) logons fail. One notification is raised for the host

Fix the clock with NTP on the host, then check the Clock chip:

  1. Run the command for the platform below (as root or Administrator).
  2. What you see: within a heartbeat or two the chip returns to ok. If it does not, point the host at your organisation's time source and run the command again.
sudo timedatectl set-ntp true        # Linux (or point chrony at your time server)
w32tm /resync                        # Windows

10.7 Removing a host from the console#

Removing the record in the console does not uninstall the agent. Uninstall it on the host first (chapters 11 and 12), otherwise the host enrols again.

Required permissions: Manage agents and Delete agents to remove or delete; Manage agents alone to revoke the token. Four-eyes: yes (critical action "Delete an agent") for Remove and Delete it and its records; no for Keep the records: revoke its token, which runs at once.

  1. Open Environment > Hosts and click the host.
  2. In the drawer, under Remove agent, click Remove agent.
  3. The console shows what records the agent still has.
    • "It has no records. Remove it?" -> click Remove.
    • "It still has N records: ..." -> choose:
      • Delete it and its records - removes the agent and its FIM events, DLP incidents, scans and forensic records. This cannot be undone. It is written to the audit trail with the row counts.
      • Keep the records: revoke its token - the agent can no longer report, the records stay. You see "Token revoked. The records are kept; a reinstall on this host enrols as this agent again."
  4. For a removal or deletion with dual control on, the console says "Sent for approval. Removing an agent needs a second signature; run it from Approvals once signed." A second administrator approves it under Approvals > Waiting for me. You then run it from Approvals > My requests > Execute now (see chapter 15).

What you see: "Agent removed." and the host leaves the list.

If it fails: a 409 message lists the tables that still hold records. Choose one of the two options above.

When to use what:

SituationAction
A host is retired and its history must stayDo nothing. It goes offline and keeps its history
An agent token may be leakedRevoke the token (above), or rotate it (chapter 16)
A host was enrolled by mistake, or its data must be erasedDelete it and its records

10.8 Agent versions and upgrades#

Environment > Agent versions shows what the fleet runs and the signed releases it can move to.

Required permissions: Manage agents to view; Publish agent releases to import, register, publish and roll out. Four-eyes: yes for Publish, single-host upgrade and rollout (critical action "Publish an agent release").

Upgrades are off by default. They need two server settings in .env:

SettingDefaultMeaning
AGENT_AUTO_UPGRADE_ENABLEDfalseSet to true to let agents accept upgrade instructions
AGENT_RELEASE_PUBLIC_KEY / AGENT_RELEASE_PUBLIC_KEY_FILEset in customer bundlesThe vendor's public release key. Without it nothing can be published

After changing .env, run sudo ./lawliet start (a restart does not re-read .env). The page shows a banner when either is missing: "The agent upgrade channel is off" or "No release public key is configured".

Procedure: upgrade agents on an air-gapped site#

Risk: an agent upgrade replaces the program on each host. Rollback: each agent keeps its previous program and restores it if the new one does not report in; to go back across the fleet, roll out the older release (the API's force option allows a downgrade).

  1. Update the server to the new bundle (chapter 4). The bundle carries the signed compiled agents.
  2. Open Environment > Agent versions and click Import bundled agents. Each agent binary's signature is checked against the release key. Each becomes a draft release. What you see: a "Bundled agents" result listing what was imported and what was skipped, with the reason.
  3. In the release catalogue, click Publish on the release. With dual control on, a second administrator approves it, and you run it from Approvals.
  4. Check Upgrade candidates. Each host shows ready or the reason it cannot move (already current, offline, mid-upgrade, below the minimum version).
  5. Click Roll out 10. At most ten eligible hosts get the upgrade. The result lists every host it skipped and why. To upgrade a single host, use Upgrade to <version> on its row.
  6. Watch Upgrade history. States: pending, downloading, verifying, applying, succeeded, rejected, failed, rolled_back.
  7. Repeat Roll out 10 until every host is current.

If it fails:

You seeMeaningDo
rejectedThe agent refused the file (signature or digest did not verify)Stop the rollout. Every other agent will refuse it too. Contact [email protected]
failedSomething went wrong on that hostRead the agent log on the host
rolled_backThe new agent did not report in, so the old one was restoredRead the agent log; retry once the cause is fixed

Procedure: register a release by hand#

Use this only for a build that did not come inside a server bundle (for example a release the vendor sent separately). Bundled builds are imported with Import bundled agents instead.

Permission: Publish agent releases. Four-eyes: no to register a draft (a draft reaches no host); yes to publish it.

  1. Open Environment > Agent versions and press Register a release (disabled with "The upgrade channel is disabled on this deployment" until AGENT_AUTO_UPGRADE_ENABLED is on).

  2. Fill the form:

    FieldWhat to enter
    VersionFor example 2.1.0
    PlatformThe operating system the build is for
    BuildPython script (every architecture) or Compiled binary (then Architecture)
    Host it on this serverTick for air-gapped sites; you upload the file after registering. Untick to give a Download URL (HTTPS) instead
    SHA-256The file's digest, 64 hexadecimal characters
    Release signatureThe base64 Ed25519 signature over the digest, made offline with the release private key
    Minimum version to upgrade fromOptional. Hosts below it step through an intermediate version
    Channelstable, or canary to keep it out of the stable selection while you try it on a few hosts
    Release notesWhat changed
  3. Press Register as draft.

  4. With Host it on this server, press Upload artefact on the new row and choose the file. The server checks it against the SHA-256.

  5. Continue with Publish and the rollout (steps 3-7 above).

If it fails: the form or the notice names the problem, for example a digest or signature that does not verify against the release public key.

Procedure: upgrade one host, stop a rollout, retire a release#

  1. One host: in Upgrade candidates, press Upgrade to <version> on a row marked ready. Four-eyes: yes.
  2. Stop a rollout: press Unpublish on the release. No new host is sent it; upgrades already running finish. Publish makes it available again (four-eyes).
  3. Retire a release: press Delete on an unpublished release and confirm "Delete release <version>? Upgrade history is kept." This cannot be undone; register or import it again if needed.

Upgrade agents to the new version before you replace the server certificate: an agent 2.1.9.s learns the server's trust key with its first heartbeat and only then can follow a certificate change by itself (chapter 16).

Re-running an installer on a host is also an upgrade: it replaces the program in place and keeps the host's identity. If anything fails, the installer puts the previous program back.

10.9 If a host does not appear or goes offline#

Work through the checks in this order; stop at the first one that fails and apply its fix. What you see when it is fixed: the host is online in Environment > Hosts.

CheckHowFix
1. Registration refusedThe installer prints the server's reason. 401 = wrong or missing enrolment secretsudo ./lawliet token shows the current secret. If none is set, sudo ./lawliet token --rotate
2. Server not reachableOn the host: curl -k https://<server>/health must return "status": "healthy"Firewall or routing between the host and the server
3. Certificate not trustedThe agent log shows an SSL error on every callExport the certificate (sudo ./lawliet tls --export) and reinstall with --ca-cert / -CaCert
4. Clock wrongThe Clock column, or the host's timeFix NTP (10.6)
5. 409 "already registered"An earlier record of this host still existsRemove the old record (10.7); the waiting agent enrols by itself within a minute
6. Service not runningsystemctl status lawliet-agent, or Get-ScheduledTaskInfo -TaskName LawlietAgentRead the log; reinstall

The installers check the server before installing anything and print one plain verdict:

What happenedWhat the installer says to do
The certificate does not name the address in --serverRun sudo ./lawliet tls repair on the server, export the certificate again, re-run with --ca-cert
Self-signed certificate and none given, or a different one givenExport it with ./lawliet tls --export, re-run with --ca-cert (-CaCert)
Certificate not yet valid or expiredSet this host's clock, or renew the certificate on the server
Connection refusedCheck --server, that the server runs, and its firewall
TimeoutA firewall drops the connection: allow the port from this host to the server
HTTP 403 "Invalid host header"Add the address to TRUSTED_HOSTS in the server's .env, then sudo ./lawliet start (8.9)
HTTP 403 on the agent downloadThe enrolment secret was refused: check --token

More detail: Agents reference.