
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/css" href="http://selinuxproject.org/w/skins/common/feed.css?63"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title>NB PAM - Revision history</title>
		<link>http://selinuxproject.org/w/?title=NB_PAM&amp;action=history</link>
		<description>Revision history for this page on the wiki</description>
		<language>en</language>
		<generator>MediaWiki 1.10.4</generator>
		<lastBuildDate>Mon, 20 May 2013 05:34:47 GMT</lastBuildDate>
		<item>
			<title>Jaxelson at 20:48, 13 September 2010</title>
			<link>http://selinuxproject.org/w/?title=NB_PAM&amp;diff=1032&amp;oldid=prev</link>
			<description>&lt;p&gt;&lt;/p&gt;

			&lt;table border='0' width='98%' cellpadding='0' cellspacing='4' style=&quot;background-color: white;&quot;&gt;
			&lt;tr&gt;
				&lt;td colspan='2' width='50%' align='center' style=&quot;background-color: white;&quot;&gt;←Older revision&lt;/td&gt;
				&lt;td colspan='2' width='50%' align='center' style=&quot;background-color: white;&quot;&gt;Revision as of 20:48, 13 September 2010&lt;/td&gt;
			&lt;/tr&gt;
		&lt;tr&gt;&lt;td colspan=&quot;2&quot; align=&quot;left&quot;&gt;&lt;strong&gt;Line 87:&lt;/strong&gt;&lt;/td&gt;
&lt;td colspan=&quot;2&quot; align=&quot;left&quot;&gt;&lt;strong&gt;Line 87:&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;----&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;----&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&amp;lt;references/&amp;gt;&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&amp;lt;references/&amp;gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt;[[Category:Notebook]]&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</description>
			<pubDate>Mon, 13 Sep 2010 20:48:33 GMT</pubDate>			<dc:creator>Jaxelson</dc:creator>			<comments>http://selinuxproject.org/page/Talk:NB_PAM</comments>		</item>
		<item>
			<title>RichardHaines: New page: = PAM Login Process = Applications used to provide login services (such as &lt;tt&gt;gdm&lt;/tt&gt; and &lt;tt&gt;ssh&lt;/tt&gt;) in F-12 use the PAM (Pluggable Authentication Modules) infrastructure to provide t...</title>
			<link>http://selinuxproject.org/w/?title=NB_PAM&amp;diff=954&amp;oldid=prev</link>
			<description>&lt;p&gt;New page: = PAM Login Process = Applications used to provide login services (such as &amp;lt;tt&amp;gt;gdm&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;ssh&amp;lt;/tt&amp;gt;) in F-12 use the PAM (Pluggable Authentication Modules) infrastructure to provide t...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= PAM Login Process =&lt;br /&gt;
Applications used to provide login services (such as &amp;lt;tt&amp;gt;gdm&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;ssh&amp;lt;/tt&amp;gt;) in F-12 use the PAM (Pluggable Authentication Modules) infrastructure to provide the following services:&lt;br /&gt;
&lt;br /&gt;
: '''Account Management''' - This manages services such as password expiry, service entitlement (i.e. what services the login process is allowed to access).&lt;br /&gt;
&lt;br /&gt;
: '''Authentication Management''' - Authenticate the user or subject and set up the credentials. PAM can handle a variety of devices including smart-cards and biometric devices.&lt;br /&gt;
&lt;br /&gt;
: '''Password Management''' - Manages password updates as needed by the specific authentication mechanism being used and the password policy.&lt;br /&gt;
&lt;br /&gt;
: '''Session Management''' - Manages any services that must be invoked before the login process completes and / or when the login process terminates. For SELinux this is where hooks are used to manage the domains the subject may enter. &lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;pam&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;pam.conf&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;man&amp;lt;/tt&amp;gt; pages describe the services and configuration in detail and only a summary is provided here covering the SELinux services.&lt;br /&gt;
&lt;br /&gt;
The PAM configuration for F-12 is managed by a number of files located in the &amp;lt;tt&amp;gt;/etc/pam.d&amp;lt;/tt&amp;gt; directory which has configuration files for login services such as: &amp;lt;tt&amp;gt;gdm&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;gdm-autologin&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;login&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;remote&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;sshd&amp;lt;/tt&amp;gt;, and at various points in this Notebook the &amp;lt;tt&amp;gt;gdm&amp;lt;/tt&amp;gt; configuration file has been modified to allow root login and the &amp;lt;tt&amp;gt;pam_namespace.so&amp;lt;/tt&amp;gt; module used to manage polyinstantiated directories for users.&lt;br /&gt;
&lt;br /&gt;
There are also a number of PAM related configuration files in &amp;lt;tt&amp;gt;/etc/security&amp;lt;/tt&amp;gt;, although only one is directly related to SELinux that is described in the &amp;lt;tt&amp;gt;/etc/security/sepermit.conf File&amp;lt;/tt&amp;gt; section of the [[GlobalConfigurationFiles | Global Configuration Files]].&lt;br /&gt;
&lt;br /&gt;
The main login service related PAM configuration files (e.g. &amp;lt;tt&amp;gt;gdm&amp;lt;/tt&amp;gt;) consist of multiple lines of information that are formatted as follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
service type control module-path arguments&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
| &amp;lt;tt&amp;gt;service&amp;lt;/tt&amp;gt;&lt;br /&gt;
| The service name such as &amp;lt;tt&amp;gt;gdm&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;login&amp;lt;/tt&amp;gt; reflecting the login application. If there is a &amp;lt;tt&amp;gt;/etc/pam.d&amp;lt;/tt&amp;gt; directory, then this is the name of a configuration file name under this directory. Alternatively, a configuration file called &amp;lt;tt&amp;gt;/etc/pam.conf&amp;lt;/tt&amp;gt; can be used. F-12 uses the &amp;lt;tt&amp;gt;/etc/pam.d&amp;lt;/tt&amp;gt; configuration.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  &amp;lt;tt&amp;gt;type&amp;lt;/tt&amp;gt;&lt;br /&gt;
| These are the management groups used by PAM with valid entries being: &amp;lt;tt&amp;gt;account&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;auth&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;password&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;session&amp;lt;/tt&amp;gt; that correspond to the descriptions given above. Where there are multiple entries of the same &amp;quot;&amp;lt;tt&amp;gt;type&amp;lt;/tt&amp;gt;&amp;quot;, the order they appear could be significant.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;control&amp;lt;/tt&amp;gt;&lt;br /&gt;
| This entry states how the module should behave when the requested task fails. There can be two formats: a single keyword such as r&amp;lt;tt&amp;gt;equired&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;optional&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;include&amp;lt;/tt&amp;gt;; or multiple space separated entries enclosed in square brackets consisting of :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   [value1=action1 value2=action2 ..]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Both formats are shown in the example file below, however see the &amp;lt;tt&amp;gt;pam.conf&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;man&amp;lt;/tt&amp;gt; pages for the gory details. &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  &amp;lt;tt&amp;gt;module-path&amp;lt;/tt&amp;gt;&lt;br /&gt;
| Either the full path name of the module or its location relative to &amp;lt;tt&amp;gt;/lib/security&amp;lt;/tt&amp;gt; (but does depend on the system architecture).&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  &amp;lt;tt&amp;gt;arguments&amp;lt;/tt&amp;gt;&lt;br /&gt;
| A space separated list of the arguments that are defined for the module.&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An example PAM configuration file is as follows, although note that the &amp;quot;&amp;lt;tt&amp;gt;service&amp;lt;/tt&amp;gt;&amp;quot; parameter is actually the file name because F-12 uses the &amp;lt;tt&amp;gt;/etc/pam.d&amp;lt;/tt&amp;gt; directory configuration (in this case &amp;lt;tt&amp;gt;gdm&amp;lt;/tt&amp;gt; for the Gnome login service).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# /etc/pam.d/gdm configuration rule entry. &lt;br /&gt;
# SERVICE = file name (gdm) &lt;br /&gt;
&lt;br /&gt;
# TYPE   CONTROL  PATH                  ARGUMENTS&lt;br /&gt;
#%PAM-1.0&lt;br /&gt;
auth     [success=done ignore=ignore default=bad] pam_selinux_permit.so&lt;br /&gt;
# auth   required pam_succeed_if.so     user != root quiet&lt;br /&gt;
auth     required pam_env.so&lt;br /&gt;
auth     substack system-auth&lt;br /&gt;
auth     optional pam_gnome_keyring.so&lt;br /&gt;
account  required pam_nologin.so&lt;br /&gt;
account  include  system-auth&lt;br /&gt;
password include  system-auth&lt;br /&gt;
session  required pam_selinux.so        close&lt;br /&gt;
session  required pam_loginuid.so&lt;br /&gt;
session  optional pam_console.so&lt;br /&gt;
session  required pam_selinux.so        open&lt;br /&gt;
session  optional pam_keyinit.so        force revoke&lt;br /&gt;
session  required pam_namespace.so&lt;br /&gt;
session  optional pam_gnome_keyring.so  auto_start&lt;br /&gt;
session  include  system-auth&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The core services are provided by PAM, however other library modules can be written to manage specific services such as support for SELinux. The SELinux PAM modules use the &amp;lt;tt&amp;gt;libselinux&amp;lt;/tt&amp;gt; API to obtain its configuration information and the three SELinux PAM entries highlighted in the above configuration file perform the following functions:&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;tt&amp;gt;'''pam_selinux_permit.so'''&amp;lt;/tt&amp;gt; - Allows pre-defined users the ability to logon without a password provided that SELinux is in enforcing mode (see the &amp;lt;tt&amp;gt;/etc/security/sepermit.conf File&amp;lt;/tt&amp;gt; section of the [[GlobalConfigurationFiles | Global Configuration Files]]). &lt;br /&gt;
&lt;br /&gt;
: &amp;lt;tt&amp;gt;'''pam_selinux.so open'''&amp;lt;/tt&amp;gt; - Allows a security context to be set up for the user at initial logon (as all programs exec'ed from here will use this context). How the context is retrieved is described in the &amp;lt;tt&amp;gt;seusers file&amp;lt;/tt&amp;gt; section of the [[PolicyConfigurationFiles | Policy Configuration Files]].&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;tt&amp;gt;'''pam_selinux.so close'''&amp;lt;/tt&amp;gt; - This will reset the login programs context to the context defined in the policy.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</description>
			<pubDate>Mon, 17 May 2010 15:26:50 GMT</pubDate>			<dc:creator>RichardHaines</dc:creator>			<comments>http://selinuxproject.org/page/Talk:NB_PAM</comments>		</item>
	</channel>
</rss>