Linux-PAM Pluggable Authentication Module Pluggable Authentication Module Collection of libraries (modules) that allow a system administrator to decide.

Slides:



Advertisements
Similar presentations
Access Control List (ACL)
Advertisements

CIS 193A – Lesson2CIS 193A - Lesson2 Authorization & Authentication Sudo and PAM.
Network and Application Attacks Contributed by- Chandra Prakash Suryawanshi CISSP, CEH, SANS-GSEC, CISA, ISO 27001LI, BS 25999LA, ERM (ISB) June 2006.
Basic Unix system administration
CCNA2 Module 4. Discovering and Connecting to Neighbors Enable and disable CDP Use the show cdp neighbors command Determine which neighboring devices.
Linux+ Guide to Linux Certification, Second Edition
Hands-On Ethical Hacking and Network Defense Second Edition Chapter 5 Port Scanning.
Hands-On Ethical Hacking and Network Defense Chapter 5 Port Scanning.
Chapter One The Essence of UNIX.
Module 10: Troubleshooting Network Access. Overview Troubleshooting Network Access Resources Troubleshooting LAN Authentication Troubleshooting Remote.
Suneeta Chawla Web Security Presentation Topic : IP Spoofing Date : 03/24/04.
Linux+ Guide to Linux Certification, Second Edition Chapter 3 Linux Installation and Usage.
Linux Security 資管研究生 劉順德. Outline General Security –Account –Local –Network –Patch Services Security –Sendmail –BIND/DNS –Apache –FTP Recent Linux security.
Page: 1 Director 1.0 TECHNION Department of Computer Science The Computer Communication Lab (236340) Summer 2002 Submitted by: David Schwartz Idan Zak.
Guide To UNIX Using Linux Third Edition
CCNA 2 v3.1 Module 2.
Linux+ Guide to Linux Certification, Second Edition
TCP/IP Tools Lesson 5. Objectives Skills/ConceptsObjective Domain Description Objective Domain Number Using basic TCP/IP commands Understanding TCP/IP3.6.
Port Scanning.
Linux Operations and Administration
1 Lab 3 Transport Layer T.A. Youngjoo Han. 2 Transport Layer  Providing logical communication b/w application processes running on different hosts 
1 Version 3.1 Module 4 Learning About Other Devices.
Linux Filesystem Management
NetFilter – IPtables Firewall –Series of rules to govern what Kind of access to allow on your system –Packet filtering –Drop or Accept packets NAT –Network.
Introduction to Shell Script Programming
Karlstad University Introduction to Vulnerability Assessment Labs Ge Zhang Dvg-C03.
1 Network Packet Generator Midway presentation Supervisor: Mony Orbach Presenting: Eugeney Ryzhyk, Igor Brevdo.
Chapter 10 Networking and the Internet ITSC 1458.
Guide to Linux Installation and Administration, 2e1 Chapter 8 Basic Administration Tasks.
1 IP Forwarding Relates to Lab 3. Covers the principles of end-to-end datagram delivery in IP networks.
Agenda User Profile File (.profile) –Keyword Shell Variables Linux (Unix) filters –Purpose –Commands: grep, sort, awk cut, tr, wc, spell.
IP Forwarding.
Access Control List (ACL) W.lilakiatsakun. ACL Fundamental ► Introduction to ACLs ► How ACLs work ► Creating ACLs ► The function of a wildcard mask.
CIS 290 Linux Security Program Authentication Module and Security Enhanced LINUX.
Linux+ Guide to Linux Certification, Third Edition
Scanning & Enumeration Lab 3 Once attacker knows who to attack, and knows some of what is there (e.g. DNS servers, mail servers, etc.) the next step is.
Page 1 Chapter 11 CCNA2 Chapter 11 Access Control Lists : Creating ACLs, using Wildcard Mask Bits, Standard and Extended ACLs.
Chapter 3 & 6 Root Status and users File Ownership Every file has a owner and group –These give read,write, and execute priv’s to the owner, group, and.
A Practical Guide to Fedora and Red Hat Enterprise Linux Unit 9: Basic Linux Administration Chapter 11: System Administration: Core Concepts Chapter 16:
Topics Network topology Virtual LAN Port scanners and utilities Packet sniffers Weak protocols Practical exercise.
1 Linux Security. 2 Linux is not secure No computer system can ever be "completely secure". –make it increasingly difficult for someone to compromise.
Advanced Packet Analysis and Troubleshooting Using Wireshark 23AF
TCP Security Vulnerabilities Phil Cayton CSE
Lesson 3-Touring Utilities and System Features. Overview Employing fundamental utilities. Linux terminal sessions. Managing input and output. Using special.
SCSC 455 Computer Security Chapter 3 User Security.
Michael Tinker September 16, 2004
Plugged Authentication Module Enijmax 4/23/2004 8/17/2004 updated.
CSC414 “Introduction to UNIX/ Linux” Lecture 6. Schedule 1. Introduction to Unix/ Linux 2. Kernel Structure and Device Drivers. 3. System and Storage.
Lecture – Authentication Services
Hp education services education.hp.com hp education services education.hp.com 1 HP World/Interex 2002 Linux System Maintenance Basics Chris Cooper (734)
CIT 380: Securing Computer SystemsSlide #1 CIT 380: Securing Computer Systems Covert Channels.
Session 11: Cookies, Sessions ans Security iNET Academy Open Source Web Development.
LINUX Presented By Parvathy Subramanian. April 23, 2008LINUX, By Parvathy Subramanian2 Agenda ► Introduction ► Standard design for security systems ►
Basic UNIX system administration CS 2204 Class meeting 14 *Notes by Doug Bowman and other members of the CS faculty at Virginia Tech. Copyright
CHAPTER 3 Router CLI Command Line Interface. Router User Interface User and privileged modes User mode --Typical tasks include those that check the router.
Chapter 7: Using Network Clients The Complete Guide To Linux System Administration.
Port Scanning James Tate II
Chapter 11: Managing Users
Error and Control Messages in the Internet Protocol
Introduction to Networking
Chapter 4: Access Control Lists (ACLs)
Access Control Lists CCNA 2 v3 – Module 11
Setting Up Firewall using Netfilter and Iptables
PAM Pluggable Autthentication Modules
Shells, Help, and Paths.
System & Network Administration (MCSA & RHCSA)
From ACCEPT to MASQUERADE Tim(othy) Clark (eclipse)
Linux Filesystem Management
A Scripting Server for Domain Automation Tasks
How to install and manage exchange server 2010 OP Saklani.
Presentation transcript:

Linux-PAM Pluggable Authentication Module Pluggable Authentication Module Collection of libraries (modules) that allow a system administrator to decide how applications will authenticate users Collection of libraries (modules) that allow a system administrator to decide how applications will authenticate users Separates task of authentication from privilege-granting programs Separates task of authentication from privilege-granting programs

Linux-PAM in Action

PAM Example login program login program –Allows access to a Linux system 1. Started on each tty (console) 2. User types username 3. Request authentication (password) 4. Verify user is who they claim to be (check /etc/passwd) 5. Start shell –PAM provides 3 & 4

Linux-PAM Operation Programs must be built to utilize PAM Programs must be built to utilize PAM PAM tells program what it needs PAM tells program what it needs Separates authentication task into four groups: Separates authentication task into four groups: –Account management –Authentication management –Password management –Session management

PAM Groups Account mgmt Account mgmt –Used to perform account management functions. Ex: Has user’s password expired? Is user allowed to access this service? Authentication mgmt Authentication mgmt –Verify the user is who they claim to be

PAM Groups (cont) Password mgmt Password mgmt –Involves updating authentication tokens (passwords, tickets) Session mgmt Session mgmt –Cover tasks that should be done prior to a service being granted and after it is revoked (mounting/unmounting home directories)

PAM Organization /lib/security/pam_*.so – the PAMs /lib/security/pam_*.so – the PAMs /lib/libpam.so.* - the PAM library /lib/libpam.so.* - the PAM library /etc/pam.conf /etc/pam.conf –Configuration file to specify how services will authenticate users –Alternatively, one config file per service in /etc/pam.d directory /etc/pam.d/login /etc/pam.d/login

Config File Structure Each line of file has these elements: Each line of file has these elements: –service-name : name of service (login) Can be omitted if second method is used Can be omitted if second method is used A special service name – OTHER – is reserved for services with no configuration present A special service name – OTHER – is reserved for services with no configuration present –module-type : PAM group this module operates in (acct, auth, password, session) –control-flag : indicates how PAM will react to success/failure of module –module-path : path to the PAM –args : arguments to the module

Module Stacking Several modules of same type (group) can be executed sequentially Several modules of same type (group) can be executed sequentially Each module contributes to success/failure of group Each module contributes to success/failure of group Known as stacking Known as stacking Ex: (auth) Ex: (auth) –Get password –Laser beams of death –Fingerprint scan

Module Stacking (cont) Control flag values: Control flag values: –required : success of module is required for the group to succeed. Failure of module will not be noticed until all modules have been executed –requisite : same as required, but if module fails no more modules are executed – control returns to application –sufficient : indicates that success of this module is sufficient for the whole group –optional : success of module is optional

Example Config File /etc/pam.d/login /etc/pam.d/login auth required /lib/security/pam_securetty.so auth required /lib/security/pam_stack.so service=system-auth auth required /lib/security/pam_nologin.so account required /lib/security/pam_stack.so service=system-auth password required /lib/security/pam_stack.so service=system-auth session required /lib/security/pam_stack.so service=system-auth session optional /lib/security/pam_console.so

PAMified Programs RH 7.3 RH 7.3 –login: sign onto system –su: substitute user –passwd: change passwords –halt: halt the system –reboot: reboot the system

Using PAM Restricting su Restricting su –Add to /etc/pam.d/su: auth sufficient /lib/security/pam_rootok.so debug auth required /lib/security/pam_wheel.so group=wheel

Using PAM (cont) Password strength Password strength –Add to /etc/pam.d/passwd password required /lib/security/pam_cracklib.so retry=3 minlen=8

Using PAM (cont) Enforcing resource limits Enforcing resource limits –Add to /etc/pam.d/login session required /lib/security/pam_limits.so –Edit /etc/security/limits.conf file –Can specify limits on number of processes, memory usage, and size of core dumps

Using PAM (cont) Strong default configuration Strong default configuration –/etc/pam.d/other: auth required pam_deny.so auth required pam_warn.so account required pam_deny.so account required pam_warn.so password required pam_deny.so password required pam_warn.so session required pam_deny.so session required pam_warn.so

Kernel Tuning /proc filesystem /proc filesystem –“virtual” filesystem – exists only in memory –Can view info on running processes Environment Environment Path to executable Path to executable Memory usage Memory usage –Interface into kernel – source of information –Can be used to configure kernel dynamically

Contents of /proc filesystems – file which lists filesystems supported by kernel filesystems – file which lists filesystems supported by kernel net – directory containing files which give info about network net – directory containing files which give info about network pci – file which contains list of PCI devices and their configuration pci – file which contains list of PCI devices and their configuration sys – contains variables which can be modified to alter kernel behavior sys – contains variables which can be modified to alter kernel behavior

Changing Variables Two ways: Two ways: 1.Since files in /proc/sys are text, can pipe output of standard text commands, i.e. echo Changes disappear upon reboot Changes disappear upon reboot 2. sysctl command /etc/sysctl.conf file – stores variable/value pairs /etc/sysctl.conf file – stores variable/value pairs Read at boot by startup script Read at boot by startup script

TCP SYN Cookies SYN floods – DoS attack which fills SYN queue SYN floods – DoS attack which fills SYN queue –Host cannot accept any more connections Defense – SYN Cookies Defense – SYN Cookies 1.Host receives SYN packet from initiator 2.Computes SYN cookie – function of source/dest IP addr, ports, time & secret 3.Sends SYN cookie value as ISN of SYN/ACK reply 4.If original SYN was syncere (hah!), initiator will reply with ACK packet - acknowledgement number will be SYN cookie 5.Host recomputes SYN cookie using values from ACK packet and recent values of time 6.If new SYN cookie matches acknowledgement number – connection established

Enable SYN Cookies echo 1 > /proc/sys/net/ipv4/tcp_syncookies echo 1 > /proc/sys/net/ipv4/tcp_syncookies - or - sysctl –w net.ipv4.tcp_syncookies=1 sysctl –w net.ipv4.tcp_syncookies=1 –Also, add following line to /etc/sysctl.conf net.ipv4.tcp_syncookies = 1 net.ipv4.tcp_syncookies = 1

Source-routing Packet contains details of path to destination Packet contains details of path to destination Reply must also follow path Reply must also follow path Attacker can forge packets to include his/her machine in the return path Attacker can forge packets to include his/her machine in the return path –Can intercept traffic Solution: do not accept source-routed packets Solution: do not accept source-routed packets

Reject source-routed packets for f in /proc/sys/net/ipv4/conf/*/accept_source_route for f in /proc/sys/net/ipv4/conf/*/accept_source_routedo echo 0 > $f done - or - sysctl –w net.ipv4.conf.all.accept_source_route=0 sysctl –w net.ipv4.conf.all.accept_source_route=0 sysctl –w net.ipv4.conf.default.accept_source_route=0 sysctl –w net.ipv4.conf.eth0.accept_source_route=0 sysctl –w net.ipv4.conf.lo.accept_source_route=0

Ignore ICMP Echo Requests echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_all echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_all - or - sysctl –w net.ipv4.icmp_echo_ignore_all=1 sysctl –w net.ipv4.icmp_echo_ignore_all=1

Ignore ICMP Broadcasts echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts - or - sysctl –w net.ipv4.icmp_echo_ignore_broadcasts=1 sysctl –w net.ipv4.icmp_echo_ignore_broadcasts=1

Ignore ICMP Redirect Used to inform hosts of non-functioning or non-optimal route Used to inform hosts of non-functioning or non-optimal route Can be used by attackers to alter routing tables Can be used by attackers to alter routing tables To disable: To disable: for f in /proc/sys/net/ipv4/conf/*/accept_redirects do echo 0 > $f done

Sources Securing and Optimizing Red-Hat Linux Securing and Optimizing Red-Hat Linux The Linux Administrator’s Security Guide The Linux Administrator’s Security Guide Skoudis, Ed. Counter Hack. Prentice Hall, New Jersey; pp. Skoudis, Ed. Counter Hack. Prentice Hall, New Jersey; pp. Linux man pages. Linux man pages.

Questions?