YahiaKandeel
GCIH,GSEC, RHCE,CEH, CCNA, MCP
IPBackbone Security Engineer
Etisalat
Pluggable authentication modules
 DiscretionaryAccessControls
 SeLinux
 TCPWrappers
 Xinetd
 IPTables
 PluggableAuthenticationModule
 Application AccessControl
Pluggable authentication modules
 Historically..
 Each program had its own way of authenticating
users ..
 PAM
 Pluggable, modular architecture
 Affords the system administrator a great deal of
flexibilityin setting authentication policies for the
system.
 Centralized authentication mechanism
 /etc/pam.d/ contains the PAM configuration files for each
PAM-awareapplication
 All supported PAM Modules under /lib/security/ directory
 auth
 This module authenticates users against database
 account
 This module verifies that access is allowed. (e.g it checks
expiration and time restrictions)
 password
 This module is used for changing user passwords.
 session
 This module configures and manages user sessions (e.g
mounting a user's home directory and making the user's
mailbox available.)
 An individual module can provide any or all module interfaces. For
instance, pam_unix.so provides all four module interfaces.
 Module interface directives can be stacked, or placed upon one
another, so that multiple modules are used together for one purpose.
 Each PAM modules generate a success or failure result when called.
 Controlflags tell PAM what to do with the result.
 Ordering is very Important ..
 /etc/pam.d/system-auth:
 Acommon interface for all applications and service daemons calling into the
PAMlibrary.
 Required
 Ifsuccess continue checking, if fail continue with failure
 Requisite
 Ifsuccess continue checking, if fail abort with failure
 Sufficient
 Ifsuccess grant access immediately, if fail ignore
 Optional
 The module result is ignored.
 Include
 Interpret the given file.All lines in the given file are treated as they
were present in this configuration file
Name Description
pam_unix Modulefor traditional password authentication
pam_rootok Gainonly root access
pam_permit The promiscuous module
pam_nologin Prevent non root uses
pam_listfile denyor allow services based on an arbitrary file
pam_tally2 The login counter (tallying) module
pam_succeed_if test account characteristics
pam_deny The locking
pam_limits PAMmodule to limit resources
pam_timestamp Auth using cached successfulauth attempts
pam_time PAMmodule for time control access
pam_cracklib Checkthe password against dictionary words
 Test account characteristics ..
 Synopsis: pam_succeed_if.so [flag...] [condition...]
 Flags:
 Conditions:
auth required pam_succeed_if.so use_uiduser ingroup wheel
use_uid
Evaluate conditions using the account of the user whose UID the
application is running under instead of the user being authenticated.
quiet Don´t log failure or success to the system log.
Field Test Value
user ingroup Wheel
uid >= 500
 Authenticate using cached successful authentication
attempts.
 Synopsis: pam_timestamp.so[timestamp_timeout=number]
 The auth and session module types are provided.
auth sufficient pam_timestamp.so
auth required pam_unix.so
session required pam_unix.so
session optional pam_timestamp.so
/etc/pam.d/wireshark
 Wireshark
 Timestamp
 Only for specific users
 Deny or allow using services based on an arbitraryfile
 Synopsis:
pam_listfile.soitem=[user|rhost|group|shell]sense=[allow|deny]
file=/path/filename onerr=[succeed|fail]
auth required pam_listfile.soitem=user onerr=fail
file=/etc/ssh.allowsense=allow
item What is listed in the file and should be checked for.
sense Action to take if found in file
onerr What to do if something weird happens like being unable to open the file
/etc/pam.d/sshd
 Enable or disable TTY auditing for specified users.
 Synopsis: pam_tty_audit.so[disable=patterns][enable=patterns]
 To view the data that was logged by the kernel to audit use
the command #aureport --tty.
session required pam_tty_audit.sodisable=*enable=root
/etc/pam.d/sshd
 The login counter.
 Synopsis:
pam_tally2.so[onerr=[fail|succeed]][even_deny_root] [deny=n]
[unlock_time=n][root_unlock_time=n] [audit]
 To view the status for locked users run this command
#pam_tally -u username
auth required pam_tally2.so deny=4
even_deny_root unlock_time=1200
/etc/pam.d/sshd
 PAM module to limit resources
 Synopsis: pam_limits.so[change_uid][conf=/path/to/limits.conf]
 By default limits are taken from the /etc/security/limits.conf
session required pam_limits.so
/etc/pam.d/sshd
<domain> <type> <item> <value>
student - maxlogins 1
/etc/security/limits.conf
CPU
Maxlogin
Priority
Memlock
Hard
Soft
-
Username
@Group
uid:uid
*
 PAM module for time control access
 Synopsis: pam_time.so [noaudit]
 The time access rules are taken from /etc/security/time.conf
account required pam_time.so
/etc/pam.d/sshd
services; ttys; users; times
sshd; * ; !root ; Wk0800-1700
/etc/security/time.conf
Users
Groups
tty
ttyp*
*
sshd
login
 SSHD:
 Limit # of concurrent sessions
 At specific time
 For specific users
 Max number of failed
logins
 Audit user activities
 SU:
 OnlySpecific users can escalate their priviledges
 References:
 http://www.centos.org/docs/5/html/Deployment_Guide-en-US/ch-
pam.html
 http://www.informit.com/articles/article.aspx?p=20968
 Linuxman pages
 Contacts:
 Eng.Qandeel@gmail.com

More Related Content

PDF
Medooze MCU Video Multiconference Server Installation and configuration guide...
PPTX
Tomcat, Undertow, Jetty, Nginx Unit: pros and cons
PPTX
Understanding eBPF in a Hurry!
PDF
An Introduction To Linux
PDF
Git Started With Git
PPTX
NGINX: Basics and Best Practices
PDF
Android Things : Building Embedded Devices
PDF
Lesson 2 Understanding Linux File System
Medooze MCU Video Multiconference Server Installation and configuration guide...
Tomcat, Undertow, Jetty, Nginx Unit: pros and cons
Understanding eBPF in a Hurry!
An Introduction To Linux
Git Started With Git
NGINX: Basics and Best Practices
Android Things : Building Embedded Devices
Lesson 2 Understanding Linux File System

What's hot (20)

PPTX
PDF
Linux Kernel - Virtual File System
PDF
Linux : PSCI
PDF
PDF
Meet cute-between-ebpf-and-tracing
PPT
Linux kernel memory allocators
PPTX
Understanding GIT and Version Control
PDF
Linux: LVM
PDF
Network Drivers
PDF
Linux Synchronization Mechanism: RCU (Read Copy Update)
PDF
Qemu & KVM Guide #1 (intro & basic)
PPT
Linux booting procedure
PDF
The Linux Kernel Implementation of Pipes and FIFOs
PPTX
Git in 10 minutes
PPT
Linux
PDF
Linux introduction
PDF
Docker Containers Deep Dive
PPTX
Linux standard file system
PDF
淺談 Live patching technology
PDF
Virtualbox
Linux Kernel - Virtual File System
Linux : PSCI
Meet cute-between-ebpf-and-tracing
Linux kernel memory allocators
Understanding GIT and Version Control
Linux: LVM
Network Drivers
Linux Synchronization Mechanism: RCU (Read Copy Update)
Qemu & KVM Guide #1 (intro & basic)
Linux booting procedure
The Linux Kernel Implementation of Pipes and FIFOs
Git in 10 minutes
Linux
Linux introduction
Docker Containers Deep Dive
Linux standard file system
淺談 Live patching technology
Virtualbox
Ad

Viewers also liked (6)

PDF
Using filesystem capabilities with rsync
PDF
Pluggable Authentication Module
PPT
Chapter 09
PDF
How to get started with the Pluggable Authentication System
PDF
Authentication Modules For Linux - PAM Architecture
PDF
How to Become a Thought Leader in Your Niche
Using filesystem capabilities with rsync
Pluggable Authentication Module
Chapter 09
How to get started with the Pluggable Authentication System
Authentication Modules For Linux - PAM Architecture
How to Become a Thought Leader in Your Niche
Ad

Similar to Pluggable authentication modules (20)

PPT
Download It
PDF
Linux Security Crash Course
PDF
7 unixsecurity
PDF
James Jara Portfolio 2014 - InfoSec White Paper- Part 5
ODP
System Administeration Basics
PPTX
Asecurity-guidelines_and_best_practices_for_retail_online_and_business_online
PPTX
Dell Quest TPAM Privileged Access Control
PDF
Linux advanced privilege escalation
PDF
Introduction to SAP Security
PPT
e-DMZ Products Overview
PPS
A Presentation about Puppet that I've made at the OSSPAC conference
PPT
006.itsecurity bcp v1
PDF
SELinux Kernel Internals and Architecture - FOSS.IN/2005
ODP
ID304 - Lotus® Connections 3.0 TDI, SSO, and User Life Cycle Management: What...
PDF
MySQL's Performance Schema, SYS Schema and Workbench Integration
PDF
Apache2 BootCamp : Restricting Access
PPT
System Calls and Components of OS . ppt
PDF
MySQL Fabric Tutorial, October 2014
PDF
Detection as Code, Automation, and Testing: The Key to Unlocking the Power of...
PDF
SELinux Johannesburg Linux User Group (JoziJUg)
Download It
Linux Security Crash Course
7 unixsecurity
James Jara Portfolio 2014 - InfoSec White Paper- Part 5
System Administeration Basics
Asecurity-guidelines_and_best_practices_for_retail_online_and_business_online
Dell Quest TPAM Privileged Access Control
Linux advanced privilege escalation
Introduction to SAP Security
e-DMZ Products Overview
A Presentation about Puppet that I've made at the OSSPAC conference
006.itsecurity bcp v1
SELinux Kernel Internals and Architecture - FOSS.IN/2005
ID304 - Lotus® Connections 3.0 TDI, SSO, and User Life Cycle Management: What...
MySQL's Performance Schema, SYS Schema and Workbench Integration
Apache2 BootCamp : Restricting Access
System Calls and Components of OS . ppt
MySQL Fabric Tutorial, October 2014
Detection as Code, Automation, and Testing: The Key to Unlocking the Power of...
SELinux Johannesburg Linux User Group (JoziJUg)

Recently uploaded (20)

PDF
International_Financial_Reporting_Standa.pdf
PPTX
Unit 4 Computer Architecture Multicore Processor.pptx
PPTX
20th Century Theater, Methods, History.pptx
PDF
AI-driven educational solutions for real-life interventions in the Philippine...
PDF
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
PDF
LDMMIA Reiki Yoga Finals Review Spring Summer
PDF
Paper A Mock Exam 9_ Attempt review.pdf.
PDF
What if we spent less time fighting change, and more time building what’s rig...
PDF
BP 704 T. NOVEL DRUG DELIVERY SYSTEMS (UNIT 2).pdf
DOC
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc
PDF
Weekly quiz Compilation Jan -July 25.pdf
PDF
1.3 FINAL REVISED K-10 PE and Health CG 2023 Grades 4-10 (1).pdf
PDF
MBA _Common_ 2nd year Syllabus _2021-22_.pdf
PPTX
ELIAS-SEZIURE AND EPilepsy semmioan session.pptx
PDF
Trump Administration's workforce development strategy
PPTX
Share_Module_2_Power_conflict_and_negotiation.pptx
PDF
HVAC Specification 2024 according to central public works department
PDF
FORM 1 BIOLOGY MIND MAPS and their schemes
PPTX
B.Sc. DS Unit 2 Software Engineering.pptx
PDF
advance database management system book.pdf
International_Financial_Reporting_Standa.pdf
Unit 4 Computer Architecture Multicore Processor.pptx
20th Century Theater, Methods, History.pptx
AI-driven educational solutions for real-life interventions in the Philippine...
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
LDMMIA Reiki Yoga Finals Review Spring Summer
Paper A Mock Exam 9_ Attempt review.pdf.
What if we spent less time fighting change, and more time building what’s rig...
BP 704 T. NOVEL DRUG DELIVERY SYSTEMS (UNIT 2).pdf
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc
Weekly quiz Compilation Jan -July 25.pdf
1.3 FINAL REVISED K-10 PE and Health CG 2023 Grades 4-10 (1).pdf
MBA _Common_ 2nd year Syllabus _2021-22_.pdf
ELIAS-SEZIURE AND EPilepsy semmioan session.pptx
Trump Administration's workforce development strategy
Share_Module_2_Power_conflict_and_negotiation.pptx
HVAC Specification 2024 according to central public works department
FORM 1 BIOLOGY MIND MAPS and their schemes
B.Sc. DS Unit 2 Software Engineering.pptx
advance database management system book.pdf

Pluggable authentication modules

  • 1. YahiaKandeel GCIH,GSEC, RHCE,CEH, CCNA, MCP IPBackbone Security Engineer Etisalat
  • 3.  DiscretionaryAccessControls  SeLinux  TCPWrappers  Xinetd  IPTables  PluggableAuthenticationModule  Application AccessControl
  • 5.  Historically..  Each program had its own way of authenticating users ..  PAM  Pluggable, modular architecture  Affords the system administrator a great deal of flexibilityin setting authentication policies for the system.
  • 6.  Centralized authentication mechanism  /etc/pam.d/ contains the PAM configuration files for each PAM-awareapplication  All supported PAM Modules under /lib/security/ directory
  • 7.  auth  This module authenticates users against database  account  This module verifies that access is allowed. (e.g it checks expiration and time restrictions)  password  This module is used for changing user passwords.  session  This module configures and manages user sessions (e.g mounting a user's home directory and making the user's mailbox available.)
  • 8.  An individual module can provide any or all module interfaces. For instance, pam_unix.so provides all four module interfaces.  Module interface directives can be stacked, or placed upon one another, so that multiple modules are used together for one purpose.  Each PAM modules generate a success or failure result when called.  Controlflags tell PAM what to do with the result.  Ordering is very Important ..  /etc/pam.d/system-auth:  Acommon interface for all applications and service daemons calling into the PAMlibrary.
  • 9.  Required  Ifsuccess continue checking, if fail continue with failure  Requisite  Ifsuccess continue checking, if fail abort with failure  Sufficient  Ifsuccess grant access immediately, if fail ignore  Optional  The module result is ignored.  Include  Interpret the given file.All lines in the given file are treated as they were present in this configuration file
  • 10. Name Description pam_unix Modulefor traditional password authentication pam_rootok Gainonly root access pam_permit The promiscuous module pam_nologin Prevent non root uses pam_listfile denyor allow services based on an arbitrary file pam_tally2 The login counter (tallying) module pam_succeed_if test account characteristics pam_deny The locking pam_limits PAMmodule to limit resources pam_timestamp Auth using cached successfulauth attempts pam_time PAMmodule for time control access pam_cracklib Checkthe password against dictionary words
  • 11.  Test account characteristics ..  Synopsis: pam_succeed_if.so [flag...] [condition...]  Flags:  Conditions: auth required pam_succeed_if.so use_uiduser ingroup wheel use_uid Evaluate conditions using the account of the user whose UID the application is running under instead of the user being authenticated. quiet Don´t log failure or success to the system log. Field Test Value user ingroup Wheel uid >= 500
  • 12.  Authenticate using cached successful authentication attempts.  Synopsis: pam_timestamp.so[timestamp_timeout=number]  The auth and session module types are provided. auth sufficient pam_timestamp.so auth required pam_unix.so session required pam_unix.so session optional pam_timestamp.so /etc/pam.d/wireshark
  • 13.  Wireshark  Timestamp  Only for specific users
  • 14.  Deny or allow using services based on an arbitraryfile  Synopsis: pam_listfile.soitem=[user|rhost|group|shell]sense=[allow|deny] file=/path/filename onerr=[succeed|fail] auth required pam_listfile.soitem=user onerr=fail file=/etc/ssh.allowsense=allow item What is listed in the file and should be checked for. sense Action to take if found in file onerr What to do if something weird happens like being unable to open the file /etc/pam.d/sshd
  • 15.  Enable or disable TTY auditing for specified users.  Synopsis: pam_tty_audit.so[disable=patterns][enable=patterns]  To view the data that was logged by the kernel to audit use the command #aureport --tty. session required pam_tty_audit.sodisable=*enable=root /etc/pam.d/sshd
  • 16.  The login counter.  Synopsis: pam_tally2.so[onerr=[fail|succeed]][even_deny_root] [deny=n] [unlock_time=n][root_unlock_time=n] [audit]  To view the status for locked users run this command #pam_tally -u username auth required pam_tally2.so deny=4 even_deny_root unlock_time=1200 /etc/pam.d/sshd
  • 17.  PAM module to limit resources  Synopsis: pam_limits.so[change_uid][conf=/path/to/limits.conf]  By default limits are taken from the /etc/security/limits.conf session required pam_limits.so /etc/pam.d/sshd <domain> <type> <item> <value> student - maxlogins 1 /etc/security/limits.conf CPU Maxlogin Priority Memlock Hard Soft - Username @Group uid:uid *
  • 18.  PAM module for time control access  Synopsis: pam_time.so [noaudit]  The time access rules are taken from /etc/security/time.conf account required pam_time.so /etc/pam.d/sshd services; ttys; users; times sshd; * ; !root ; Wk0800-1700 /etc/security/time.conf Users Groups tty ttyp* * sshd login
  • 19.  SSHD:  Limit # of concurrent sessions  At specific time  For specific users  Max number of failed logins  Audit user activities  SU:  OnlySpecific users can escalate their priviledges
  • 20.  References:  http://www.centos.org/docs/5/html/Deployment_Guide-en-US/ch- pam.html  http://www.informit.com/articles/article.aspx?p=20968  Linuxman pages  Contacts:  Eng.Qandeel@gmail.com