Write and edit rules
This guide shows you how a rule works, how to fill in every part of the rule editor, and how to create a complete rule from scratch. It ends with saving, rolling out changes and editing many rules at once.
Before you start
- You need an administrator account to create or change rules. Anyone can read them.
- You need at least one host with a working LEA agent, to test the rule on. See Add and manage hosts.
- Look in the rule library first. LEA Platform ships hundreds of ready-made rules. Starting from one of them is faster and safer. See Rule library and updates.
What a rule is made of
A rule is one check, for example "SSH root login is disabled". It has these parts:
| Part | In plain words |
|---|---|
| Validations | The commands the LEA agent runs on the host. They only read the current state, for example cat /etc/ssh/sshd_config. The agent sends the raw output to the server. |
| Expectations | What the server looks for in that output, for example "a line PermitRootLogin no must be present". If every expectation is met, the result is PASS; otherwise FAIL. When the output shows the check could not run (for example Permission denied), the result is CAN'T CHECK. |
| Remediations (optional) | Commands that fix a failing host. They run automatically, so they are optional and off in library rules. See Fix hosts automatically. |
| Parameters (optional) | Values that are filled into the commands, such as a port number or a secret. |
| Functions (optional) | Code on the LEA Platform server that runs on the rule's results. See Functions. |
| General settings | Name, description, how often it runs (interval), severity, tags. |
A rule does nothing on its own. Hosts run a rule only when the rule is active and assigned to an active group the host belongs to. See Groups.
Follow the LEA rule conventions
These conventions keep rules safe, fast and explainable. Library rules follow them; follow them in your own rules too.
-
Read only, raw output. Validation commands only read state:
catof files and of/proc,stat,reg query,Get-ItemProperty,Get-Service. They never change anything. -
No filtering on the host. Do not use
grep,awk,sedorcutto pick out lines on the host. Send the whole output and let the expectations decide on the server. Then a failure can always be explained from the stored output.Good Bad cat /etc/ssh/sshd_configgrep Protocol /etc/ssh/sshd_configcat /proc/*/commps aux | grep clamdcat /proc/moduleslsmod -
No
sudo. The agent runs as an unprivileged user. If a check needs more rights, write in the description which command must be allowed, instead of callingsudo. -
Python regular expressions. Patterns use Python syntax. Use
\s,\d,\w, not POSIX classes such as[[:space:]]. Use word boundaries (\bsshd\b) for process and module names. Use^and$only when needed, and then start the pattern with(?m). -
Optional services pass when absent. When a setting only matters if a service runs, print the marker
LEA_RULE_no_servicewhen the service is not running, and accept the marker in the expectation:cat /proc/*/comm | grep -q '^sshd$' && cat /etc/ssh/sshd_config || echo 'LEA_RULE_no_service'Expectation:
(?mi)^[ \t]*PermitRootLogin[ \t]+no\b|LEA_RULE_no_service. This is the only accepted use ofgrep: as a yes/no test, never to filter the reported output. -
A "must not match" check alone is not enough. If the output is empty, nothing forbidden is found, so the rule would pass. Add a "must match" check for
\S(the output is not empty). -
Keep the error output and say when the check could not run. Do not hide error messages with
2>/dev/null(only thecat /proc/*/commtest for a running service may). Fill Could not check if → stderr matches withPermission denied|Operation not permittedon Linux and macOS, so a file the agent cannot read is reported as Could not check instead of a failure. Never putPermission deniedin a "must not match" check: that turns an unreadable file into a failure. -
One rule, one concern. Use separate validation and expectation entries per operating system, and per distribution when the commands differ (for example
ufwon Ubuntu andfirewalldon Red Hat). -
macOS has no
/proc. Use for exampleps -axthere. Windows commands run in PowerShell.
Copy-paste patterns for common checks (process running, module not loaded, Windows registry, one command per distribution) and the full rule JSON are in Rule format.
Open the rule editor
- New rule: open Rules and click New rule at the top right, or go to Create rule.
- Existing rule: open the rule and click Edit at the top right, or click the pencil icon (Edit Rule) in its row on the Rules page.
- Copy of a rule: open the rule and click Clone at the top right, right-click the rule anywhere and choose Clone rule, click the copy icon (Clone Rule) in its row, or the copy icon (Clone) in the editor. The copy opens in the editor as "<name> (Copy)" and is only created when you save it.
The editor has a list of sections on the left: General, Parameters, Validations, Expectations, Remediations and Functions. A number next to a section shows how many entries it has. A red dot means the section has an error. The buttons at the top right are Import JSON, JSON tools, Save rule and Cancel, plus View rule, a copy icon (Clone) and a bin icon (Delete) when you edit an existing rule.
Fill in General
| Field | What to enter |
|---|---|
| Rule name (required) | A unique, clear name of at most 120 characters, for example "SSH Root Login Disabled". |
| Active | On: hosts in the rule's groups run it. Off: it runs nowhere. |
| Staging (does not affect host compliance) | On: the rule runs and shows its results, but does not count toward host compliance. See Staging rules. |
| Description | What is checked and why. If the agent needs extra rights to read a file, say which ones. |
| Category | A free word for grouping, for example access_control or network_security. |
| Severity | Critical, High, Medium, Low or Informative. Default (Settings) uses the default from Settings → Severity. Severity weighs the rule in the compliance score. A rule without expectations is informational: its severity shows grey everywhere, because it never fails. |
| Interval (seconds) (required) | How often the rule runs. 3600 (one hour) is a good default. Use 43200 (12 hours) for slow commands. |
| Command info key (tag) | Usually empty. When set, the rule's latest output is also stored on the host under this name. Dynamic groups and the Host metadata filter can use it. See Groups. |
| Tags | Labels. Pick known tags from the list or type a new one and press Enter. Tags starting with std: connect the rule to compliance frameworks, for example std:ISO27001:A.8.2. See Reports and evidence. |
Add parameters
A parameter is a named value that is filled into the rule's commands. Write it in a command as %NAME%. Use parameters for values that differ between sites, so you change the value instead of the command.
-
Open Parameters and click Add parameter (or Add secret for a password or key).
-
Enter the Parameter name, for example
MAX_AUTH_TRIES. -
Enter the Parameter value, for example
4. -
Choose the Type:
Type What happens Internal variable The server replaces %NAME%in the commands with the value before it sends them. Use this in most cases.Environment variable The agent sets an environment variable with this name while the command runs (on Linux read it as $NAME). A host or group environment variable with the same name replaces it (see Environment variables).File The agent writes the value into a temporary file with this name in the system's temporary folder, readable only by the agent, and removes it afterwards. LEA Platform variable A value that differs per host, filled in by the server for each host. Choose it under Platform field, for example Host UUID. -
Use the parameter in a validation command, for example
%MAX_AUTH_TRIES%.
You can also insert a host-specific value directly: in Validations or Remediations, click the { } icon (Insert LEA platform variable) next to the command and pick one.
Built-in values need no parameter: %LEA_UUID% is always replaced with the host's LEA identity (its UUID). A parameter with the same name takes priority.
%NAME% is replaced only when a parameter (or built-in value) with exactly that name exists; anything else is sent to the host as written. That is what you want for Windows variables such as %SystemRoot%, but a typo would go unnoticed, so Save rule refuses any %LEA_...% that is neither a parameter nor a built-in value, and tells you which one.
Secrets are hidden in the editor (click the eye icon to show them for a moment). Secret values are not stored in rule versions. Read-only users never receive secret values: the rule page shows secret · hidden and the editor shows Secret value (hidden), also in the API, the AI assistant and the lea command line. Hosts in probation (after a re-enrollment, see Add and manage hosts) do not receive rules that use secret parameters until an administrator confirms them.
Add validations
- Open Validations and click Add validation.
- Leave Field on command.
- In the text box next to it, type the command, for example
cat /etc/ssh/sshd_config. For a short script, press Enter to start a new line; the box grows as you type. On Linux and macOS the agent runs the command withsh, so use plainshsyntax, not bash-only features such as[[ ]]or arrays. Remediations use the same text box. - In Systems, choose the operating systems this command is for: Linux, Darwin (macOS) or Windows. The list shows the systems your hosts report.
- In Target Distributions, choose distributions only when this command is for some Linux distributions only, for example Ubuntu. Leave it empty for all.
Add one validation per operating system or distribution family that needs a different command. If several validations apply to one host, their outputs are joined.
A validation for a named distribution replaces the ones with an empty Target Distributions on hosts of that distribution: those hosts run only their own. The same applies to expectations.
At least one validation is required.
Add expectations
An expectation is a check the server makes on the output.
-
Open Expectations and click Add expectation.
-
Choose the Field:
Field Passes when re: stdout The pattern is found in the output. re: stderr The pattern is found in the error output. Not re: stdout The pattern is not found in the output. Not re: stderr The pattern is not found in the error output. returncode The command exits with exactly this number, for example 0.md5 Special case; leave it unless a library rule uses it. -
Type the pattern in the text box next to it.
-
Set Systems and Target Distributions to match the validation it belongs to.
Every expectation that applies to a host must pass for the rule to pass. When several expectations apply, all of them are checked.
The editor holds one field per expectation entry. To combine a "must match" and a "must not match" check, add two expectations with the same systems. In the rule JSON they can also sit in one entry, as in the library rules.
Check a pattern
Next to each pattern there is a status icon. The server checks the pattern with the same Python engine it uses for results:
- spinner: checking,
- green tick: Valid Python regular expression,
- red cross: the pattern is invalid; hover to see the error and its position,
- grey question mark: the check could not run.
Use the Regex Builder
- Click the < > icon (Open Regex Builder) next to a pattern.
- In Test pattern, edit the pattern.
- In Sample text, paste real output. Copy it from a result page (copy icon next to STDOUT). See Read results and fix failures.
- Look at the highlighted matches. An invalid pattern shows "Invalid Python regular expression" with a marker under the wrong position.
- Click Apply pattern to put the pattern into the field, or Cancel.
The dialog also explains how patterns are evaluated and gives a command you can run on a test machine with Python 3 to check a pattern yourself.
Important: Apply pattern writes the pattern into a "must match" (re) field. When you opened the builder from a Not re field, copy the pattern from Test pattern, click Cancel and paste it into the field yourself.
Facts about patterns:
- The server runs
re.search(pattern, output)on the whole output. re passes when anything matches; Not re passes when nothing matches. - Without
(?m),^and$mean the start and end of the whole output. Start a pattern with(?m)to make them work per line.(?i)ignores case.(?s)lets.match line breaks. These flags must be at the very start. - Online testers must be set to the Python flavour.
- In rule JSON every backslash is doubled:
\bsshd\bis written"\\bsshd\\b". In the editor fields you type it once.
Could not check
Some outputs mean the check could not run at all, for example cat: /etc/ssh/sshd_config: Permission denied when the agent may not read the file. Mark them in the expectation's Could not check if row: stderr matches for the error output, stdout matches for the output. Empty fields are ignored. In the rule JSON this is unknown_re:
{"system": ["Linux"], "distribution": [],
"re": {"stdout": "(?mi)^[ \\t]*PermitRootLogin[ \\t]+no\\b"},
"not_re": {"stdout": "(?mi)^[ \\t]*PermitRootLogin[ \\t]+(?!no\\b)\\S"},
"unknown_re": {"stderr": "Permission denied|Operation not permitted"}}
When the expectation passes, the result is PASS, whatever the error output says. When it does not pass and the pattern matches, the result is CAN'T CHECK: not a pass, not a failure, no remediation, and the host stays compliant (see Could not check). Two exceptions keep real problems visible:
- if a "must not match" check of the same expectation finds a forbidden value in what could be read, the result is FAIL,
- if another expectation fails, the result is FAIL.
A Could not check pattern alone is not a check: an expectation still needs a match, must-not-match, return code or md5 check. Library rules carry the pattern on every expectation (Permission denied|Operation not permitted on Linux and macOS, the PowerShell access-denied messages on Windows).
Staging rules
A staging rule runs on its hosts and shows PASS, FAIL or CAN'T CHECK as usual, with its severity, but it never affects host compliance: it does not make a host non-compliant, is left out of the worst severity and the compliance score, is left out of compliance reports, and integrations do not see it. Use it to try a new or changed rule on the fleet before it counts.
- Turn Staging (does not affect host compliance) on in General in the rule editor, or for many rules at once with Bulk edit (see Edit many rules at once).
- Staging rules carry a STAGING chip on the Rules page, the rule page and the host page, and the Rules page can filter on them.
- Notifications and webhooks about the rule itself (for example "rule failed on host") still fire, so you see how it would behave.
- Turn Staging off to make the rule count. Hosts that fail it then become non-compliant at once.
Make an informational rule
A rule with no expectations is informational. It only collects data, for example a list of installed packages. Its results show INFO (no verdict) and never make a host non-compliant. The rule page shows the pill INFO.
Use it together with Command info key (tag) to collect host data for dynamic groups and filters.
Add remediations and actions
Remediations are commands that fix a failing host automatically. Read Fix hosts automatically before you add one.
- Open Remediations and click Add remediation.
- Type the command and set Systems and Target Distributions.
Under Actions you can define named command lists (click Add action, enter an Action name in lowercase letters, digits and _, then add commands). A server-side function can choose one of them to run on the host. Actions never run on their own.
Note: Library rules keep their fix disabled under the name
_remedy. The editor does not show_remedy, and saving the rule in the editor does not keep it. To see it, open the rule page → Definition → Raw definition → Show JSON. See Fix hosts automatically.
Attach functions
The Functions section attaches server-side functions to the rule, for example to open a ticket when the rule fails. Click Manage functions to open Settings → Functions. See Functions for how to write and attach them.
Example: check that SSH root login is disabled
This example creates a Linux rule that fails when the SSH server allows direct root login.
-
Open Create rule.
-
In General, enter:
- Rule name:
SSH Root Login Disabled (custom) - Active: on
- Description:
Fails when sshd_config does not contain PermitRootLogin no, or allows root login. The agent must be able to read /etc/ssh/sshd_config. - Category:
access_control - Severity: High
- Interval (seconds):
3600 - Tags:
std:ISO27001:A.8.2(optional)
- Rule name:
-
Open Validations, click Add validation and enter:
- Field: command
- command:
cat /etc/ssh/sshd_config - Systems: Linux
-
Open Expectations, click Add expectation and enter:
- Field: re: stdout
- pattern:
(?mi)^[ \t]*PermitRootLogin[ \t]+no\b - Systems: Linux
This means: some line, ignoring case and leading spaces, says
PermitRootLogin no. Commented lines (starting with#) do not count. -
Click Add expectation again and enter:
- Field: Not re: stdout
- pattern:
(?mi)^[ \t]*PermitRootLogin[ \t]+(?!no\b)\S - Systems: Linux
This means: no line sets
PermitRootLoginto anything other thanno. -
Wait for the green tick next to both patterns.
-
Click Save rule. You should see the Rules page with your new rule.
-
Assign the rule to a small test group: open the rule, click the Groups tab, and use + Add to group... at the bottom of the table. See Groups.
-
Wait for the hosts' next run of the rule (up to the interval), then open the rule's Hosts tab. You should see PASS or FAIL per host.
-
Open a FAIL and read the output to confirm the rule is right. See Read results and fix failures. When it is, add the rule to your production groups.
The same rule as JSON. You can paste it with Import JSON instead of steps 2 to 5:
{
"name": "SSH Root Login Disabled (custom)",
"description": "Fails when sshd_config does not contain PermitRootLogin no, or allows root login. The agent must be able to read /etc/ssh/sshd_config.",
"active": true,
"category": "access_control",
"cycle": 3600,
"severity": "high",
"cmd_info_key": null,
"tags": ["std:ISO27001:A.8.2"],
"parameters": [],
"cmd": {
"validation": [
{"command": "cat /etc/ssh/sshd_config", "system": ["Linux"], "distribution": []}
],
"expect": [
{"system": ["Linux"], "distribution": [],
"re": {"stdout": "(?mi)^[ \\t]*PermitRootLogin[ \\t]+no\\b"},
"not_re": {"stdout": "(?mi)^[ \\t]*PermitRootLogin[ \\t]+(?!no\\b)\\S"}}
],
"remedy": [],
"system": []
}
}
Field by field: cycle is Interval (seconds); validation holds the commands with their system and distribution; expect holds the expectations, with re (must match) and not_re (must not match) per stream.
Note: On Red Hat family systems
/etc/ssh/sshd_configis readable by root only. There the agent gets "Permission denied", the output is empty, and the rule fails. Either give the agent user read access, or start from the library rule SSH Root Login Disabled, which also reads/etc/ssh/sshd_config.d/and passes withLEA_RULE_no_serviceon hosts without an SSH server.
Use systems and distributions
- A validation or expectation with Systems set applies only to hosts with that operating system. Empty means all systems.
- Target Distributions narrows it further. Empty means every distribution of that system.
- When some entries name the host's distribution and others name none, the entries that name the distribution win. Entries that name the distribution and its version win over both.
- If no validation matches a host, the host never gets a result for the rule (INFO).
Use the distribution names exactly as your hosts report them. The Distribution column on the Compliance page shows them, and Target Distributions offers them.
Import JSON and use JSON tools
Import JSON (top right) fills the editor from a rule in JSON format:
- Click Import JSON.
- On Paste JSON, paste the rule. Or on Upload File, click Choose JSON File and pick a
.jsonfile. - Click Import.
You should see all sections filled in. Nothing is saved until you click Save rule. You can paste a rule from the rule library as it is.
JSON tools opens the Rule JSON Tools dialog for the rule you are editing:
- View: the rule as formatted JSON. Copy to Clipboard copies it.
- Edit: change values in a tree.
- Raw: edit the JSON text directly. You should see "JSON is valid and ready to save" when the text is valid.
Click Apply Changes to take the edits into the editor, then Save rule.
Note: The editor keeps only the parts it knows: validations, expectations, remedy, actions, parameters and functions. A
_remedyentry in imported JSON is dropped.
Save a rule and roll out the change
Click Save rule.
- New rule: it is saved and you return to the Rules page.
- Name, description, tags, severity, interval, category or Active changed: the change applies to all hosts right away.
- Commands, expectations, remediations or parameters changed: a dialog opens, for example Roll out the new definition. A changed definition becomes a new version of the rule; earlier versions stay on the rule's Versions tab.
In the rollout dialog choose:
| Option in the console | What it does | When to use it |
|---|---|---|
| All hosts now | Every host runs the change from its next run. | Fixes you trust, for example a corrected pattern. |
| New hosts only | Hosts that already run the rule stay on their current version ("held") until you promote them. Hosts that get the rule later use the change. | Risky changes. Promote a test group first, then everyone. |
| Selected hosts and groups | Only the Hosts and Groups you pick run the change now and are pinned to it; every other host is held until you promote it. The pins show on the rule's Versions tab under Pinned hosts and groups. Hosts that get the rule later use the change. | Trying a change on a test group in one step. |
Tick Use this choice as the default next time to make it the preselected option. The default can also be set in Settings → Rule sources. Click Apply.
To promote held hosts, open the rule's Versions tab (Held hosts → Update or Update all), or the Held rules tab of a host or group. See Rule library and updates.
Read the Rules table
The Rules page lists every rule. Hover a column name to see what it means.
| Column | What it shows |
|---|---|
| Status | Whether the rule passes on your hosts, judged by each host's latest result, in plain text: one failing host makes it Failing. Passing means every host with a result passes; Pending means no host has reported a result yet; Could not check means the agent could not read the input on any host that reported; Info means the rule has no expectations; Inactive means the rule is turned off. The small bar under the word shows the rule's hosts: passing in green on the left, pending or could not check in grey, failing in red on the right. Hover the bar for the counts, for example 200 hosts: 180 passing · 20 failing. A STAGING chip marks a rule that does not count toward host compliance. |
| Severity | How serious it is when this rule fails, from Critical down to Informative. Higher severities weigh more in the compliance score. A grey severity marks an informational rule (no expectations): it never fails, so its severity has no effect. |
| Category | A free word that groups similar rules, for example access_control, shown as Access control. It does not change how the rule runs. |
| Cycle | How often each host runs the rule again, shown in seconds (s), minutes (m), hours (h) or days (d), or once for a rule that runs one time. The rule editor calls it Interval (seconds). |
| Last executed | How long ago the rule last returned a result on any host; hover it for the exact time in your local time zone. Click it to open the rule's results on the Execution page. A dash means no host has run it yet. |
Read the rule page
The rule page (/rules/<id>) shows pills next to the name: INACTIVE, vN · N VERSIONS (when the rule has more than one version, see Rule updates), HELD ON N HOSTS, or the state on hosts (N FAILING, ALL PASSING, INFO). Buttons: Check now (see Check now), Execution (results of this rule on the Execution page) and Edit.
| Tab | What you find there |
|---|---|
| Overview | Compliance across hosts and About this rule: remedy (automatic or none), frameworks and tags, with View definition and All hosts. |
| Hosts | Every host that runs the rule, with its status, Last check and whether the host is online or stale. Filter Failing, Passing, Info. |
| Definition | Commands, expectations, remedies, parameters and functions. Raw definition → Show JSON shows the full stored definition. |
| Versions | Every version with the number of hosts on it: Diff, Apply (make it current), Pin hosts (keep hosts or groups on it), Held hosts, and Pinned hosts and groups. |
| Run history | Every run of the rule on every host. |
| Groups | Groups that run the rule, directly or through nesting. Add it with + Add to group..., remove it with the remove icon. |
Read the Hosts tab
| Column | What it shows |
|---|---|
| Status | The latest result of this rule on the host: PASS, FAIL, CAN'T CHECK (the agent could not read the input), or INFO when there is no pass or fail. |
| Version | The version of the rule that produced the host's latest result. Orange means an older version than the current one; the host is held, or has not reported since the change. Shown only for rules with more than one version. |
| Output | The start of the raw output of the host's latest run of this rule (stdout, or stderr in red when there is no stdout). Click the row for the full output and verdict. |
| RC | The exit code of that run. Orange means non-zero. |
| Distribution | The host's operating system and version. |
| IP Address | The address the host reported. |
| Agent Version | The LEA agent version on the host. |
| Last check | When the host last sent a result for this rule. never means the host has not run it yet. |
| Host check-in | Whether the host has contacted the server in the last 24 hours (online) or not (stale). A stale host's results may be out of date. |
Read the Groups tab
| Column | What it shows |
|---|---|
| Group | A group whose hosts run this rule, because the rule is in the group or in a group it includes for its rules. Only active groups are listed. |
Check now
A rule runs on each host at its interval. Check now runs it on the next check-in instead, for example right after you fixed a host or changed the rule.
- Open what you want to check and click Check now, or right-click it anywhere and choose the same item:
- Rule page: Check now, then choose All hosts that have this rule (the default), Hosts in a group or Selected hosts.
- Group page: Check group now runs every rule of the group on every host in the group, nested groups included.
- Host page: Check all rules now runs every rule the host has.
- Result page (one rule on one host): Check now runs that rule on that host.
- The dialog shows how many rules and hosts it covers. Click Check now.
- Hosts run the checks at their next check-in, usually within seconds: they check in every 5 seconds for the next 5 minutes. A host that is offline runs them if it checks in within the hour; after that the request is dropped.
- Click Show in Execution in the message to watch the results arrive. These runs carry the ON REQUEST tag.
Good to know:
- You need the Run remediation permission (the Operator, Engineer and Administrator roles have it). With access to some groups only, only hosts in those groups are checked.
- Only active hosts and active rules that apply to the host's system are checked. A host in probation still does not get rules with secret parameters.
- The same rule on the same host can be asked for once a minute. Asking again sooner skips it; the dialog says how many are skipped.
- A check runs the rule's validation only, never its remediation. Results count like any other check.
- Each request is in Audit as CHECK_NOW, with who asked and the counts.
Edit many rules at once
- Open Rules.
- Filter the list to the rules you want (status, severity, tags, group, search).
- Click the checkbox icon (Select rules) at the left end of the table header. A selection bar appears above the table. Click rules to select them, or use Select all N on this page or Select all N rules matching in the bar.
- Choose an action on the right of the selection bar:
- Add to group: in Add Rules to Group pick a Group, click Continue and confirm. The selected rules are added to it. To put them in a new group, pick + New group…, type its New group name and continue; the group is created with the selected rules and no hosts, so add hosts to it on its page.
- Bulk edit: opens Bulk Edit Rules.
- In Bulk Edit Rules, choose Selected rules or All rules matching the current filters. Tick what to change; anything left unticked is not changed:
- Staging, then set its switch on or off for those rules (see Staging rules),
- Interval, with a Unit (Seconds, Minutes, Hours, Days),
- Severity (or Default (Settings)),
- Tags, with Mode Add, Remove or Replace. With Replace and no tags, all tags are cleared.
- Click Apply.
On the Rules page, the pill UPDATE means a newer version is available from a rule pack, HELD n means n hosts still run an older version, and vN marks the current version of a rule that has more than one version. When the name column is too narrow for every pill, the name stays readable and the pills that do not fit fold into a +N pill; hover it to see them (they stay clickable).
Delete a rule
- Open the rule in the editor.
- Click the bin icon (Delete) at the top right, then confirm in the Delete rule dialog.
Deleting cannot be undone. To stop a rule but keep its history, turn Active off instead.
If something goes wrong
- "At least one validation command is required": add a validation.
- "Rule name is required" or "Cycle must be a positive number": fix them in General.
- "Rule name must be at most 120 characters": shorten the name in General.
- The rule fails on every host with empty output: the agent cannot read the file, or the file does not exist on that distribution. Read stderr on a result page.
- The rule passes where it should fail: the pattern may match a commented line (anchor it with
(?m)^[ \t]*), or a "must not match" check passes on empty output (add a\S"must match" check). - A host never gets a result: no validation matches its system or distribution, or the rule is not in any of its groups, or the rule is inactive.
- Your change does not show on some hosts: they are held on an older version. Check the Versions tab.
For more, see Read results and fix failures and Troubleshooting.
Related
- Rule library and updates
- Groups
- Fix hosts automatically
- Functions
- Rules reference
- Rule format