Authentication via Unusual PAM Grantor

This rule detects successful authentications via PAM grantors that are not commonly used. This could indicate an attacker is attempting to escalate privileges or maintain persistence on the system by modifying the default PAM configuration.

Elastic rule (View on GitHub)

 1[metadata]
 2creation_date = "2024/03/06"
 3integration = ["auditd_manager"]
 4maturity = "production"
 5min_stack_comments = "Multiple field support in the New Terms rule type was added in Elastic 8.6"
 6min_stack_version = "8.6.0"
 7updated_date = "2024/03/06"
 8
 9[rule]
10author = ["Elastic"]
11description = """
12This rule detects successful authentications via PAM grantors that are not commonly used. This could indicate an
13attacker is attempting to escalate privileges or maintain persistence on the system by modifying the default PAM
14configuration.
15"""
16from = "now-9m"
17index = ["auditbeat-*", "logs-auditd_manager.auditd-*"]
18language = "kuery"
19license = "Elastic License v2"
20name = "Authentication via Unusual PAM Grantor"
21risk_score = 47
22rule_id = "a8aaa49d-9834-462d-bf8f-b1255cebc004"
23setup = """## Setup
24This rule requires the use of the `auditd_manager` integration. `Auditd_manager` is a tool designed to simplify and enhance the management of the audit subsystem in Linux systems. It provides a user-friendly interface and automation capabilities for configuring and monitoring system auditing through the auditd daemon. With `auditd_manager`, administrators can easily define audit rules, track system events, and generate comprehensive audit reports, improving overall security and compliance in the system. The following steps should be executed in order to install and deploy `auditd_manager` on a Linux system.

Kibana --> Management --> Integrations --> Auditd Manager --> Add Auditd Manager

 1`Auditd_manager` subscribes to the kernel and receives events as they occur without any additional configuration. However, if more advanced configuration is required to detect specific behavior, audit rules can be added to the integration in either the "audit rules" configuration box or the "auditd rule files" box by specifying a file to read the audit rules from.
 2For this detection rule to trigger, no additional configuration is required.
 3"""
 4severity = "medium"
 5tags = [
 6    "Domain: Endpoint",
 7    "OS: Linux",
 8    "Use Case: Threat Detection",
 9    "Tactic: Credential Access",
10    "Tactic: Persistence",
11    "Data Source: Auditd Manager",
12]
13timestamp_override = "event.ingested"
14type = "new_terms"
15query = '''
16event.category:authentication and host.os.type:linux and event.action:authenticated and event.outcome:success and
17auditd.data.grantors:(* and not (pam_rootok or *pam_cap* or *pam_permit*))
18'''
19
20[[rule.threat]]
21framework = "MITRE ATT&CK"
22
23[[rule.threat.technique]]
24id = "T1543"
25name = "Create or Modify System Process"
26reference = "https://attack.mitre.org/techniques/T1543/"
27
28[rule.threat.tactic]
29id = "TA0003"
30name = "Persistence"
31reference = "https://attack.mitre.org/tactics/TA0003/"
32
33[[rule.threat]]
34framework = "MITRE ATT&CK"
35
36[[rule.threat.technique]]
37id = "T1556"
38name = "Modify Authentication Process"
39reference = "https://attack.mitre.org/techniques/T1556/"
40
41[rule.threat.tactic]
42id = "TA0006"
43name = "Credential Access"
44reference = "https://attack.mitre.org/tactics/TA0006/"
45
46[rule.new_terms]
47field = "new_terms_fields"
48value = ["auditd.data.grantors", "agent.id"]
49
50[[rule.new_terms.history_window_start]]
51field = "history_window_start"
52value = "now-14d"

Related rules

to-top