Skip to content

Insights

Using LEA Rules to Verify Your Patching Routines

Published · Updated

LEA isn't a patch manager, and it doesn't deploy patches. What it can do is check, on every cycle, that update policy and update status on each host match what you expect, across Windows, macOS and Linux.

LEA Platform's rule engine is built for configuration compliance: agents run read-only checks, send the raw output to the server, and the server decides pass or fail. That makes it a good fit for the part of patching that patch tools often leave open: confirming afterwards that hosts are actually in the state you intended. Keep using your patch tooling (Ansible, WSUS, MECM, your distribution's update services) to install updates. Use LEA to check the result.

This addresses a common problem known as update drift: systems that fall out of policy after patching because of misconfiguration, held-back packages, disabled update services or partial updates. With LEA, "we pushed the patches" becomes something you check on every cycle instead of something you assume.

1. Define the rule for your patching policy

Start with a JSON rule that describes the state you want. This can be broad ("automatic OS updates must be enabled") or targeted ("no pending security updates on production servers").

Rule essentials

  • Name: a descriptive identifier, e.g. Automatic Updates Enabled
  • Description: clear intent, e.g. "Verifies that automatic operating system updates are enabled"
  • Tags: for filtering and framework mapping, e.g. std:CIS, std:NIST_800-53:SI-2, std:ISO27001:A.12.6.1, risk:high
  • Cycle: how often the check runs, e.g. 3600 seconds

Platform-specific variants

A single rule can carry separate validation commands per operating system and distribution, so one rule covers the whole fleet:

  • Ubuntu/Debian: apt-based configuration and status
  • Red Hat family: dnf/yum-based configuration and status
  • Windows: registry policy, Get-HotFix
  • macOS: softwareupdate

Rules are plain JSON, so they can live in version control alongside the rest of your configuration.

2. Set up validation commands

Validation commands read the current state on the host. LEA's convention is to keep them read-only and unfiltered: the agent sends raw stdout, stderr and return code, and the server does the matching. No grep on the host, no root-only commands where a readable file will do.

Example: update policy (shipped rule "Automatic Updates Enabled")

{
  "validation": [
    { "command": "cat /etc/apt/apt.conf.d/20auto-upgrades /etc/dnf/automatic.conf", "system": ["Linux"] },
    { "command": "(Get-ItemProperty -Path 'HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\WindowsUpdate\\AU' -Name NoAutoUpdate -ErrorAction SilentlyContinue).NoAutoUpdate", "system": ["Windows"] }
  ],
  "expect": [
    { "system": ["Linux"], "re": { "stdout": "(?s)(APT::Periodic::Update-Package-Lists\\s*\"1\"|APT::Periodic::Unattended-Upgrade\\s*\"1\"|apply_updates\\s*=\\s*yes)" } },
    { "system": ["Windows"], "re": { "stdout": "^(?:0)?$" } }
  ]
}

Other checks you can write

  • Pending updates (Debian/Ubuntu): apt list --upgradable
  • Pending security updates (RHEL family): dnf updateinfo list --security
  • Running kernel: uname -r
  • Installed Windows updates: Get-HotFix
  • macOS: softwareupdate -l

Agents run these on the rule's cycle, so drift from held-back packages, failed updates or a kernel that didn't change after a reboot shows up on the next check.

3. Define what "compliant" looks like

The expect block lives only on the server; agents never see it. It matches the raw output with regular expressions (re, not_re) or the return code.

Examples

  • No pending security updates: not_re on the list of upgradable security packages
  • Required Windows KB installed: re for the specific KB number in the Get-HotFix output
  • Kernel version: re for the expected version string in uname -r

When the output doesn't match, the host is marked as failing that rule. Tags map rules to frameworks such as CIS Controls, NIST SP 800-53 and ISO 27001, and the results feed into LEA's sealed evidence snapshots and reports.

Use the dashboard and Reports for per-host status, execution history and drift (PASS → FAIL) over time, for example how often update checks fail across the fleet.

4. Remediation: opt-in, and use it carefully

A rule can include an optional remedy. When validation fails and a remedy is defined, the server sends it; the agent runs the remedy, then re-runs the validation, and reports both. Remedy attempts are stored as their own history.

For patching, remedies are best used for policy settings, not for installing updates. Good candidates:

  • re-enabling automatic updates in the update configuration
  • re-enabling a disabled update service

Installing updates is a job for your patch tool, with its maintenance windows, approvals and reboot handling. A remedy is just a command you define, and LEA doesn't schedule it into maintenance windows or ask for approval before running it. Keep remedies off for anything that could disrupt production.

5. Workflow and best practices

Assign rules to groups. Apply update rules to groups of hosts: all Linux servers, all Windows workstations, production versus staging. Groups can be static, dynamic (matched by host attributes) or nested.

Check on every cycle. Checks run on each rule's cycle, closing the gap between patch runs. After reboots, confirm the running kernel matches what you expect.

Work with your existing tools. Use Ansible, WSUS or MECM to deploy patches, then LEA for ongoing checks that catch regressions. LEA fills the gap between "patches were pushed" and "hosts are in the state we expect."

Keep the evidence. LEA keeps the history of every result and remedy, seals evidence snapshots with an HMAC-SHA256, and produces stakeholder reports. That evidence supports audits under frameworks such as PCI DSS, ISO 27001 and SOC 2.

Key takeaways

  • LEA turns patching from "pushed and assumed" into checked on every cycle.
  • JSON rules carry per-OS variants for Windows, macOS and Linux.
  • Agents send raw output; the server decides pass or fail.
  • LEA complements patch tools (Ansible, WSUS, MECM); it doesn't replace them or deploy patches.
  • Opt-in remedies suit policy settings; result history and sealed evidence support your audits.

Getting started

Start small. Write one update rule, assign it to a test group, and watch results come in on the dashboard. Add more checks once you trust what you see.

For rule syntax and more examples, see the insights on OS security updates and JSON rule architecture. For help, contact GSR support.

LEA Platform produces evidence; certification is granted only by an accredited auditor.

Try LEA Platform on your own servers:

Start a free POC

Try it on your own servers.

30 days, up to 25 endpoints, every feature. We help you install it and agree on success criteria first.