| 1 | This is the README of the PKCS #11 PAM Login Module |
|---|
| 2 | ====================================================================== |
|---|
| 3 | |
|---|
| 4 | Release: 0.6.1 |
|---|
| 5 | Authors: Mario Strasser <mast@gmx.net> |
|---|
| 6 | Juan Antonio Martinez <jonsito@teleline.es> |
|---|
| 7 | Ludovic Rouseau <ludovic.rousseau@free.fr> |
|---|
| 8 | |
|---|
| 9 | This Linux-PAM login module allows a X.509 certificate based user |
|---|
| 10 | login. The certificate and its dedicated private key are thereby |
|---|
| 11 | accessed by means of an appropriate PKCS #11 module. For the |
|---|
| 12 | verification of the users' certificates, locally stored CA |
|---|
| 13 | certificates as well as either online or locally accessible CRLs are |
|---|
| 14 | used. |
|---|
| 15 | |
|---|
| 16 | Detailed information about the Linux-PAM system can be found in [1], |
|---|
| 17 | [2] and [3]. The specification of the Cryptographic Token Interface |
|---|
| 18 | Standard (PKCS #11) is available at [4]. |
|---|
| 19 | |
|---|
| 20 | |
|---|
| 21 | PKCS #11 Module Requirements |
|---|
| 22 | ---------------------------------------------------------------------- |
|---|
| 23 | The PKCS #11 modules must fullfill the requirements given by the RSA |
|---|
| 24 | Asymmetric Client Signing Profile, which has been specified in the |
|---|
| 25 | PKCS #11 Conformance Profile Specification [5] by RSA Laboratories. |
|---|
| 26 | |
|---|
| 27 | |
|---|
| 28 | User Matching |
|---|
| 29 | ---------------------------------------------------------------------- |
|---|
| 30 | To approve the ownership of a certificate, that is to allow the owner |
|---|
| 31 | of a certificate to login as a particular user Several modules |
|---|
| 32 | are provided. See README.mappers file in doc directory |
|---|
| 33 | |
|---|
| 34 | [Note: This is still a work in progress, any suggestions for |
|---|
| 35 | improvements or alternative matching algorithms are welcome.] |
|---|
| 36 | |
|---|
| 37 | |
|---|
| 38 | Installation |
|---|
| 39 | ---------------------------------------------------------------------- |
|---|
| 40 | |
|---|
| 41 | bash# tar xvzf pam_pkcs11-X.Y.Z.tar.gz |
|---|
| 42 | bash# cd pam_pkcs11-X.Y.Z |
|---|
| 43 | bash# ./configure |
|---|
| 44 | bash# make |
|---|
| 45 | bash# sudo make install |
|---|
| 46 | |
|---|
| 47 | |
|---|
| 48 | Configuration |
|---|
| 49 | |
|---|
| 50 | 1- Create a directory /etc/pam_pkcs11 |
|---|
| 51 | 2- Copy $(base)/etc/pam_pkcs11.conf.example to /etc/pam_pkcs11/ and personalize |
|---|
| 52 | 3- Create crls and cacerts directories according with configuration file, |
|---|
| 53 | and fill them with proper data |
|---|
| 54 | 4- Choose one or more mappers to install, set up configuration file, and |
|---|
| 55 | if needed configure mappers |
|---|
| 56 | |
|---|
| 57 | The file etc/pam_pkcs11.conf is fully auto-documented, to allow you easy |
|---|
| 58 | editing |
|---|
| 59 | |
|---|
| 60 | 5- setup /etc/pam.d/xxx entries |
|---|
| 61 | |
|---|
| 62 | ---------------------------------------------------------------------- |
|---|
| 63 | To make use of the PKCS #11 login module replace the line |
|---|
| 64 | |
|---|
| 65 | auth requisite pam_unix2.so ... |
|---|
| 66 | |
|---|
| 67 | with |
|---|
| 68 | |
|---|
| 69 | auth requisite pam_pkcs11.so ... |
|---|
| 70 | |
|---|
| 71 | in the pam configuration files. |
|---|
| 72 | |
|---|
| 73 | Some mappers doesn't map to an existing user. To allow correct login, |
|---|
| 74 | you may need to install also pam-mkhomedir in session pam stack |
|---|
| 75 | See http://www.kernel.org/pub/linux/libs/pam for details |
|---|
| 76 | |
|---|
| 77 | The following options are recognised for pam-pkcs11.so: |
|---|
| 78 | |
|---|
| 79 | debug |
|---|
| 80 | Enable debugging support. |
|---|
| 81 | |
|---|
| 82 | config_file |
|---|
| 83 | To specify up configuration file ( default /etc/pam_pkcs11/pam_pkcs11.conf ) |
|---|
| 84 | |
|---|
| 85 | Next options should be taken from configuration file, but is up to the |
|---|
| 86 | user to specify them from command line. If so, it takes precedence over |
|---|
| 87 | configuration file |
|---|
| 88 | |
|---|
| 89 | nullok |
|---|
| 90 | Allow empty passwords. |
|---|
| 91 | |
|---|
| 92 | use_first_pass |
|---|
| 93 | Do not prompt the user for the passwords but take them from the |
|---|
| 94 | PAM_ items instead. |
|---|
| 95 | |
|---|
| 96 | try_first_pass |
|---|
| 97 | Do not prompt the user for the passwords unless PAM_(OLD)AUTHTOK |
|---|
| 98 | is unset. |
|---|
| 99 | |
|---|
| 100 | use_authtok |
|---|
| 101 | Like try_first_pass, but fail if the new PAM_AUTHTOK has not been |
|---|
| 102 | previously set (intended for stacking password modules only). |
|---|
| 103 | |
|---|
| 104 | Next options are pkcs11 module specific |
|---|
| 105 | |
|---|
| 106 | pkcs11_module=<file> |
|---|
| 107 | Filename of the PKCS #11 module. The default value is |
|---|
| 108 | /etc/pam_pkcs11/pkcs11_module.so. |
|---|
| 109 | Note that this option takes precedence over "module" entry |
|---|
| 110 | in proper pkcs11_module section, but this section is still needed |
|---|
| 111 | |
|---|
| 112 | slot_num=<nr> |
|---|
| 113 | Slot-number to use. One for the first, two for the second and so |
|---|
| 114 | on. The default value is zero which means to use the first slot |
|---|
| 115 | with an available token. |
|---|
| 116 | |
|---|
| 117 | ca_dir=<path> |
|---|
| 118 | Path to the directory where the CA certificates are stored. The |
|---|
| 119 | directory must contain an openssl hash-link to each certificate. |
|---|
| 120 | The default value is /etc/pam_pkcs11/cacerts. |
|---|
| 121 | |
|---|
| 122 | crl_dir=<path> |
|---|
| 123 | Path to the directory where the CRLs are stored. The directory |
|---|
| 124 | must contain an openssl hash-link to each CRL. The default value |
|---|
| 125 | is /etc/pam_pkcs11/crls. |
|---|
| 126 | |
|---|
| 127 | crl_policy={none, online, offline, auto} |
|---|
| 128 | Sets the CRL verification policy. None performs no verification |
|---|
| 129 | at all, online downloads the CRL form the location given by the |
|---|
| 130 | CRL distribution point extension of the certificate and offline |
|---|
| 131 | uses the locally stored CRLs. Auto is a combination of online and |
|---|
| 132 | offline; it first tries to download the CRL from a possibly |
|---|
| 133 | given CRL distribution point and if this fails, uses the local |
|---|
| 134 | CRLs. The default setting is none. |
|---|
| 135 | |
|---|
| 136 | Example: |
|---|
| 137 | |
|---|
| 138 | auth sufficient pam_pkcs11.so config_file=/etc/pam_pkcs11/pam_pkcs11.conf |
|---|
| 139 | |
|---|
| 140 | or ( avoid if possible ) |
|---|
| 141 | |
|---|
| 142 | auth sufficient pam_pkcs11.so nullok debug try_first_pass \ |
|---|
| 143 | pkcs11_module=/usr/lib/pkcs11/pkcs11_module.so \ |
|---|
| 144 | ca_dir=/etc/cacerts/ crl_dir=/etc/cacerts/ crl_policy=auto |
|---|
| 145 | |
|---|
| 146 | |
|---|
| 147 | Contact |
|---|
| 148 | ---------------------------------------------------------------------- |
|---|
| 149 | |
|---|
| 150 | Any comments, suggestions and bug reports are welcome. Please, mention |
|---|
| 151 | the keywords 'pkcs' and 'pam' in the subject. |
|---|
| 152 | |
|---|
| 153 | Mario Strasser <mast@gmx.net> |
|---|
| 154 | Juan Antonio Martinez <jonsito@teleline.es> |
|---|
| 155 | |
|---|
| 156 | |
|---|
| 157 | References |
|---|
| 158 | ---------------------------------------------------------------------- |
|---|
| 159 | |
|---|
| 160 | [1] The Linux-PAM System Administrators' Guide |
|---|
| 161 | http://www.kernel.org/pub/linux/libs/pam/Linux-PAM-html/pam.html |
|---|
| 162 | |
|---|
| 163 | [2] The Linux-PAM Module Writers' Guide |
|---|
| 164 | http://www.kernel.org/pub/linux/libs/pam/Linux-PAM-html/pam_modules.html |
|---|
| 165 | |
|---|
| 166 | [3] The Linux-PAM Application Developers' Guide |
|---|
| 167 | http://www.kernel.org/pub/linux/libs/pam/Linux-PAM-html/pam_appl.html |
|---|
| 168 | |
|---|
| 169 | [4] PKCS #11 - Cryptographic Token Interface Standard |
|---|
| 170 | http://www.rsasecurity.com/rsalabs/pkcs/pkcs-11/ |
|---|
| 171 | |
|---|
| 172 | [5] PKCS #11: Conformance Profile Specification |
|---|
| 173 | http://www.rsasecurity.com/rsalabs/pkcs/pkcs-11/ |
|---|
| 174 | |
|---|