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"
 5updated_date = "2024/07/23"
 6
 7[rule]
 8author = ["Elastic"]
 9description = """
10This rule detects successful authentications via PAM grantors that are not commonly used. This could indicate an
11attacker is attempting to escalate privileges or maintain persistence on the system by modifying the default PAM
12configuration.
13"""
14from = "now-9m"
15index = ["auditbeat-*", "logs-auditd_manager.auditd-*"]
16language = "kuery"
17license = "Elastic License v2"
18name = "Authentication via Unusual PAM Grantor"
19risk_score = 47
20rule_id = "a8aaa49d-9834-462d-bf8f-b1255cebc004"
21setup = """## Setup
22This 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"
15
16query = '''
17event.category:authentication and host.os.type:linux and event.action:authenticated and event.outcome:success and
18auditd.data.grantors:(* and not (pam_rootok or *pam_cap* or *pam_permit*))
19'''
20
21
22[[rule.threat]]
23framework = "MITRE ATT&CK"
24[[rule.threat.technique]]
25id = "T1543"
26name = "Create or Modify System Process"
27reference = "https://attack.mitre.org/techniques/T1543/"
28
29
30[rule.threat.tactic]
31id = "TA0003"
32name = "Persistence"
33reference = "https://attack.mitre.org/tactics/TA0003/"
34[[rule.threat]]
35framework = "MITRE ATT&CK"
36[[rule.threat.technique]]
37id = "T1556"
38name = "Modify Authentication Process"
39reference = "https://attack.mitre.org/techniques/T1556/"
40
41
42[rule.threat.tactic]
43id = "TA0006"
44name = "Credential Access"
45reference = "https://attack.mitre.org/tactics/TA0006/"
46
47[rule.new_terms]
48field = "new_terms_fields"
49value = ["auditd.data.grantors", "agent.id"]
50[[rule.new_terms.history_window_start]]
51field = "history_window_start"
52value = "now-14d"

Related rules

to-top