Skip to content

Commit 7aacebb

Browse files
authored
[Rule Tuning] Creation or Modification of Pluggable Authentication Module or Configuration (#5421)
1 parent 3bcacdb commit 7aacebb

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

rules/cross-platform/persistence_credential_access_modify_auth_module_or_config.toml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
creation_date = "2020/12/21"
33
integration = ["endpoint"]
44
maturity = "production"
5-
updated_date = "2025/01/15"
5+
updated_date = "2025/12/08"
66

77
[rule]
88
author = ["Elastic"]
@@ -17,7 +17,7 @@ from = "now-9m"
1717
index = ["auditbeat-*", "logs-endpoint.events.*"]
1818
language = "kuery"
1919
license = "Elastic License v2"
20-
name = "Modification of Standard Authentication Module or Configuration"
20+
name = "Deprecated - Modification of Standard Authentication Module or Configuration"
2121
references = [
2222
"https://github.com/zephrax/linux-pam-backdoor",
2323
"https://github.com/eurialo/pambd",
@@ -39,7 +39,6 @@ tags = [
3939
]
4040
timestamp_override = "event.ingested"
4141
type = "new_terms"
42-
4342
query = '''
4443
event.category:file and event.type:change and
4544
(file.name:pam_*.so or file.path:(/etc/pam.d/* or /private/etc/pam.d/* or /usr/lib64/security/*)) and
@@ -74,7 +73,7 @@ note = """## Triage and analysis
7473
> **Disclaimer**:
7574
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
7675
77-
### Investigating Modification of Standard Authentication Module or Configuration
76+
### Investigating Deprecated - Modification of Standard Authentication Module or Configuration
7877
7978
Authentication modules, such as PAM (Pluggable Authentication Modules), are crucial for managing user authentication in Linux and macOS environments. Adversaries may exploit these by altering module files or configurations to gain unauthorized access or escalate privileges. The detection rule identifies suspicious changes to these modules, excluding legitimate processes and paths, to flag potential unauthorized modifications.
8079

rules/linux/persistence_pluggable_authentication_module_creation.toml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
creation_date = "2024/03/06"
33
integration = ["endpoint"]
44
maturity = "production"
5-
updated_date = "2025/01/15"
5+
updated_date = "2025/12/08"
66

77
[rule]
88
author = ["Elastic"]
@@ -42,12 +42,12 @@ type = "eql"
4242
query = '''
4343
file where host.os.type == "linux" and event.action in ("rename", "creation") and
4444
process.executable != null and (
45-
(file.path like~ (
45+
(file.path like (
4646
"/lib/security/*", "/lib64/security/*", "/usr/lib/security/*", "/usr/lib64/security/*",
4747
"/lib/x86_64-linux-gnu/security/*", "/usr/lib/x86_64-linux-gnu/security/*"
4848
) and file.extension == "so") or
49-
(file.path like~ "/etc/pam.d/*" and file.extension == null) or
50-
(file.path like~ "/etc/security/pam_*" or file.path == "/etc/pam.conf")
49+
(file.path like "/etc/pam.d/*" and file.extension == null) or
50+
(file.path like "/etc/security/pam_*" or file.path == "/etc/pam.conf")
5151
) and not (
5252
process.executable in (
5353
"/bin/dpkg", "/usr/bin/dpkg", "/bin/dockerd", "/usr/bin/dockerd", "/usr/sbin/dockerd", "/bin/microdnf",
@@ -58,18 +58,23 @@ process.executable != null and (
5858
"/bin/puppet", "/opt/puppetlabs/puppet/bin/puppet", "/usr/bin/chef-client", "/bin/chef-client",
5959
"/bin/autossl_check", "/usr/bin/autossl_check", "/proc/self/exe", "/dev/fd/*", "/usr/bin/pamac-daemon",
6060
"/bin/pamac-daemon", "/usr/lib/snapd/snapd", "/usr/local/bin/dockerd", "/usr/sbin/pam-auth-update",
61-
"/usr/lib/systemd/systemd", "/usr/libexec/packagekitd", "/usr/bin/bsdtar", "/sbin/pam-auth-update"
61+
"/usr/lib/systemd/systemd", "/usr/libexec/packagekitd", "/usr/bin/bsdtar", "/sbin/pam-auth-update", "./user/bin/podman",
62+
"/usr/bin/dnf5", "/opt/puppetlabs/puppet/bin/ruby", "/usr/bin/crio", "/sbin/authconfig", "/usr/sbin/yum-cron",
63+
"/sbin/yum-cron", "/usr/local/psa/bin/dnf_install", "/opt/jc/bin/jumpcloud-agent"
64+
6265
) or
6366
file.path like (
6467
"/tmp/snap.rootfs_*/pam_*.so", "/tmp/newroot/lib/*/pam_*.so", "/tmp/newroot/usr/lib64/security/pam_*.so"
6568
) or
6669
file.extension in ("swp", "swpx", "swx", "dpkg-remove") or
6770
file.Ext.original.extension == "dpkg-new" or
6871
process.executable like (
69-
"/nix/store/*", "/var/lib/dpkg/*", "/snap/*", "/dev/fd/*", "/usr/lib/virtualbox/*"
72+
"/nix/store/*", "/var/lib/dpkg/*", "/snap/*", "/dev/fd/*", "/usr/lib/virtualbox/*", "/usr/bin/python*",
73+
"/opt/alt/python*/bin/python*", "/usr/libexec/platform-python*", "./snap/snapd/*/usr/lib/snapd/snap-update-ns"
7074
) or
7175
(process.name == "sed" and file.name like~ "sed*") or
72-
(process.name == "perl" and file.name like~ "e2scrub_all.tmp*")
76+
(process.name == "perl" and file.name like~ "e2scrub_all.tmp*") or
77+
(process.name == "perl" and event.action == "rename" and file.Ext.original.name like "*.pam-new")
7378
)
7479
'''
7580
note = """## Triage and analysis

0 commit comments

Comments
 (0)