
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/css" href="http://selinuxproject.org/w/skins/common/feed.css?63"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://selinuxproject.org/w/?title=NB_Apache&amp;action=history&amp;feed=atom</id>
		<title>NB Apache - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://selinuxproject.org/w/?title=NB_Apache&amp;action=history&amp;feed=atom"/>
		<link rel="alternate" type="text/html" href="http://selinuxproject.org/w/?title=NB_Apache&amp;action=history"/>
		<updated>2013-05-25T00:30:16Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.10.4</generator>

	<entry>
		<id>http://selinuxproject.org/w/?title=NB_Apache&amp;diff=1025&amp;oldid=prev</id>
		<title>Jaxelson at 20:46, 13 September 2010</title>
		<link rel="alternate" type="text/html" href="http://selinuxproject.org/w/?title=NB_Apache&amp;diff=1025&amp;oldid=prev"/>
				<updated>2010-09-13T20:46:25Z</updated>
		
		<summary type="html">&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:46, 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 62:&lt;/strong&gt;&lt;/td&gt;
&lt;td colspan=&quot;2&quot; align=&quot;left&quot;&gt;&lt;strong&gt;Line 62:&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;[[Category:Notebook]]&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Jaxelson</name></author>	</entry>

	<entry>
		<id>http://selinuxproject.org/w/?title=NB_Apache&amp;diff=977&amp;oldid=prev</id>
		<title>RichardHaines: New page: = Apache SELinux Support = Apache web servers are generally managed under SELinux by using the Apache policy modules from the Reference Policy, however an SELinux-aware shared library is a...</title>
		<link rel="alternate" type="text/html" href="http://selinuxproject.org/w/?title=NB_Apache&amp;diff=977&amp;oldid=prev"/>
				<updated>2010-05-18T15:51:08Z</updated>
		
		<summary type="html">&lt;p&gt;New page: = Apache SELinux Support = Apache web servers are generally managed under SELinux by using the Apache policy modules from the Reference Policy, however an SELinux-aware shared library is a...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Apache SELinux Support =&lt;br /&gt;
Apache web servers are generally managed under SELinux by using the Apache policy modules from the Reference Policy, however an SELinux-aware shared library is available that will allow finer grained access control as described in this section. The additional Apache module is called &amp;lt;tt&amp;gt;mod_selinux.so&amp;lt;/tt&amp;gt; and has a supporting policy module called &amp;lt;tt&amp;gt;mod_selinux.pp&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;mod_selinux.pp&amp;lt;/tt&amp;gt; policy module also makes use of the [[TypeRules#typebounds_Statement | typebounds statement]] that was introduced into version 24 of the policy (that requires a minimum kernel of 2.6.28). This was introduced to allow threads in a multi-threaded application (such as Apache) to be bound within a defined set of permissions (i.e. the child domain cannot have greater permissions than the parent domain).&lt;br /&gt;
&lt;br /&gt;
These components are known as 'Apache / SELinux Plus' and are described in the sections that follow, however a full description including configuration details is available from the following web site:&lt;br /&gt;
: [http://code.google.com/p/sepgsql/wiki/Apache_SELinux-plus http://code.google.com/p/sepgsql/wiki/Apache_SELinux-plus]&lt;br /&gt;
&lt;br /&gt;
The objective of these Apache add-on services is to achieve a fully SELinux-aware web stack (although not there yet). For example currently the LAPP&amp;lt;ref name=&amp;quot;ftn35&amp;quot;&amp;gt;This is similar to the LAMP (Linux, Apache, MySQL, PHP/Perl/Python) stack, however MySQL is not SELinux-aware.&amp;lt;/ref&amp;gt; (Linux, Apache, PostgreSQL, PHP / Perl / Python) stack has the following support:&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
| &amp;lt;center&amp;gt;'''L'''&amp;lt;/center&amp;gt;&lt;br /&gt;
| Linux has SELinux support.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;'''A'''&amp;lt;/center&amp;gt;&lt;br /&gt;
| Apache has partial SELinux support using the 'Apache SELinux Plus' module.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;'''P'''&amp;lt;/center&amp;gt;&lt;br /&gt;
| PostgreSQL has SELinux support using SE-PostgreSQL.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;center&amp;gt;'''P'''&amp;lt;/center&amp;gt;&lt;br /&gt;
| PHP / Perl / Python is not currently SELinux-aware.&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;[http://sepgsql.googlecode.com/files/LCA20090120-lapp-selinux.pdf A secure web application platform powered by SELinux]&amp;quot; document gives a good overview of the LAPP architecture.&lt;br /&gt;
&lt;br /&gt;
== mod_selinux Overview ==&lt;br /&gt;
What the &amp;lt;tt&amp;gt;mod_selinux&amp;lt;/tt&amp;gt; module achieves is to allow a web application (or a 'request handler') to be launched by Apache with a security context based on policy rather than that of the web server process itself, for example:&lt;br /&gt;
&lt;br /&gt;
* A user sends an HTTP request to Apache that requires the services of a web application (Apache may or may not apply HTTP authentication).&lt;br /&gt;
* Apache receives the request and launches the web application instance to perform the task:&lt;br /&gt;
** Without &amp;lt;tt&amp;gt;mod_selinux&amp;lt;/tt&amp;gt; enabled the web applications security context is identical to the Apache web server process, it is therefore not possible to restrict it privileges.&lt;br /&gt;
** With &amp;lt;tt&amp;gt;mod_selinux&amp;lt;/tt&amp;gt; enabled the web application is launched with the security context defined in the &amp;lt;tt&amp;gt;mod_selinux.conf&amp;lt;/tt&amp;gt; file (&amp;lt;tt&amp;gt;selinuxDomainVal &amp;lt;security_context&amp;gt;&amp;lt;/tt&amp;gt; entry). It is therefore possible to restrict its privileges as described in the Bounds Overview section below.&lt;br /&gt;
&lt;br /&gt;
* The web application exits, handing control back to the web server that replies with the HTTP response.&lt;br /&gt;
&lt;br /&gt;
=== Bounds Overview ===&lt;br /&gt;
Because multiple threads share the same memory segment, SELinux is unable to check the information flows between these different threads. This means that if a thread (the parent) should launch another thread (a child) with a different security context, SELinux cannot enforce the different permissions (this is why pre 2.6.28 kernels did not allow a different security context to be set on a thread).&lt;br /&gt;
&lt;br /&gt;
To resolve this issue the &amp;lt;tt&amp;gt;typebound&amp;lt;/tt&amp;gt; statement was introduced that stops a child thread (the 'bounded domain') having greater privileges than the parent thread (the 'bounding domain') i.e. the child thread must have equal or less permissions than the parent. &lt;br /&gt;
&lt;br /&gt;
For example the following &amp;lt;tt&amp;gt;typebounds&amp;lt;/tt&amp;gt; statement and &amp;lt;tt&amp;gt;allow&amp;lt;/tt&amp;gt; rules:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#          parent   | child&lt;br /&gt;
#          domain   | domain&lt;br /&gt;
typebounds httpd_t    httpd_child_t;&lt;br /&gt;
&lt;br /&gt;
allow httpd_t etc_t : file { getattr read };&lt;br /&gt;
allow httpd_child_t etc_t : file { read write };&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
States that the parent domain (&amp;lt;tt&amp;gt;httpd_t&amp;lt;/tt&amp;gt;) has &amp;lt;tt&amp;gt;file:{getattr read}&amp;lt;/tt&amp;gt; permissions. However the child domain (&amp;lt;tt&amp;gt;httpd_child_t&amp;lt;/tt&amp;gt;) has been given &amp;lt;tt&amp;gt;file:{read write}&amp;lt;/tt&amp;gt;. This would not be allowed by the compiler because the parent does not have &amp;lt;tt&amp;gt;write&amp;lt;/tt&amp;gt; permission, thus ensuring the child domain will always have equal or less privileges than the parent.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>RichardHaines</name></author>	</entry>

	</feed>