Skip to content

Siemphony is in beta and still being built. How a rule earns its badge.

Siemphony’s repertoire

PAM configuration or module directory written on Linux

Siemphony@siemphonylowT1556.003unverified
AN1250 asks for file modification under /etc/pam.d/ or /lib/security/ correlated with unusual authentication activity. lib/sigma has no cross-event join or timeframe, so this rule takes only the file-write leg — an auditd PATH record naming one of MITRE's own `MonitoredPaths`, populated here with the two directories MITRE names plus the modern multiarch module location (/lib/x86_64-linux-gnu/security/ and /usr/lib/x86_64-linux-gnu/ security/), which is this rule's own addition since most current distributions moved pam_unix.so and friends there rather than the legacy /lib/security/ path MITRE cites. This follows the same {product: linux, service: auditd} PATH-record vocabulary already established for T1053.003, T1543.002 and T1546.017 in this corpus. It shares the crontab rule's exact limitation: auditd's `name=` field records the path exactly as handed to the syscall, so an editor that writes a temporary file and renames it into /etc/pam.d/ (vi, many config-management modules) is caught by the rename target, but a relative write from inside the directory (`cd /etc/pam.d && cp evil sshd`) logs only `name="sshd"` with the directory on a separate, unjoinable CWD record — no path selection here can catch that form. The second AN1250 logsource, {category: process_creation, product: linux} covering the execve leg, is not attempted: MITRE frames it as correlating with the resulting login anomaly, which is the same cross-event join this rule already cannot do, and a bare "some process ran" selector on that category would add no observable beyond the file write already captured here. The macOS leg, AN1251, is not attempted at all: both its logsources, {product: macos, service: unifiedlog} and {product: macos, service: osquery}, have no established Sigma field vocabulary anywhere in this corpus — osquery has never been used as a rule's logsource in this corpus, and unifiedlog carries the same blocker recorded against T1037.002, T1036.004, T1036.006 and others. MITRE's `TimeWindow` and `BaselineAccounts` knobs (correlating the write with anomalous login patterns) go entirely unimplemented for the same cross-event-join reason. Prerequisite: auditd does not watch these paths by default; this returns nothing until watches such as `-w /etc/pam.d -p wa -k pam_tamper` and `-w /lib/x86_64-linux-gnu/security -p wa -k pam_tamper` are loaded, and zero rows reads as quiet when it actually means blind. UNVERIFIED AS AUTHORED — derived from MITRE ATT&CK DET0454, not hand-written and not tested by its author. Any lab result is on this rule's own page.Full description

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/pam.d/*") OR (type="PATH" AND name="*/lib/security/*") OR (type="PATH" AND (name="*/lib/x86_64-linux-gnu/security/*" OR name="*/usr/lib/x86_64-linux-gnu/security/*")))

Elastic · ES|QL

Run this as a search.

FROM logs-*| WHERE ((TO_LOWER(type) == "path" AND TO_LOWER(name) LIKE "*/etc/pam.d/*") OR (TO_LOWER(type) == "path" AND TO_LOWER(name) LIKE "*/lib/security/*") OR (TO_LOWER(type) == "path" AND (TO_LOWER(name) LIKE "*/lib/x86_64-linux-gnu/security/*" OR TO_LOWER(name) LIKE "*/usr/lib/x86_64-linux-gnu/security/*")))

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/pam\.d/</field>    <description>PAM configuration or module directory written on Linux (1/3)</description>    <mitre>      <id>T1556.003</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)/lib/security/</field>    <description>PAM configuration or module directory written on Linux (2/3)</description>    <mitre>      <id>T1556.003</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/x86_64-linux-gnu/security/|/usr/lib/x86_64-linux-gnu/security/)</field>    <description>PAM configuration or module directory written on Linux (3/3)</description>    <mitre>      <id>T1556.003</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.

Log in to react
Not yet reported on

Nobody has run this in a real environment and said what happened.

Verdicts from engineers who deployed it

0 cast

No 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.