Config Hive: Host Posture Rules¶
The host_posture_rule hive holds the rules of Host Posture. Each record is one rule: a check that the Host Posture extension runs on your Windows, macOS and Linux sensors to find misconfigurations. The record name is the rule's id.
Like the Application Control hives, host_posture_rule is partitioned by organization. The extension ships no rules of its own. The rules you see here are the ones you installed from the default pack and the ones you wrote. All of them are ordinary records: you can edit, disable and delete any of them.
Format¶
{
"rule": {
"apiVersion": "lc-posture/v1",
"kind": "Signature",
"id": "lc.linux.kernel.ptrace-scope",
"version": 1,
"title": "ptrace is not restricted to administrators",
"...": "the rest of the rule"
},
"scope": {
"sensor_tags": ["prod"],
"exclude_sensor_tags": ["kiosk"]
}
}
| Field | Required | Description |
|---|---|---|
rule |
Yes | One rule in the lc-posture/v1 language, as a JSON object. See the rule language reference for the fields, and Writing rules for a walkthrough. The rule may carry its own tests. |
scope |
No | Limits the rule to some of your sensors, by tag. See Scope. |
Keywords are case-sensitive. The record accepts no other top-level key, and an unknown field is refused when you save the record.
The rule object is the same document you would write in YAML. Convert YAML to JSON before you save it through an API that takes JSON. The CLI accepts either, since it reads the file into an object.
Two things live in the record's metadata rather than in its data:
- Enabled. Only enabled records run. Disabling a rule stops it on every sensor at the next sweep.
- Expiry. A metadata
expiryremoves the record at that time: it disappears from every read and is then deleted. See A temporary rule.
A comment explaining why the rule exists goes in the metadata comment.
Note
Pass --enabled when you create a record with the CLI, as in the examples below, so that the rule starts running. Saving, enabling, disabling or setting the expiry of a rule also needs the sensor.task permission. See Permissions.
The record name is the rule id¶
The record name must equal rule.id. The hive refuses a record whose name differs, with an error that names both.
A rule id is lowercase and dot-separated, with at least two parts, for example lc.linux.kernel.ptrace-scope or acme.windows.rdp.no-nla. Any prefix is allowed. The default pack uses the lc. prefix to show where a rule came from. That is only a label: on sensor 5.4.4 and later, an lc. rule is treated exactly like any other.
Scope¶
By default a rule runs on every sensor whose platform is listed in rule.platforms. The optional scope narrows that by sensor tag. Platform targeting stays in rule.platforms.
| Field | Description |
|---|---|
sensor_tags |
If not empty, the rule runs only on sensors that carry at least one of these tags. |
exclude_sensor_tags |
A sensor that carries any of these tags is skipped. |
exclude_sensor_tags wins: a sensor that carries a tag from both lists is skipped. Each list holds at most 32 tags, and each tag is at most 128 bytes. An empty tag, or a tag with spaces at its start or end, is refused, since it would match no sensor.
Note
scope uses your sensor tags. It is not the same as the tags field inside rule, which labels the rule itself (for example baseline:windows).
The extension's own scope_tags limit which sensors a sweep covers, and a sweep given tags uses its own tags instead. A scan of one sensor ignores scope_tags. Each rule's scope applies in every case.
Validation¶
The hive checks a rule when you save it, in three stages, and refuses the record with the problems of the first stage that fails:
- The required fields.
apiVersion,kind,id,version,title,severity,platforms,probesandviolationare present with the right types; theidformat, thetitlelength,platforms,standardsand therequiresformat are valid; the document is at most 128 KiB. - The record. The record name equals
rule.id, and thescopetags are valid. - Everything else. Unknown top-level fields, probe types and probe names, the limits (16 probes,
configpaths anddiscoversettings), the probe typesrequires.evaluatorallows, then every expression (it must compile and use only the functions the language provides, regular expressions must compile, literal selectors must be declared), then the rule'stests. Tests are optional, but if a rule carries them they must all pass, and a test whose result rests on an undeclared absence is refused.
Each problem names its place in the record, for example LANG rule.violation: ... or FAIL rule.tests[set to 10]: expect fail, got error. At most 50 are listed.
The hive does not check keys inside a probe (path: for paths:), field names inside a condition (p.valeu), the types of comparisons (p.value == 1), sysctl prefixes, registry roots or catalog item names. Those mistakes show up on hosts as error or invalid, or in tests that reach them. Write tests. See Writing rules.
To check a record without saving it:
limacharlie hive validate --hive-name host_posture_rule --key acme.linux.sshd.max-auth-tries --input-file rule.yaml
It runs the same checks and tests as a save, and needs the same permissions. It is in CLI 5.14.0 and later.
Permissions¶
Managing records in the host_posture_rule hive requires:
| Action | Permissions |
|---|---|
| Read rules and their metadata | host_posture.get |
| Create or edit a rule | host_posture.set and sensor.task |
| Enable, disable or set the expiry of a rule | host_posture.set and sensor.task |
| Delete a rule | host_posture.set |
Saving, enabling, disabling and setting the expiry need sensor.task because a rule is code that LimaCharlie runs on your sensors, and enabling it decides whether it runs. The permission is checked when you save or change the record, not on every sweep. Deleting a rule needs only host_posture.set, since it removes something from your sensors.
By default the Owner, Administrator and Operator roles can do all of the above, and the Viewer role has host_posture.get. See Permissions.
Examples¶
The examples use the CLI (5.14.0 or later): the generic limacharlie hive commands and the limacharlie host-posture rules group. Both read and write the same records. hive set also takes --expiry and adds or removes single tags (--tag-add, --tag-rm); host-posture rules set has no --expiry, and its --tag replaces the whole tag list. Pass --oid <oid> if your CLI is not already pointed at the organization.
Installing the default pack¶
The quickest way to start is to write LimaCharlie's pack of rules into the hive:
See The default rule pack for what the command does and does not overwrite.
A rule from the pack, kept off developer workstations¶
This is based on the lc.linux.kernel.ptrace-scope rule of the default pack. It flags Linux hosts where any process can attach to another with ptrace, the precondition of CVE-2026-46333. The scope here keeps it off developer workstations, where debuggers need ptrace. Save it as ptrace.json:
{
"rule": {
"apiVersion": "lc-posture/v1",
"kind": "Signature",
"id": "lc.linux.kernel.ptrace-scope",
"version": 1,
"title": "ptrace is not restricted to administrators",
"description": "CVE-2026-46333 lets a local user steal file descriptors from exiting setuid programs (chage, ssh-keysign, pkexec) through ptrace and pidfd_getfd, which exposes /etc/shadow and SSH host keys. Setting kernel.yama.ptrace_scope to 2 or higher blocks the technique.",
"severity": "medium",
"platforms": ["linux"],
"tags": ["threat-pack:linux-kernel-attack-surface"],
"threat_refs": { "cves": ["CVE-2026-46333"] },
"requires": { "evaluator": "1.1" },
"probes": {
"ps": { "state": "linux.sysctl.kernel.yama.ptrace_scope" }
},
"violation": "absent(ps) || num(ps.value) < 2",
"evidence": {
"ptrace_scope": "absent(ps) ? \"absent (no Yama LSM)\" : ps.value"
},
"remediation": {
"action": "set-sysctl",
"args": { "key": "kernel.yama.ptrace_scope", "value": "2" },
"text": "Set kernel.yama.ptrace_scope=2 in /etc/sysctl.d/. Debuggers then need root, so leave developer workstations at 1 if needed."
},
"tests": [
{ "name": "ubuntu default (1)", "probes": { "ps": { "status": "ok", "value": "1" } }, "expect": "fail" },
{ "name": "admin-only (2)", "probes": { "ps": { "status": "ok", "value": "2" } }, "expect": "pass" },
{ "name": "no attach (3)", "probes": { "ps": { "status": "ok", "value": "3" } }, "expect": "pass" },
{ "name": "yama not built", "probes": { "ps": { "status": "absent" } }, "expect": "fail" },
{ "name": "unreadable", "probes": { "ps": { "status": "unreadable" } }, "expect": "error" }
]
},
"scope": {
"exclude_sensor_tags": ["developer-workstations"]
}
}
limacharlie hive set \
--hive-name host_posture_rule \
--key lc.linux.kernel.ptrace-scope \
--input-file ptrace.json \
--enabled \
--comment "Developer workstations excluded: debuggers need ptrace"
The same command is available as limacharlie host-posture rules set --key ... --input-file ....
A rule for your own fleet¶
Rules are not limited to the default pack. This one, saved under your own prefix, checks the SMB signing setting on Windows servers you tag file-servers. It reuses the registry reads of the pack's lc.windows.network.smb-signing-not-required, without that rule's per-build exceptions:
{
"rule": {
"apiVersion": "lc-posture/v1",
"kind": "Signature",
"id": "acme.windows.smb.signing-required",
"version": 1,
"title": "File server does not require SMB signing",
"description": "File servers must require SMB signing so that relayed NTLM authentication cannot be used against them.",
"severity": "high",
"platforms": ["windows"],
"requires": { "evaluator": "1.1" },
"probes": {
"req": {
"registry": {
"key": "HKLM\\SYSTEM\\CurrentControlSet\\Services\\LanmanServer\\Parameters",
"value": "RequireSecuritySignature"
}
}
},
"violation": "absent(req) || req.value != \"1\"",
"evidence": {
"require_security_signature": "absent(req) ? \"absent\" : req.value"
},
"remediation": {
"text": "Enable the policy \"Microsoft network server: Digitally sign communications (always)\"."
},
"tests": [
{ "name": "required", "probes": { "req": { "status": "ok", "value": "1" } }, "expect": "pass" },
{ "name": "not required", "probes": { "req": { "status": "ok", "value": "0" } }, "expect": "fail" },
{ "name": "absent", "probes": { "req": { "status": "absent" } }, "expect": "fail" },
{ "name": "unreadable", "probes": { "req": { "status": "unreadable" } }, "expect": "error" }
]
},
"scope": {
"sensor_tags": ["file-servers"]
}
}
limacharlie host-posture rules set \
--key acme.windows.smb.signing-required \
--input-file smb.json \
--enabled
A temporary rule¶
Run a check for a limited time, for example during an incident. Set the expiry with the CLI --expiry flag, which takes Unix epoch seconds:
limacharlie hive set \
--hive-name host_posture_rule \
--key acme.linux.incident.check \
--input-file check.json \
--enabled \
--expiry 1797292800 \
--comment "Incident check: remove after the window"
1797292800 is 2026-12-15 00:00:00 UTC. Replace it with the end of your own window (date -d '2026-12-15 00:00:00 UTC' +%s prints it). The hive refuses an expiry more than an hour in the past. At the expiry the record disappears and is then deleted, so its findings close as retired. The hive stores expiry in milliseconds, so hive get shows 1797292800000. If you write the record with a usr_mtd block instead of the flag, give the expiry in milliseconds there.
Listing, reading, disabling and deleting rules¶
limacharlie host-posture rules list
limacharlie host-posture rules get --key lc.linux.kernel.ptrace-scope
limacharlie host-posture rules disable --key lc.linux.kernel.ptrace-scope
limacharlie host-posture rules delete --key acme.windows.smb.signing-required --confirm
What happens when a rule changes¶
- The extension reads the enabled records of the hive and caches them for about a minute, so a change reaches the next sweep, not instantly.
- A rule with a new
versionreplaces the old one. Findings it raised keep their history. - A disabled, expired or deleted rule stops running. The per-host findings it raised close with the reason
retired, and in Cloud Security the rule's finding closes as "rule removed", not as resolved. A rule shows as resolved only when the hosts assessed against it actually pass. - A record that fails to parse when the extension reads it is skipped and reported in the extension's
status. It does not stop the other rules.
Limits¶
- Record name (the rule id): the id syntax of the language, lowercase and dot-separated.
- Rule document: 128 KiB as JSON.
idandtitle: 256 bytes each.standards: 32 references per framework, 128 bytes each. scope.sensor_tagsandscope.exclude_sensor_tags: 32 tags each, 128 bytes per tag.- Enabled rules per organization: the extension runs at most 2,000, in record-name order. A rule past the cap is reported on every host in its scope as an
errorresult with the reasonover_capacity. It is never dropped silently. - Rules per sensor: the extension splits a sensor's rules into up to 16 requests of at most 256 rules and 512 KB, and sends each at least 15 minutes after the sensor answered the previous one. Rules that do not fit in 16 requests are reported as
over_capacitytoo. - Files per
configprobe: a sensor reads at most 32. See the rule language reference.