Plugged Authentication Module Enijmax 4/23/2004 8/17/2004 updated.

Slides:



Advertisements
Similar presentations
MFA for Business Banking – Security Code Multifactor Authentication: Quick Tip Sheets Note to Financial Institutions: We are providing these QT sheets.
Advertisements

Digital Certificate Installation & User Guide For Class-2 Certificates.
Installation & User Guide
Digital Certificate Installation & User Guide For Class-2 Certificates.
MY NCBI (module 4.5).
Lectures on File Management
CIS 193A – Lesson2CIS 193A - Lesson2 Authorization & Authentication Sudo and PAM.
Digital Certificate Installation & User Guide For Class-2 Certificates.
Forms Authentication, Users, Roles, Membership Ventsislav Popov Crossroad Ltd.
Module R2 CS450. Next Week R1 is due next Friday ▫Bring manuals in a binder - make sure to have a cover page with group number, module, and date. You.
ATTACKING AUTHENTICATION The Web Application Hacker’s Handbook, Ch. 6 Presenter: Jie Huang 10/31/2012.
CS426Fall 2010/Lecture 81 Computer Security CS 426 Lecture 8 User Authentication.
©2008 TTW Where “Lean” principles are considered common sense and are implemented with a passion! Product Training Credit Cards.
Samba Integrating SMB file systems with UNIX. Samba Provides a file server compatible with Windows 9x and NT.. SMB Can function in NETBIOS name browsing.
(Remote Access Security) AAA. 2 Authentication User named "flannery" dials into an access server that is configured with CHAP. The access server will.
Sinewave Computer Services Pvt. Ltd. Page 1 7/2/2015 Taxbase New Features Index.
Information for students Welcome to the S 3 P system. Login to the system by entering your User ID and password. The User ID is the same as your normal.
Updating User Information Password – use this field to change your own password Confirm Password – retype the new password for verification purposes To.
4-1 PSe_4Konf.503 EAGLE Getting Started and Configuration.
Digital Certificate Installation & User Guide For Class - 2 Certificates.
Open Source Server Side Scripting ECA 236 Open Source Server Side Scripting Cookies & Sessions.
Actilab Pharma Online Services User Manual June 2004.
XP New Perspectives on Microsoft Office Access 2003 Tutorial 12 1 Microsoft Office Access 2003 Tutorial 12 – Managing and Securing a Database.
Guide to Linux Installation and Administration, 2e1 Chapter 8 Basic Administration Tasks.
Module 10: Configuring Windows XP Professional to Operate in Microsoft Networks.
WaveMaker Visual AJAX Studio 4.0 Training Authentication.
Moodle (Course Management Systems). Assignments 1 Assignments are a refreshingly simple method for collecting student work. They are a simple and flexible.
Copyright © 2007, Oracle. All rights reserved. Managing Concurrent Requests.
| nectar.org.au NECTAR TRAINING Module 5 The Research Cloud Lifecycle.
COMP3121 E-Commerce Technologies Richard Henson University of Worcester November 2011.
Selecting, Formatting, and Printing a finished Report…….
 In Karnataka, Digital Signatures are being extensively used in various projects right from delivery of citizen centric services through various projects.
CIS 290 Linux Security Program Authentication Module and Security Enhanced LINUX.
Oracle Application Express Security. © 2009 Oracle Corporation Authentication Out-of-the-Box Pre-Configured Schemes LDAP Directory credentials Oracle.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 3: Operating-System Structures System Components Operating System Services.
© 2006 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice HP Library Encryption - LTO4 Key.
0 eCPIC Admin Training: Automating User Account Management These training materials are owned by the Federal Government. They can be used or modified only.
Managing Users  Each system has two kinds of users:  Superuser (root)  Regular user  Each user has his own username, password, and permissions that.
1 Linux Security. 2 Linux is not secure No computer system can ever be "completely secure". –make it increasingly difficult for someone to compromise.
Linux-PAM Pluggable Authentication Module Pluggable Authentication Module Collection of libraries (modules) that allow a system administrator to decide.
Configuring and Troubleshooting Identity and Access Solutions with Windows Server® 2008 Active Directory®
How to write a MSGQ Transport (MQT) Overview Nov 29, 2005 Todd Mullanix.
SCSC 455 Computer Security Chapter 3 User Security.
Michael Tinker September 16, 2004
PaymentNet: Approvers Procurement Services Laurie Krauel.
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
Password Security Module 8. Objectives Explain Authentication and Authorization Provide familiarity with how passwords are used Identify the importance.
Oracle Business Intelligence Foundation – Testing and Deploying OBI Repository.
Securing Web Applications Lesson 4B / Slide 1 of 34 J2EE Web Components Pre-assessment Questions 1. Identify the correct return type returned by the doStartTag()
LINUX Presented By Parvathy Subramanian. April 23, 2008LINUX, By Parvathy Subramanian2 Agenda ► Introduction ► Standard design for security systems ►
Page ADP PearsonAccess Proctor Training. Page Agenda Test Overview Testing Components Proctor Roles and Responsibilities Overview Administering the Test.
CACI Proprietary Information | Date 1 PD² v4.2 Increment 2 SR13 and FPDS Engine v3.5 Database Upgrade Name: Semarria Rosemond Title: Systems Analyst, Lead.
Prototype Security New Feature: Send Mass & Activity Code.
By Hello Team Awesome World™.  To avoid strangers using others’ keys, cards, and passwords to enter the buildings, our team will develop a face recognition-based.
Architecture Review 10/11/2004
Authentication & .htaccess
Chapter 11: Managing Users
Is 221: Database Administration
Chapter 2: System Structures
Installation & User Guide
Multi-Factor Authentication (MFA)
Fun gym Cambridge Nationals R001.
PAM Pluggable Autthentication Modules
Microsoft Office Access 2003
Installation & User Guide
Product Training Credit Cards
A Scripting Server for Domain Automation Tasks
How to install and manage exchange server 2010 OP Saklani.
Presentation transcript:

Plugged Authentication Module Enijmax 4/23/2004 8/17/2004 updated

PAM Design Goals The system admin should be able to choose the default authentication mechanism for the machine. The range from a simple password to complex smart card system. It should be possible to configure the user authentication mechanism on a per application basis. The framework should support the display requirements of the applications.[ 顯示 密碼提示的需求 ] It should be possible to configure multiple authentication protocols for each of those applications. The system administrator should be able to stack multiple user authentication mechanisms such that the user is authenticated with all authentication protocols without retyping the password. The architecture should allow for multiple passwords if necessary to achieve higher security for users with specific security requirements. The system-entry services should not be required to change when the underlying mechanism changes. For backward-compatibility reasons, the PAM API should support the authentication requirements of the current system-entry services.

PAM Architecture 程式流動的方向

Four Basic functions Authentication  PAM uses to know how to authenticate a user to the system’s authentication method. The first is to determine that the user is who they say they are, by passwords or other token. Second the module sets up the credentials for the user, such as user id. Account  It verifies the accounts availability. Session  It handles what is needed to set-up and tear-down a session. Including logging and setting up any mounts. Password  Change the authentication token (ex : password) associated with an account.

Four Building Block PAM aware applications/services  PAM aware application will have a call to the PAM library and then in turn the libraries/modules do the work of authentication according to the PAM configuration file specification. PAM libraries  The PAM library modules are at the heart of what makes PAM work. The PAM library modules are the dynamically linked functions that are called to do the PAM configured tasks. Different modules are developed to work with one or more of the four basic tasks. PAM configuration file or files  See the next page. Information data files or databases that a library may look for or need to access.  Pam_unix.so use the /etc/passwd and /etc/shadow files or a password database.  Pam_pwdb.so module is used with the account action to write accounting information to syslog and update /etc/utmp and /etc/wtmp.

Configuration file Format:  Application-Name, Type, control-flag, module-path, module- arguments [/etc/pam.conf]  Type, Control-flag, module-path, module-arguments [/etc/pam.d/*] Type  Auth  Account  Session  Password Control Flag  Required  Requisite  Sufficient  Optional

Configuration file (Cont.) Module-path  The module path is the actual path to the library module you want to use for a specific task type.  Not all library modules can be used with all the task types.  If a task calls a module and which is not programmed for that task, then that line will be ignored and PAM move on to the next line. Module-Arguments  Each module accepts different arguments.

Control Flags Depending on if the module passes or fails, the control flag then determines what PAM will tell the application. Required  Success of the module is required for the module type facility to succeed. Failure of the module will not show to the application until all of the remaining modules have been executed. Requisite (order sensitive, failure->immediately return)  Like required, however, in the case that such a module returns a failure, control is directly returned to the application.  Gain: It protects against the possibility of a user getting the opportunity to enter a password over an unsafe medium.  Loss: Such behavior might inform an attacker of valid accounts on a system.

Control Flags (Cont.) Sufficient (order sensitive, success->immediately return)  If the module fails, then the module is ignored and the rest of the PAM-Module is executed.  If the module succeeds and no earlier module in the chain has filed, the PAM-Module is immediately terminated and return success. Optional  This control-flag marks the module as not being critical to the success or failure of the user’s application for service.  In the absence of any definite successes or failures of stacked modules, this module will determine the nature of the response to the application.

Example (it also called stack module) Auth required /lib/security/pam_securetty.so #it checks that if the user is trying to login as root, the tty on which they are logging in is listed in the /etc/securetty file. Auth required /lib/security/pam_unix.so shadow nullok #This line causes the user to be asked for a password and then checks the password using the information stored in /etc/passwd and /etc/shadow. Auth required /lib/security/pam_nologin.so #This is the final authentication step. It checks to see if the file /etc/nologin exists. Account required /lib/security/pam_unix.so #It caused any necessary account verification to be done. Password required /lib/security/pam_cracklib.so retry=3 #If password has expired, the password component of the pam_cracklib.so module prompts for a new password. Retry=3 means there have three time for user to create a strong password if he chose a week password. Password required /lib/security/pam_unix.so shadow nullok use_authtok #When change the password, we need pam_unix.so to update shadow password. #shadow: update shadow password file; nullok: password can be empty; use_authtok: Session required /lib/security/pam_unix.so #It logs the username and the service type to /var/log/messages at the beginning and end of each session. Execution order

Configuration setup error? If any of the fields are invalid, or if a module is not found, that line is ignored and the error is logged as a critical error via syslog(3). All PAM module failure will record in /var/log/message. Example: Date &TimeHostnameProg nameError message Apr 23 12:06:47leop2:PAM unable to dlopen(/usr/lib/security/pam_unix_acct. so)

PAM Aware Application Before running the program, we can use PAM APIs to finish authentication of the program. The application must take responsibility for protecting the environment in which PAM operates.

PAM Application Interface Authentication management API:  pam_authentication(pam_handle_t *pamh, int flags) It is used to authenticate the user.  pam_setcred(pam_handle_t *pamh, int flags) It is used to set, refresh or destroy the user credentials. Account management API:  pam_acct_mgmt(pam_handle_t *pamh, int flags) It is used to check whether the authenticated user should be given access to his account. In other word, it checks the states of the user account in sure that the account is available. Session management APIs:  pam_open_session(pam_handle_t *pamh, int flags) A new session has been initialized.  pam_close_session(pam_handle_t *pamh, int flags) Upon termination of the session.

PAM Application Interface (Cont.) Password management APIs:  pam_chauthtok() It is used to change the password. Administrative Interfaces APIs:  pam_start() Initializing pam module.  pam_end() Finishing pam module.  pam_set_item()  pam_get_item() The above APIs are used to read and write the state information.  pam_strerror() The error message can be printed with this API.

PAM Module API

Conversation Function An application must provides the conversation function used for direct communication between a loaded module and the application. The structure of pam_conv : struct pam_conv { int (*conv) (int num_msg, const struct pam_message * *msg, struct pam_response * *resp, void *appdata_ptr); void *appdata_ptr; }; It is initialized by the application before it is passed to the module.

Conversation Function (Cont.) Struct pam_message { int msg_style; const char *msg; }; /*The use of pam_message structure is indicating what kind of message style and text should be showed.*/ msg_style could be the one of followings:  PAM_PROMPT_ECHO_OFF  PAM_PROMPT_ECHO_ON  PAM_ERROR_MSG  PAM_TEXT_INFO Struct pam_response { char *resp; int resp_retcode; }; /*The use of pam_response structure is keeping the result in the resp.*/

Transactions in PAM Application The lifecycle of a typical PAM transaction is described below. If any of these steps fail, the transaction should be aborted. 1. Calling pam_start(3) to initialize the PAM library and specify its service name and target account, and register a suitable conversation function. 2. Calling pam_set(3) to set relative information( e.g. username and hostname) 3. Calling pam_authenticate(3) to authenticate the applicant. 4. Calling pam_acct_mgmt(3) to verify that the requested account is available and valid. If the password is correct but has expired, app should call pam_chauthtok(3) to force the client to change the authentication token. 5. Calling pam_setcred(3) to establish the credentials of the requested account. 6. Once the correct credentials have been established, app calls pam_open_session(3) to set up the session. 7. Provide the applicant with a shell. 8. Close the session by using pam_close_session(3). 9. Finally, app calls pam_end(3) to notify the PAM library that it is done and release whatever resources it has allocated in the course of the transaction.

Examples #include static struct pam_conv pamc = {misc_conv, NULL}; void my_prog() { printf("this is my program!"); } int main() { pam_handle_t *pamh; int result; struct passwd *pw; //save the password printf("start to authenticate\n"); if ((pw=getpwuid(getuid())) == NULL ) perror("getpwuid"); else if (( result = pam_start("su",pw->pw_name, &pamc, &pamh)) != PAM_SUCCESS) fprintf(stderr, " start failed: %d\n", result); else if (( result = pam_authenticate(pamh,0)) != PAM_SUCCESS) fprintf(stderr, " authenticate failed: %d\n", result); else if (( result = pam_acct_mgmt(pamh,0)) != PAM_SUCCESS) fprintf(stderr, " acct_mgmt failed: %d\n",result); else if ((result = pam_end(pamh, result)) !=PAM_SUCCESS) fprintf(stderr, " end failed: %d\n", result); else my_prog(); return 0; }

PAM Security Issues Sharing of passwords with multiple authentication mechanisms.  If user use the same password for all of the authentication mechanisms and any of them is compromised, the user’s password in all systems would be compromised. Password-mapping.  This technique of encrypting all other passwords with the primary password assumes that it is lot more difficult to crack the primary password. Security of the configuration file.  The configuration should be protected from unauthorized modifications. Stacking various PAM modules.  The composition of various authentication modules should be carefully examined. The trusted computing base of the machine now includes the PAM modules.

Writing PAM Modules Authentication Management  pam_sm_authenticate()  pam_sm_setcred() Account Management  pam_sm_acct_mgmt() Session Management  pam_sm_open_session()  pam_sm_close_session() Password Management  pam_sm_chauthtok()