7.1 Authentication Architecture: PAM, Polkit, SSSD, LDAP & Kerberos
Key Takeaways
Map the application to its configured PAM service. Look at each of auth, account, password and session separately.
Required failure is remembered. Requisite failure stops the current stack scope immediately. Sufficient success cannot conceal an earlier required failure.
PAM failure tallies, account eligibility and passwords represent separate controls. Polkit authorizes an action and subject without changing the client’s identity.
Use NSS for lookup, the configured directory or realm for centralized identity, and klist to inspect current Kerberos credentials.
Audit rules select events that auditd can record. Compare journal, text logs and audit records in their actual configured scope.
7.1 Authentication Architecture: PAM, Polkit, SSSD, LDAP & Kerberos
Separate the questions that each tool answers. Identity lookup resolves an account and its groups. Authentication verifies credentials. Authorization decides whether an operation is permitted. Accounting and auditing record the events that the system is configured to capture.
Follow the application's PAM stack
A PAM-aware program selects a service. On Linux-PAM, check its file under /etc/pam.d/, any included groups, and distribution defaults. The older /etc/pam.conf form has a service field. Modern Linux-PAM can also supply vendor configuration directories. Resolve the active configuration before changing it. On RHEL 9, exam examples that use managed system-auth or password-auth should first check the authselect profile. Debian-family stacks can use shared files such as common-auth and the other common-* files.
| Management group | What it controls |
|---|---|
auth | Verify an authentication factor or establish credentials through the configured module. |
account | Check account eligibility, such as account expiration, access policy and an expired authentication token. |
password | Change an authentication token, with policy checks when configured. |
session | Set up and tear down session resources, such as applying limits via pam_limits.so in a service that loads it. |
A line selects a group, a control and a module with optional arguments. For example, pam_unix.so can check and maintain local shadow credentials. Analyze a particular operation, such as the auth call, from top to bottom using the real expanded stack.
| Simple control | Ordinary success | Failure |
|---|---|---|
required | Continue. | Record failure and continue unless another rule terminates evaluation. |
requisite | Continue. | Return immediately from the current stack scope with failure. |
sufficient | If a prior required failure is absent, end this scope successfully. Otherwise continue. | Ignore failure and continue. |
optional | Normally influences the result only if it is the sole module for the group. | Normally ignored when another module decides. |
For a lab's top-level auth stack, suppose a required password module fails and a later sufficient module succeeds. That success cannot erase the earlier required failure. If a top-level requisite module instead fails, evaluation of that stack stops at that point. The bracketed control form maps named return codes to actions such as ok, bad, done, die, or a numeric skip count. The exact behavior can differ by operation and return code. A substack confines certain early returns and jumps to the substack so the outer stack can keep processing.
A password accepted by one module does not by itself establish access. Check whether the service uses PAM and what its account stage checks. Where a configured pam_faillock.so stack maintains a failure tally, faillock --user labuser displays records from the relevant tally directory. Confirm the configured source and the cause. An authorized faillock --user labuser --reset clears that tally. Password locks, account expiration and service access rules are separate.
Polkit and system services
Polkit evaluates a subject's request to an operation implemented by a privileged service. The service identifies the action and passes request details when supported. For example, a systemd unit-management request can carry the unit and verb. A delegation for restarting a specific service should check both when present, plus the subject condition. The client process keeps its own identity. Sudo instead launches an authorized command with a selected identity.
Read action definitions such as XML files under /usr/share/polkit-1/actions/. They define action IDs and defaults, which can differ for active, inactive and other sessions. JavaScript rules from locations such as /etc/polkit-1/rules.d/ and /usr/share/polkit-1/rules.d/ are processed in lexical filename order. A same-named local file is ordered before its packaged peer. A result can allow, deny or require a challenge. Confirm the action, subject, session and supplied detail fields before delegating. An early allow for an entire action family can grant access to more operations than intended.
Directory identity and tickets
| Mechanism | What to check |
|---|---|
| NSS and SSSD | The configured NSS path resolves users and groups. SSSD can provide NSS resolution and PAM functions for a configured remote domain. getent passwd labuser@example.test and id labuser@example.test test lookup on a host where that name format is configured. Login policy can still deny the result. |
| Realmd and Samba Winbind | realm discover example.test discovers a suitable domain and realm list shows configured realms. Enrollment choices and authorization depend on the provider. Samba Winbind can supply NSS/PAM integration and map domain SIDs to local IDs through its configured backends. Coordinate the identity mapping with the Samba domain member configuration. |
| LDAP | LDAP accesses directory entries identified by distinguished names. A search uses a base DN, scope, filter and requested attributes. Standard LDAP runs over TCP 389 and can start TLS on that connection. LDAP with implicit TLS commonly uses TCP 636. Require TLS and certificate validation for sensitive binds. |
| Kerberos | The KDC supplies tickets for network authentication. DNS, clock agreement, principal names and key availability matter for the chosen realm and service. |
On a RHEL 9 SSSD deployment, protect /etc/sssd/sssd.conf with the documented ownership and permissions. When credential caching is enabled for a supported provider, a previously established cached credential can support offline login within the active policy. An NSS identity cache entry alone does not supply a usable offline authentication credential. Check offline limits and the access provider.
For an approved OpenLDAP lab with its CA and hostname configured, a bounded search can require StartTLS:
ldapsearch -x -ZZ -H ldap://ldap.example.test -b 'dc=example,dc=test' '(uid=labuser)' mail
Whether it can return mail depends on directory access controls. Keep sensitive bind credentials out of command arguments and logs.
Kerberos worked sequence
Use kinit labuser@EXAMPLE.TEST to obtain initial credentials on an authorized MIT Kerberos lab client with a configured realm. The authentication exchange yields a ticket-granting ticket (TGT) protected with a TGS key and a client part containing the session key, protected for the client. In common password-based Kerberos, the client derives the needed key without sending the password. Preauthentication and other credential mechanisms change the initial exchange.
The client presents the TGT and an authenticator to the ticket-granting service when it needs an application ticket. It then presents the application ticket and a new authenticator to the target service. The service needs the appropriate key, often from a protected keytab. The protocol supports a reply for mutual authentication when requested. An available service ticket establishes neither service authorization nor a universal guarantee that the deployment can proceed without any other providers.
Use MIT klist to inspect the default credentials cache. A service name such as krbtgt/EXAMPLE.TEST@EXAMPLE.TEST identifies the realm's TGT. Compare its expiry with the current time and compare application ticket names with the target service. klist -A can list a cache collection where supported, while klist -k inspects a keytab.
Record and investigate activity
On a Linux host running the Audit subsystem, rules select events in the kernel, and auditd records events according to its configuration. Check auditctl -s for status, auditctl -l for loaded rules, and ausearch -k KEY for matching records. A typical audit log is /var/log/audit/audit.log; use the configured path. Read the event fields together, including login identity, current credentials, operation, and success when available. Set scope and retention according to policy.
On a lab kernel where only the 64-bit ABI is in scope, this runtime rule selects write and attribute access to an existing test file:
auditctl -a always,exit -F arch=b64 -F path=/var/tmp/audit-lab.conf -F perm=wa -k lab_config
ausearch -k lab_config
For both ABI classes, use corresponding approved rules where needed. The older -w PATH -p wa -k KEY watch is supported for compatibility on relevant releases. Current audit tooling recommends the syscall-based path and permission form. An auditctl command affects the active policy if permitted. For persistence on a distribution using augenrules, put the reviewed rule in /etc/audit/rules.d/ and use the supported load procedure, which assembles /etc/audit/audit.rules. Check for immutable or competing rules and verify an actual test event.
On a systemd host, journalctl -u sshd --since '1 hour ago' selects a unit's recent records when that name exists. Use -p warning for warnings and more severe journal entries. A service may use a different unit name or log destination. Rsyslog can route selected facilities and severities, for example authpriv.* to the protected auth log defined by local policy. Verify the input modules and action configuration before assuming journal and syslog have identical coverage. For text logs, use the owning service's logrotate policy and documented reopen action. logrotate -d previews behavior without rotating logs. The journal has its own retention controls.
A module in the top-level Linux-PAM auth stack must succeed when reached. If it returns an ordinary failure, evaluation must stop without invoking later modules in that stack. Which simple control meets this requirement?
required
requisite
sufficient
optional
An MIT Kerberos client user wants to see whether the default credentials cache holds a TGT and when it expires. Which command displays those tickets?
kinit
ktutil
realm list
klist
On a Linux lab host, a reviewed runtime audit rule should record write and attribute access to an existing /var/tmp/audit-lab.conf for the 64-bit ABI and label the events lab_config. Which modern rule meets that scope?
auditctl -a always,exit -F arch=b64 -F path=/var/tmp/audit-lab.conf -F perm=wa -k lab_config
auditctl -a always,exit -F arch=b64 -S write -k lab_config
auditctl -a always,exit -F arch=b64 -F path=/var/tmp/audit-lab.conf -F perm=r -k lab_config
ausearch -k lab_config
Sections you finish are checked off in the contents.