Udev rule file written in a udev rules directory on Linux
Matches an auditd PATH record naming a file inside one of the five directories udev reads rules from, which is where this technique plants the `RUN+=` or `IMPORT{program}` key it wants systemd-udevd to execute the next time a matching device event fires. The directory list is MITRE's `UdevRulePath` knob, populated here with the five paths the technique text names, and it is split across three selections purely to record where the noise comes from: the vendor trees under /usr/lib and /lib are rewritten by ordinary package installs, while /etc, /run and /usr/local are where a rule gets placed by hand — by an administrator, or by an adversary who already has root. The bare /lib tree is anchored with startswith rather than contains, because as a substring it also swallows /usr/lib and /usr/local/lib and would put the hand-placed path on the package-noise side of that split. Three limits are structural. auditd records `name=` exactly as it was handed to the syscall, so an editor invoked from inside /etc/udev/rules.d writes a bare `99-persist.rules` and is missed by every one of these directory anchors. The PATH record carries no file content, so MITRE's `SuspiciousRunPattern` knob — the entire question of whether the new rule contains a `RUN+=` at all — cannot be applied inside this selection, and every rules-file write matches equally. And the analytic's second half, an unexpected process spawning from a systemd-udevd fork inside MITRE's `TimeWindow` knob, is a cross-event correlation lib/sigma has no way to express, so the execution leg of AN1056 is not attempted here. Prerequisite: auditd watches none of these directories in a default install, so this rule returns zero rows until watches such as `-w /etc/udev/rules.d/ -p wa -k udev` are loaded, and zero rows reads as quiet when it actually means blind. The `wa` permission also matters for volume: with it only writes and attribute changes are recorded, whereas a watch that includes `r` makes every udev rule reload match as well. The selection is written in the raw auditd record vocabulary — one document per record, with `type=PATH` and `name=`. A pipeline that collapses the SYSCALL, CWD and PATH records of one event into a single document, as the Auditbeat auditd module does, has no `type=PATH` document at all and carries the filenames under `auditd.paths`; there this rule needs a field mapping before it can match. UNVERIFIED AS AUTHORED — derived from MITRE ATT&CK DET0375, not hand-written and not tested by its author. Any lab result is on this rule's own page.Full descriptionShow less
The detection
The 3 SIEM queries below are previews produced by Siemphony’s own translator, not pySigma, and none has been executed against a real backend — review before you deploy.
detection.yml
Splunk · SPL
Run this as a search.
index=* ((type="PATH" AND (name="*/etc/udev/rules.d/*" OR name="*/run/udev/rules.d/*" OR name="*/usr/local/lib/udev/rules.d/*")) OR (type="PATH" AND name="*/usr/lib/udev/rules.d/*") OR (type="PATH" AND name="/lib/udev/rules.d/*"))Elastic · ES|QL
Run this as a search.
FROM logs-*| WHERE ((TO_LOWER(type) == "path" AND (TO_LOWER(name) LIKE "*/etc/udev/rules.d/*" OR TO_LOWER(name) LIKE "*/run/udev/rules.d/*" OR TO_LOWER(name) LIKE "*/usr/local/lib/udev/rules.d/*")) OR (TO_LOWER(type) == "path" AND TO_LOWER(name) LIKE "*/usr/lib/udev/rules.d/*") OR (TO_LOWER(type) == "path" AND TO_LOWER(name) LIKE "/lib/udev/rules.d/*"))
Wazuh · XML rule
Deploy to your manager — this is a rule, not a search.
<group name="sigma,linux,"> <!-- Rule ids must be unique on your manager; 100000+ is the user range. --> <!-- 3 rules: the Sigma condition ORs across different fields, which one rule cannot express. Any one matching is a hit. --> <rule id="100000" level="5"> <!-- Set <if_sid> to the decoder/base rule for linux so this only evaluates relevant events. --> <field name="type" type="pcre2">(?i)^PATH$</field> <field name="name" type="pcre2">(?i)(/etc/udev/rules\.d/|/run/udev/rules\.d/|/usr/local/lib/udev/rules\.d/)</field> <description>Udev rule file written in a udev rules directory on Linux (1/3)</description> <mitre> <id>T1546.017</id> </mitre> </rule> <rule id="100001" level="5"> <!-- Set <if_sid> to the decoder/base rule for linux so this only evaluates relevant events. --> <field name="type" type="pcre2">(?i)^PATH$</field> <field name="name" type="pcre2">(?i)/usr/lib/udev/rules\.d/</field> <description>Udev rule file written in a udev rules directory on Linux (2/3)</description> <mitre> <id>T1546.017</id> </mitre> </rule> <rule id="100002" level="5"> <!-- Set <if_sid> to the decoder/base rule for linux so this only evaluates relevant events. --> <field name="type" type="pcre2">(?i)^PATH$</field> <field name="name" type="pcre2">(?i)^/lib/udev/rules\.d/</field> <description>Udev rule file written in a udev rules directory on Linux (3/3)</description> <mitre> <id>T1546.017</id> </mitre> </rule></group>
Sentinel · KQL
Run this as a search.
Sentinel cannot express this construct. No Sentinel table is modelled for this logsource ({"product":"linux","service":"auditd"}), so there is nothing honest to query. Pick a logsource this translator maps, or write the KQL by hand. The Sigma source is on the first tab, unchanged.
Verdicts · reactions · comments
Community
Verdicts from engineers who actually deployed it, and the conversation around it.
Nobody has run this in a real environment and said what happened.
Verdicts from engineers who deployed it
0 castNo verdicts reported yet. The first one is worth more than the tenth — say what you ran it against.
Log in to report a verdict.
Log in to join the discussion.
No comments yet. Someone who deploys this will have something to say about it.