Linux auditd: systemd service file creation under systemd directories
Identifies new systemd unit file creation events under common systemd directories using auditd PATH create logs.
- Product
- linux
- Service
- auditd
- Author
- Pawel Mazur (SigmaHQ), DRL 1.1
- Published
- 2022-02-03
- Updated
- 2026-07-31
ATT&CK techniques
Persistence → Priv EscRecon
Resource Dev
Initial Access
Execution
Persistence
Priv Esc
Defense Evasion
Cred Access
Discovery
Lateral Movement
Collection
C2
Exfiltration
Impact
What it detects
This rule flags file creation events for systemd service units under standard systemd locations (e.g., /usr/lib/systemd/system/ and /etc/systemd/system/) and user unit paths containing /.config/systemd/user/. Adversaries can abuse these locations to persist by having systemd start attacker-controlled code via newly created unit files. It relies on Linux auditd PATH create telemetry that includes the created file path.
Reporting behind it
Changelog
v3- v3Candidate ingested via manual entry.2026-07-31
- v2Candidate ingested via manual entry.2026-07-31
- v1No changelog recorded for this version.2026-07-30
Detection content is published as a reviewed draft. Tune thresholds and exclusions against your own telemetry before enabling this rule for alerting.
title: "Linux auditd: systemd service file creation under systemd directories"
id: 5462dc06-fce7-4bba-bf90-10e67ce1c29e
status: test
description: This rule flags file creation events for systemd service units under standard systemd locations (e.g., /usr/lib/systemd/system/ and /etc/systemd/system/) and user unit paths containing /.config/systemd/user/. Adversaries can abuse these locations to persist by having systemd start attacker-controlled code via newly created unit files. It relies on Linux auditd PATH create telemetry that includes the created file path.
references:
- https://github.com/redcanaryco/atomic-red-team/blob/f339e7da7d05f6057fdfcdd3742bfcf365fee2a9/atomics/T1543.002/T1543.002.md
- https://github.com/SigmaHQ/sigma/blob/master/rules/linux/auditd/path/lnx_auditd_systemd_service_creation.yml
author: Pawel Mazur, Huntrule Team
date: 2022-02-03
modified: 2022-02-06
tags:
- attack.privilege-escalation
- attack.persistence
- attack.t1543.002
logsource:
product: linux
service: auditd
detection:
path:
type: PATH
nametype: CREATE
name_1:
name|startswith:
- /usr/lib/systemd/system/
- /etc/systemd/system/
name_2:
name|contains: /.config/systemd/user/
condition: path and 1 of name_*
falsepositives:
- Admin work like legit service installs.
level: medium
license: DRL-1.1
related:
- id: 1bac86ba-41aa-4f62-9d6b-405eac99b485
type: derived