Linux Pam

LogZilla App Store application: Linux Pam

Overview

Linux Pluggable Authentication Modules (PAM) is a suite of libraries that allows system administrators to configure authentication methods for users. PAM provides a flexible and centralized way to manage authentication across secured applications and services.

App Function

  • Parse pam_unix authentication log messages
  • Extract session events (opened/closed) and authentication failures
  • Track users, remote hosts, and TTY devices
  • Set Vendor: Linux and Product: PAM tags for filtering
  • Categorize events with Event Class: auth
  • Alert on authentication failures and root session access

Vendor Documentation

Device Configuration

PAM log messages are written to /var/log/auth.log (Debian/Ubuntu) or /var/log/secure (RHEL/CentOS). Configure syslog forwarding to send these logs to LogZilla:

  1. Edit the syslog configuration (e.g., /etc/rsyslog.d/logzilla.conf)

  2. Add a rule to forward auth logs:

    text
    auth,authpriv.*    @logzilla-server:514
    
  3. Restart the syslog service:

    bash
    sudo systemctl restart rsyslog
    

Verification

Trigger an authentication event (e.g., SSH login) and verify events appear in LogZilla with the message containing pam_unix.

Incoming Log Format

PAM log messages follow this format:

text
pam_unix(<process>:<context>): <message>
  • process - Service name (sshd, sudo, login, systemd-user)
  • context - PAM context (session, auth)
  • message - Event description

Parsed Metadata Fields

Tag NameExampleDescription
VendorLinuxVendor name
ProductPAMProduct name
Event ClassauthCross-vendor event classification
Event Typelogin_failureSpecific event type (login_failure, session_start, session_end)
PAM Actionsession openedAuthentication action or failure message
PAM User TrackingvmuserUser being authenticated
UservmuserUsername (same as PAM User Tracking)
ProcesssshdProcess handling the session
StatusopenedSession status
PAM TTYsshTerminal device (auth failures only)
PAM Remote Host192.168.250.2Remote host address (auth failures only)
PAM Remote UseradminRemote username (auth failures only)
DstIP10.0.0.1Destination IP address (session logs)

Log Examples

Session Opened

text
pam_unix(sshd:session): session opened for user vmuser by (uid=0)

Session Closed

text
pam_unix(sudo:session): session closed for user root

Authentication Failure

text
pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh
ruser= rhost=192.168.250.2  user=vmuser

Triggers

TriggerDescription
PAM: Authentication FailureAuthentication failures - potential brute force
PAM: Root Session OpenedRoot session opened - privilege escalation monitoring
Linux Pam | LogZilla Documentation