<?xml version="1.0"?>
<rdf:RDF
	xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:foaf="http://xmlns.com/foaf/0.1/"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns="http://purl.org/rss/1.0/"
>
<channel rdf:about="http://selinuxnews.org/planet/">
	<title>Planet SELinux</title>
	<link>http://selinuxnews.org/planet/</link>
	<description>Planet SELinux - http://selinuxnews.org/planet/</description>

	<items>
		<rdf:Seq>
			<rdf:li rdf:resource="http://danwalsh.livejournal.com/50014.html" />
			<rdf:li rdf:resource="http://danwalsh.livejournal.com/49762.html" />
			<rdf:li rdf:resource="http://danwalsh.livejournal.com/49564.html" />
			<rdf:li rdf:resource="http://danwalsh.livejournal.com/49336.html" />
			<rdf:li rdf:resource="http://etbe.coker.com.au/?p=3133" />
			<rdf:li rdf:resource="http://d.hatena.ne.jp/kaigai/20120119/1326955553" />
			<rdf:li rdf:resource="http://blog.namei.org/?p=517" />
			<rdf:li rdf:resource="http://blog.namei.org/?p=512" />
			<rdf:li rdf:resource="http://d.hatena.ne.jp/kaigai/20120109/1326139650" />
			<rdf:li rdf:resource="http://d.hatena.ne.jp/kaigai/20120106/1325852100" />
			<rdf:li rdf:resource="http://etbe.coker.com.au/?p=2987" />
			<rdf:li rdf:resource="http://etbe.coker.com.au/?p=3084" />
			<rdf:li rdf:resource="http://danwalsh.livejournal.com/48936.html" />
			<rdf:li rdf:resource="http://danwalsh.livejournal.com/48886.html" />
			<rdf:li rdf:resource="http://d.hatena.ne.jp/kaigai/20111204/1322926643" />
			<rdf:li rdf:resource="http://danwalsh.livejournal.com/48571.html" />
			<rdf:li rdf:resource="http://danwalsh.livejournal.com/48161.html" />
			<rdf:li rdf:resource="http://danwalsh.livejournal.com/48006.html" />
			<rdf:li rdf:resource="http://etbe.coker.com.au/?p=3038" />
			<rdf:li rdf:resource="http://etbe.coker.com.au/?p=2994" />
			<rdf:li rdf:resource="http://danwalsh.livejournal.com/47738.html" />
			<rdf:li rdf:resource="http://blog.namei.org/?p=508" />
			<rdf:li rdf:resource="http://danwalsh.livejournal.com/47533.html" />
			<rdf:li rdf:resource="http://danwalsh.livejournal.com/47118.html" />
			<rdf:li rdf:resource="http://danwalsh.livejournal.com/47066.html" />
			<rdf:li rdf:resource="http://danwalsh.livejournal.com/46653.html" />
			<rdf:li rdf:resource="http://danwalsh.livejournal.com/46388.html" />
			<rdf:li rdf:resource="http://danwalsh.livejournal.com/46245.html" />
			<rdf:li rdf:resource="tag:blogger.com,1999:blog-5240359826706545510.post-3289137103999606727" />
			<rdf:li rdf:resource="tag:blogger.com,1999:blog-5240359826706545510.post-6192655919467253952" />
			<rdf:li rdf:resource="http://blog.namei.org/?p=503" />
			<rdf:li rdf:resource="urn:lj:livejournal.com:atom1:paulmoore:6886" />
			<rdf:li rdf:resource="http://danwalsh.livejournal.com/46018.html" />
			<rdf:li rdf:resource="http://danwalsh.livejournal.com/45712.html" />
			<rdf:li rdf:resource="http://danwalsh.livejournal.com/45414.html" />
			<rdf:li rdf:resource="http://danwalsh.livejournal.com/45194.html" />
			<rdf:li rdf:resource="tag:blogger.com,1999:blog-5024703430482213163.post-4238326997061638222" />
			<rdf:li rdf:resource="urn:lj:livejournal.com:atom1:paulmoore:6463" />
			<rdf:li rdf:resource="http://danwalsh.livejournal.com/44836.html" />
			<rdf:li rdf:resource="urn:lj:livejournal.com:atom1:paulmoore:6360" />
			<rdf:li rdf:resource="urn:lj:livejournal.com:atom1:paulmoore:6109" />
			<rdf:li rdf:resource="tag:blogger.com,1999:blog-5240359826706545510.post-3790794325190251494" />
			<rdf:li rdf:resource="http://etbe.coker.com.au/?p=2916" />
			<rdf:li rdf:resource="http://etbe.coker.com.au/?p=2913" />
			<rdf:li rdf:resource="http://danwalsh.livejournal.com/44763.html" />
			<rdf:li rdf:resource="http://danwalsh.livejournal.com/44398.html" />
			<rdf:li rdf:resource="http://etbe.coker.com.au/?p=2904" />
			<rdf:li rdf:resource="http://danwalsh.livejournal.com/44090.html" />
			<rdf:li rdf:resource="http://danwalsh.livejournal.com/43816.html" />
			<rdf:li rdf:resource="http://danwalsh.livejournal.com/43730.html" />
			<rdf:li rdf:resource="tag:blogger.com,1999:blog-5240359826706545510.post-8319060620358119756" />
			<rdf:li rdf:resource="http://danwalsh.livejournal.com/43264.html" />
			<rdf:li rdf:resource="http://blog.namei.org/?p=497" />
			<rdf:li rdf:resource="http://danwalsh.livejournal.com/43170.html" />
			<rdf:li rdf:resource="tag:blogger.com,1999:blog-5240359826706545510.post-5713951199572545408" />
			<rdf:li rdf:resource="http://blog.namei.org/?p=493" />
			<rdf:li rdf:resource="http://d.hatena.ne.jp/kaigai/20110515/1305466803" />
			<rdf:li rdf:resource="http://blog.namei.org/?p=480" />
			<rdf:li rdf:resource="tag:blogger.com,1999:blog-5240359826706545510.post-5263008056347626545" />
			<rdf:li rdf:resource="http://etbe.coker.com.au/?p=2747" />
			<rdf:li rdf:resource="http://danwalsh.livejournal.com/42768.html" />
			<rdf:li rdf:resource="http://blog.namei.org/?p=474" />
			<rdf:li rdf:resource="http://danwalsh.livejournal.com/42689.html" />
			<rdf:li rdf:resource="http://danwalsh.livejournal.com/42394.html" />
			<rdf:li rdf:resource="tag:blogger.com,1999:blog-5240359826706545510.post-2132013955084852516" />
			<rdf:li rdf:resource="http://danwalsh.livejournal.com/42186.html" />
			<rdf:li rdf:resource="http://danwalsh.livejournal.com/41794.html" />
			<rdf:li rdf:resource="http://danwalsh.livejournal.com/41593.html" />
			<rdf:li rdf:resource="tag:blogger.com,1999:blog-5240359826706545510.post-2155535332855749669" />
			<rdf:li rdf:resource="tag:blogger.com,1999:blog-5240359826706545510.post-655568822192184808" />
			<rdf:li rdf:resource="tag:blogger.com,1999:blog-7673377107942959487.post-5665729863540851325" />
			<rdf:li rdf:resource="http://danwalsh.livejournal.com/41441.html" />
			<rdf:li rdf:resource="http://danwalsh.livejournal.com/40992.html" />
			<rdf:li rdf:resource="tag:blogger.com,1999:blog-5240359826706545510.post-2471259512934613505" />
			<rdf:li rdf:resource="http://danwalsh.livejournal.com/40752.html" />
			<rdf:li rdf:resource="http://blogs.fedoraproject.org/wp/mgrepl/?p=207" />
			<rdf:li rdf:resource="http://etbe.coker.com.au/?p=2641" />
			<rdf:li rdf:resource="http://danwalsh.livejournal.com/40455.html" />
			<rdf:li rdf:resource="http://blogs.fedoraproject.org/wp/mgrepl/?p=149" />
			<rdf:li rdf:resource="http://blogs.fedoraproject.org/wp/mgrepl/?p=134" />
			<rdf:li rdf:resource="tag:blogger.com,1999:blog-5024703430482213163.post-3872935420517166958" />
			<rdf:li rdf:resource="http://blogs.fedoraproject.org/wp/mgrepl/?p=113" />
			<rdf:li rdf:resource="tag:blogger.com,1999:blog-5024703430482213163.post-8991280132991920661" />
			<rdf:li rdf:resource="tag:blogger.com,1999:blog-5024703430482213163.post-5546042921201310113" />
			<rdf:li rdf:resource="http://danwalsh.livejournal.com/40350.html" />
			<rdf:li rdf:resource="http://blogs.fedoraproject.org/wp/mgrepl/?p=84" />
			<rdf:li rdf:resource="http://danwalsh.livejournal.com/39974.html" />
			<rdf:li rdf:resource="http://danwalsh.livejournal.com/39815.html" />
			<rdf:li rdf:resource="tag:blogger.com,1999:blog-5240359826706545510.post-6518269643502648066" />
			<rdf:li rdf:resource="http://danwalsh.livejournal.com/39534.html" />
			<rdf:li rdf:resource="http://danwalsh.livejournal.com/39197.html" />
			<rdf:li rdf:resource="tag:blogger.com,1999:blog-5024703430482213163.post-3822209684765812282" />
			<rdf:li rdf:resource="http://etbe.coker.com.au/?p=2597" />
			<rdf:li rdf:resource="http://danwalsh.livejournal.com/39155.html" />
			<rdf:li rdf:resource="tag:blogger.com,1999:blog-5240359826706545510.post-7711893362827725942" />
			<rdf:li rdf:resource="http://danwalsh.livejournal.com/38736.html" />
			<rdf:li rdf:resource="http://blogs.fedoraproject.org/wp/mgrepl/?p=22" />
			<rdf:li rdf:resource="tag:blogger.com,1999:blog-5024703430482213163.post-8543066306813862089" />
			<rdf:li rdf:resource="tag:blogger.com,1999:blog-5240359826706545510.post-1222885404529095949" />
			<rdf:li rdf:resource="tag:blogger.com,1999:blog-5240359826706545510.post-6228856452899647198" />
		</rdf:Seq>
	</items>
</channel>

<item rdf:about="http://danwalsh.livejournal.com/50014.html">
	<title>Dan Walsh: Why I love Open Source...  II</title>
	<link>http://danwalsh.livejournal.com/50014.html</link>
	<content:encoded>When SELinux does a full relabel, it prints a * for each 1000 files that it relabels.&lt;br /&gt;&lt;br /&gt;Some users were complaining about a full relabel and not being able to estimate how much time was left.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;I explained to them that I did not know how many files were on the file system, so I could not estimate how much time was left.&amp;nbsp; They explained to me that there was ways to look at the file system and get then number of inodes, and then you could estimate how much time was left.&amp;nbsp; I told them patches accepted, and within a couple of days, I got a patch from John Reiser.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;As of policycoreutils-2.1.10-21.fc17&lt;br /&gt;&lt;br /&gt;If you do a &lt;span&gt;touch /.autorelabel; reboot&lt;/span&gt; or a&lt;span&gt; fixfiles restore&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;You will see output like&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;# fixfiles&amp;nbsp; restore&lt;br /&gt;10%&lt;br /&gt;&lt;br /&gt;With the counter slowly rising.&lt;br /&gt;&lt;br /&gt;Open source opens the possibility for all of us to contribute and make the whole better.&lt;br /&gt;&lt;br /&gt;Thanks John.</content:encoded>
	<dc:date>2012-02-03T17:23:11+00:00</dc:date>
	<dc:creator>dwalsh@redhat.com</dc:creator>
</item>
<item rdf:about="http://danwalsh.livejournal.com/49762.html">
	<title>Dan Walsh: 10 things you probably did not know about SELinux,  #10 shipping policy versions</title>
	<link>http://danwalsh.livejournal.com/49762.html</link>
	<content:encoded>&lt;b&gt;Can I install a policy module built on RHEL6 on a RHEL5 box?&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;First you need to understand policy is compiled statically.&amp;nbsp; Even if you use interfaces, all the rules are compiled into the policy.pp file.&lt;br /&gt;If you use policy_module(mypol, 1.0), this will generate a gen_require(` ') block for all of the permissions, classes defined in policy.&amp;nbsp;&lt;br /&gt;Meaning if you compile a policy on RHEL6 and install it on RHEL5 using policy_module(mypol,1.0) you are likely to fail with an error like:&lt;br /&gt;&lt;br /&gt;&lt;span&gt;# semodule -i mypol.pp&lt;br /&gt;libsepol.permission_copy_callback: Module mypol depends on permission open in class file, not satisfied&lt;br /&gt;libsemanage.semanage_link_sandbox: Link packages failed semodule:&amp;nbsp; Failed!&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This is the compiler telling you that you tried to install a policy module that required the &amp;quot;open&amp;quot; permission and RHEL5 policy, and kernel for that matter, has no idea what the &amp;quot;open&amp;quot; permission is.&lt;br /&gt;&lt;br /&gt;I guess the analogy would be compiling an executable on RHEL6 that uses a function call in a shared library that does not exists on a RHEL5 box, it won't work.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Usually we recommend that you compile policy on the oldest machines policy that you plan on supporting, then it should be installable on all future versions of that policy.&amp;nbsp; We don't tend to remove accesses.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Can I install a policy module built on RHEL5 on a RHEL6 box? &lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Yes you can, but it probably will not work the way you expect!&lt;br /&gt;&lt;br /&gt;In RHEL5 the access required to read a file was:&lt;br /&gt;&lt;br /&gt;&lt;span&gt;define(`read_file_perms',`{&amp;nbsp; getattr read ioctl lock }')&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In RHEL6 the access required to read a file was:&lt;br /&gt;&lt;br /&gt;&lt;span&gt;define(`read_file_perms',`{ open getattr read ioctl lock }')&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;So if you compile in a line like:&lt;br /&gt;&lt;br /&gt;&lt;span&gt;allow httpd_t mysecret_t:file read_file_perms;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;On RHEL5 this would allow the apache type to read files labeled mysecret_t, but if you compiled it on RHEL5 and installed it on RHEL6, apache would not be allowed to &amp;quot;open&amp;quot; the file so the access would fail.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span&gt;Bottom Line:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;If you want to ship policy for two MAJOR&amp;nbsp; DIFFERENT VERSIONS of RHEL then you would need to compile a version for RHEL5 and for RHEL6.&lt;br /&gt;&lt;br /&gt;Policy should work for all Minor versions, as long as you compile on the oldest, supported version, although it might work if you compile on a newer version and install on an older version.&lt;br /&gt;&lt;br /&gt;Meaning a compiled version of policy on RHEL6.1 should work on RHEL6.2, RHEL6.3 ...&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;</content:encoded>
	<dc:date>2012-02-02T15:14:21+00:00</dc:date>
	<dc:creator>dwalsh@redhat.com</dc:creator>
</item>
<item rdf:about="http://danwalsh.livejournal.com/49564.html">
	<title>Dan Walsh: More on deny_ptrace ...</title>
	<link>http://danwalsh.livejournal.com/49564.html</link>
	<content:encoded>This boolean brings into conflict two of my top goals with SELinux.&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://danwalsh.livejournal.com/25265.html&quot;&gt;&lt;b&gt;1. Make the system secure by default.&lt;/b&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The problem with most security systems is NO ONE turns them on.&amp;nbsp; NO ONE increases the security of their system.&lt;br /&gt;Now while these are exaggerations, I would bet you that 99 % of SELinux users never turn on &lt;a href=&quot;http://danwalsh.livejournal.com/37404.html&quot;&gt;confined users&lt;/a&gt;, or &lt;a href=&quot;http://danwalsh.livejournal.com/42394.html&quot;&gt;disable the unconfined module&lt;/a&gt; .&amp;nbsp; There are large numbers of people who run SELinux in permissive mode or even disabled.&amp;nbsp;&amp;nbsp;&amp;nbsp; If we shipped Fedora and RHEL with SELinux disabled, I would bet the number of people who would enable it would be infinitesimally small.&amp;nbsp;&amp;nbsp;&amp;nbsp; So when I add a feature, I always think about how it would help the vast majority of people.&amp;nbsp;&amp;nbsp;&amp;nbsp; Will this boolean make my Wife's computer more secure.&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://danwalsh.livejournal.com/30084.html&quot;&gt;&lt;b&gt;2. Keep the unconfined domain unconfined...&lt;/b&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Read the blog for why uses expect things to just work, especially from their logged in accounts, especially if they are the admin.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Should deny_ptrace be on by default????&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Well deny_ptrace actually confines the unconfined domain, so it conflicts with #2, but if I don't turn it on, for the most part people will not take advantage.&amp;nbsp; Most users would not see the benefit.&amp;nbsp; Right now I am going to turn it on by default (Of course I reserve the right to change my mind, or be beaten into submission.)&amp;nbsp; Any person who wants to disable it permanently can execute.&lt;br /&gt;&lt;br /&gt;&lt;span&gt;# setsebool -P deny_ptrace 0&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Programmers and system admins if you get a &amp;quot;permission denied&amp;quot; or &amp;quot;Operation not supported&amp;quot; error with ptrace, strace or gdb, it is SELinux causing the problem, and if you need to debug a problem, you can turn the boolean on temporarily.&lt;br /&gt;&lt;br /&gt;&lt;span&gt;# setsebool deny_ptrace 0&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;And do your thing.&lt;br /&gt;&lt;br /&gt;Since sysadmins and programmers understand Linux best, it would be easier for them to toggle the security feature.&lt;br /&gt;&lt;br /&gt;&lt;span&gt;&lt;b&gt;Now some questions about this feature.&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;What happened to allow_ptrace boolean in RHEL versions and older Fedora's?&amp;nbsp; &lt;/b&gt;&lt;br /&gt;&lt;br /&gt;I originally thought about extending allow_ptrace, but I thought I had better just create a new boolean and remove the old.&lt;br /&gt;&lt;br /&gt;allow_ptrace only effected confined users. But since hardly anyone used confined users, I thought I needed a better way to describe the feature, and change its name.&amp;nbsp; I have removed allow_ptrace and now deny_ptrace will remove all ptrace, sys_ptrace that I know about from the system.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Does deny_ptrace guarantee no domains on my system can ptrace another domain?&amp;nbsp; &lt;/b&gt;&lt;br /&gt;&lt;br /&gt;NO&lt;br /&gt;If you load a custom policy with an &amp;quot;allow XYZ self:process ptrace&amp;quot;, this boolean will not effect it.&amp;nbsp; So it only effects actually policy shipped by Fedora or Red Hat.&lt;br /&gt;deny_ptrace does not effect permissive domains,&amp;nbsp; or permissive mode (obviously),&amp;nbsp; so if you want to make sure no processes can execute ptrace, you need to &lt;a href=&quot;http://danwalsh.livejournal.com/46245.html&quot;&gt;disable permissive domains&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;After you turn on the deny_ptrace boolean, you can check if any domains are still able to ptrace by executing&lt;br /&gt;&lt;br /&gt;&lt;span&gt;# sesearch&amp;nbsp; -A -C -p ptrace,sys_ptrace | grep -v ^D&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;What about separation between root and users?&lt;/h3&gt;Well SELinux does not know anything about UID users, so root and non root mean nothing to SELinux.&amp;nbsp; The only way to get this distinction is by setting up confined users and then say run as staff_t as non root and then transition to unconfined_t, or sysadm_t or a confined admin type.&amp;nbsp; But since hardly anyone uses confined users, this is not an option, if I want to make most computers more secure.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Could you add a bunch of booleans that allows us to turn on and off ptrace per confined domain?&lt;/h3&gt;Well this is not really necessary, since most confined domains can not ptrace now, or only could ptrace because of some bugs in the kernel that generated ptrace avc's when running the ps command as root or if a process examined the /proc/PID files of another process.&amp;nbsp;&amp;nbsp;&amp;nbsp; We have fixed these kernel issues and are removing most domains ability to ptrace permanently, Ie turning deny_ptrace off DOES not allow every domain the ability to ptrace, only a few select domains that we believe might need it.&amp;nbsp; (Really just user domains.)&lt;br /&gt;</content:encoded>
	<dc:date>2012-02-01T15:03:43+00:00</dc:date>
	<dc:creator>dwalsh@redhat.com</dc:creator>
</item>
<item rdf:about="http://danwalsh.livejournal.com/49336.html">
	<title>Dan Walsh: Fedora 17 New SELinux Feature part I - deny_ptrace</title>
	<link>http://danwalsh.livejournal.com/49336.html</link>
	<content:encoded>The deny_ptrace feature allows an administrator to toggle the ability of processes on the computer system from examining other processes on the system, including user processes.&amp;nbsp;&amp;nbsp; It can even block processes running as root.&lt;br /&gt;&lt;br /&gt;Most people do not realize that any program they run can examine the memory of any other process run by them.&amp;nbsp; Meaning the computer game you are running on your desktop can watch everything going on in Firefox or a programs like pwsafe or kinit or other program that attempts to hide passwords..&lt;br /&gt;&lt;br /&gt;SELinux defines this access as ptrace and sys_ptrace.&amp;nbsp; These accesses allow one process to read the memory of another process.&amp;nbsp;&amp;nbsp; ptrace allows developers and administrators to debug how a process is running using tools like strace, ptrace and gdb.&amp;nbsp;&amp;nbsp;&amp;nbsp; You can even use gdb (GNU Debugger) to manipulate another process running memory and environment.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;The problem is this is allowed by default.&amp;nbsp; &lt;/b&gt;&lt;br /&gt;&lt;br /&gt;My wife does not debug programs, why is she allowed to debug them?&amp;nbsp; As a matter of fact most of the time, I am not debugging applications, so it would be more secure if we could disable it by default.&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://fedoraproject.org/wiki/Features/SELinuxDenyPtrace&quot; rel=&quot;nofollow&quot;&gt;I created a feature for Fedora 17 called SELinuxDenyPtrace&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Here is a youtube video demonstrating the SELinuxDenyPtrace feature.&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://youtu.be/WVRS9krNFxU&quot; rel=&quot;nofollow&quot;&gt;Check it out.&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;</content:encoded>
	<dc:date>2012-01-31T18:43:57+00:00</dc:date>
	<dc:creator>dwalsh@redhat.com</dc:creator>
</item>
<item rdf:about="http://etbe.coker.com.au/?p=3133">
	<title>Russell Coker (security): SE Linux Status in Debian 2012-01</title>
	<link>http://etbe.coker.com.au/2012/01/25/se-linux-status-2012-01/</link>
	<content:encoded>&lt;p&gt;Since &lt;a href=&quot;http://etbe.coker.com.au/2011/10/31/selinux-status-2011-10/&quot;&gt;my last SE Linux in Debian status report [1]&lt;/a&gt; there have been some significant changes.&lt;/p&gt;
&lt;h3&gt;Policy&lt;/h3&gt;
&lt;p&gt;Last year I reported that the policy wasn&amp;#8217;t very usable, on the 18th of January I uploaded version 2:2.20110726-2 of the policy packages that fixes many bugs. The policy should now be usable by most people for desktop operations and as a server. Part of the delay was that I wanted to include support for systemd, but as my work on systemd proceeded slowly and others didn&amp;#8217;t contribute policy I could use I gave up and just released it. Systemd is still a priority for me and I plan to use it on all my systems when Wheezy is released.&lt;/p&gt;
&lt;h3&gt;Kernel&lt;/h3&gt;
&lt;p&gt;Some time between Debian kernel 3.0.0-2 and 3.1.0-1 support for an upstream change to the security module configuration was incorporated. Instead of using &lt;b&gt;selinux=1&lt;/b&gt; on the kernel command line to enable SE Linux support the kernel option is &lt;b&gt;security=selinux&lt;/b&gt;. This change allows people to boot with &lt;b&gt;security=tomoyo&lt;/b&gt; or &lt;b&gt;security=apparmor&lt;/b&gt; if they wish. No support for Smack though.&lt;/p&gt;
&lt;p&gt;As the kernel silently ignores command line parameters that it doesn&amp;#8217;t understand so there is no harm in having both &lt;b&gt;selinux=1&lt;/b&gt; and &lt;b&gt;security=selinux&lt;/b&gt; on both older and newer kernels. So version &lt;b&gt;0.5.0&lt;/b&gt; of &lt;b&gt;selinux-basics&lt;/b&gt; now adds both kernel command-line options to GRUB configuration when &lt;b&gt;selinux-activate&lt;/b&gt; is run. Also when the package is upgraded it will search for &lt;b&gt;selinux=1&lt;/b&gt; in the GRUB configuration and if it&amp;#8217;s there it will add &lt;b&gt;security=selinux&lt;/b&gt;. This will give users the functionality that they expect, systems which have SE Linux activated will keep running SE Linux after a kernel upgrade or downgrade! Prior to updating &lt;b&gt;selinux-basics&lt;/b&gt; systems running Debian/Unstable won&amp;#8217;t work with SE Linux.&lt;/p&gt;
&lt;p&gt;As an aside the postinst file for &lt;b&gt;selinux-basics&lt;/b&gt; was last changed in 2006 (thanks Erich Schubert). This package is part of the new design of SE Linux in Debian and some bits of it haven&amp;#8217;t needed to be changed for 6 years! SE Linux isn&amp;#8217;t a new thing, it&amp;#8217;s been in production for a long time.&lt;/p&gt;
&lt;h3&gt;Audit&lt;/h3&gt;
&lt;p&gt;While the audit daemon isn&amp;#8217;t strictly a part of SE Linux (each can be used without the other) it seems that most of the time they are used together (in Debian at least). I have prepared a NMU of the new upstream version of audit and uploaded it to delayed/7. I want to get everything related to SE Linux up to date or at least with comparable versions to Fedora. Also I sent some of the Debian patches for the auditd upstream which should reduce the maintenance effort in future.&lt;/p&gt;
&lt;h3&gt;Libraries&lt;/h3&gt;
&lt;p&gt;There have been some NMUs of libraries that are part of SE Linux. Due to a combination of having confidence in the people doing the NMUs and not having much spare time I have let them go through without review. I&amp;#8217;m sure that I will notice soon enough if they don&amp;#8217;t work, my test systems exercise enough SE Linux functionality that it would be difficult to break things without me noticing.&lt;/p&gt;
&lt;h3&gt;Play Machine&lt;/h3&gt;
&lt;p&gt;I am now preparing a new SE Linux &amp;#8220;Play Machine&amp;#8221; running Debian/Unstable. I wore my Play Machine shirt at LCA so I&amp;#8217;ve got to get one going again soon. This is a good exercise of the strict features of SE Linux policy, I&amp;#8217;ve found some bugs which need to be fixed. Running Play Machines really helps improve the overall quality of SE Linux.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;[1]&lt;a href=&quot;http://etbe.coker.com.au/2011/10/31/selinux-status-2011-10/&quot;&gt; http://etbe.coker.com.au/2011/10/31/selinux-status-2011-10/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Related posts:&lt;/p&gt;&lt;ol&gt;
&lt;li&gt;&lt;a href=&quot;http://etbe.coker.com.au/2009/01/20/status-se-linux-debian-lca2009/&quot; rel=&quot;bookmark&quot; title=&quot;Status of SE Linux in Debian LCA 2009&quot;&gt;Status of SE Linux in Debian LCA 2009&lt;/a&gt; &lt;small&gt;This morning I gave a talk at the Security mini-conf...&lt;/small&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://etbe.coker.com.au/2007/05/18/se-linux-in-debian/&quot; rel=&quot;bookmark&quot; title=&quot;SE Linux in Debian&quot;&gt;SE Linux in Debian&lt;/a&gt; &lt;small&gt;I have now got a Debian Xen domU running the...&lt;/small&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://etbe.coker.com.au/2008/03/28/debian-se-linux-status/&quot; rel=&quot;bookmark&quot; title=&quot;Debian SE Linux Status&quot;&gt;Debian SE Linux Status&lt;/a&gt; &lt;small&gt;At the moment I&amp;#8217;ve got more time to work on...&lt;/small&gt;&lt;/li&gt;
&lt;/ol&gt;</content:encoded>
	<dc:date>2012-01-25T11:36:31+00:00</dc:date>
	<dc:creator>etbe</dc:creator>
</item>
<item rdf:about="http://d.hatena.ne.jp/kaigai/20120119/1326955553">
	<title>KaiGai Kohei: [OSS/Linux] PG-Stromにプロファイラをつけてみた</title>
	<link>http://d.hatena.ne.jp/kaigai/20120119/1326955553</link>
	<content:encoded>&lt;div class=&quot;section&quot;&gt;
&lt;p&gt;1月6日(金)に書いた『しゅとろ〜む、しゅとろ〜む』の記事は割と反響が大きかったようだ。&lt;/p&gt;
&lt;p&gt;コメント欄に次のような質問を頂いたので、試してみることにする。&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;span class=&quot;deco&quot;&gt;通りすがりさん wrote:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;すばらしい成果ですね．&lt;/p&gt;
&lt;p&gt;カラム指向的にデータを持っていること自体が性能向上に寄与しているということはないですか？&lt;/p&gt;
&lt;p&gt;(通常 + CPU) vs (カラム指向+GPU)で比較をされていますが，&lt;/p&gt;
&lt;p&gt;(通常 + CPU) vs (カラム指向+CPU) vs (カラム指向+GPU) の評価にも興味があります．&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;plan.c 内の is_device_executable_qual() 関数が常に false を返すようにすれば、条件句の処理をCPUだけで行うようになる。これは (カラム指向+CPU) と同等である。&lt;/p&gt;
&lt;p&gt;1,000万件のレコードを持つ、通常のテーブル t1 と、PG-Strom管理下のテーブル t2 に対してそれぞれ以下のクエリを実行してみた。&lt;/p&gt;
&lt;p&gt;■ １回目（バッファにデータが乗っていない状態）&lt;/p&gt;
&lt;pre&gt;
(通常 + CPU)
Timing is on.
postgres=# SELECT COUNT(&amp;#42;) FROM t1 WHERE sqrt((x-25.6)^2 + (y-12.8)^2) &amp;#60; 15;
 count
-------
  6718
(1 row)

Time: 8041.237 ms

(カラム指向 + CPU)
postgres=# SELECT COUNT(&amp;#42;) FROM t2 WHERE sqrt((x-25.6)^2 + (y-12.8)^2) &amp;#60; 15;
 count
-------
  6718
(1 row)

Time: 8660.486 ms

(カラム指向 + GPU)
postgres=# SELECT COUNT(&amp;#42;) FROM t2 WHERE sqrt((x-25.6)^2 + (y-12.8)^2) &amp;#60; 15;
 count
-------
  6718
(1 row)

Time: 4667.643 ms

&lt;/pre&gt;

&lt;p&gt;■ ２回目（バッファにデータが乗っている状態）&lt;/p&gt;
&lt;pre&gt;
(通常 + CPU)
postgres=# SELECT COUNT(&amp;#42;) FROM t1 WHERE sqrt((x-25.6)^2 + (y-12.8)^2) &amp;#60; 15;
 count
-------
  6718
(1 row)

Time: 7016.732 ms

(カラム指向 + CPU)
postgres=# SELECT COUNT(&amp;#42;) FROM t2 WHERE sqrt((x-25.6)^2 + (y-12.8)^2) &amp;#60; 15;
 count
-------
  6718
(1 row)

Time: 6733.771 ms

(カラム指向 + GPU)
postgres=# SELECT COUNT(&amp;#42;) FROM t2 WHERE sqrt((x-25.6)^2 + (y-12.8)^2) &amp;#60; 15;
 count
-------
  6718
(1 row)

Time: 173.351 ms
&lt;/pre&gt;

&lt;p&gt;(通常+CPU)と(カラム指向+CPU)の比較で、ディスクからの読み出しが発生する場合にカラム指向の方が8%程度遅いという結果になっている。&lt;/p&gt;
&lt;p&gt;複雑な条件句を設定したために、I/OよりもCPUバウンドな処理になっている事、xとyにはランダムな値を入れているために、全く圧縮が効いていないのが一因かもしれない。&lt;/p&gt;
&lt;p&gt;(カラム指向 + GPU)で２回目の方が早くなっているのは、主にGPUコードのJITコンパイルの処理時間の違いによるものだろう。JITコンパイルにここまで時間がかかることは稀だが、確実にI/Oを発生させるために Linux の Page Cache をクリアしてから測定を行ったため、nvccコマンドもOSのキャッシュから弾き出されたという事だろう。&lt;/p&gt;
&lt;p&gt;ただ、psql の \timing ではトータルの実行時間を表示するだけで、何が要因で時間を食っているのかは分からない。PG-Stromは性能改善を目的とするモジュールなので、どの辺を改善したら良いのか探るには先ず、どの辺にボトルネックがあるのかを探る必要がある。&lt;/p&gt;
&lt;p&gt;という訳で、PG-StromのGUCパラメータ pg_strom.exec_profile を追加してみた。&lt;/p&gt;
&lt;p&gt;これに &quot;on&quot; をセットすると、各々コンポーネントで消費した時間を表示してくれる。&lt;/p&gt;
&lt;pre&gt;
postgres=# SET pg_strom.exec_profile = ON;
SET
&lt;/pre&gt;

&lt;p&gt;（カラム指向 + GPU; １回目）&lt;/p&gt;
&lt;pre&gt;
postgres=# SELECT COUNT(&amp;#42;) FROM t2 WHERE sqrt((x-25.6)^2 + (y-12.8)^2) &amp;#60; 15;
INFO:  PG-Strom Exec Profile on &quot;t2&quot;
INFO:  Total PG-Strom consumed time: 4367.067 ms
INFO:  Time to JIT Compile GPU code: 1741.505 ms
INFO:  Time to initialize devices:   345.353 ms
INFO:  Time to Load column-stores:   2119.669 ms
INFO:  Time to Scan column-stores:   3.566 ms
INFO:  Time to Fetch virtual tuples: 110.920 ms
INFO:  Time of GPU Synchronization:  31.244 ms
INFO:  Time of Async memcpy:         31.320 ms
INFO:  Time of Async kernel exec:    27.906 ms
INFO:  Num of registers/thread &amp;#91;0]:  25
INFO:  Constant memory usage &amp;#91;0]:    40 byte
INFO:  Max device memory usage&amp;#91;0]:   536 KB
 count
-------
  6718
(1 row)

Time: 4514.738 ms
&lt;/pre&gt;

&lt;p&gt;\timing で計測した応答時間 4514.738ms のうち、PG-Strom モジュール内の処理時間は 4367.067 msで、そのうち、大部分を占めるのが、GPUコードのJITコンパイル（1741.505ms）と、カラムストアからのロード（2119.669ms）になる。これと比べると、GPUでの処理時間・メモリ転送は桁が違う。&lt;/p&gt;
&lt;p&gt;（カラム指向 + GPU; ２回目）&lt;/p&gt;
&lt;pre&gt;
postgres=# SELECT COUNT(&amp;#42;) FROM t2 WHERE sqrt((x-25.6)^2 + (y-12.8)^2) &amp;#60; 15;
INFO:  PG-Strom Exec Profile on &quot;t2&quot;
INFO:  Total PG-Strom consumed time: 183.302 ms
INFO:  Time to JIT Compile GPU code: 0.043 ms
INFO:  Time to initialize devices:   1.134 ms
INFO:  Time to Load column-stores:   54.883 ms
INFO:  Time to Scan column-stores:   3.425 ms
INFO:  Time to Fetch virtual tuples: 96.384 ms
INFO:  Time of GPU Synchronization:  27.462 ms
INFO:  Time of Async memcpy:         30.737 ms
INFO:  Time of Async kernel exec:    27.906 ms
INFO:  Num of registers/thread &amp;#91;0]:  25
INFO:  Constant memory usage &amp;#91;0]:    40 byte
INFO:  Max device memory usage&amp;#91;0]:   536 KB
 count
-------
  6718
(1 row)

Time: 186.867 ms
&lt;/pre&gt;

&lt;p&gt;１回目で時間を食っていた、GPUコードのJITコンパイル処理時間が消え、カラムストアからのロード時間も大幅に減っている。また、地味にデバイスの初期化にも345.353 ms要していたが、これがほぼ無くなっている。&lt;/p&gt;
&lt;p&gt;この結果、トータルの処理時間が4514.738 ms⇒186.867msに減少。&lt;/p&gt;
&lt;p&gt;カラムストアのロード/スキャンと、タプルをフェッチする処理（これはFDWの仕様なので減らすのが難しい）、それにGPUの処理の同期で合わせて 182.154 ms が消費されている。&lt;/p&gt;
&lt;p&gt;1/6(金)の時点から少しアルゴリズムを変更しているが、メモリ使用量はほとんど問題になっていない。&lt;/p&gt;
&lt;p&gt;これは、I/O周りで時間がかかっているために、２個、３個とチャンクを非同期に処理しようとしても、次のチャンクを読み込んでGPUに渡す頃には、前のチャンクの処理が既に終わっているからという事だろう。&lt;/p&gt;
&lt;p&gt;この辺、もっと足回りの良いマシンなら変わってくるのだろうか。&lt;/p&gt;
&lt;p&gt;なお、Time to scan... というのは、条件句を評価した結果に基づいてカラムストアをスキャンする処理で、条件句には使われていないものの、Target-listに含まれるカラムが存在する場合に発生する。今回のクエリは COUNT(*) を返すだけなので、追加のスキャンは発生していない。&lt;/p&gt;
&lt;br /&gt;

&lt;p&gt;おまけ。(カラム指向 + CPU)の実行結果だとこうなる。&lt;/p&gt;
&lt;pre&gt;
postgres=# SELECT COUNT(&amp;#42;) FROM t2 WHERE sqrt((x-25.6)^2 + (y-12.8)^2) &amp;#60; 15;
INFO:  PG-Strom Exec Profile on &quot;t2&quot;
INFO:  Total PG-Strom consumed time: 2314.374 ms
INFO:  Time to JIT Compile GPU code: 0.000 ms
INFO:  Time to initialize devices:   0.000 ms
INFO:  Time to Load column-stores:   6.881 ms
INFO:  Time to Scan column-stores:   1435.570 ms
INFO:  Time to Fetch virtual tuples: 871.891 ms
INFO:  Time of GPU Synchronization:  0.000 ms
INFO:  Time of Async memcpy:         0.000 ms
INFO:  Time of Async kernel exec:    0.000 ms
 count
-------
  6718
(1 row)

Time: 8063.461 ms
&lt;/pre&gt;

&lt;p&gt;トータル 8063ms のうち、PS-Strom内の処理は 2314 ms。つまり、必死こいてPG-Stromから本体側にメモリコピーの後、CPUで条件句を処理という流れが見える。PG-Strom内での結果の絞込みができないので、Fetch virtual tuplesの時間が大幅に増加しているのが分かる。&lt;/p&gt;
&lt;p&gt;それと、Scan column-store の時間もやや気がかり。足回りとして、この辺は改善の余地があるやも。&lt;/p&gt;
&lt;/div&gt;</content:encoded>
	<dc:date>2012-01-19T06:45:53+00:00</dc:date>
	<dc:creator>kaigai</dc:creator>
</item>
<item rdf:about="http://blog.namei.org/?p=517">
	<title>James Morris: Save the date: 2012 Linux Security Summit, 30-31 August, San Diego</title>
	<link>http://blog.namei.org/2012/01/18/save-the-date-2012-linux-security-summit-30-31-august-san-diego/</link>
	<content:encoded>&lt;p&gt;This is a pre-announcement so people can start planning travel for the year.&lt;/p&gt;
&lt;p&gt;The Linux Security Summit for 2012 will be held on the 30th and 31st of August in San Diego, CA, USA.  It will be co-located with &lt;a href=&quot;https://events.linuxfoundation.org/events/linuxcon&quot;&gt;LinuxCon North America&lt;/a&gt;, plumbers and the kernel summit.&lt;/p&gt;
&lt;p&gt;More details to follow.&lt;/p&gt;</content:encoded>
	<dc:date>2012-01-18T00:43:18+00:00</dc:date>
	<dc:creator>jamesm</dc:creator>
</item>
<item rdf:about="http://blog.namei.org/?p=512">
	<title>James Morris: New git repository for the Linux kernel security subsystem</title>
	<link>http://blog.namei.org/2012/01/16/new-git-repository-for-the-linux-kernel-security-subsystem/</link>
	<content:encoded>&lt;p&gt;I&amp;#8217;ve set up a new git repository for the Linux kernel security subsystem on the new kernel.org server.&lt;/p&gt;
&lt;p&gt;The URLs are:&lt;/p&gt;
&lt;p&gt;git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security.git&lt;br /&gt;
http://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security.git&lt;br /&gt;
https://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security.git&lt;/p&gt;
&lt;p&gt;Developers should work against the &amp;#8220;next&amp;#8221; branch.&lt;/p&gt;
&lt;p&gt;A web-browsable interface via gitweb may be found at:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://git.kernel.org/?p=linux/kernel/git/jmorris/linux-security.git;a=summary&quot;&gt;http://git.kernel.org/?p=linux/kernel/git/jmorris/linux-security.git;a=summary&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The temporary repo on selinuxproject.org will go away soon, so please update your repositories.&lt;/p&gt;</content:encoded>
	<dc:date>2012-01-16T05:02:20+00:00</dc:date>
	<dc:creator>jamesm</dc:creator>
</item>
<item rdf:about="http://d.hatena.ne.jp/kaigai/20120109/1326139650">
	<title>KaiGai Kohei: [OSS/Linux]PG-Strom</title>
	<link>http://d.hatena.ne.jp/kaigai/20120109/1326139650</link>
	<content:encoded>&lt;div class=&quot;section&quot;&gt;
&lt;p&gt;I've checked up an idea whether it is feasible to implement, or not, since I saw a &lt;a href=&quot;http://www.pgcon.org/2011/schedule/events/352.en.html&quot; target=&quot;_blank&quot;&gt;presentation by Tim Child&lt;/a&gt; in Ottawa last year.&lt;/p&gt;
&lt;p&gt;Is it possible to accelerate sequential-scan of PostgreSQL?&lt;/p&gt;
&lt;p&gt;We often see sequential-scan instead of index-scan in case of queries with complex calculation. I thought GPU works fine in these cases.&lt;/p&gt;
&lt;p&gt;I tried to implement a module that works as FDW (foreign data wrapper) of PostgreSQL, since I could have a time to develop during Christmas vacation.&lt;/p&gt;
&lt;p&gt;The name of module is PG-Strom that is pronounced as shutt-row-me; being pronounced in German style.&lt;/p&gt;
&lt;p&gt;Its name originates &quot;Streaming Multiprocessor&quot; that is a unit of process in GPU.&lt;/p&gt;
&lt;p&gt;Of course, it assumes existing interface of FDW, so it is unavailable to update, and some more restrictions like sort or aggregate functions. However, it achieves good performance as a prototype.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Note that the following description is based on author's understanding (quite newbie for CUDA), so please point out if something incorrect.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4&gt; Benchmark&lt;/h4&gt;
&lt;p&gt;Even though it is an arbitrary testcase, I tries to execute a query that scans a table with 20-million records in my development environment. NVidia's GTS450eco is installed.&lt;/p&gt;
&lt;pre&gt;
-- A regular table
mytest=# SELECT count(&amp;#42;) FROM pgbench_accounts
    WHERE (xval - 23.45) &amp;#42; (xval - 23.45) + (yval - 54.32) &amp;#42; (yval - 54.32) &amp;#60; 100;
 count
--------
 629291
(1 row)

Time: 29030.738 ms

-- with PG-Strom
mytest=# SELECT count(&amp;#42;) FROM pgstrom_accounts
    WHERE (xval - 23.45) &amp;#42; (xval - 23.45) + (yval - 54.32) &amp;#42; (yval - 54.32) &amp;#60; 100;
 count
--------
 629291
(1 row)

Time: 2337.475 ms
&lt;/pre&gt;

&lt;p&gt;It is a surprising result. PG-Strom returns the result with 10 times faster!&lt;/p&gt;
&lt;p&gt;In addition, we may be able to expect more improvement because GPU is quite cheap one (about 100Euro).&lt;/p&gt;
&lt;p&gt;Let's try again. I reduced the number of records (5-million records, with shared_buffer=960MB) to store whole of the table on the buffer; to eliminate affects from disk-I/O.&lt;/p&gt;
&lt;pre&gt;
-- A regular table
mytest=# SELECT count(&amp;#42;) FROM t1
   WHERE (xval - 23.45) &amp;#42; (xval - 23.45) + (yval - 54.32) &amp;#42; (yval - 54.32) &amp;#60; 100;
 count
--------
 157800
(1 row)

Time: 4106.045 ms

-- with PG-Strom
mytest=# SELECT count(&amp;#42;) FROM t2
    WHERE (xval - 23.45) &amp;#42; (xval - 23.45) + (yval - 54.32) &amp;#42; (yval - 54.32) &amp;#60; 100;
 count
--------
 157800
(1 row)

Time: 393.346 ms
&lt;/pre&gt;

&lt;p&gt;Wow!&lt;/p&gt;
&lt;h4&gt; Idea&lt;/h4&gt;
&lt;p&gt;PostgreSQL iterates (1) fetch a tuple from storage (or buffer), and (2) evaluation of qualifier of WHERE clause according to contents of the tuple during sequential-scan. Thus, it unavailable to handle (2) during execution of (1), and also unavailable to handle (1) during execution of (2). An idea is CPU multi-threading, however, it is hard to implement because PostgreSQL does not have thread-safe design including memory or I/O management.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://f.hatena.ne.jp/kaigai/20120106194226&quot; class=&quot;hatena-fotolife&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://cdn-ak.f.st-hatena.com/images/fotolife/k/kaigai/20120106/20120106194226.png&quot; alt=&quot;f:id:kaigai:20120106194226p:image:w512&quot; title=&quot;f:id:kaigai:20120106194226p:image:w512&quot; class=&quot;hatena-fotolife&quot; width=&quot;512&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;PG-Strom entrusts GPU device the (2) portion (evaluation of WHERE clause), and make CPU focus on I/O stuff.&lt;/p&gt;
&lt;p&gt;The calculation stuff shall be handled on GPU device side asynchronously, so it shall be finished during CPU handles more I/O stuff.&lt;/p&gt;
&lt;p&gt;However, GPU is not a magic bullet for anything.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://f.hatena.ne.jp/kaigai/20120106194225&quot; class=&quot;hatena-fotolife&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://cdn-ak.f.st-hatena.com/images/fotolife/k/kaigai/20120106/20120106194225.png&quot; alt=&quot;f:id:kaigai:20120106194225p:image:w512&quot; title=&quot;f:id:kaigai:20120106194225p:image:w512&quot; class=&quot;hatena-fotolife&quot; width=&quot;512&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;We need to transfer data to be calculated by GPU into device memory mounted on GPU. It requires to transfer via PCI-E that has narrow bandwidth compared to the one between CPU and Memory. (Max 2.5GB/s in x16 lane)&lt;/p&gt;
&lt;p&gt;Thus, amount of data to be copied should be smaller as we can as possible.&lt;/p&gt;
&lt;p&gt;In most cases, it is rare case that WHERE clause reference all the columns within the table, because the purpose of query is to fetch a record that satisfies the condition of XXXXX.&lt;/p&gt;
&lt;p&gt;PG-Strom handles execution of WHERE clause on GPU device. At that time, all copied to GPU device are contents of referenced columns. I expect 10%-20% of table size needs to be copied to GPU device via PCI-E, because numeric data is smaller than text data.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://f.hatena.ne.jp/kaigai/20120106194224&quot; class=&quot;hatena-fotolife&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://cdn-ak.f.st-hatena.com/images/fotolife/k/kaigai/20120106/20120106194224.png&quot; alt=&quot;f:id:kaigai:20120106194224p:image:w512&quot; title=&quot;f:id:kaigai:20120106194224p:image:w512&quot; class=&quot;hatena-fotolife&quot; width=&quot;512&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h4&gt; Data structure and Asynchronous process&lt;/h4&gt;
&lt;p&gt;The internal data structure of PG-Strom is organized according to the above idea.&lt;/p&gt;
&lt;p&gt;For example, when we create a foreign table with four-columns: a, b, c and d, PG-Strom creates tables corresponding to each columns within pg_strom schema. These tables have rowid (int64) to identify a particular row and an array-type to store multiple original data.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://f.hatena.ne.jp/kaigai/20120106194223&quot; class=&quot;hatena-fotolife&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://cdn-ak.f.st-hatena.com/images/fotolife/k/kaigai/20120106/20120106194223.png&quot; alt=&quot;f:id:kaigai:20120106194223p:image:w512&quot; title=&quot;f:id:kaigai:20120106194223p:image:w512&quot; class=&quot;hatena-fotolife&quot; width=&quot;512&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Even though it is a column-oriented data structure recently well used, it does not go out of transaction management of PostgreSQL, PG-Strom does not need to touch them.&lt;/p&gt;
&lt;p&gt;This type of data structure allows PG-Strom to load data into GPU devices via PCI-E bus effectively.&lt;/p&gt;
&lt;p&gt;The contents read from the databases are temporarily stored on fixed-length buffer called &quot;chunk&quot;, then it shall be moved to GPU devices and calculated, and the results shall be written back at last. These steps are executed asynchronously, thus, CPU can scan the database concurrently to set up next chunk. This design enables to utilize both of CPU and GPU.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://f.hatena.ne.jp/kaigai/20120106194222&quot; class=&quot;hatena-fotolife&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://cdn-ak.f.st-hatena.com/images/fotolife/k/kaigai/20120106/20120106194222.png&quot; alt=&quot;f:id:kaigai:20120106194222p:image:w512&quot; title=&quot;f:id:kaigai:20120106194222p:image:w512&quot; class=&quot;hatena-fotolife&quot; width=&quot;512&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h4&gt; Just-in-time compile and native-code execution&lt;/h4&gt;
&lt;p&gt;CPU and GPU have its own advantage and disadvantage for each. GPU has much higher computing capability using large number of calculation units in parallel, however, one of its disadvantage is conditional branch.&lt;/p&gt;
&lt;p&gt;NVidia's GPU synchronously run 32 of execution units (that is called as SM:Streaming-Multiprocessor) like as a SIMD operations. In the case when device code contains conditional-branch part, a particular thread has 'true' on the condition, and other thread has 'false' on the condition, then, all the threads execute both of true-block and false-block and result of the block to be skipped shall be ignored. Thus, we cannot ignore the cost to execute branch statement within GPU device, especially, if-block is big.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://f.hatena.ne.jp/kaigai/20120106194221&quot; class=&quot;hatena-fotolife&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://cdn-ak.f.st-hatena.com/images/fotolife/k/kaigai/20120106/20120106194221.png&quot; alt=&quot;f:id:kaigai:20120106194221p:image:w512&quot; title=&quot;f:id:kaigai:20120106194221p:image:w512&quot; class=&quot;hatena-fotolife&quot; width=&quot;512&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;PostgreSQL has internal representation of WHERE clause as tree-structure, and we scan the tree-structure using switch statement on execute them. It shall be worst effectiveness.&lt;/p&gt;
&lt;p&gt;Thus, PG-Strom adopts Just-in-time compile to generate native binary code of GPU to avoid execution control on GPU device.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://f.hatena.ne.jp/kaigai/20120106194219&quot; class=&quot;hatena-fotolife&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://cdn-ak.f.st-hatena.com/images/fotolife/k/kaigai/20120106/20120106194219.png&quot; alt=&quot;f:id:kaigai:20120106194219p:image:w512&quot; title=&quot;f:id:kaigai:20120106194219p:image:w512&quot; class=&quot;hatena-fotolife&quot; width=&quot;512&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;When the supplied query tries to reference a foreign-table managed by PG-Strom, the query planner requires PG-Strom to generate execution plan. At that time, PG-Strom dynamically generate a source code towards GPU device, then kicks nvcc (compiler of NVidia's device) to build a native code of GPU device.&lt;/p&gt;
&lt;p&gt;Of course, it shall be cached on shared memory to avoid execute compiler so frequently.&lt;/p&gt;
&lt;p&gt;Next, when query-executor calls PG-Strom's executor, as I mentioned above, this native code shall be transferred to the device side with data read from pg_strom schema, and executed asynchronously.&lt;/p&gt;
&lt;p&gt;The qualifiers of WHERE clause is already extracted on the planner stage, no need to handle a big switch statement.&lt;/p&gt;
&lt;p&gt;We can confirm the automatically generated code of GPU device.&lt;/p&gt;
&lt;pre&gt;
mytest=# EXPLAIN SELECT &amp;#42; FROM pgstrom_accounts
         WHERE (xval - 23.45) &amp;#42; (xval - 23.45) +
               (yval - 54.32) &amp;#42; (yval - 54.32) &amp;#60; 100;
                        QUERY PLAN
--------------------------------------------------------------
 Foreign Scan on pgstrom_accounts  (cost=2.00..0.00 rows=1000 width=368)
    Required Cols : aid, bid, abalance, filler, xval, yval
   Used in clause : xval, yval
      1: typedef unsigned long size_t;
      2: typedef long __clock_t;
      3: typedef __clock_t clock_t;
      4: #include &quot;crt/device_runtime.h&quot;
      5:
      6: typedef char  bool_t;
      7:
      8: __global__ void
      9: pgstrom_qual(unsigned char rowmap&amp;#91;],
     10:              double c5_values&amp;#91;],
     11:              unsigned char c5_nulls&amp;#91;],
     12:              double c6_values&amp;#91;],
     13:              unsigned char c6_nulls&amp;#91;])
     14: {
     15:     int offset_base = blockIdx.x &amp;#42; blockDim.x + threadIdx.x;
     16:     int offset = offset_base &amp;#42; 8;
     17:     unsigned char result = rowmap&amp;#91;offset_base];
     18:     unsigned char errors = 0;
     19:     unsigned char cn5 = c5_nulls&amp;#91;offset_base];
     20:     unsigned char cn6 = c6_nulls&amp;#91;offset_base];
     21:     int bitmask;
     22:
     23:     for (bitmask=1; bitmask &amp;#60; 256; bitmask &amp;#60;&amp;#60;= 1)
     24:     {
     25:         double cv5 = c5_values&amp;#91;offset];
     26:         double cv6 = c6_values&amp;#91;offset];
     27:
     28:         if ((result &amp;#38; bitmask) &amp;#38;&amp;#38;
                    !((((cv5 - 23.45) &amp;#42; (cv5 - 23.45)) +
                       ((cv6 - 54.32) &amp;#42; (cv6 - 54.32))) &amp;#60; 100))
     29:             result &amp;#38;= ~bitmask;
     30:         offset++;
     31:     }
     32:     rowmap&amp;#91;offset_base] = (result &amp;#38; ~errors);
     33: }
(36 rows)
&lt;/pre&gt;

&lt;h4&gt; Publication&lt;/h4&gt;
&lt;p&gt;Right now, it is in public at GitHub. GPLv3 is applied.&lt;/p&gt;
&lt;p&gt;  &lt;a href=&quot;https://github.com/kaigai/pg_strom&quot; target=&quot;_blank&quot;&gt;https://github.com/kaigai/pg_strom&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Even though it is a prototype, thus, its specification depends on my feeling, and we cannot expect documentation for a while, if you'd like to use, please call me (@kkaigai) on twitter.&lt;/p&gt;
&lt;h4&gt; A short demonstration&lt;/h4&gt;
&lt;p&gt;This is a short demonstration. The 't1' table is a regular table with 5-million records, and the 't2' table is a foreign table managed by PG-Strom also with 5-million records.&lt;/p&gt;
&lt;p&gt;In the case of sequential-scan with complex qualifier, scan on 't2' was finished x10 times faster than the case of 't1'.&lt;/p&gt;
&lt;p&gt;
&lt;a href=&quot;http://d.hatena.ne.jp/video/youtube/xrUBffs9aJ0&quot; alt=&quot;この動画を含む日記&quot;&gt;&lt;img src=&quot;http://d.hatena.ne.jp/images/d_entry.gif&quot; alt=&quot;D&quot; border=&quot;0&quot; title=&quot;この動画を含む日記&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;</content:encoded>
	<dc:date>2012-01-09T20:07:30+00:00</dc:date>
	<dc:creator>kaigai</dc:creator>
</item>
<item rdf:about="http://d.hatena.ne.jp/kaigai/20120106/1325852100">
	<title>KaiGai Kohei: [OSS/Linux] しゅとろ〜む、しゅとろ〜む</title>
	<link>http://d.hatena.ne.jp/kaigai/20120106/1325852100</link>
	<content:encoded>&lt;div class=&quot;section&quot;&gt;
&lt;p&gt;昨年、オタワで&lt;a href=&quot;http://www.pgcon.org/2011/schedule/events/352.en.html&quot; target=&quot;_blank&quot;&gt;Tim Child氏の発表&lt;/a&gt;を聞いて以来、実装できないものかと思って暖めていたアイデアがある。GPUの処理能力を使って、PostgreSQLの検索処理を高速化できないか？というものである。&lt;/p&gt;
&lt;p&gt;特に複雑な計算を含むクエリの場合、Index-Scanに落ちないで、全件スキャンが走ることが往々にしてあるが、こういったケースで有効に作用するのではなかろうか？という着想である。&lt;/p&gt;
&lt;p&gt;クリスマス休暇の間、割とまとまった開発時間を取る事ができたので、PostgreSQLのFDW(Foreign Data Wrapper)として動作するモジュールを作成してみた。&lt;/p&gt;
&lt;p&gt;モジュールの名前は PG-Strom で、ドイツ風に『しゅとろ〜む』と発音する。&lt;/p&gt;
&lt;p&gt;これは GPU の処理単位である Streaming Multiprocessor に由来する。&lt;/p&gt;
&lt;p&gt;もちろん、現状のFDWのI/F前提なので、更新は不可能でソートや集約関数もモジュール側に出せないという諸々制約はあるが、プロトタイプとしてはまずまずの性能である。&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;※ なお、下記のGPU関連の記述は著者（CUDAプログラミング歴１ヶ月）の理解によるものです。間違っていたらご指摘ください。むしろ教えてくださいｗ&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4&gt; ベンチマーク&lt;/h4&gt;
&lt;p&gt;かなり恣意的なテストケースではあるが、2,000万件のレコードからなるテーブルを全件スキャンするクエリを手元の環境で実施してみた。なお、搭載しているGPUはNvidia GTX450ecoである。&lt;/p&gt;
&lt;pre&gt;
-- 従来のテーブル
mytest=# SELECT count(&amp;#42;) FROM pgbench_accounts
    WHERE (xval - 23.45) &amp;#42; (xval - 23.45) + (yval - 54.32) &amp;#42; (yval - 54.32) &amp;#60; 100;
 count
--------
 629291
(1 row)

Time: 29030.738 ms

-- PG-Stromを利用
mytest=# SELECT count(&amp;#42;) FROM pgstrom_accounts
    WHERE (xval - 23.45) &amp;#42; (xval - 23.45) + (yval - 54.32) &amp;#42; (yval - 54.32) &amp;#60; 100;
 count
--------
 629291
(1 row)

Time: 2337.475 ms
&lt;/pre&gt;

&lt;p&gt;驚いた事に、1/10以下の応答時間でクエリを実行してしまったではないか。&lt;/p&gt;
&lt;p&gt;しかも利用しているGPUは100Euro程度のショボイものだけに、伸びしろもあるだろう。&lt;/p&gt;
&lt;p&gt;もう一回、今度はディスクIOの影響を除くため、テーブル全体がバッファに乗るサイズ（shared_buffer=960MBで、件数を500万件に削減）で試してみた。&lt;/p&gt;
&lt;pre&gt;
-- 従来のテーブル
mytest=# SELECT count(&amp;#42;) FROM t1
   WHERE (xval - 23.45) &amp;#42; (xval - 23.45) + (yval - 54.32) &amp;#42; (yval - 54.32) &amp;#60; 100;
 count
--------
 157800
(1 row)

Time: 4106.045 ms

mytest=# SELECT count(&amp;#42;) FROM t2
    WHERE (xval - 23.45) &amp;#42; (xval - 23.45) + (yval - 54.32) &amp;#42; (yval - 54.32) &amp;#60; 100;
 count
--------
 157800
(1 row)

Time: 393.346 ms
&lt;/pre&gt;

&lt;p&gt;わお！&lt;/p&gt;
&lt;h4&gt; アイデア&lt;/h4&gt;
&lt;p&gt;PostgreSQLの場合、基本的に全件スキャン時の処理は (1) ディスク(or バッファ)からの読み出し (2) タプルの内容に基づいて WHERE 条件句を評価 の繰り返しとなる。&lt;/p&gt;
&lt;p&gt;そのため、(1)の処理中は(2)を実行できず、(2)の処理中は(1)を実行できない。CPUマルチスレッド化はひとつのアイデアだが、PostgreSQLはメモリ管理やI/O周りを含めて Thread-Safe な構造にはなっていないため、これは非常に難しい。&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://f.hatena.ne.jp/kaigai/20120106194226&quot; class=&quot;hatena-fotolife&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://cdn-ak.f.st-hatena.com/images/fotolife/k/kaigai/20120106/20120106194226.png&quot; alt=&quot;f:id:kaigai:20120106194226p:image:w512&quot; title=&quot;f:id:kaigai:20120106194226p:image:w512&quot; class=&quot;hatena-fotolife&quot; width=&quot;512&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;PG-Stromでは、(2)のWHERE条件句の処理を GPU 側に任せる事で、CPUをI/Oに専念させる。&lt;/p&gt;
&lt;p&gt;計算処理はGPU側で非同期に実施してくれるので、CPUから見た場合『ここにあるデータを評価しておいて頂戴』と頼んでおくと、しばらくI/O処理をしている間に計算結果が出来上がっている、という算段である。&lt;/p&gt;
&lt;p&gt;ただ、GPUに処理をさせれば万事OKかというと、そうは問屋が卸さない。&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://f.hatena.ne.jp/kaigai/20120106194225&quot; class=&quot;hatena-fotolife&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://cdn-ak.f.st-hatena.com/images/fotolife/k/kaigai/20120106/20120106194225.png&quot; alt=&quot;f:id:kaigai:20120106194225p:image:w512&quot; title=&quot;f:id:kaigai:20120106194225p:image:w512&quot; class=&quot;hatena-fotolife&quot; width=&quot;512&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;GPUで計算させるには、GPU搭載のdevice memoryにデータを転送する必要があるが、これには PCI-Eを通して転送する必要があり、この箇所の帯域はCPU-Memory間に比べて非常に小さいのである。(x16のバスでもMAX片側2.5GB/s)&lt;/p&gt;
&lt;p&gt;したがって、GPUデバイスに転送するデータの量はできるだけ少なくした方がよい。&lt;/p&gt;
&lt;p&gt;通常、SQLのWHERE条件句がテーブルの全てのカラムを参照するという事は考えにくい。&lt;/p&gt;
&lt;p&gt;『○○の条件を満たすレコードを取り出す』というのがクエリの目的だからだ。&lt;/p&gt;
&lt;p&gt;PG-StromではWHERE条件句の処理をGPU側で実行するが、その際、GPUデバイス側に転送されるのは計算に必要なカラムだけである。普通は数値データの方が文字列よりも短いため、PCI-Eを介してGPUデバイスに転送の必要があるのは、テーブル全体の10%-20%程度ではなかろうか。&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://f.hatena.ne.jp/kaigai/20120106194224&quot; class=&quot;hatena-fotolife&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://cdn-ak.f.st-hatena.com/images/fotolife/k/kaigai/20120106/20120106194224.png&quot; alt=&quot;f:id:kaigai:20120106194224p:image:w512&quot; title=&quot;f:id:kaigai:20120106194224p:image:w512&quot; class=&quot;hatena-fotolife&quot; width=&quot;512&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h4&gt; データ構造と非同期処理&lt;/h4&gt;
&lt;p&gt;PG-Stromの内部データ構造も、上記の方針に従って編成されている。&lt;/p&gt;
&lt;p&gt;例えば、a、b、c、dの4つのカラムを持つFOREIGN TABLEを定義したとき、PG-Stromは各々のカラムに対応するテーブルを&quot;pg_strom&quot;スキーマ内に作成する。これらのテーブルは、行を一意に識別する rowid (int64) と、元々のデータを配列化したデータ型を持つ事になる。&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://f.hatena.ne.jp/kaigai/20120106194223&quot; class=&quot;hatena-fotolife&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://cdn-ak.f.st-hatena.com/images/fotolife/k/kaigai/20120106/20120106194223.png&quot; alt=&quot;f:id:kaigai:20120106194223p:image:w512&quot; title=&quot;f:id:kaigai:20120106194223p:image:w512&quot; class=&quot;hatena-fotolife&quot; width=&quot;512&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;最近流行のカラム指向DB的なデータ構造という訳だが、あくまでも PostgreSQL のトランザクション管理の枠内でデータ構造を規定しているので、その辺の厄介な処理は PG-Strom の側では一切ノータッチで済ませている。&lt;/p&gt;
&lt;p&gt;この様なデータ構造を持つ事により、PG-StromではPCI-Eを介してGPUデバイスに送り込むデータを高速にDBから読み込めるようになっている。読み込んだデータはチャンクと呼ぶ固定長のバッファに蓄えられ、順次GPUデバイスに送出、GPUでの演算処理を行い、結果の書き戻しが行われる。&lt;/p&gt;
&lt;p&gt;実際にはこれらの一連の処理は全て非同期に実施されるため、CPUはその間もDBからデータを読み込み、次のチャンクのセットアップが可能であるため、CPU/GPUを効率的に利用する事ができる。&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://f.hatena.ne.jp/kaigai/20120106194222&quot; class=&quot;hatena-fotolife&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://cdn-ak.f.st-hatena.com/images/fotolife/k/kaigai/20120106/20120106194222.png&quot; alt=&quot;f:id:kaigai:20120106194222p:image:w512&quot; title=&quot;f:id:kaigai:20120106194222p:image:w512&quot; class=&quot;hatena-fotolife&quot; width=&quot;512&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h4&gt; Just-in-time compile と native code 実行&lt;/h4&gt;
&lt;p&gt;CPUとGPUにはそれぞれ得意不得意の分野があり、GPUは非常に多くの並列演算ユニットを協調して動作させる事により高い計算能力を発揮するが、不得意な分野もある。その一つが条件分岐である。&lt;/p&gt;
&lt;p&gt;NVidiaのGPUでは32個の実行ユニットを含むStreaming Multiprocessorという単位で、SIMDライクな処理が行われる。GPU内の処理が条件分岐を含み、特定のスレッドでは IF 条件が真に、別のスレッドでは偽になるような場合、全てのスレッドがIF文の真ブロック/偽ブロックを処理し、IF条件に合致しないケースを破棄するという処理が行われる。そのため、特にIFブロックのサイズが大きくなるに従って、GPU内で条件句を処理する際のコストが無視できないものとなる。&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://f.hatena.ne.jp/kaigai/20120106194221&quot; class=&quot;hatena-fotolife&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://cdn-ak.f.st-hatena.com/images/fotolife/k/kaigai/20120106/20120106194221.png&quot; alt=&quot;f:id:kaigai:20120106194221p:image:w512&quot; title=&quot;f:id:kaigai:20120106194221p:image:w512&quot; class=&quot;hatena-fotolife&quot; width=&quot;512&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;PostgreSQL内部ではWHERE条件句をツリー状のデータ構造によって保持しているが、ツリーを順にスキャンして『次は '+' 演算子だから…』と switch() 文で分岐させるような処理は、最悪の効率、という事になる。&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;※ ただ、並列に実行する全てのスレッドでIF条件の評価結果が同じ場合にどうなるか？という点は、調べた限りではよく分からなかった。この場合にペナルティが避けられるのであれば、GPU側でコントロール処理を行うのも一つのアイデア。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;そのため、PG-StromではJust-in-time compileの技術を使って動的にネイティブのGPUコードを生成して実行するという方針を採用している。&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://f.hatena.ne.jp/kaigai/20120106194219&quot; class=&quot;hatena-fotolife&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://cdn-ak.f.st-hatena.com/images/fotolife/k/kaigai/20120106/20120106194219.png&quot; alt=&quot;f:id:kaigai:20120106194219p:image:w512&quot; title=&quot;f:id:kaigai:20120106194219p:image:w512&quot; class=&quot;hatena-fotolife&quot; width=&quot;512&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;利用者のクエリがPG-Strom管理下の外部テーブルを参照する場合、Query PlannerはPG-Stromに対してクエリ実行プランを作成するよう要求する。その時、PG-Strom PlannerはWHERE条件句に従って動的にGPUデバイス用のコードを生成し、nvcc（NVidia の GPU向けコンパイラ）を実行してGPU向けのネイティブコードを生成する。もちろん、毎回コンパイラを起動していては時間の無駄なので、生成したバイナリは共有メモリ上にキャッシュされる。&lt;/p&gt;
&lt;p&gt;次いで、Query-ExecutorがPG-Strom Executorを呼び出すと、前述の通り、pg_stromスキーマ内から読み出したデータと共に、GPU向けのネイティブコードがデバイス側に送出され、非同期に実行される。&lt;/p&gt;
&lt;p&gt;WHERE条件句は既にPlanner段階で展開されているので、改めて巨大な switch 文を処理する必要は…ない。&lt;/p&gt;
&lt;p&gt;ちなみに、EXPLAIN文でどのようなGPU向けのコードが生成されているかを見る事ができる。&lt;/p&gt;
&lt;pre&gt;
mytest=# EXPLAIN SELECT &amp;#42; FROM pgstrom_accounts
         WHERE (xval - 23.45) &amp;#42; (xval - 23.45) +
               (yval - 54.32) &amp;#42; (yval - 54.32) &amp;#60; 100;
                        QUERY PLAN
--------------------------------------------------------------
 Foreign Scan on pgstrom_accounts  (cost=2.00..0.00 rows=1000 width=368)
    Required Cols : aid, bid, abalance, filler, xval, yval
   Used in clause : xval, yval
      1: typedef unsigned long size_t;
      2: typedef long __clock_t;
      3: typedef __clock_t clock_t;
      4: #include &quot;crt/device_runtime.h&quot;
      5:
      6: typedef char  bool_t;
      7:
      8: __global__ void
      9: pgstrom_qual(unsigned char rowmap&amp;#91;],
     10:              double c5_values&amp;#91;],
     11:              unsigned char c5_nulls&amp;#91;],
     12:              double c6_values&amp;#91;],
     13:              unsigned char c6_nulls&amp;#91;])
     14: {
     15:     int offset_base = blockIdx.x &amp;#42; blockDim.x + threadIdx.x;
     16:     int offset = offset_base &amp;#42; 8;
     17:     unsigned char result = rowmap&amp;#91;offset_base];
     18:     unsigned char errors = 0;
     19:     unsigned char cn5 = c5_nulls&amp;#91;offset_base];
     20:     unsigned char cn6 = c6_nulls&amp;#91;offset_base];
     21:     int bitmask;
     22:
     23:     for (bitmask=1; bitmask &amp;#60; 256; bitmask &amp;#60;&amp;#60;= 1)
     24:     {
     25:         double cv5 = c5_values&amp;#91;offset];
     26:         double cv6 = c6_values&amp;#91;offset];
     27:
     28:         if ((result &amp;#38; bitmask) &amp;#38;&amp;#38;
                    !((((cv5 - 23.45) &amp;#42; (cv5 - 23.45)) +
                       ((cv6 - 54.32) &amp;#42; (cv6 - 54.32))) &amp;#60; 100))
     29:             result &amp;#38;= ~bitmask;
     30:         offset++;
     31:     }
     32:     rowmap&amp;#91;offset_base] = (result &amp;#38; ~errors);
     33: }
(36 rows)
&lt;/pre&gt;

&lt;h4&gt; 公開先&lt;/h4&gt;
&lt;p&gt;今のところGitHUBで公開中。ライセンスはGPLv3です。&lt;/p&gt;
&lt;p&gt;  &lt;a href=&quot;https://github.com/kaigai/pg_strom&quot; target=&quot;_blank&quot;&gt;https://github.com/kaigai/pg_strom&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;まだプロトタイプ段階なので、私の気分次第で仕様は変わりますし、当面はドキュメントも期待できません。それでも使ってみようという奇特な方がいらっしゃいましたら、Twitter (@kkaigai) などで呼びかけてもらえれば。&lt;/p&gt;
&lt;/div&gt;</content:encoded>
	<dc:date>2012-01-06T12:15:00+00:00</dc:date>
	<dc:creator>kaigai</dc:creator>
</item>
<item rdf:about="http://etbe.coker.com.au/?p=2987">
	<title>Russell Coker (security): My Blog Server was Cracked</title>
	<link>http://etbe.coker.com.au/2011/12/31/server-cracked/</link>
	<content:encoded>&lt;p&gt;On the 1st of August I noticed that the server which runs my blog among other things was having an occasional SEGV from a sshd process. Unfortunately I was busy and didn&amp;#8217;t pay much attention to this, which turned out to be a big mistake.&lt;/p&gt;
&lt;p&gt;On the 12th of September I started investigating this properly and noticed that when someone tried to connect to ssh with password authentication sshd would SEGV after it was denied access to a shared memory region or a semaphore which had a SE Linux type of unconfined_t. I added some SE Linux &lt;b&gt;auditallow&lt;/b&gt; rules and discovered that the memory region in question was created by the ssh client. Shortly after that I came to the conclusion that this wasn&amp;#8217;t some strange feature of ssh (or one of the many shared objects it uses) but hostile activity. The ssh client appeared to be storing passwords that it used in a shared memory region and sshd was also collecting passwords in the same region and presumably offering them to a ssh client which uses some extension to the ssh protocol.&lt;/p&gt;
&lt;p&gt;The sshd process was crashing because it couldn&amp;#8217;t handle EPERM on access to shared memory or semaphores. Presumably if the system in question wasn&amp;#8217;t running SE Linux then the exploit would have remained undetected for a lot longer.&lt;/p&gt;
&lt;p&gt;At this stage we don&amp;#8217;t know how the attacker got in. Presumably one of the people with root access ran a ssh client on a compromised system and had their password sniffed. One such client system was mysteriously reinstalled at about that time, the sysadmin of the system in question claimed to have no backups which made it impossible to determine if that system had been compromised. I believe that the sysadmin of the client system knew that their system was compromised, kept that information secret, and allowed other systems to become and remain compromised.&lt;/p&gt;
&lt;p&gt;The attacker made no good effort to conceal their presence, they replaced &lt;b&gt;ssh&lt;/b&gt;, &lt;b&gt;sshd&lt;/b&gt;, and &lt;b&gt;ssh-add&lt;/b&gt; and didn&amp;#8217;t bother changing the Debian checksums so the &lt;b&gt;debsums&lt;/b&gt; program flagged the files as modified. Note that I have kept copies of the files in question and am willing to share them with anyone who wants to analyse them.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://be-geek.com/linux/2011/11/15/steinar-h-gunderson-ebury-a-new-ssh-trojan&quot;&gt;Steinar H. Gunderson has named this trojan Ebury [1]&lt;/a&gt;.&lt;/p&gt;
&lt;h3&gt;Recovery&lt;/h3&gt;
&lt;p&gt;By the evening of the 13th of September I had the system mostly working again. Jabber still isn&amp;#8217;t working because ejabberd is difficult to get working at the best of times, I am now investigating whether there is a better Jabber server to use, but as I don&amp;#8217;t use Jabber often this hasn&amp;#8217;t been a priority for me.&lt;/p&gt;
&lt;p&gt;Some of the WordPress plugins I use and all of the WordPress themes that are installed were outside the Debian packaging system, as I couldn&amp;#8217;t be sure that they hadn&amp;#8217;t been altered (because the people who wrote WordPress plugins don&amp;#8217;t keep old versions online) I had to upgrade to the newer versions. Of course the newer versions weren&amp;#8217;t entirely compatible so I had to use a different theme and I couldn&amp;#8217;t get all plugins working. &lt;a href=&quot;http://etbe.coker.com.au/2010/04/30/link-within/&quot;&gt;Link Within no longer works, not that it ever worked properly [2]&lt;/a&gt;, I wanted to try Outbrain again but their web site won&amp;#8217;t let me login (and they haven&amp;#8217;t responded to my support request). Does anyone know of a good WordPress plugin to provide links to related content? Either related content on my blog or on the Internet in general will be OK.&lt;/p&gt;
&lt;p&gt;Some people have asked me about the change in appearance of my blog. It was simply impossible (for someone with my PHP skills) to get my blog looking the same way as it did before the server was cracked. I think that the new look is OK and don&amp;#8217;t mind if people think it looks likw a VW advert &amp;#8211; VW make great cars, I was very satisfied with the VW Passat I used to drive.&lt;/p&gt;
&lt;h3&gt;Future Plans&lt;/h3&gt;
&lt;p&gt;I had bought some &lt;a href=&quot;http://www.yubico.com/&quot;&gt;Yubikeys (USB devices that generate one-time passwords) [3]&lt;/a&gt; to control access to that server, if I had configured the software to use them then this might not have happened. The use of one-time password devices can prevent passive password-sniffing attacks. It would still allow active attacks (such as using ControlPath/ControlMaster options on the ssh client to allow a hostile party to connect later (EG the &lt;b&gt;-M&lt;/b&gt;, &lt;b&gt;-S&lt;/b&gt;, and &amp;#8220;&lt;b&gt;-o ControlPersist&lt;/b&gt;&amp;#8221; options for the ssh client). It&amp;#8217;s a pity that there doesn&amp;#8217;t seem to be a way to configure the ssh server to disable ControlMaster.&lt;/p&gt;
&lt;h3&gt;Conclusion&lt;/h3&gt;
&lt;p&gt;It would be good to have some changes to sshd to allow more restrictions on what a client can request, as ControlMaster functionality isn&amp;#8217;t needed by most users it should be possible to disable it.&lt;/p&gt;
&lt;p&gt;SE Linux doesn&amp;#8217;t protect against a compromised client system or any other way of stealing passwords. It did do a good job of stopping Ebury from doing all the things it wanted to do and thus making me aware of the problem. So I count this as a win for SE Linux.&lt;/p&gt;
&lt;p&gt;Yubikeys are the cheapest and easiest way of managine one-time passwords. I had already bought some for use on the system in question but hadn&amp;#8217;t got around to configuring them. I have to make that a priority.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;[1]&lt;a href=&quot;http://be-geek.com/linux/2011/11/15/steinar-h-gunderson-ebury-a-new-ssh-trojan&quot;&gt; http://be-geek.com/linux/2011/11/15/steinar-h-gunderson-ebury-a-new-ssh-trojan&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;[2]&lt;a href=&quot;http://etbe.coker.com.au/2010/04/30/link-within/&quot;&gt; http://etbe.coker.com.au/2010/04/30/link-within/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;[3]&lt;a href=&quot;http://www.yubico.com/&quot;&gt; http://www.yubico.com/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Related posts:&lt;/p&gt;&lt;ol&gt;
&lt;li&gt;&lt;a href=&quot;http://etbe.coker.com.au/2009/04/27/email-passwords/&quot; rel=&quot;bookmark&quot; title=&quot;Email Passwords&quot;&gt;Email Passwords&lt;/a&gt; &lt;small&gt;I was doing some routine sysadmin work for a client...&lt;/small&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://etbe.coker.com.au/2009/03/06/case-sensitivity-published-passwords/&quot; rel=&quot;bookmark&quot; title=&quot;Case Sensitivity and Published Passwords&quot;&gt;Case Sensitivity and Published Passwords&lt;/a&gt; &lt;small&gt;When I first started running a SE Linux Play Machine...&lt;/small&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://etbe.coker.com.au/2006/09/10/whats-a-good-blog-server-for-serious-blogging/&quot; rel=&quot;bookmark&quot; title=&quot;what&amp;#8217;s a good blog server for serious blogging?&quot;&gt;what&amp;#8217;s a good blog server for serious blogging?&lt;/a&gt; &lt;small&gt;I&amp;#8217;m getting sick of blogger. The main thing is that...&lt;/small&gt;&lt;/li&gt;
&lt;/ol&gt;</content:encoded>
	<dc:date>2011-12-31T00:01:06+00:00</dc:date>
	<dc:creator>etbe</dc:creator>
</item>
<item rdf:about="http://etbe.coker.com.au/?p=3084">
	<title>Russell Coker (security): Secure Boot and Protecting Against Root</title>
	<link>http://etbe.coker.com.au/2011/12/28/secure-boot-protecting-against-root/</link>
	<content:encoded>&lt;p&gt;There has been a lot of discussion recently about the recent Microsoft ideas regarding secure boot, in case you have missed it &lt;a href=&quot;http://ncommander.blogspot.com/2011/11/secure-boot-its-here-and-been-here-for.html&quot;&gt;Michael Casadevall has written a good summary of the issue [1]&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Recently I&amp;#8217;ve seen a couple of people advocate the concept of secure boot with the stated idea that &amp;#8220;root&amp;#8221; should be unable to damage the system, as Microsoft Software is something that doesn&amp;#8217;t matter to me I&amp;#8217;ll restrict my comments to how this might work on Linux.&lt;/p&gt;
&lt;p&gt;Restricting the &amp;#8220;root&amp;#8221; account is something that is technically possible, for much of the past 9 years I have been running &lt;a href=&quot;http://www.coker.com.au/selinux/play.html&quot;&gt;SE Linux &amp;#8220;Play Machines&amp;#8221; which have UID 0 (root) restricted by SE Linux such that they can&amp;#8217;t damage the system [2]&lt;/a&gt; &amp;#8211; there are other ways of achieving similar goals. But having an account with UID 0 that can&amp;#8217;t change anything on the system doesn&amp;#8217;t really match what most people think of as &amp;#8220;root&amp;#8221;, I just do it as a way of demonstrating that SE Linux controls all access such that cracking a daemon which runs as root won&amp;#8217;t result in immediately controlling the entire system.&lt;/p&gt;
&lt;p&gt;As an aside my Play Machine is not online at the moment, I hope to have it running again soon.&lt;/p&gt;
&lt;h3&gt;Root Can&amp;#8217;t Damage the System&lt;/h3&gt;
&lt;p&gt;One specific claim was that &amp;#8220;root&amp;#8221; should be unable to damage the system. While a secure boot system can theoretically result in a boot to single user mode without any compromise that doesn&amp;#8217;t apply to fully operational systems. For a file owned by root to be replaced the system security has to be compromised in some way. The same compromise will usually work every time until the bug is fixed and the software is upgraded. So the process of cracking root that might be used to install hostile files can also be used at runtime to exploit running processes via ptrace and do other bad stuff.&lt;/p&gt;
&lt;p&gt;Even if the attacker is forced to compromise the system at every boot this isn&amp;#8217;t a great win for the case of servers with months of uptime or for the case of workstations that have confidential data that can be rapidly copied over the Internet. There are also many workstations that are live on the Internet for months nowadays.&lt;/p&gt;
&lt;p&gt;Also the general claim doesn&amp;#8217;t really make sense on it&amp;#8217;s own. &amp;#8220;root&amp;#8221; usually means the account that is used for configuring the system. If a system can be configured then the account which is used to configure it will be able to do unwanted things. It is theoretically possible to run workstations without external root access (EG have them automatically update to the latest security fixes). Such a workstation configuration MIGHT be able to survive a compromise by having a reboot trigger an automatic update. But a workstation that is used in such a manner could be just re-imaged as it would probably be used in an environment where data-less operation makes sense.&lt;/p&gt;
&lt;p&gt;An Android phone could be considered as an example of a Linux system for which the &amp;#8220;root&amp;#8221; user can&amp;#8217;t damage the system if you consider &amp;#8220;root&amp;#8221; to mean &amp;#8220;person accessing the GUI configuration system&amp;#8221;. But then it wouldn&amp;#8217;t be difficult to create a configuration program for a regular Linux system that allows the user to change some parts of the system configuration while making others unavailable. Besides there are many ways in which the Android configuration GUI permits the user to make the system mostly unusable (EG by disabling data access) or extremely expensive to operate (EG by forcing data roaming). So I don&amp;#8217;t think that Android is a good example of &amp;#8220;root&amp;#8221; being prevented from doing damage.&lt;/p&gt;
&lt;h3&gt;Signing All Files&lt;/h3&gt;
&lt;p&gt;Another idea that I saw advocated was to have the &amp;#8220;secure boot&amp;#8221; concept extended to all files. So you have a boot loader that loads a signed kernel which then loads only signed executables and then every interpreter (Perl, Python, etc) will also check for signatures on files that they run. This would be tricky with interpreters that are designed to run from standard input (most notably /bin/sh but also many other interpreters).&lt;/p&gt;
&lt;p&gt;Doing this would require changing many programs, I guess you would even have to change mount to check the signature on /etc/fstab etc. This would be an unreasonably large amount of work.&lt;/p&gt;
&lt;p&gt;Another possibility would be to change the kernel such that it checks file signatures and has restrictions on system calls such as open() and the exec() family of calls. In concept it would be possible to extend SE Linux or any other access control system to include access checks on which files need to be signed (some types such as etc_t and bin_t would need to be signed but others such as var_t wouldn&amp;#8217;t).&lt;/p&gt;
&lt;p&gt;Of course this would mean that no sysadmin work could be performed locally as all file changes would have to come from the signing system. I can imagine all sorts of theoretically interesting but practically useless ways of implementing this such as having the signing system disconnected from the Internet with USB flash devices used for one-way file transfer &amp;#8211; because you can&amp;#8217;t have the signing system available to the same attacks as the host system.&lt;/p&gt;
&lt;p&gt;The requirement to sign all files would reduce the use of such a system to a tiny fraction of the user-base. Which would then raise the question of why anyone would spend the effort on that task when there are so many other ways of improving security that involve less work and can be used by more people.&lt;/p&gt;
&lt;h3&gt;Encrypted Root Filesystem&lt;/h3&gt;
&lt;p&gt;One real benefit of a secure boot system is for systems using encrypted filesystems. It would be good to know that a hostile party hasn&amp;#8217;t replaced the kernel and initrd when you are asked for the password to unlock the root filesystem. This would be good for the case where a laptop is left in a hotel room or other place where a hostile party could access it.&lt;/p&gt;
&lt;p&gt;Another way of addressing the same problem is to boot from a USB device so that you can keep a small USB boot device with you when it&amp;#8217;s inconvenient to carry a large laptop (which works for me). Of course it&amp;#8217;s theoretically possible for the system BIOS to be replaced with something that trojans the boot process (EG runs the kernel in a virtual machine). But I expect that if someone who is capable of doing that gets access to my laptop then I&amp;#8217;m going to lose anyway.&lt;/p&gt;
&lt;h3&gt;Conclusion&lt;/h3&gt;
&lt;p&gt;The secure boot concept does seem to have some useful potential when the aim is to reboot the system and have it automatically apply security fixes in the early stages of the boot process. This could be used for Netbooks and phones. Of course such a process would have to reset some configuration settings to safe defaults, this means replacing files in /etc and some configuration files in the user&amp;#8217;s home directory. So such a reboot and upgrade procedure would either leave the possibility that files in /etc were still compromised or it would remove some configuration work and thus give the user an incentive to avoid applying the patch.&lt;/p&gt;
&lt;p&gt;Any system that tries to extend signature checks all the way would either be vulnerable to valid but hostile changes to system configuration (such as authenticating to a server run by a hostile party) or have extreme ease of use issues due to signing everything.&lt;/p&gt;
&lt;p&gt;Also a secure boot will only protect a vulnerable system between the time it is rebooted and the time it returns to full operation after the reboot. If the security flaw hasn&amp;#8217;t been fixed (which could be due to a 0-day exploit or an exploit for which the patch hasn&amp;#8217;t been applied) then the system could be cracked again.&lt;/p&gt;
&lt;p&gt;I don&amp;#8217;t think that a secure boot process offers real benefits to many users.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;[1]&lt;a href=&quot;http://ncommander.blogspot.com/2011/11/secure-boot-its-here-and-been-here-for.html&quot;&gt; http://ncommander.blogspot.com/2011/11/secure-boot-its-here-and-been-here-for.html&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;[2]&lt;a href=&quot;http://www.coker.com.au/selinux/play.html&quot;&gt; http://www.coker.com.au/selinux/play.html&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Related posts:&lt;/p&gt;&lt;ol&gt;
&lt;li&gt;&lt;a href=&quot;http://etbe.coker.com.au/2009/03/16/question-about-a-secure-filesystem/&quot; rel=&quot;bookmark&quot; title=&quot;Question about a &amp;#8220;Secure Filesystem&amp;#8221;&quot;&gt;Question about a &amp;#8220;Secure Filesystem&amp;#8221;&lt;/a&gt; &lt;small&gt;I have just been asked for advice about &amp;#8220;secure filesystem&amp;#8221;...&lt;/small&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://etbe.coker.com.au/2007/10/10/how-se-linux-prevents-local-root-exploits/&quot; rel=&quot;bookmark&quot; title=&quot;How SE Linux Prevents Local Root Exploits&quot;&gt;How SE Linux Prevents Local Root Exploits&lt;/a&gt; &lt;small&gt;In a comment on my previous post about SE Linux...&lt;/small&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://etbe.coker.com.au/2010/05/29/logging-in-as-root/&quot; rel=&quot;bookmark&quot; title=&quot;Logging in as Root&quot;&gt;Logging in as Root&lt;/a&gt; &lt;small&gt;Martin Meredith wrote a blog post about logging in as...&lt;/small&gt;&lt;/li&gt;
&lt;/ol&gt;</content:encoded>
	<dc:date>2011-12-28T04:16:22+00:00</dc:date>
	<dc:creator>etbe</dc:creator>
</item>
<item rdf:about="http://danwalsh.livejournal.com/48936.html">
	<title>Dan Walsh: 10 things you probably did not know about SELinux #9 Backing up and Restoring Labels.</title>
	<link>http://danwalsh.livejournal.com/48936.html</link>
	<content:encoded>It has been a few years since I discusses backing up and restoring labels with SELinux.&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;I was asked at the Lisa 11 conference by a backup utility developer, &amp;quot;How should he save and restore SELinux security contexts?&amp;quot;&amp;nbsp; He also asked whether or not his tool should always maintain these context?&amp;nbsp; Finally how should the tool react if the system would not allow the context to be restored?&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Interesting topic.&amp;nbsp; Lets first take a look at a few tools for backing up content with SELinux labels.&lt;br /&gt;&lt;br /&gt;SELinux stores SELinux security labels (contexts) as extended attributes with the inode on the file system.&amp;nbsp; If an administrate wants to backup/restore files with the SELinux labels,&amp;nbsp; you need to use a utility that supports this.&lt;br /&gt;&lt;br /&gt;When SELinux first shipped the only utility to do this was &lt;span&gt;star&lt;/span&gt; (RHEL4) , GNU &lt;span&gt;tar&lt;/span&gt; at that time did not support extended attributes.&amp;nbsp; Later extended attribute support was added to GNU tar.&amp;nbsp; (&lt;span&gt; tar --selinux -cvf /tmp/etc.tgz /etc&lt;/span&gt; ) Rsync also has support for maintaining extended attributes.&amp;nbsp; Even Dump/Restore can now support maintaining the extended attributes.&lt;br /&gt;&lt;br /&gt;I often question is whether this is a good idea to maintain the labels.&amp;nbsp; In some cases your security goals require it.&amp;nbsp; For example backing up sensitivity labelled data (MLS) requires this.&amp;nbsp; If you have a file labelled TopSecret, you would definitely want to maintain this within the archive.&lt;br /&gt;&lt;br /&gt;But most of us do not deal with sensitivity labelled data, and we would want to make sure the data on our system is labelled correctly based on the current security definition on our system.&amp;nbsp; Trying to maintain the SELinux labels and restore them can be a mistake in several cases.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;For example:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Target file system does not support extended attributes.&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;If you attempted to restore files to a file system that does not support extended attributes.&amp;nbsp; Does the administrator have a way to allow this?&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Updating a machine for one version of the OS to another.&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;If you backed up your /home directory before updating from Fedora 15 to Fedora 16 and then restored the content of the archive, certain directories in you home directory will be mislabeled and potentially tools like googlechrome or colord will fail.&amp;nbsp; You would have been better off having the content restored the archive and then running &lt;span&gt;restorecon -R - v /home&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Copying an archive from one machine to another machine with an older OS.&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Attempting to maintain the labels would be wrong if you created an archive on a RHEL6 box and then attempting to restore the archive on a RHEL5 box.&amp;nbsp; If the RHEL5 kernel does not understand a label from a RHEL6 box, then the label will not be allowed to be placed on the disk.&amp;nbsp;&amp;nbsp; In this case, again you would want to put the files down and then restore the labels.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;In this case it would be nice if the tools used to restore the content had the ability to label the content &amp;quot;correctly&amp;quot; based on the file_contexts definitions on the target system.&amp;nbsp; That way we would not have a race condition where the labels on the files are incorrect for a period of time.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;In conclusion the backup/restore utility should:&lt;/b&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;allow the administrator to decide whether or not to save the SELinux labels and restore them.&lt;/li&gt;&lt;li&gt;Allow the administrator to specify the tool to restore the files using the default labels as specified on the target system (matchpathcon/setfscreatecon)&lt;/li&gt;&lt;li&gt;If the utility does not allow have the second option, in most cases the administrator should run restorecon on the restored files.&lt;/li&gt;&lt;/ul&gt;</content:encoded>
	<dc:date>2011-12-12T19:38:21+00:00</dc:date>
	<dc:creator>dwalsh@redhat.com</dc:creator>
</item>
<item rdf:about="http://danwalsh.livejournal.com/48886.html">
	<title>Dan Walsh: Why isn't setroubleshoot working in Fedora 16?</title>
	<link>http://danwalsh.livejournal.com/48886.html</link>
	<content:encoded>Well if you did a fresh install it does work.&amp;nbsp; But if you did an upgrade install from an older Fedora you have a problem.&lt;br /&gt;&lt;br /&gt;setroubleshootd is a dbus service launched by the audit daemon.&amp;nbsp; &amp;nbsp; In Fedora 16 all daemons that were running under as System V init scripts and were converted to systemd, no longer are started by &lt;a href=&quot;http://fedoraproject.org/wiki/Common_F16_bugs#enablement-status&quot; rel=&quot;nofollow&quot;&gt;default&lt;/a&gt;.&amp;nbsp; Meaning the auditd daemon is probably no longer running on your machines.&amp;nbsp; You might notice AVC messages showing up in /var/log/messages, rather then /var/log/audit/audit.log.&lt;br /&gt;&lt;br /&gt;It is simple to fix this problem by executing&lt;br /&gt;&lt;br /&gt;&lt;span&gt;# systemctl enable auditd.service&lt;br /&gt;# systemctl start auditd.service&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This will re-enable the auditd daemon and your setroubleshoot daemon should start working again.&amp;nbsp; If you get any AVC messages, they will start showing up in the /var/log/audit/audit.log.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;</content:encoded>
	<dc:date>2011-12-08T18:13:21+00:00</dc:date>
	<dc:creator>dwalsh@redhat.com</dc:creator>
</item>
<item rdf:about="http://d.hatena.ne.jp/kaigai/20111204/1322926643">
	<title>KaiGai Kohei: [OSS/Linux]Leaky Views と Security Barrier : PostgreSQL Advent Calendar #4</title>
	<link>http://d.hatena.ne.jp/kaigai/20111204/1322926643</link>
	<content:encoded>&lt;div class=&quot;section&quot;&gt;
&lt;p&gt;このエントリは&lt;a href=&quot;http://atnd.org/events/21994&quot; target=&quot;_blank&quot;&gt;PostgreSQL Advent Calendar&lt;/a&gt;に参加しています。12/4(日)担当也。ヨーロッパ中部時間ではまだ12/3(土)ですが。&lt;/p&gt;
&lt;p&gt;&lt;hr /&gt;&lt;/p&gt;
&lt;p&gt;RDBMSで行レベルのアクセス制御を実現する方法として、利用者に対して直接のアクセス権を付与せずに、特定のビューを通してだけアクセスを許可するのはしばしば使われるテクニックです。&lt;/p&gt;
&lt;p&gt;ですが、場合によっては不可視な行の中身を参照できてしまうというのは、あまり広く認知されている訳ではないようです。&lt;/p&gt;
&lt;p&gt;ので、問題のポイントと、現在開発中の PostgreSQL v9.2 に提案しているアイデアをご紹介します。&lt;/p&gt;
&lt;h4&gt; ユーザ定義関数のCOST値による問題&lt;/h4&gt;
&lt;p&gt;ここでは、以下の表を例に考えてみます。&lt;/p&gt;
&lt;p&gt;customerテーブル&lt;/p&gt;

&lt;table&gt;
&lt;tr&gt;&lt;th&gt;列名&lt;/th&gt;&lt;th&gt;型&lt;/th&gt;&lt;th&gt;制約&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;cid&lt;/td&gt;&lt;td&gt;int&lt;/td&gt;&lt;td&gt;primary key&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;cname&lt;/td&gt;&lt;td&gt;text&lt;/td&gt;&lt;td&gt;not null&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;cmail&lt;/td&gt;&lt;td&gt;text&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;cpasswd&lt;/td&gt;&lt;td&gt;text&lt;/td&gt;&lt;/tr&gt;

&lt;/table&gt;
&lt;p&gt;customerテーブルには全顧客の情報が格納されているため、利用者は自分自身の情報しか見る事ができないよう設定しましょう。&lt;/p&gt;
&lt;p&gt;（便宜上 PostgreSQL ユーザ名が cname に対応するものとします）&lt;/p&gt;
&lt;pre&gt;
postgres=# CREATE VIEW my_account AS SELECT &amp;#42; FROM customer
                  WHERE cname = getpgusername();
CREATE VIEW
postgres=# GRANT SELECT ON my_account TO public;
GRANT
&lt;/pre&gt;

&lt;p&gt;本来、このテーブルには 3ユーザ分の情報が格納されているのですが、&lt;/p&gt;
&lt;pre&gt;
postgres=# SELECT * FROM customer;
 cid | cname |       cmail       | cpasswd
-----+-------+-------------------+----------
 101 | alice | alice@example.com | abcdef
 102 | bob   | bob@example.com   | xyz123
 103 | eve   | eve@example.com   | deadbeaf
(3 rows)
&lt;/pre&gt;
&lt;p&gt;確かに、自分自身の情報しか参照できないように見えます。&lt;/p&gt;
&lt;pre&gt;
postgres=# SET SESSION AUTHORIZATION alice;
SET
postgres=&amp;#62; SELECT * FROM customer;
ERROR:  permission denied for relation customer
postgres=&amp;#62; SELECT * FROM my_account;
 cid | cname |       cmail       | cpasswd
-----+-------+-------------------+---------
 101 | alice | alice@example.com | abcdef
(1 row)
&lt;/pre&gt;
&lt;p&gt;しかし、利用者がSQL関数を定義できる場合、面白い事が起こります。&lt;/p&gt;
&lt;p&gt;（&lt;span class=&quot;deco&quot;&gt;public&lt;/span&gt;スキーマはデフォルトでCREATE権限を全体に与えている事に注意！）&lt;/p&gt;
&lt;pre&gt;
postgres=&amp;#62; CREATE FUNCTION f_leak(text) RETURNS bool LANGUAGE plpgsql
           &lt;span class=&quot;deco&quot;&gt;COST 0.00000001&lt;/span&gt;
           AS 'BEGIN RAISE NOTICE ''f_leak =&amp;#62; %'', $1; RETURN true; END';
CREATE FUNCTION

postgres=&amp;#62; SELECT * FROM my_account WHERE f_leak(cmail);
&lt;span class=&quot;deco&quot;&gt;NOTICE:  f_leak =&amp;#62; alice@example.com
NOTICE:  f_leak =&amp;#62; bob@example.com
NOTICE:  f_leak =&amp;#62; eve@example.com
&lt;/span&gt; cid | cname |       cmail       | cpasswd
-----+-------+-------------------+---------
 101 | alice | alice@example.com | abcdef
(1 row)
&lt;/pre&gt;
&lt;p&gt;おっと、何か見えてはならないモノが見えたようです。&lt;/p&gt;
&lt;p&gt;どういう事なのでしょうか、ちょっと EXPLAIN で調べてみましょう。&lt;/p&gt;
&lt;pre&gt;
postgres=&amp;#62; EXPLAIN SELECT * FROM my_account WHERE f_leak(cmail);
                           QUERY PLAN
-----------------------------------------------------------------
 Seq Scan on customer  (cost=0.00..20.85 rows=1 width=100)
   Filter: (f_leak(cmail) AND (cname = (getpgusername())::text))
(2 rows)
&lt;/pre&gt;
&lt;p&gt;この実行計画はVIEWの本体である customer テーブルをスキャンしていますが、利用者が付与した f_leak() とVIEWの条件を順にチェックしています。&lt;/p&gt;
&lt;p&gt;問題は、副作用を持つ f_leak() の実行コストが非常に小さな値に設定されているため、オプティマイザは cname = getpgusername() より先にf_leak()を実行して不必要な条件の判断を省略した方が得策であると判断して、関数の実行順序を並べ替えている事です。その結果、不可視であるべき行の内容が引数としてf_leak()に渡され、それが利用者に漏えいしている訳です。&lt;/p&gt;
&lt;h4&gt; JOINと条件句の分配に伴う問題&lt;/h4&gt;
&lt;p&gt;同様に、VIEWによる行レベルアクセス制御を破るシナリオはもう一つ知られています。&lt;/p&gt;
&lt;p&gt;先ほどの customer テーブルに加えて、もう一つテーブルを追加して考察を進めてみましょう。&lt;/p&gt;
&lt;p&gt;creditテーブル&lt;/p&gt;

&lt;table&gt;
&lt;tr&gt;&lt;th&gt;列名&lt;/th&gt;&lt;th&gt;型&lt;/th&gt;&lt;th&gt;制約&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;cid&lt;/td&gt;&lt;td&gt;int&lt;/td&gt;&lt;td&gt;references customer(cid)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;number&lt;/td&gt;&lt;td&gt;text&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;expired&lt;/td&gt;&lt;td&gt;date&lt;/td&gt;&lt;/tr&gt;

&lt;/table&gt;
&lt;p&gt;この credit テーブルは顧客のクレジットカード番号を保持しています。先ほどの my_account ビューと同様に、自分自身のレコードだけを参照できるようなVIEWを定義してみましょう。&lt;/p&gt;
&lt;pre&gt;
postgres=# SELECT * FROM customer;
 cid | cname |       cmail       | cpasswd
-----+-------+-------------------+----------
 101 | alice | alice@example.com | abcdef
 102 | bob   | bob@example.com   | xyz123
 103 | eve   | eve@example.com   | deadbeaf
(3 rows)

postgres=# SELECT * FROM credit;
 cid |       number        |  expired
-----+---------------------+------------
 101 | 1111-2222-3333-4444 | 2014-02-28
 102 | 5555-6666-7777-8888 | 2013-10-30
 102 | 1234-5678-1234-5678 | 2015-06-30
 103 | 0987-6543-2109-8765 | 2014-08-31
(4 rows)

postgres=# CREATE VIEW my_credit AS SELECT cname, cmail, credit.*
           FROM customer NATURAL JOIN credit WHERE cname = getpgusername();
CREATE VIEW
postgres=# GRANT SELECT ON my_credit TO public;
GRANT
&lt;/pre&gt;
&lt;p&gt;おや、やっぱり何かおかしいようです。&lt;/p&gt;
&lt;pre&gt;
postgres=# SET SESSION AUTHORIZATION alice;
SET
postgres=&amp;#62; SELECT * FROM my_credit;
 cname |       cmail       | cid |       number        |  expired
-------+-------------------+-----+---------------------+------------
 alice | alice@example.com | 101 | 1111-2222-3333-4444 | 2014-02-28
(1 row)

postgres=&amp;#62; SELECT * FROM my_credit WHERE f_leak(number);
&lt;span class=&quot;deco&quot;&gt;NOTICE:  f_leak =&amp;#62; 1111-2222-3333-4444
NOTICE:  f_leak =&amp;#62; 5555-6666-7777-8888
NOTICE:  f_leak =&amp;#62; 1234-5678-1234-5678
NOTICE:  f_leak =&amp;#62; 0987-6543-2109-8765&lt;/span&gt;
 cname |       cmail       | cid |       number        |  expired
-------+-------------------+-----+---------------------+------------
 alice | alice@example.com | 101 | 1111-2222-3333-4444 | 2014-02-28
(1 row)
&lt;/pre&gt;
&lt;p&gt;もう一度 EXPLAIN で実行計画を眺めてみましょう。&lt;/p&gt;
&lt;pre&gt;
postgres=&amp;#62; EXPLAIN SELECT * FROM my_credit WHERE f_leak(number);
                              QUERY PLAN
----------------------------------------------------------------------
 Hash Join  (cost=20.89..43.96 rows=2 width=104)
   Hash Cond: (credit.cid = customer.cid)
   -&amp;#62;  Seq Scan on credit  (cost=0.00..21.60 rows=387 width=40)
         Filter: &lt;span class=&quot;deco&quot;&gt;f_leak(number)&lt;/span&gt;
   -&amp;#62;  Hash  (cost=20.85..20.85 rows=3 width=68)
         -&amp;#62;  Seq Scan on customer  (cost=0.00..20.85 rows=3 width=68)
               Filter: (cname = (getpgusername())::text)
(7 rows)
&lt;/pre&gt;
&lt;p&gt;困ったことに、『creditテーブルをf_leak()条件でスキャンした結果』と『customerテーブルをcname = getpgusername()条件でスキャンした結果』がJOINされています。&lt;/p&gt;
&lt;p&gt;オプティマイザはJOINすべき行を最小化するよう条件句を分配するのですが、f_leak()関数は credit テーブルの number 列のみ、cname = getpgusername() 条件は customer テーブルの cname 列のみに依存しています。そのため、JOINの完了を待つ事なく個々のテーブルをスキャンする時点で条件句を実行した方が、JOINすべき行数を減らす事ができます。&lt;/p&gt;
&lt;p&gt;その結果、副作用を持つf_leak()がcreditテーブルのスキャン計画に push-down され、最初の例と同様に、不可視であるべき行の内容がf_leak()に渡され、それが利用者に漏えいしてしまっています。&lt;/p&gt;
&lt;p&gt;この２つの問題は共に、オプティマイザがVIEWの境界を越えて関数の実行順序を入れ替えている事が原因です。これは性能観点からは優れた実装ですが、セキュリティを目的としたVIEW定義という観点では問題です。&lt;/p&gt;
&lt;p&gt;一方で、VIEW内部で使われている関数を全て評価してから、その外部から与えられた関数を評価するという実装は、安全ですが、性能上無視できない性能劣化をもたらします。例えば、1万行 x 1万行のテーブルをJOINする場合、外部から与えられた関数をテーブルスキャンの時点で評価する事で片方の行数を1万行から100行に絞り込めるとしたら、9900万行分のJOIN処理を省略する事ができます。&lt;/p&gt;
&lt;p&gt;次に、PostgreSQL v9.2に向けて提案されている Leaky View 問題への対策を紹介しましょう。&lt;/p&gt;
&lt;h4&gt; VIEW の security_barrier 属性と最適化の抑制&lt;/h4&gt;
&lt;p&gt;ここからは、私の提案している「&lt;a href=&quot;http://archives.postgresql.org/message-id/CADyhKSUGwN68i7tewO0P1Jfrz8gZ=PH_+TWS0H+5vHaoc0QkWA@mail.gmail.com&quot; target=&quot;_blank&quot;&gt;Fix Leaky View Problemパッチ&lt;/a&gt;」の解説です。&lt;/p&gt;
&lt;p&gt;前節で考察したように、VIEWを行レベルアクセス制御の目的で利用する場合には、パフォーマンスとセキュリティのトレードオフが存在します。安全側に倒せば許容できない程の性能劣化を招く可能性があり、一方、性能最適であれば情報漏えいの危険があります。&lt;/p&gt;
&lt;p&gt;Fix Leaky Views Problem パッチは、CREATE VIEW構文でWITH(...)句を用いてオプション値を指定することを許容します。構文は以下の通りです。&lt;/p&gt;
&lt;pre&gt;
CREATE VIEW &lt;span class=&quot;deco&quot;&gt;view_name&lt;/span&gt; [WITH (&lt;span class=&quot;deco&quot;&gt;options&lt;/span&gt;[,...])] AS &lt;span class=&quot;deco&quot;&gt;select_statement&lt;/span&gt;;
options:
  security_barrier[= true|false]
&lt;/pre&gt;
&lt;p&gt;security_barrier オプションは、VIEWが行レベルアクセス制御を目的として定義されていることを示す属性です。これを指定することで、一部のクエリ最適化を抑制する事が可能になります。&lt;/p&gt;
&lt;p&gt;この設計に至るまでには長い議論があったのですが、結局、パフォーマンスとセキュリティのどちらが重要であるのかを判断できるのはVIEWを定義する人のみである、というシンプルな結論にたどり着いたのでした。&lt;/p&gt;
&lt;p&gt;VIEWにsecurity_barrier属性が付与されている時、VIEWの内側で使用されている全ての関数・条件句は、VIEWの外側から与えられた関数・条件句よりも先に実行される事が保証されます。&lt;/p&gt;
&lt;p&gt;では、実際に試してみましょう。以下で定義する my_account_secure と my_credit_secure は、先ほどの2つの例で使用したVIEWにsecurity_barrier属性を付加したものです。&lt;/p&gt;
&lt;pre&gt;
postgres=# CREATE VIEW my_credit_secure WITH (security_barrier) AS
           SELECT cname, cmail, credit.* FROM customer NATURAL JOIN credit
           WHERE cname = getpgusername();
CREATE VIEW
postgres=# GRANT SELECT ON my_account_secure TO public;
GRANT
postgres=# CREATE VIEW my_account_secure WITH (security_barrier) AS
           SELECT * FROM customer WHERE cname = getpgusername();
CREATE VIEW
postgres=# GRANT SELECT ON my_credit_secure TO public;
GRANT
&lt;/pre&gt;
&lt;p&gt;動作結果は以下のようになりました。&quot;f_leak =&amp;#62; ...&quot; と表示されている内容は、クエリによって本来参照可能なデータの範囲内に収まっている事が分かります。&lt;/p&gt;
&lt;pre&gt;
postgres=# SET SESSION AUTHORIZATION alice;
SET
postgres=&amp;#62; SELECT * FROM my_account_secure WHERE f_leak(cmail);
NOTICE:  f_leak =&amp;#62; alice@example.com
 cid | cname |       cmail       | cpasswd
-----+-------+-------------------+---------
 101 | alice | alice@example.com | abcdef
(1 row)

postgres=&amp;#62; SELECT * FROM my_credit_secure WHERE f_leak(number);
NOTICE:  f_leak =&amp;#62; 1111-2222-3333-4444
 cname |       cmail       | cid |       number        |  expired
-------+-------------------+-----+---------------------+------------
 alice | alice@example.com | 101 | 1111-2222-3333-4444 | 2014-02-28
(1 row)
&lt;/pre&gt;
&lt;p&gt;では、VIEWにsecurity_barrier属性を付加することで、クエリ実行計画にどのように変化しているのでしょうか？先ほどと同じように、EXPLAIN構文で調べてみましょう。&lt;/p&gt;
&lt;pre&gt;
postgres=&amp;#62; EXPLAIN SELECT * FROM my_account_secure WHERE f_leak(cmail);
                               QUERY PLAN
-------------------------------------------------------------------------
 Subquery Scan on my_account_secure  (cost=0.00..20.88 rows=1 width=100)
   Filter: &lt;span class=&quot;deco&quot;&gt;f_leak(my_account_secure.cmail)&lt;/span&gt;
   -&amp;#62;  Seq Scan on customer  (cost=0.00..20.85 rows=3 width=100)
         Filter: (cname = (getpgusername())::text)
(4 rows)
&lt;/pre&gt;
&lt;p&gt;f_leak()関数の評価は cname = getpgusername() 条件で customer テーブルをスキャンした後に行われる事が分かります。オプティマイザは security_viwe 属性を持ったVIEWの内側に条件句を push-down しなくなりました。&lt;/p&gt;
&lt;p&gt;もう一つの例も同様です。&lt;/p&gt;
&lt;pre&gt;
postgres=&amp;#62; EXPLAIN SELECT * FROM my_credit_secure WHERE f_leak(cmail);
                                 QUERY PLAN
----------------------------------------------------------------------------
 Subquery Scan on my_credit_secure  (cost=20.89..46.96 rows=2 width=104)
   Filter: &lt;span class=&quot;deco&quot;&gt;f_leak(my_credit_secure.cmail)&lt;/span&gt;
   -&amp;#62;  Hash Join  (cost=20.89..46.90 rows=6 width=104)
         Hash Cond: (credit.cid = customer.cid)
         -&amp;#62;  Seq Scan on credit  (cost=0.00..21.60 rows=1160 width=40)
         -&amp;#62;  Hash  (cost=20.85..20.85 rows=3 width=68)
               -&amp;#62;  Seq Scan on customer  (cost=0.00..20.85 rows=3 width=68)
                     Filter: (cname = (getpgusername())::text)
(8 rows)
&lt;/pre&gt;
&lt;p&gt;パッチ自体の動作原理は極めて単純です。&lt;/p&gt;
&lt;p&gt;PostgreSQLは、一旦、VIEWに対するクエリを内部的にサブクエリに書き換えます。その後、オプティマイザがクエリ実行計画を作成する際に、&quot;シンプル&quot;なサブクエリ（OFFSET/LIMIT句を含まない…など）であれば、性能最適の観点からサブクエリをJOINを用いてフラット化(Pull-Up)します。&lt;/p&gt;
&lt;p&gt;その後で、条件句はオプティマイザによって性能上最適な位置に振り分けられるため、VIEWの内側/外側といった区別はもはや意味を持たなくなります。&lt;/p&gt;
&lt;p&gt;VIEWのsecurity_barrier属性は、この際の条件に作用します。RangeTblEntry構造体のsecurity_barrierは、関連するサブクエリがVIEWに由来し、かつ、VIEWのsecurity_barrier属性がtrueである場合にセットされます。&lt;/p&gt;
&lt;p&gt;以下の処理では、security_barrier属性が false だとpull_up_simple_subquery()は呼ばれないため、サブクエリのフラット化は抑制されます。&lt;/p&gt;
&lt;pre&gt;
--- a/src/backend/optimizer/prep/prepjointree.c
+++ b/src/backend/optimizer/prep/prepjointree.c
@@ -543,6 +543,7 @@ pull_up_subqueries(PlannerInfo &amp;#42;root, Node &amp;#42;jtnode,
         &amp;#42;/
        if (rte-&amp;#62;rtekind == RTE_SUBQUERY &amp;#38;&amp;#38;
            is_simple_subquery(rte-&amp;#62;subquery) &amp;#38;&amp;#38;
+           !rte-&amp;#62;security_barrier &amp;#38;&amp;#38;
            (containing_appendrel == NULL ||
             is_safe_append_member(rte-&amp;#62;subquery)))
            return pull_up_simple_subquery(root, jtnode, rte,
&lt;/pre&gt;

&lt;p&gt;さらにもう一ヶ所。条件句に与える引数が特定のサブクエリにだけ依存している場合、オプティマイザはこの条件句の実行をサブクエリ処理の中に移動(Push-Down)しようとしますが、同様にサブクエリが security_view 属性つきのVIEWに由来する時は、これをスキップします。&lt;/p&gt;
&lt;pre&gt;
@@ -763,6 +769,7 @@ set_subquery_pathlist(PlannerInfo &amp;#42;root, RelOptInfo &amp;#42;rel,
      Node       &amp;#42;clause = (Node &amp;#42;) rinfo-&amp;#62;clause;

      if (!rinfo-&amp;#62;pseudoconstant &amp;#38;&amp;#38;
+         !rte-&amp;#62;security_barrier &amp;#38;&amp;#38;
          qual_is_pushdown_safe(subquery, rti, clause, differentTypes))
      {
          /&amp;#42; Push it down &amp;#42;/
&lt;/pre&gt;

&lt;p&gt;この２ヶ所の処理を追加することによって、これまで見たような、VIEWを行レベルアクセス制御の目的に使用する場合の問題を回避する事ができます。&lt;/p&gt;
&lt;h4&gt; FUNCTION の leakproof 属性&lt;/h4&gt;
&lt;p&gt;Leaky View問題はVIEWのsecurity_barrier属性によって解決する事ができるのですが、これは一部のクエリ最適化を無効化するために、場合によっては、そのためのコストが看過できないほど大きい事もあります。&lt;/p&gt;
&lt;p&gt;例えば、アプリケーションの設計上、以下のようなVIEWを定義し、VIEWの外側から条件句（主キーによる絞込みなど）を与えて使いたいというケースを考えてみましょう。&lt;/p&gt;
&lt;pre&gt;
CREATE VIEW valid_credit WITH (security_barrier) AS
    SELECT * FROM credit WHERE card_is_valid(number, expired);

SELECT * FROM valid_credit WHERE cid = &lt;span class=&quot;deco&quot;&gt;&amp;#60;customer-id&amp;#62;&lt;/span&gt;;
&lt;/pre&gt;
&lt;p&gt;この場合、card_is_valid関数と、VIEWの外部から与えた cid = &lt;span class=&quot;deco&quot;&gt;&amp;#60;customer-id&amp;#62;&lt;/span&gt; を用いて credit テーブルをスキャンした結果が利用者には返されます。ですが、VIEWにはsecurity_barrier属性が設定されているため、常にcard_is_valid関数が先に実行されます。&lt;/p&gt;
&lt;p&gt;この制限は cid 列にインデックスが設定されていても同様です。したがってインデックス・スキャンが選択されるべき状況でも全件スキャンが選択されてしまいます。ああ困った、困った。&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://archives.postgresql.org/message-id/CADyhKSUGwN68i7tewO0P1Jfrz8gZ=PH_+TWS0H+5vHaoc0QkWA@mail.gmail.com&quot; target=&quot;_blank&quot;&gt;Fix Leaky View Problemパッチ&lt;/a&gt;はPart-1とPart-2から構成されており、Part-1は前述の security_barrier 属性の実装を、Part-2ではその例外を設定する機能を実装しています。&lt;/p&gt;
&lt;p&gt;Part-2によって、先ほどのオプティマイザへの変更は一部修正されます。&lt;/p&gt;
&lt;pre&gt;
--- a/src/backend/optimizer/path/allpaths.c
+++ b/src/backend/optimizer/path/allpaths.c
@@ -769,7 +769,8 @@ set_subquery_pathlist(PlannerInfo &amp;#42;root, RelOptInfo &amp;#42;rel,
        Node       &amp;#42;clause = (Node &amp;#42;) rinfo-&amp;#62;clause;

        if (!rinfo-&amp;#62;pseudoconstant &amp;#38;&amp;#38;
-           !rte-&amp;#62;security_barrier &amp;#38;&amp;#38;
+           (!rte-&amp;#62;security_barrier ||
+            !contain_leakable_functions(clause)) &amp;#38;&amp;#38;
            qual_is_pushdown_safe(subquery, rti, clause, differentTypes))
        {
            /&amp;#42; Push it down &amp;#42;/
&lt;/pre&gt;

&lt;p&gt;サブクエリがsecurity_barrier属性付きのVIEWに由来するとき、このif文は条件句のPush-Downを抑止しますが、Part-2パッチは条件句(clause)が leakable-functions （つまり情報を漏えいする可能性のある関数）を含んでいなければ、サブクエリへの条件句のPush-Downを許可するように修正します。&lt;/p&gt;
&lt;p&gt;では、関数が情報を漏えいする可能性の有無をどのように設定するか。&lt;/p&gt;
&lt;p&gt;それには、CREATE FUNCTION構文に新たに追加されるLEAKPROOF属性を使用します。&lt;/p&gt;
&lt;p&gt;例えば、以下のように使用します。LEAKPROOFを指定することで、この関数に情報漏えいの恐れがないという事を明示的に指定できますが、これは同時に、潜在的に不可視の行の内容を参照することを可能にするため、関数のLEAKPROOF属性をセットするには特権ユーザの権限が必要です。&lt;/p&gt;
&lt;p&gt;（SE-PostgreSQLでも db_procedure:{install}権限をチェックする予定です）&lt;/p&gt;
&lt;pre&gt;
CREATE FUNCTION is_positive(int) RETURNS bool LANGUAGE plpgsql
    &lt;span class=&quot;deco&quot;&gt;LEAKPROOF&lt;/span&gt;
    AS 'BEGIN RETURN $1 &amp;#62; 0; END';
&lt;/pre&gt;
&lt;p&gt;一部のビルトイン関数の中でも、明らかに情報漏えいのリスクがない関数については、デフォルトでLEAKPROOF属性がセットされています。&lt;/p&gt;
&lt;p&gt;（全部で2400個程あるため、網羅的なチェックはこれからですが…。）&lt;/p&gt;
&lt;p&gt;例えば、32bit Integer同士の大小比較を行う int4gt 関数は、以下のように実装されています。&lt;/p&gt;
&lt;pre&gt;
Datum
int4gt(PG_FUNCTION_ARGS)
{
    int32       arg1 = PG_GETARG_INT32(0);
    int32       arg2 = PG_GETARG_INT32(1);

    PG_RETURN_BOOL(arg1 &amp;#62; arg2);
}
&lt;/pre&gt;
&lt;p&gt;この実装に情報漏えいの危険はありませんので、DB初期化時にLEAKPROOF属性はセットされています。&lt;/p&gt;
&lt;p&gt;その他にも、現在のパッチでは各種ビルトインタイプの等価・大小比較演算子の実装として利用されている関数にLEAKPROOF属性がついています。実際に試してみましょう。&lt;/p&gt;
&lt;pre&gt;
postgres=# SET SESSION AUTHORIZATION bob;
SET
postgres=&amp;#62; SELECT * FROM my_credit;
 cname |      cmail      | cid |       number        |  expired
-------+-----------------+-----+---------------------+------------
 bob   | bob@example.com | 102 | 5555-6666-7777-8888 | 2013-10-30
 bob   | bob@example.com | 102 | 1234-5678-1234-5678 | 2015-06-30
(2 rows)
&lt;/pre&gt;
&lt;p&gt;ユーザ bob は2枚のクレジットカードを持っています。リッチメンですね。&lt;/p&gt;
&lt;p&gt;では、２つの条件句を付加してみます。一つは先ほどのf_leak()関数、もう一つは expired &amp;#60; '2014-01-01' という Date 型の大小比較演算です。&lt;/p&gt;
&lt;pre&gt;
postgres=&amp;#62; SELECT * FROM my_credit_secure WHERE f_leak(number) AND expired &amp;#60; '2014-01-01';
NOTICE:  f_leak =&amp;#62; 5555-6666-7777-8888
 cname |      cmail      | cid |       number        |  expired
-------+-----------------+-----+---------------------+------------
 bob   | bob@example.com | 102 | 5555-6666-7777-8888 | 2013-10-30
(1 row)
&lt;/pre&gt;
&lt;p&gt;NOTICEメッセージが一行だけ表示されているという事は、大小比較演算はf_leak()関数よりも先に実行されたようです。EXPLAINで実行計画を見てみましょう。&lt;/p&gt;
&lt;pre&gt;
postgres=&amp;#62; EXPLAIN SELECT * FROM my_credit_secure WHERE f_leak(number) AND expired &amp;#60; '2014-01-01';
                                QUERY PLAN
---------------------------------------------------------------------------
 Subquery Scan on my_credit_secure  (cost=1.06..27.06 rows=1 width=104)
   Filter: &lt;span class=&quot;deco&quot;&gt;f_leak(my_credit_secure.number)&lt;/span&gt;
   -&amp;#62;  Hash Join  (cost=1.06..27.04 rows=2 width=104)
         Hash Cond: (credit.cid = customer.cid)
         -&amp;#62;  Seq Scan on credit  (cost=0.00..24.50 rows=387 width=40)
               Filter: &lt;span class=&quot;deco&quot;&gt;(expired &amp;#60; '2014-01-01'::date)&lt;/span&gt;
         -&amp;#62;  Hash  (cost=1.05..1.05 rows=1 width=68)
               -&amp;#62;  Seq Scan on customer  (cost=0.00..1.05 rows=1 width=68)
                     Filter: (cname = (getpgusername())::text)
(9 rows)
&lt;/pre&gt;
&lt;p&gt;見ての通り、expired &amp;#60; '2014-01-01' 条件句が credit テーブルのスキャンに結びついているのと比較して、f_leak()関数はmy_credit_secureビューの内側にPush-Downされていません。これが LEAKPROOF 属性の有無による違いです。もし credit テーブルにインデックスが設定されていれば、Push-Downされた条件句により、全件スキャンの代わりにインデックス・スキャンが選択されるかもしれません。&lt;/p&gt;
&lt;h4&gt; まとめ&lt;/h4&gt;
&lt;p&gt;確かこの問題は、かれこれ2年以上議論を続けてきた息の長い問題です。&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;2009年9月4日のセキュアOS塾『SE-PostgreSQL vs Oracle Label Security』の資料の中で言及があります。（p.34）&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://sepgsql.googlecode.com/files/090904-jsosjk04-sepgsql-vs-ols.pdf&quot; target=&quot;_blank&quot;&gt;http://sepgsql.googlecode.com/files/090904-jsosjk04-sepgsql-vs-ols.pdf&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;開発コミュニティとしての方向性は、概ね上で紹介した形で収束しつつありますが、まだ v9.2 の新機能として紹介できるかどうか、は分からない状況です。が、SE-PostgreSQLの行レベルアクセス制御機能を実現するためにもマージしておきたい機能ですので、なんとかcommitできるよう頑張りたいところです。&lt;/p&gt;
&lt;p&gt;最後に『じゃあ、既存のシステムではどうやって対策したら良いのよ？』という質問に対して一つTIPSを紹介しておきたいと思います。&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Q. PostgreSQL v9.1以前のバージョンでLeaky View問題を防ぐにはどうしたらよいか？&lt;/p&gt;
&lt;p&gt;A. クエリに OFFSET 0 を付ける&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;オプティマイザがサブクエリをフラット化、または、条件句をPush-Downする時、サブクエリにOFFSET/LIMIT句が含まれている場合はそれを断念する、という事を思い出してください。&lt;/p&gt;
&lt;p&gt;OFFSET 0は結果セットの先頭から値を読むという意味ですので、本来は何の意味もありません。ですが、ここまで説明した条件句の実行順序に起因する問題を防ぐには簡便な方法です。&lt;/p&gt;
&lt;p&gt;ただし、関数のLEAKPROOF属性に相当する機能はありませんので、その点でトレードオフは必要になります。&lt;/p&gt;
&lt;p&gt;&lt;hr /&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://atnd.org/events/21994&quot; target=&quot;_blank&quot;&gt;PostgreSQL Advent Calendar&lt;/a&gt;向けに記事を書くにあたり、MySQL、MS SQL Server、Oracle Databaseなど他のRDBMSの挙動はどうなっているのか調べたかったのですが、時間がありませんでした。特に Oracle は勝手にWHERE句に条件をくっつけるVirtual Private Databaseという機能を持っていますので気になります。&lt;/p&gt;
&lt;p&gt;これらは、追って調査したいと思います。きっと。いつの日か。アディオス、アミーゴ。&lt;/p&gt;
&lt;br /&gt;

&lt;p&gt;さて、翌 12/5(月) は笠原さんです。よろしく〜&lt;/p&gt;
&lt;/div&gt;</content:encoded>
	<dc:date>2011-12-03T15:37:23+00:00</dc:date>
	<dc:creator>kaigai</dc:creator>
</item>
<item rdf:about="http://danwalsh.livejournal.com/48571.html">
	<title>Dan Walsh: SELinux versus pam_securid.so</title>
	<link>http://danwalsh.livejournal.com/48571.html</link>
	<content:encoded>Seems to be my month for fighting pam modules from third parties.&amp;nbsp;&amp;nbsp; I have heard that RSA corporation is recommending SELinux be turned off to run their products.&amp;nbsp; I just love it when a &lt;i&gt;supposed&lt;/i&gt; security company recommends that customers turn on a key security component of the Operating System.&amp;nbsp; Now did RSA ever contact me to work through the problems,? No.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Come on RSA you can do better then this.&amp;nbsp; &lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;I am trying to avoid underhanded security comment about using SELinux to protect key assets of the company...&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I worked with Joe Lucchesi, to get this pam module to work with SELinux.&amp;nbsp; Joe was having problems with sshd working with the pam module.&amp;nbsp; He was getting execstack errors.&amp;nbsp; Turns out the pam_securid.so file was shipped with the execstack flag turned on.&amp;nbsp; Execstack is a dangerous protection to allow a domain, since it turns off protection against buffer overflow attacks.&amp;nbsp; Most app never need this access.&lt;br /&gt;&lt;br /&gt;Executing&lt;br /&gt;&lt;br /&gt;&lt;span&gt;execstack -c /lib64/security/pam_securid.so&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Cleared the flag.&amp;nbsp; And allowed sshd to get past this AVC.&amp;nbsp; Whatever is causing this flag to be set, the build procedure or installation needs to be fixed.&lt;br /&gt;&lt;br /&gt;The next problems we hit was pam_securid seems to be running netstat under the covers.&amp;nbsp; I recall we had this problem with the Netscape Certificate libraries. They used to execute netstat in order to generate entropy when using certificates, so I figure this is what is going on here.&amp;nbsp; I also see the sshd executing ps?&amp;nbsp; Probably&amp;nbsp; for the same reason.&amp;nbsp;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;RSA guys please use /dev/urandom and /dev/random.&amp;nbsp; &lt;/b&gt;&lt;br /&gt;&lt;br /&gt;We turned off the use of netstat in our libraries years ago.&amp;nbsp; Using netstat and ps causes me to have to allow login programs to search /sys/net and because of bugs in our kernel add a dontaudit for sys_ptrace.&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Finally secureid uses /var/ace to store its authorization content.&amp;nbsp; This should probably be under /var/lib/ace, I have added a label for this directory&lt;br /&gt;&lt;br /&gt;&lt;span&gt;/var/ace(/.*)?&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gen_context(system_u:object_r:var_auth_t,s0)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This should allow the pam_securid module to use the content in this directory.&lt;br /&gt;&lt;br /&gt;Now Joe can run his pam_securid.so on his machine in enforcing mode with a small custom module until we push updates to fix the problem.&lt;br /&gt;&lt;br /&gt;Bottom line.&amp;nbsp; If you are a third party and you are having problems running your tools with SELinux, please, please contact me or Red Hat and lets work through the problems, and give our users a better experience.</content:encoded>
	<dc:date>2011-12-02T12:55:03+00:00</dc:date>
	<dc:creator>dwalsh@redhat.com</dc:creator>
</item>
<item rdf:about="http://danwalsh.livejournal.com/48161.html">
	<title>Dan Walsh: SELinux versus pam_google_authenticator...</title>
	<link>http://danwalsh.livejournal.com/48161.html</link>
	<content:encoded>I just became aware of a new PAM, &lt;a href=&quot;http://code.google.com/p/google-authenticator/&quot; rel=&quot;nofollow&quot;&gt;pam_google_authenticator.&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;It is some kind of One TIme Password tool to allow you to add One Time Passwords to you Linux Login and I guess use your Android phone.&lt;br /&gt;&lt;br /&gt;pam_google_authenticator causes login programs to&amp;nbsp; try and&amp;nbsp; write to ~/.google_authenticator by default.&amp;nbsp; SELinux does not like this.&amp;nbsp; SELinux prevents login programs from writing to random locations in the home directory.&amp;nbsp; It is usually not a good idea to rely on stuff in the home dir for authorization because the homedir may require authorization to be able to be mounted or decrypted. (kNFS for example).&amp;nbsp;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;I got a bugzilla on sshd not being able to write to ~/.google_authenticator.&amp;nbsp; One option would be to set the label on the .google_authenticator as ssh_home_t.&amp;nbsp; I also did some &amp;quot;googling&amp;quot; and found the following entry:&lt;br /&gt;&lt;a href=&quot;http://code.google.com/p/google-authenticator/wiki/PamModuleInstructions&quot; rel=&quot;nofollow&quot;&gt;http://code.google.com/p/google-authenticator/wiki/PamModuleInstructions&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;Comment by&lt;/span&gt;&lt;a href=&quot;http://code.google.com/u/108719985377468594203/&quot; rel=&quot;nofollow&quot;&gt;&lt;span&gt; phil.may &amp;lt;snip&amp;gt;&lt;/span&gt;&lt;/a&gt;&lt;span&gt;,&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span title=&quot;Thu Jul  7 10:12:53 2011&quot;&gt; Jul 7, 2011&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;div&gt;&lt;span&gt;If you are using Fedora and SELinux, you will need to use the right config. The default SELinux policy does not allow the SSH daemon to update the ~/.google_authenticator file.&lt;/span&gt;&lt;br /&gt;&lt;p&gt;&lt;span&gt;In Fedora 14 (and possibly other versions) sshd runs under &amp;quot;sshd_t&amp;quot; and can only writelocations with certain SELinux labels. One such label is &amp;quot;var_auth_t&amp;quot; and the default policy sets this label on &amp;quot;/var/run/user/&lt;strong&gt;&amp;quot; &lt;/strong&gt;Therefore, the following config works:&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;&lt;span&gt;&lt;span&gt;# If the user is NOT in group &amp;quot;otp_users&amp;quot;, skip next module&lt;/span&gt;
&lt;span&gt;auth &lt;/span&gt;&lt;span&gt;[&lt;/span&gt;&lt;span&gt;success&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt;1&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;default&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt;ignore&lt;/span&gt;&lt;span&gt;]&lt;/span&gt;&lt;span&gt; pam_succeed_if&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;so user notingroup otp_users
auth &amp;nbsp; &amp;nbsp; &amp;nbsp; required &amp;nbsp; &amp;nbsp; pam_google_authenticator&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;so secret&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt;/var/&lt;/span&gt;&lt;span&gt;run&lt;/span&gt;&lt;span&gt;/&lt;/span&gt;&lt;span&gt;user&lt;/span&gt;&lt;span&gt;/&lt;/span&gt;&lt;span&gt;$&lt;/span&gt;&lt;span&gt;{&lt;/span&gt;&lt;span&gt;USER&lt;/span&gt;&lt;span&gt;}/.&lt;/span&gt;&lt;span&gt;google_authenticator
auth &amp;nbsp; &amp;nbsp; &amp;nbsp; include &amp;nbsp; &amp;nbsp; &amp;nbsp;password&lt;/span&gt;&lt;span&gt;-&lt;/span&gt;&lt;span&gt;auth

&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;BTW I have not tried this out on Fedora 16, and am curious if this will work, or does pam_google_authenticator expect the contents of .google_authenticator to survive a reboot.&lt;br /&gt;</content:encoded>
	<dc:date>2011-11-18T15:45:17+00:00</dc:date>
	<dc:creator>dwalsh@redhat.com</dc:creator>
</item>
<item rdf:about="http://danwalsh.livejournal.com/48006.html">
	<title>Dan Walsh: Customizing the Kiosk OS.</title>
	<link>http://danwalsh.livejournal.com/48006.html</link>
	<content:encoded>I receve a decent amount of interest about the &lt;a href=&quot;http://danwalsh.livejournal.com/44398.html&quot;&gt;kiosk spin&lt;/a&gt;, but I have never formalized it as a fedora spin.&amp;nbsp; The reason for this is almost everyone who looks at it, likes the idea but they need to customize it, in one way or another. &amp;nbsp;&lt;br /&gt;&lt;br /&gt;My vision of the Kiosk Operating system was that it was readonly and periodically an admin would recut/rebuild a newer version and then redestribute it to his machines.&amp;nbsp; It is fairly easy to build your own image.&amp;nbsp; Just download the kiosk kickstart file (kiosk.ks), make some customization and rebuild your ISO file using the livecd-tools.&amp;nbsp; The last step would be to install it to your favorite medium, USB Sticks or DVD.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;I recently received an email that requested:&lt;br /&gt;&lt;br /&gt;&lt;i&gt;&amp;quot;I have downloaded kiosk just this afternoon and tried on my laptop: as I have been requested for such a spin in our city library for eight computers, how can I build a spin with language/keyboard set as Italian??? (the standard procedure to change settings/Logout/login seems not to be working..) &amp;quot;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;Here is how I would go about building the Italian version of the Kiosk Operating System.&lt;br /&gt;&lt;br /&gt;On the currently released version of Fedora.&amp;nbsp; As I write this blog, we are at Fedora 16.&amp;nbsp; Login as root and and follow this procedure.&lt;br /&gt;&lt;br /&gt;You are going to build the Kiosk Operating System using the spin-kickstarts, so we need to install the sortware.&lt;br /&gt;&lt;br /&gt;&lt;span&gt;# yum install spin-kickstarts livecd-tools&lt;br /&gt;# cd /usr/share/spin-kickstarts&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Make sure you have the latest kiosk.ks file from my people page. &lt;a href=&quot;http://people.fedoraproject.org/~dwalsh/SELinux/kiosk/kiosk.ks&quot; rel=&quot;nofollow&quot;&gt;&lt;span&gt;http://people.fedoraproject.org/~dwalsh/SELinux/kiosk/kiosk.ks&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;# rm -f kiosk.ks*&lt;br /&gt;# wget http://people.fedoraproject.org/~dwalsh/SELinux/kiosk/kiosk.ks&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Change the default language within the kickstart file. &amp;nbsp; You can use your favorite editor to do this, and modify &amp;quot;lang&amp;quot; line.&amp;nbsp; I will just use a sed command.&lt;br /&gt;&lt;br /&gt;&lt;span&gt;# sed -i 's/en_US.UTF8/it_IT.UTF-8/g' kiosk.ks&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Now you can build a new kiosk image.&amp;nbsp; Replacing the name of the livecd with your own content.&lt;br /&gt;&lt;br /&gt;&lt;span&gt;# livecd-creator -t MYLIBRARY -f MYLIBRARY -c kiosk.ks --cache=/var/cache/kiosk&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Now go get a cup of coffee since this will take a long while, maybe a half hour.&amp;nbsp;&lt;br /&gt;When it finishes, you will have an ISO image named MYLIBRARY.iso.&amp;nbsp; You need to install the iso ont a dvd or to a usb stick using livecd-iso-to-disk.&lt;br /&gt;&lt;br /&gt;&lt;span&gt;# livecd-iso-to-disk --totaltimeout 1&amp;nbsp; ./MYLIBRARY.iso /dev/sdb1&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Remove your USB stick and attempt a boot a machine using it.&lt;br /&gt;&lt;br /&gt;Of course if you want to add some less then free packages to your kiosk operating system, you would edit the kickstart file and add your alternative repositories.&lt;br /&gt;&lt;br /&gt;For additional information on building livecd please use:&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://fedoraproject.org/wiki/How_to_create_and_use_Live_USB&quot; rel=&quot;nofollow&quot;&gt;http://fedoraproject.org/wiki/How_to_create_and_use_Live_USB&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;And on using kickstart files.&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://fedoraproject.org/wiki/Anaconda/Kickstart&quot; rel=&quot;nofollow&quot;&gt;http://fedoraproject.org/wiki/Anaconda/Kickstart&lt;/a&gt;</content:encoded>
	<dc:date>2011-11-17T20:54:01+00:00</dc:date>
	<dc:creator>dwalsh@redhat.com</dc:creator>
</item>
<item rdf:about="http://etbe.coker.com.au/?p=3038">
	<title>Russell Coker (security): SE Linux Status in Debian 2011-10</title>
	<link>http://etbe.coker.com.au/2011/10/31/selinux-status-2011-10/</link>
	<content:encoded>&lt;h3&gt;Debian/Unstable Development&lt;/h3&gt;
&lt;p&gt;&lt;b&gt;deb http://www.coker.com.au wheezy selinux&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;The above APT sources.list line has my repository for SE Linux packages that have been uploaded to Unstable and which will eventually go to testing and then the Wheezy release (if they aren&amp;#8217;t obsoleted first). I have created that repository for people who want to track SE Linux development without waiting for an Unstable mirror to update.&lt;/p&gt;
&lt;p&gt;In that repository I&amp;#8217;ve included a new version of &lt;b&gt;policycoreutils&lt;/b&gt; that now includes &lt;b&gt;mcstrans&lt;/b&gt; and also has support for newer policy such that the latest &lt;b&gt;selinux-policy-default&lt;/b&gt; package can be installed. The version that is currently in Testing supports upgrading policy on a running system but doesn&amp;#8217;t support installing the policy on a system that previously didn&amp;#8217;t run SE Linux.&lt;/p&gt;
&lt;p&gt;I have also uploaded SE Linux Policy packages from upstream release 20110726 compared to the previous packages which were from upstream release 20100524. As the numbers imply there is 14 months of upstream policy development which changes many things. Many of the patches from my Squeeze policy packages are not yet incorporated in the policy I have uploaded to Unstable. I won&amp;#8217;t guarantee that an Unstable system in Enforcing mode will do anything other than boot up and allow you to login via ssh. It&amp;#8217;s definitely not ready for production but it&amp;#8217;s also very suitable for development (10 years ago I did a lot of development on SE Linux systems that often denied login access, it wasn&amp;#8217;t fun).&lt;/p&gt;
&lt;p&gt;Kyle Moffett submitted a patch for libselinux which dramatically changed the build process. As Manoj (who wrote the previous build scripts) was not contactable I accepted Kyle&amp;#8217;s patch as provided. Thanks for the patch Kyle, and thanks for all your work over the years Manoj. Anyway the result of these changes should mean that it&amp;#8217;s easier to bootstrap Debian on a new architecture and easier to support multi-arch &amp;#8211; but I haven&amp;#8217;t tested either of these.&lt;/p&gt;
&lt;h3&gt;Squeeze&lt;/h3&gt;
&lt;p&gt;The policy packages from Squeeze can&amp;#8217;t be compiled on Unstable. The newer policy compilation tool chain is more strict about how some things can be declared and used, thus some policy which was fairly dubious but usable is now invalid. While it wouldn&amp;#8217;t be difficult to fix those problems I don&amp;#8217;t plan to do so. There is no good reason for compiling Squeeze policy on Unstable now that I&amp;#8217;ve uploaded a new upstream release.&lt;/p&gt;
&lt;h3&gt;deb http://www.coker.com.au squeeze selinux&lt;/h3&gt;
&lt;p&gt;I am still developing Squeeze policy and releasing it in the above APT repository. I will also get another policy release in a Squeeze update if possible to smooth the transition to Wheezy &amp;#8211; the goal is that Squeeze policy will be usable on Wheezy even if it can&amp;#8217;t be compiled. Also note that the compilation failures only affect the Debian package, it should still be possible to make modules for local use on a Wheezy system with Squeeze policy.&lt;/p&gt;
&lt;h3&gt;MLS&lt;/h3&gt;
&lt;p&gt;On Wednesday I&amp;#8217;m giving a lecture at my local LUG about &lt;a href=&quot;http://en.wikipedia.org/wiki/Multilevel_security&quot;&gt;MLS&lt;/a&gt; on SE Linux. I hope to have a MLS demonstration system available to LUG members by then. Ideally I will have a MLS system running on a virtual server somewhere that&amp;#8217;s accessible as well as a Xen/KVM image on a USB stick that can be copied by anyone at the meeting.&lt;/p&gt;
&lt;p&gt;I don&amp;#8217;t expect to spend much time on any aspect of SE Linux unrelated to MLS for the rest of the week.&lt;/p&gt;
&lt;h3&gt;Version Control&lt;/h3&gt;
&lt;p&gt;I need to change the way that I develop SE Linux packages, particularly the &lt;b&gt;refpolicy&lt;/b&gt; source package (source of &lt;b&gt;selinux-policy-default&lt;/b&gt; among others). A 20,000 line single patch is difficult to work with! I will have to switch to using &lt;b&gt;quilt&lt;/b&gt;, once I get it working well it should save me time on my own development as well as making it easier to send patches upstream. Also I need to setup a public version control system so I can access the source from my workstation, laptop, and netbook. While doing that I might as well make it public so any interested people can help out. Suggestions on what type of VCS to use are welcome.&lt;/p&gt;
&lt;h3&gt;How You Can Help&lt;/h3&gt;
&lt;p&gt;Sorting out the mess that is the &lt;b&gt;refpolicy&lt;/b&gt; package, sending patches upstream and migrating to a VCS is a fair bit of work. But there are lots of small parts. Sending patches upstream is a job that could be done in small pieces.&lt;/p&gt;
&lt;p&gt;Writing new policy is not something to do yet. There&amp;#8217;s not much point in doing that while I still haven&amp;#8217;t merged all the patches from Squeeze &amp;#8211; maybe next week. However I can provide the missing patches to anyone who wants to review them and assist with the merging.&lt;/p&gt;
&lt;p&gt;I have a virtual server that has some spare capacity. One thing I would like to do is to have some virtual machines running Unstable with various configurations of server software. Then we could track Unstable on those images and use automated testing to ensure that nothing breaks. If anyone wants root access on a virtual server to install their favorite software then let me know. But such software needs to be maintained and tested!&lt;/p&gt;
&lt;p&gt;Related posts:&lt;/p&gt;&lt;ol&gt;
&lt;li&gt;&lt;a href=&quot;http://etbe.coker.com.au/2009/11/17/debian-ssh-se-linux/&quot; rel=&quot;bookmark&quot; title=&quot;Debian SSH and SE Linux&quot;&gt;Debian SSH and SE Linux&lt;/a&gt; &lt;small&gt;I have just filed Debian bug report #556644 against the...&lt;/small&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://etbe.coker.com.au/2011/07/22/run-se-linux-policy/&quot; rel=&quot;bookmark&quot; title=&quot;/run and SE Linux Policy&quot;&gt;/run and SE Linux Policy&lt;/a&gt; &lt;small&gt;Currently Debian/Unstable is going through a transition to using /run...&lt;/small&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://etbe.coker.com.au/2010/07/25/se-linux-status-squeeze/&quot; rel=&quot;bookmark&quot; title=&quot;SE Linux status in Debian/Squeeze&quot;&gt;SE Linux status in Debian/Squeeze&lt;/a&gt; &lt;small&gt;ffmpeg I&amp;#8217;ve updated my SE Linux repository for Squeeze to...&lt;/small&gt;&lt;/li&gt;
&lt;/ol&gt;</content:encoded>
	<dc:date>2011-10-31T12:22:43+00:00</dc:date>
	<dc:creator>etbe</dc:creator>
</item>
<item rdf:about="http://etbe.coker.com.au/?p=2994">
	<title>Russell Coker (security): Capabilities vs SE Linux</title>
	<link>http://etbe.coker.com.au/2011/10/28/capabilities-vs-se-linux/</link>
	<content:encoded>&lt;p&gt;&lt;a href=&quot;http://www.cl.cam.ac.uk/research/security/capsicum/papers/2010usenix-login-capsicum.pdf&quot;&gt;In December 2010 a paper was published by Robert N.M. Watson and Jonathan Anderson from the Cambridge University and Ben Laurie and Kris Kennaway of Google about the Capsicum capabilities system [1]&lt;/a&gt;. It seems that the aim of the project is to allow systems that need privileges briefly when they start (such as tcpdump) a safe method of dropping privs. &lt;a href=&quot;http://www.cl.cam.ac.uk/research/security/capsicum/&quot;&gt;The main project page is here [2]&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The focus of the paper is on the Chromium web browser and six different ways of constraining the Chromium sandbox are compared. For the SE Linux comparison they claim 200 lines of code changes as of Fedora 15, in Fedora 16 I couldn&amp;#8217;t find a Chromium package, so I presume that they mean 200 lines of SE Linux policy (I am not aware of anyone modifying the Chromium source for SE Linux). They note that SE Linux doesn&amp;#8217;t support separating different sandboxes, while it would be possible to have each sandbox be assigned a different MCS sensitivity label to separate them that option would be unwieldy enough that they are essentially correct in this regard. For SE Linux systems running the MLS policy the correct thing to do would be to run multiple copies of Chromium at different levels to access different sensitivity levels of data, this would normally be done by polyinstantiating the home directory.&lt;/p&gt;
&lt;p&gt;One thing to note however is that there is no requirement that only one security method be implemented. I can&amp;#8217;t think of any technical reason why it would be impossible to run SE Linux and Capsicum on the same system. SE Linux could constrain daemons and restrict the access to Capsicum services while Capsicum could be used to give minimum privileges to parts of Chromium. I&amp;#8217;m not sure that such a combination would offer anything that the MLS users would desire, but it seems that everyone else (the vast majority of computer users) would be served well by a combination of SE Linux and Capsicum.&lt;/p&gt;
&lt;p&gt;It&amp;#8217;s disappointing that the paper didn&amp;#8217;t mention Posix 1003.1e capabilities, but given the lack of use that Posix capabilities get that&amp;#8217;s understandable.&lt;/p&gt;
&lt;p&gt;It&amp;#8217;s also disappointing when someone develops something new and different nowadays and doesn&amp;#8217;t provide a virtual machine image for it. Installing and configuring something that requires application and kernel changes is a lot of work and most people who are idly curious about the technology won&amp;#8217;t go to the effort. By today&amp;#8217;s standards it&amp;#8217;s not that difficult to share a 1GB filesystem image via Bittorrent.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;[1]&lt;a href=&quot;http://www.cl.cam.ac.uk/research/security/capsicum/papers/2010usenix-login-capsicum.pdf&quot;&gt; http://www.cl.cam.ac.uk/research/security/capsicum/papers/2010usenix-login-capsicum.pdf&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;[2]&lt;a href=&quot;http://www.cl.cam.ac.uk/research/security/capsicum/&quot;&gt; http://www.cl.cam.ac.uk/research/security/capsicum/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Related posts:&lt;/p&gt;&lt;ol&gt;
&lt;li&gt;&lt;a href=&quot;http://etbe.coker.com.au/2007/08/22/se-linux-vs-chroot/&quot; rel=&quot;bookmark&quot; title=&quot;SE Linux vs chroot&quot;&gt;SE Linux vs chroot&lt;/a&gt; &lt;small&gt;A question that is often asked is whether to use...&lt;/small&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://etbe.coker.com.au/2010/07/26/se-linux-chroot-environment/&quot; rel=&quot;bookmark&quot; title=&quot;Creating a SE Linux Chroot environment&quot;&gt;Creating a SE Linux Chroot environment&lt;/a&gt; &lt;small&gt;Why use a Chroot environment? A large part of the...&lt;/small&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://etbe.coker.com.au/2007/09/23/context-of-devxvc0/&quot; rel=&quot;bookmark&quot; title=&quot;Context of /dev/xvc0&quot;&gt;Context of /dev/xvc0&lt;/a&gt; &lt;small&gt;I have just converted a Fedora Core 5 server to...&lt;/small&gt;&lt;/li&gt;
&lt;/ol&gt;</content:encoded>
	<dc:date>2011-10-28T02:47:57+00:00</dc:date>
	<dc:creator>etbe</dc:creator>
</item>
<item rdf:about="http://danwalsh.livejournal.com/47738.html">
	<title>Dan Walsh: Open Source how do I love thee, let me count the ways.</title>
	<link>http://danwalsh.livejournal.com/47738.html</link>
	<content:encoded>Yesterday I got contacted by Red Hat Support about a problem we had in libselinux.&amp;nbsp; If you are setting up confined users you can use the &lt;span&gt;semanage login&lt;/span&gt; command to setup a group of linux users to be assigned to a confined user type.&lt;br /&gt;&lt;br /&gt;&lt;span&gt;# semanage login -a -s staff_u -r s0-s0:c0.c1023 %wheel&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This command would cause all linux users in the wheel group to login as the staff_u SELinux user.&amp;nbsp; Well we had a bug in getseuserbyname function in libseliunux.&amp;nbsp; When you login to a system the pam_selinux module uses this function to figure out which SELinux user should be used for your UID.&amp;nbsp; There was a bug where we were not allocating enough memory for reading the entire group file contents.&amp;nbsp; Basically if the number of users within a group was too large, the library would stop reading.&amp;nbsp;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;A customer of ours found the problem and reported it.&amp;nbsp;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Now the reason I love Open Source...&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;The customer did not stop there.&amp;nbsp; They downloaded our source, found the problem, built a patch and attached it to the bug report.&amp;nbsp; So all I had to do was apply the patch and start the errata process.&amp;nbsp;&amp;nbsp; This is the type of stuff that can't happen in a closed source system, and is why Open Source is better...&lt;br /&gt;&lt;br /&gt;Open source is like &lt;a href=&quot;http://www.authorama.com/grimms-fairy-tales-39.html&quot; rel=&quot;nofollow&quot;&gt;The Elves and the Shoemaker&lt;/a&gt;, just don't tell my boss.&amp;nbsp; :^)</content:encoded>
	<dc:date>2011-10-25T12:37:05+00:00</dc:date>
	<dc:creator>dwalsh@redhat.com</dc:creator>
</item>
<item rdf:about="http://blog.namei.org/?p=508">
	<title>James Morris: New GPG Key</title>
	<link>http://blog.namei.org/2011/10/23/new-gpg-key/</link>
	<content:encoded>&lt;p&gt;In support of the new &lt;a href=&quot;http://article.gmane.org/gmane.linux.kernel/1197920&quot;&gt;kernel.org security scheme&lt;/a&gt;, I&amp;#8217;ve created a new 4096 bit RSA key:&lt;/p&gt;
&lt;pre&gt;pub   4096R/FA118320 2011-10-23
      Key fingerprint = 4ED7 50E6 F7F9 ACED 29DD  B750 EB75 1458 FA11 8320
uid   James Morris &amp;lt;jmorris@namei.org&amp;gt;&lt;/pre&gt;
&lt;p&gt;I&amp;#8217;ve published the key via the &lt;a href=&quot;http://pgp.mit.edu/&quot;&gt;MIT key server&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ll continue to host the security subsystem tree on selinuxproject.org until things are fully set up on kernel.org.&lt;/p&gt;</content:encoded>
	<dc:date>2011-10-23T13:02:34+00:00</dc:date>
	<dc:creator>jamesm</dc:creator>
</item>
<item rdf:about="http://danwalsh.livejournal.com/47533.html">
	<title>Dan Walsh: 10 things you probably did not know about SELinux.. #8 How to remove a port from a port type?</title>
	<link>http://danwalsh.livejournal.com/47533.html</link>
	<content:encoded>&lt;span&gt;How do you remove a network port from a network port type?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;First a little explanation.&amp;nbsp; Linux contains 65536 network ports for both UDP and TCP.&lt;br /&gt;SELinux uses types to group network ports together.&amp;nbsp; If you want to see a listing of the port types on the system you can execute:&lt;br /&gt;&lt;br /&gt;&lt;span&gt;semanage&amp;nbsp; port -l&lt;br /&gt;SELinux Port Type&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Proto&amp;nbsp;&amp;nbsp;&amp;nbsp; Port Number&lt;br /&gt;&lt;br /&gt;afs_bos_port_t&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; udp&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7007&lt;br /&gt;afs_client_port_t&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; udp&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7001&lt;br /&gt;afs_fs_port_t&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tcp&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2040&lt;br /&gt;afs_fs_port_t&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; udp&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7000, 7005&lt;br /&gt;...&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Then we write rules in SELinux like&lt;br /&gt;&lt;br /&gt;&lt;b&gt;allow httpd_t http_port_t : tcp_socket name_bind ; &lt;/b&gt;&lt;br /&gt;&lt;br /&gt;This rules says the apache process can execute the bind command using any port that is currently labeled http_port_t.&lt;br /&gt;&lt;br /&gt;&lt;span&gt;# semanage&amp;nbsp; port -l | grep http_port_t&lt;br /&gt;http_port_t&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tcp&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 80, 443, 488, 8008, 8009, 8443&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Now a fairly common question that gets asked is, can I remove these ports.&amp;nbsp;&amp;nbsp; IE I do not want to allow apache to bind to port 8008.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;How would I do this?&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;The simplest thing to do is to redefine port 8008 as a different port type that httpd can not bind to.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;The default port type for all unassigned ports&amp;nbsp; &amp;gt; 1024 is unreserved_port_t or ephemeral_port_t (Fedora 16)&lt;br /&gt;&lt;br /&gt;&lt;span&gt;# semanage&amp;nbsp; port -l | grep ^unreserved_port_t&lt;br /&gt;unreserved_port_t&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tcp&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1024-32767, 61001-65535&lt;br /&gt;unreserved_port_t&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; udp&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1024-32767, 61001-65535&lt;br /&gt;# semanage&amp;nbsp; port -l | grep ^ephemeral_port_t&lt;br /&gt;ephemeral_port_t&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tcp&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 32768-61000&lt;br /&gt;ephemeral_port_t&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; udp&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 32768-61000&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Note SELinux will use a more specific port type if the port has been defined, for example when the kernel sees tcp port 8008, it will use http_port_t rather then unreserved_port_t.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;But the admin can override this by adding his own port definition.&lt;br /&gt;&lt;br /&gt;&lt;span&gt;# semanage port -m -t unreserved_port_t -p tcp 8008&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;To prove this worked, I tested using apache.&lt;br /&gt;&lt;br /&gt;&lt;span&gt;# sed -i 's/Listen 80/Listen 8008/g' /etc/httpd/conf/httpd.conf&lt;br /&gt;# semanage&amp;nbsp; port -m -t unreserved_port_t -p tcp 8008&lt;br /&gt;# service httpd restart&lt;br /&gt;Restarting httpd (via systemctl):&amp;nbsp; Job failed. See system logs and 'systemctl status' for details.&amp;nbsp; [FAILED]&lt;br /&gt;# semanage port -d -p tcp 8008&lt;br /&gt;# service httpd restart&lt;br /&gt;Restarting httpd (via systemctl):&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [&amp;nbsp; OK&amp;nbsp; ]&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;NOTE:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Be careful doing this, because you have just changed the definition of http_port_t for ALL domains, not just the httpd_t domain.&amp;nbsp;&amp;nbsp; Meaning if you were running firefox with a sandbox_web_t sandbox on the same machine, the firefox would no longer be able to connect to port 8008, because sandbox_web_t is only allowed to connect to http_port_t and 8008 is no longer defined as 8008.</content:encoded>
	<dc:date>2011-10-21T15:01:11+00:00</dc:date>
	<dc:creator>dwalsh@redhat.com</dc:creator>
</item>
<item rdf:about="http://danwalsh.livejournal.com/47118.html">
	<title>Dan Walsh: How should you disable IPV6?</title>
	<link>http://danwalsh.livejournal.com/47118.html</link>
	<content:encoded>&lt;span&gt;Blogging twice in the same day, a new record...&lt;br /&gt;&lt;br /&gt;Lots of people are out there disabling IPV6, and when you do invariably you get a flood of AVC messages about different confined domains asking the kernel to load the kernel module net-pf-10.&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;type=AVC msg=audit(10/18/11 23:40:10.233:978087) : avc:&amp;nbsp; denied&amp;nbsp; { &lt;span&gt;module_request &lt;/span&gt;} for&amp;nbsp; pid=32265 comm=pickup kmod=&amp;quot;&lt;span&gt;net-pf-10&lt;/span&gt;&amp;quot; scontext=system_u:system_r:postfix_pickup_t:s0 tcontext=system_u:system_r:&lt;span&gt;kernel_t&lt;/span&gt;:s0 tclass=&lt;span&gt;system &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Now I am not recommending that you enable or disable IPV6, but if you do want to disable it and run with SELinux turned on, please read the following:&lt;br /&gt;&lt;br /&gt;Eric Paris reports&lt;br /&gt;&lt;br /&gt;&lt;i&gt;&amp;quot;I believe the networking kernel community recommends (and it will shut up these AVCs) that IPv6 be disabled by:&lt;br /&gt;&lt;br /&gt;echo 1 &amp;gt; /proc/sys/net/ipv6/conf/all/disable_ipv6&lt;br /&gt;&lt;br /&gt;It still loads the module but unhooks almost all of the calls into the module. (apparently the IPv6 module has become so ingrained in the kernel that a number of other things, like certain firewall modules, require it. I didn't design it, I'm just telling it how it is) &amp;quot;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;We recommend that you do not disable the ipv6 module but add&lt;br /&gt;&lt;br /&gt;&lt;span&gt;net.ipv6.conf.all.disable_ipv6 = 1&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;to &lt;span&gt;/etc/sysctl.conf&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;And the AVC messages should go away.&lt;br /&gt;&lt;br /&gt;The setroubleshoot plugin in Fedora reflects this info.&lt;/span&gt;&lt;br /&gt;</content:encoded>
	<dc:date>2011-10-19T13:34:07+00:00</dc:date>
	<dc:creator>dwalsh@redhat.com</dc:creator>
</item>
<item rdf:about="http://danwalsh.livejournal.com/47066.html">
	<title>Dan Walsh: Making a domain &quot;unconfined&quot;</title>
	<link>http://danwalsh.livejournal.com/47066.html</link>
	<content:encoded>In a couple of previous blogs I talked about permissive and unconfined domains.&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://danwalsh.livejournal.com/24537.html?thread=176857&quot;&gt;http://danwalsh.livejournal.com/24537.html?thread=176857&lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;http://danwalsh.livejournal.com/42394.html&quot;&gt;http://danwalsh.livejournal.com/42394.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Today we had a question about how to I disable_trans on pam_console_t in Red Hat Enterprise Linux 6.&lt;br /&gt;If you have used RHEL5 or have read one of the blogs above you will realize in RHEL5 we had a lot of booleans DOMAIN_disable_trans.&amp;nbsp; The idea was to run these domains without SELinux protection.&amp;nbsp; We quickly figured out that this was a bad idea.&amp;nbsp; Other confined domains would start failing because the process they were supposed to communicate with would be running with a different label.&amp;nbsp; Or files created by the disabled_trans DOMAIN would now get created with the wrong labels.&amp;nbsp;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;In RHEL6 we introduced permissive domains, so that you could run the entire system locked down but pick a few process domains to run in permissive mode.&amp;nbsp; The nice thing about this is we can figure out what the domain wants to do and improve the policy.&lt;br /&gt;&lt;br /&gt;Miroslav Grepl came up with a third solution to the problem today.&amp;nbsp; Basically if a administrator wants to just allow a domain to do what it wants, he can add a policy module that turns the domain into an unconfined domain.&amp;nbsp; This will work on all Fedora releases and RHEL5 as well as RHEL6.&amp;nbsp; And is a much better solution then the disable_trans boolean.&lt;br /&gt;&lt;br /&gt;If you wanted to run pam_console_t as an unconfined domain, you would first create a file call mypam.te.&lt;br /&gt;&lt;br /&gt;&lt;span&gt;# cat mypam.te&lt;br /&gt;policy_module(mypam, 1.0)&lt;br /&gt;gen_requires(`&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; type pam_console_t;&lt;br /&gt;')&lt;br /&gt;unconfined_domain(pam_console_t)&lt;br /&gt;# make -f /usr/share/selinux/devel/Makefile&lt;br /&gt;# semodule -i mypam.pp&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Now pam_console_t will be an unconfined domain, but any confined domain that needs to interact with it will still work.&amp;nbsp; All of the file transition rules will still happen, so the system should stay labelled properly.&amp;nbsp; And no AVC messages will be generated about this domain.&lt;br /&gt;&lt;br /&gt;</content:encoded>
	<dc:date>2011-10-19T13:01:03+00:00</dc:date>
	<dc:creator>dwalsh@redhat.com</dc:creator>
</item>
<item rdf:about="http://danwalsh.livejournal.com/46653.html">
	<title>Dan Walsh: setrans is a handy little tool to analyze policy transitions</title>
	<link>http://danwalsh.livejournal.com/46653.html</link>
	<content:encoded>For several years we have had a SELinux tool set called setools that allows you to analyse policy.&amp;nbsp; I use sesearch and seinfo all the time for looking at policy.&amp;nbsp; setools includes a tcl/tk interface, called apol,&amp;nbsp; that allows you to ask really complicated questions in policy about whether one process and read/write a file, even through process transitions.&amp;nbsp; The problem is the GUI is a little clunky, and I don't like GUIs.&lt;br /&gt;&lt;br /&gt;A few years ago I added python bindings for sesearch and seinfo to the setools/apol libraries.&amp;nbsp; These python interfaces are used within some of the semanage tool chain.&amp;nbsp;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;I often see an AVC about one domain not being able to write to another domains files.&amp;nbsp; Usually these types of avc's are caused by passing an open file descriptor, like stdout, from one process to another process.&amp;nbsp; &amp;nbsp; Sometimes I am puzzled by the relationship between the two domains.&amp;nbsp; I recently got an AVC about ldconfig_t not being able to write to a chr_file labeled mock_var_lib_t.&amp;nbsp;&amp;nbsp; How does the ldconfig program even know about a chr_file labeled mock_var_lib_t?&amp;nbsp; How did did mock transition to the ldconfig domain?&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Well I wrote a tool, &lt;a href=&quot;http://people.fedoraproject.org/~dwalsh/SELinux/setrans&quot; rel=&quot;nofollow&quot;&gt;setrans&lt;/a&gt;, that helps answer these question.&amp;nbsp; The tool takes two domain/process types and attempts to see if the first&lt;br /&gt;type can transition to the second type, and then print all of the intermediary types that it used to get from one domain to the other.&lt;br /&gt;&lt;br /&gt;./setrans init_t httpd_t&lt;br /&gt;init_t --&amp;gt; httpd_t&lt;br /&gt;&lt;br /&gt;./setrans mock_t ldconfig_t&lt;br /&gt;mock_t --&amp;gt; mount_t --&amp;gt; insmod_t --&amp;gt; initrc_t --&amp;gt; ldconfig_t&lt;br /&gt;&lt;br /&gt;./setrans mock_t user_t&lt;br /&gt;mock_t --&amp;gt; mount_t --&amp;gt; insmod_t --&amp;gt; initrc_t --&amp;gt; stunnel_t --&amp;gt; rlogind_t --&amp;gt; remote_login_t --&amp;gt; unpriv_userdomain --&amp;gt; user_t&lt;br /&gt;mock_t --&amp;gt; mount_t --&amp;gt; insmod_t --&amp;gt; initrc_t --&amp;gt; crond_t --&amp;gt; user_t&lt;br /&gt;mock_t --&amp;gt; mount_t --&amp;gt; insmod_t --&amp;gt; initrc_t --&amp;gt; getty_t --&amp;gt; local_login_t --&amp;gt; userdomain --&amp;gt; user_t&lt;br /&gt;mock_t --&amp;gt; mount_t --&amp;gt; insmod_t --&amp;gt; initrc_t --&amp;gt; xdm_t --&amp;gt; gkeyringd_domain --&amp;gt; user_t&lt;br /&gt;&lt;br /&gt;I know that it is not complete and will not show all paths, but it is pretty useful for quick analyses of the policy.&lt;br /&gt;&lt;br /&gt;</content:encoded>
	<dc:date>2011-10-12T16:09:47+00:00</dc:date>
	<dc:creator>dwalsh@redhat.com</dc:creator>
</item>
<item rdf:about="http://danwalsh.livejournal.com/46388.html">
	<title>Dan Walsh: Fedora 16 New SELinux Feature part IV - Shrinking policy</title>
	<link>http://danwalsh.livejournal.com/46388.html</link>
	<content:encoded>Back in July the systemd team was trying to decrease the boot time on early versions of Fedora 16.&amp;nbsp; They found that with a Solid State disk, SELinux policy load and relabel was quickly becoming the biggest pig as far as boot time.&amp;nbsp; So they added some log messages that showed how long it was taking to just read the selinux policy off of disk and load it into the kernel.&lt;br /&gt;&lt;br /&gt;Lennart Poettering announced systemd 32 with the following message.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;span&gt;Primarily bugfixes, and one really cool improvement: we can now load the SELinux policy without having to reexecute ourselves. This is much
prettier and saves up to 70ms or so. I also added some basic profiling output for SELinux which unfortunately shows that SELinux costs around
5s on every boot on f16 (and that on my really fast machine!). Sad. 

Look for output like this:

[   10.727004] systemd[1]: Successfully loaded SELinux policy in 3s 270ms 896us.
[   10.769204] systemd[1]: Successfully loaded SELinux database in 41ms 700us, size on heap is 460K.
[   11.943903] systemd[1]: Relabelled /dev and /run in 1s 125ms 738us.&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;He even added these lines to every boot, so everyone would know how much time SELinux was costing them on boot.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Nothing like public embarrassment to make you take action.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Shame is a great motivator. :^(&lt;br /&gt;&lt;br /&gt;I decided to take a look at the policy using the sesearch tools.&amp;nbsp; I wanted to figure out where all the rules were coming from, and whether we had some duplicates we could remove.&amp;nbsp; The first thing I noticed was there were thousands of rules related to network ports.&amp;nbsp; To me there seemed to be way to many.&amp;nbsp; I began to investigate and found that M4 macro expansion was the problem.&lt;br /&gt;&lt;br /&gt;SELinux policy is written using m4.&amp;nbsp; Over the years we have written lots of macros which policy writers take advantage. &amp;nbsp; We call these macros interfaces.&amp;nbsp; Another feature of SELinux policy is the use of attributes.&amp;nbsp; Attrinbutes are a way of grouping lots of types (init_t, httpd_t) together.&amp;nbsp; You can create a new user type say staff_t and add an attribute say usertype.&amp;nbsp; Now you write rules regarding the usertype that affect all users.&lt;br /&gt;&lt;br /&gt;allow usertype etc_t:file read;&lt;br /&gt;&lt;br /&gt;SELinux also defines network port attributes like port_type and reserved_port_type.&amp;nbsp; All network ports get the attribute port_type and all ports &amp;lt; 1024 get the attribute reserved port type.&amp;nbsp; Well M4 has a cool feature &amp;quot;negation&amp;quot;.&amp;nbsp;&amp;nbsp; SELinux policy was using negation in many places including defineing unreserved_ports.&amp;nbsp; For example in Fedora 15 we have an interface that says.&lt;br /&gt;&lt;br /&gt;&lt;span&gt;interface(`corenet_tcp_bind_all_unreserved_ports',`&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; gen_require(`&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; attribute port_type, reserved_port_type;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ')&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; allow $1 { port_type -reserved_port_type }:tcp_socket name_bind;&lt;br /&gt;')&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;All types that need to bind to ports &amp;gt; 1023 would then using this interface.&lt;br /&gt;&lt;br /&gt;/usr/bin/ssh (ssh_t) needs to be able to setup alternate ports to allow a tunnel connection between a remote sshd service and the local machine, so we allow it to bind to any port &amp;gt; 1023 using the following line:&lt;br /&gt;&lt;br /&gt;&lt;span&gt;corenet_tcp_bind_all_unreserved_ports(ssh_t)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Seems like a simple rule to add, until you understand how m4 works with negation.&amp;nbsp; M4 expands out all the attributes into their types and then writes a rule for each type that matches.&amp;nbsp; A rule like this could end up adding 100s of allow rules.&amp;nbsp; For every type that is a port_type and not a reserved_port_type, a rule would be written allowing ssh_t to bind to the port.&lt;br /&gt;&lt;br /&gt;allow ssh_t amqp_port_t:tcp_socket name_bind;&lt;br /&gt;allow ssh_t asterisk_port_t:tcp_socket name_bind;&lt;br /&gt;...&lt;br /&gt;&lt;br /&gt;I found that if I defined a new attribute &amp;quot;unreserved_port_type&amp;quot;, and rewrote the interface to something like.&lt;br /&gt;&lt;br /&gt;&lt;span&gt;interface(`corenet_tcp_bind_all_unreserved_ports',`&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; gen_require(`&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; attribute port_type, reserved_port_type;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ')&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; allow $1 unreserved_port_type:tcp_socket name_bind;&lt;br /&gt;')&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I ended up with only one rule generated by&lt;br /&gt;&lt;br /&gt;&lt;span&gt;corenet_tcp_bind_all_unreserved_ports(ssh_t)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;allow ssh_t unreserved_port_type:tcp_socket name_bind;&lt;br /&gt;&lt;br /&gt;Turns out we had lots and lots of interfaces where we used the negation.&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; dontaudit $1 { port_type -port_t }:dccp_socket name_bind;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; files_read_all_dirs_except($1, $2 -shadow_t)&lt;br /&gt;&lt;br /&gt;I went through the entire policy and switched to using only attributes like unreserved_port_type attributes and shrunk the size of policy by about 80 %.&lt;br /&gt;&lt;br /&gt;What is really nice, you can check the size of policy using seinfo.&lt;br /&gt;----------------------------&lt;br /&gt;As time went on F15 machine:&lt;br /&gt;&lt;span&gt;$ seinfo&lt;br /&gt;Statistics for policy file: /etc/selinux/targeted/policy/policy.24&lt;br /&gt;Policy Version &amp;amp; Type: v.24 (binary, mls)&lt;br /&gt;Allow:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;b&gt;282444&lt;/b&gt;&lt;br /&gt;Dontaudit:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;b&gt;184516&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;and on F16 machine:&lt;br /&gt;&lt;br /&gt;&lt;span&gt;$ seinfo&lt;br /&gt;Statistics for policy file: /etc/selinux/targeted/policy/policy.26&lt;br /&gt;Policy Version &amp;amp; Type: v.26 (binary, mls)&lt;br /&gt;Allow:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;b&gt;88242&lt;/b&gt;&lt;br /&gt;Dontaudit:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;b&gt;11302&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Tools used to load the policy run about 3 times as fast.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Conclusion:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Tom London looked at the change on his machine and found&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;And comparing 'old vs. new' boot times, first the old:

Jul 28 06:39:29 tlondon systemd[1]: Startup finished in 3s 336ms 755us (kernel) + 11s 625ms 240us (initrd) + 28s 189ms 914us (userspace) = 43s 151ms 909us.

And now the 'new':

Jul 29 06:00:41 tlondon systemd[1]: Startup finished in 1s 844ms 542us (kernel) + 4s 999ms 977us (initrd) + 29s 239ms 766us (userspace) = 36s 84ms 285us.

6.5 seconds less in initrd.&lt;/pre&gt;&lt;p&gt;&lt;br /&gt;A second feature of this change is we are now taking up probably 80% less kernel memory...&lt;br /&gt;&lt;br /&gt;RHEL 6&lt;br /&gt;# du -s /etc/selinux/targeted/policy/policy.24&lt;br /&gt;6004&amp;nbsp;&amp;nbsp;&amp;nbsp; /etc/selinux/targeted/policy/policy.24&lt;br /&gt;&lt;br /&gt;Fedora 16:&lt;/p&gt;&lt;p&gt;# du -s /etc/selinux/targeted/policy/policy.26&lt;br /&gt;2156&amp;nbsp;&amp;nbsp;&amp;nbsp; /etc/selinux/targeted/policy/policy.26&lt;br /&gt;&lt;br /&gt;And Fedora 16 has more domains, types and rules...&lt;br /&gt;&lt;br /&gt;At some point I should probably back port these changes to RHEL6.&lt;/p&gt;</content:encoded>
	<dc:date>2011-09-30T18:30:05+00:00</dc:date>
	<dc:creator>dwalsh@redhat.com</dc:creator>
</item>
<item rdf:about="http://danwalsh.livejournal.com/46245.html">
	<title>Dan Walsh: Fedora 16 New SELinux Feature part III - permissivedomains module</title>
	<link>http://danwalsh.livejournal.com/46245.html</link>
	<content:encoded>As has been stated in&lt;a href=&quot;http://danwalsh.livejournal.com/42394.html&quot;&gt; previous blogs&lt;/a&gt; we have three types of unconfined processes on Fedora.&amp;nbsp;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;We have unconfined_domain() system processes.&amp;nbsp; initrc_t, init_t, kernel_t, ...&lt;/li&gt;&lt;li&gt;We have unconfined_domain() user processes. unconfined_t,&lt;/li&gt;&lt;li&gt;We have permissivedomains&lt;/li&gt;&lt;/ol&gt;Up until now you can remove unoconfined system processes by disabling the unconfined.pp module.&lt;br /&gt;&lt;br /&gt;semodule -d unconfined&lt;br /&gt;&lt;br /&gt;You can disable the unconfined users by removing unconfined user mappings and then disabling unconfineduser.pp&lt;br /&gt;&lt;br /&gt;# semanage login -m -a staff_u __default__&lt;br /&gt;# semanage login -m -a staff_u root&lt;br /&gt;You might need to log out and back in now as sysadm_t and make sure there are no unconfined_u/unconfined_t processes running. Also make sure that you do not have any entries in /etc/sudoers for unconfined_t or files left over in /tmp or /var/db/sudo.&lt;br /&gt;# semanage user -d unconfined_u&lt;br /&gt;# semode -d unconfineduser&lt;br /&gt;&lt;br /&gt;But you could not get rid of permissive domains, since the permissive flag was in individual policy modules.&amp;nbsp; In F16 we re-factored all of the permissive domain declarations into a new module called permissivedomains.pp.&amp;nbsp; If you want to remove all permissive domains from your system&lt;br /&gt;you can execute&lt;br /&gt;&lt;br /&gt;semodule -d permissivedomains&lt;br /&gt;&lt;br /&gt;# semanage permissive -l&lt;br /&gt;Builtin Permissive Types&lt;br /&gt;&lt;br /&gt;Customized Permissive Types&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;This will give you a fully locked down machine.&lt;br /&gt;</content:encoded>
	<dc:date>2011-09-29T13:17:50+00:00</dc:date>
	<dc:creator>dwalsh@redhat.com</dc:creator>
</item>
<item rdf:about="tag:blogger.com,1999:blog-5240359826706545510.post-3289137103999606727">
	<title>Thomas Biege (Security): 4th German OWASP Security Day</title>
	<link>http://thetoms-random-thoughts.blogspot.com/2011/09/4th-german-owasp-security-day.html</link>
	<content:encoded>My submission to the &lt;a href=&quot;https://www.owasp.org/index.php/German_OWASP_Day_2011&quot;&gt;4th German OWASP Security Day&lt;/a&gt; was accepted. Now let's see if we can accept their OWASP license that needs to be signed...&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;!-- BlogCounter Code START --&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://www.blogcounter.de/&quot; id=&quot;bclink&quot; title=&quot;kostenloser Counter fuer Weblogs&quot;&gt;&lt;span id=&quot;bccount&quot;&gt;kostenloser Counter&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://www.blogcounter.de/&quot;&gt;&lt;img alt=&quot;Weblog counter&quot; src=&quot;http://track.blogcounter.de/log.php?id=thetom_blog&quot; /&gt;&lt;/a&gt; - &lt;/p&gt;&lt;!-- BlogCounter Code END --&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width=&quot;1&quot; height=&quot;1&quot; src=&quot;https://blogger.googleusercontent.com/tracker/5240359826706545510-3289137103999606727?l=thetoms-random-thoughts.blogspot.com&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;</content:encoded>
	<dc:date>2011-09-22T01:09:14+00:00</dc:date>
	<dc:creator>Thomas (noreply@blogger.com)</dc:creator>
</item>
<item rdf:about="tag:blogger.com,1999:blog-5240359826706545510.post-6192655919467253952">
	<title>Thomas Biege (Security): I am leaving the SUSE Security Team...</title>
	<link>http://thetoms-random-thoughts.blogspot.com/2011/09/i-am-leaving-suse-security-team.html</link>
	<content:encoded>After 12 years I am leaving the SUSE Security-Team... just to support them! :-)&lt;br /&gt;&lt;br /&gt;Like a satellite I was spun-off from mother earth. Flying around the SUSE Security Team as project-manager to take care of our products before they get released working hand-in-hand with Marcus and his team that (mostly but not exclusively) takes care of the security of already released products.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;!-- BlogCounter Code START --&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://www.blogcounter.de/&quot; id=&quot;bclink&quot; title=&quot;kostenloser Counter fuer Weblogs&quot;&gt;&lt;span id=&quot;bccount&quot;&gt;kostenloser Counter&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://www.blogcounter.de/&quot;&gt;&lt;img alt=&quot;Weblog counter&quot; src=&quot;http://track.blogcounter.de/log.php?id=thetom_blog&quot; /&gt;&lt;/a&gt; - &lt;/p&gt;&lt;!-- BlogCounter Code END --&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width=&quot;1&quot; height=&quot;1&quot; src=&quot;https://blogger.googleusercontent.com/tracker/5240359826706545510-6192655919467253952?l=thetoms-random-thoughts.blogspot.com&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;</content:encoded>
	<dc:date>2011-09-21T03:25:20+00:00</dc:date>
	<dc:creator>Thomas (noreply@blogger.com)</dc:creator>
</item>
<item rdf:about="http://blog.namei.org/?p=503">
	<title>James Morris: Linux Security Summit 2011 – Presentation Slides</title>
	<link>http://blog.namei.org/2011/09/20/linux-security-summit-2011-presentation-slides/</link>
	<content:encoded>&lt;p&gt;Just over a week ago, the 2011 Linux Security Summit was held in Santa Rosa CA, co-located with &lt;a href=&quot;http://www.linuxplumbersconf.org/2011/&quot;&gt;Linux Plumbers&lt;/a&gt;.  It ran for a day, starting with refereed presentations, and then round-table discussions.&lt;/p&gt;
&lt;p&gt;The home page for the summit is on the kernel.org wiki, and is currently unavailable, so I&amp;#8217;m posting links to the slides here:&lt;/p&gt;
&lt;p&gt;* &lt;a href=&quot;http://selinuxproject.org/~jmorris/lss2011_slides/SmackIntelPlumbers2011.pdf&quot;&gt;Smack is Alive and Well&lt;/a&gt;&lt;br /&gt;
Casey Schaufler, Intel&lt;/p&gt;
&lt;p&gt;* &lt;a href=&quot;http://selinuxproject.org/~jmorris/lss2011_slides/Integrity_overview_lss.pdf&quot;&gt;An Overview of the Linux Integrity Subsystem: Use Cases and Demonstration&lt;/a&gt;&lt;br /&gt;
David Safford and Mimi Zohar, IBM&lt;/p&gt;
&lt;p&gt;* &lt;a href=&quot;http://selinuxproject.org/~jmorris/lss2011_slides/IMA_EVM_Digital_Signature_Support.pdf&quot;&gt;Digital Signature support for IMA/EVM&lt;/a&gt;&lt;br /&gt;
Dmitry Kasatkin and Ryan Ware, Intel  (presented by Casey)&lt;/p&gt;
&lt;p&gt;* &lt;a href=&quot;http://selinuxproject.org/~jmorris/lss2011_slides/kruus_ima_lss_2011.pdf&quot;&gt;Protecting the Filesystem Integrity of a Fedora 15 Virtual Machine from Offline Attacks using IMA/EVM&lt;/a&gt;&lt;br /&gt;
Peter Kruus, The Johns Hopkins University Applied Physics Laboratory&lt;/p&gt;
&lt;p&gt;* &lt;a href=&quot;http://selinuxproject.org/~jmorris/lss2011_slides/LSS_11_Integrity_checked_block_devices.pdf&quot;&gt;Efficient, TPM-free system integrity checking with device mapper: dm-verity&lt;/a&gt;&lt;br /&gt;
Will Drewry and Mandeep Baines, Google&lt;/p&gt;
&lt;p&gt;* &lt;a href=&quot;http://selinuxproject.org/~jmorris/lss2011_slides/caseforseandroid.pdf&quot;&gt;The Case for SE Android&lt;/a&gt;&lt;br /&gt;
Stephen Smalley, NSA&lt;/p&gt;
&lt;p&gt;Roundtable discussions:&lt;/p&gt;
&lt;p&gt;* Kernel Hardening  [no slides]&lt;br /&gt;
Lead by Kees Cook, Canonical and Will Drewry, Google&lt;/p&gt;
&lt;p&gt;* &lt;a href=&quot;http://selinuxproject.org/~jmorris/lss2011_slides/LSMsPlumbers.pdf&quot;&gt;LSM Architecture&lt;/a&gt;&lt;br /&gt;
Lead by Kees Cook, Canonical and Casey Schaufler&lt;/p&gt;
&lt;p&gt;The SE Android talk was a last minute replacement for Ryan Ware&amp;#8217;s talk on MeeGo (Ryan was unfortunately not able to make it).&lt;/p&gt;
&lt;p&gt;See the write-ups by by &lt;a href=&quot;http://paulmoore.livejournal.com/6886.html&quot;&gt;Paul Moore&lt;/a&gt; and &lt;a href=&quot;http://lwn.net/SubscriberLink/458805/55b62ac6b3ec112f/&quot;&gt;LWN&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Feedback so far has been positive.  I think it&amp;#8217;s valuable for the security developers to get together like this, after spending the rest of the year working remotely with each other.  Next year, we&amp;#8217;ll likely be looking at co-locating with LPC/KS/LinuxCon in San Diego.  It may be worth thinking about expanding to a two-day event, with the first day following the same format, but then splitting into project groups on day two for BoFs/hack sessions.&lt;/p&gt;
&lt;p&gt;Contact the &lt;a href=&quot;mailto:lss-pc AT ext.namei.org&quot;&gt;program committee&lt;/a&gt; if you have any suggestions.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;d like to thank the LPC folk, and especially Jesse Barnes, for allowing us to co-locate and taking care of all of the logistics &amp;#8212; all we had to do was organize the talks and turn up.  Also thanks to the speakers, discussion leaders and attendees.  See you next year!&lt;/p&gt;</content:encoded>
	<dc:date>2011-09-20T05:41:52+00:00</dc:date>
	<dc:creator>jamesm</dc:creator>
</item>
<item rdf:about="urn:lj:livejournal.com:atom1:paulmoore:6886">
	<title>Paul Moore: Wrapping Up The 2011 Linux Security Summit</title>
	<link>http://paulmoore.livejournal.com/6886.html</link>
	<content:encoded>We just closed the doors on the 2011 Linux Security Summit a few hours ago and I wanted to jot down a few notes while everything was still fresh in my mind. Once again, a big thanks to all of our presenters, James Morris and the rest of the organizing committee; my personal opinion is that the summit was a success this year and I look forward to doing this again in 2012.&lt;br /&gt;&lt;br /&gt;Just as in the past, presentations will be posted at the wiki below once kernel.org comes back online.&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://security.wiki.kernel.org/index.php/LinuxSecuritySummit2011&quot; rel=&quot;nofollow&quot;&gt;http://security.wiki.kernel.org/index.php/LinuxSecuritySummit2011&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Smack is Alive and Well, Casey Schaufler&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;This presentation started with a brief introduction to Smack and then moved on to presenting the recent users, motivations and focus. While Smack has been incorporated into at least one general purpose Linux Distribution, Ubuntu, over the past year or two Smack has grown increasingly focused on small and embedded devices. Functionality wise, Smack has gained several new additions including process labels and transmutable directories. Process labels allow an executable file to be started with a label specified in the file's xattrs and not the parent process's attributes. Transmutable directories allow two differently labeled processes to write into each other's directories without&amp;nbsp;requiring full write access to the other label; this should make it much easier&amp;nbsp;to share files and data between labels. Beyond the new functionality,&amp;nbsp;performance improvements, increased Linux Test Project coverage and improved&amp;nbsp;consistency between AF_UNIX and AF_INET sockets have seen their way, or will&amp;nbsp;soon see their way into Smack.&lt;br /&gt;&lt;br /&gt;&lt;span&gt;MeeGo platform security, including Smack userspace: &amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://meego.gitorious.org/meego-platform-security/&quot; rel=&quot;nofollow&quot;&gt;&lt;span&gt;http://meego.gitorious.org/meego-platform-security&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;The Case for SE Android, Stephen Smalley&lt;/u&gt;&lt;div&gt; &lt;br /&gt;This presentation discussed a recent effort to prototype a SELinux&amp;nbsp;implementation for Android. While SELinux is well known in desktop and server&amp;nbsp;Linux environments, it is still rare in mobile and embedded systems due to&amp;nbsp;concerns around resource usage and differences in both the kernels and&amp;nbsp;userspace. This talk explained the basic Linux/Android differences and what&amp;nbsp;was needed to enable SELinux on the Android platform. Resource issues around&amp;nbsp;policy size were addressed through a greatly simplified SELinux policy which&amp;nbsp;avoided per-application policy and relied on a relatively simple rule set.&amp;nbsp;Finally, the effectiveness of the prototype was evaluated by examining&amp;nbsp;a recent Android vulnerability with a known exploit and determining the&amp;nbsp;effectiveness of the SELinux Android port in preventing the exploit. In the&amp;nbsp;end, this remains a prototype at present, designed to investigate Android's&amp;nbsp;security capabilities, but it shows quite a bit of promise and has a lot to&amp;nbsp;offer beyond the current Android security functionality.&lt;/div&gt;&lt;br /&gt;&lt;u&gt;Overview of the Linux Integrity Architecture, David Safford and Mimi Zohar&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;The Linux Integrity Architecture project has seen a lot of activity over the&amp;nbsp;past few years and the presentation started off with an overview of project,&amp;nbsp;including a status update on where each piece of functionality stood with&amp;nbsp;respect to upstream and established distributions. The good news is that&amp;nbsp;almost all of the IMA project is either currently upstream or patches have been&amp;nbsp;submitted and are being discussed on the related mailing lists. One of the&amp;nbsp;presentation highlights was a demo tying together the IMA principals and&amp;nbsp;virtualization to demonstrate a &amp;quot;Trusted Cloud&amp;quot;. While there is work to be&amp;nbsp;done, the IMA project has made great strides and already offers some impressive&amp;nbsp;functionality.&lt;br /&gt;&lt;br /&gt;&lt;span&gt;IMA project website:&amp;nbsp;&lt;a href=&quot;http://linux-ima.sf.net&quot; rel=&quot;nofollow&quot;&gt;http://linux-ima.sf.net&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Digital Signature Support for IMA/EVM, Dmitry Kasatkin and Casey Schaufler&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;This presentation addressed a problem common to system and device manufacturers&amp;nbsp;who install a single &amp;quot;golden image&amp;quot; on each system they ship: how do you&amp;nbsp;reconcile the business need of a single install image with a TPM based EVM HMAC&amp;nbsp;which uses a per-device key stored in the TPM? One potential answer is to&amp;nbsp;expand on the EVM mechanism to support public key digital signatures in&amp;nbsp;addition to the TPM based HMAC. When the devices are initially installed, a&amp;nbsp;public key certificate is installed into the Linux Kernel keyring via an initrd&amp;nbsp;with the filesystem using digital signatures for the EVM xattr in place of the&amp;nbsp;traditional HMAC. As the files are accessed, the EVM digital signature is&amp;nbsp;verified, and if correct, it is replaced by a TPM generated HMAC. If the EVM&amp;nbsp;digital signature verification fails, access is denied in the same way as if&amp;nbsp;the EVM HMAC verification had failed.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Protecting the Filesystem Integrity of a Fedora 15 Virtual Machine from&amp;nbsp;Offline Attacks using IMA/EVM, Peter Kruus&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;This presentation covered some work being done to better secure Fedora 15&amp;nbsp;guests running on VMWare ESXi while the guests were both running and offline. &amp;nbsp;All systems are vulnerable to offline attacks, but in the case of virtual&amp;nbsp;systems, offline vulnerabilities can sometimes be much easier to exploit due to&amp;nbsp;the availability of the host system and guest storage volumes. In order to&amp;nbsp;help mitigate this problem, the presenter leveraged the existing IMA/EVM&amp;nbsp;support in Fedora 15 to verify the integrity of critical system files, but&amp;nbsp;unfortunately due to missing vTPM support in VMWare ESXi the presenter was&amp;nbsp;unable to leverage TPM based HMACs in the EVM attributes. The solution was to&amp;nbsp;use a passphrase protected key which was loaded at boot through a combination&amp;nbsp;of the system's initrd and dracut. While this solution does provide an&amp;nbsp;increased level of protection against attack, for this approach to be truly&amp;nbsp;successful, full vTPM support is needed in the hypervisor to allow the guest to&amp;nbsp;utilize the TPM. While vTPM patches have been submitted for QEMU/KVM, the&amp;nbsp;state of the vTPM in VMWare ESXi is unknown.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Integrity-checked Block Devices with Device Mapper,&amp;nbsp;Will Drewry and Mandeep Baines&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;This presentation dealt with an enhancement to the Linux Kernel Device Mapper&amp;nbsp;to perform block level integrity verification. This solution was designed&amp;nbsp;primarily for the Linux based Chromium OS running on modest netbook class&amp;nbsp;hardware where boot performance was a significant requirement. Helping to&amp;nbsp;simplify the solution was the fact that the system is very well defined and&amp;nbsp;operates in a read-only mode such that the integrity verification mechanism&amp;nbsp;does not need to worry about online updates to the storage volume. The&amp;nbsp;solution, dm-verity, uses a slightly modified hash tree, with the root hash&amp;nbsp;specified on the kernel command line to quickly verify the integrity of the&amp;nbsp;entire block device. Optimization is ongoing, but already the developers are&amp;nbsp;able to boot a ~800MB Chromium OS root partition in ~1.2s on an Atom CPU using&amp;nbsp;a SSD storage volume. While this integrity verification solution may not lend&amp;nbsp;itself quite as well to general purpose systems as the TPM/IMA based solutions,&amp;nbsp;it presents a novel solution that helps solve Chromium OS's needs in a a high&amp;nbsp;performance, low cost manner.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Kernel Hardening Roundtable, Kees Cook and Will Drewry&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;This roundtable started with a discussion on the different kernel interfaces&amp;nbsp;where the kernel is exposed to user input, malicious or otherwise. From here&amp;nbsp;the focus shifted to how the existing security mechanisms, such as DAC, LSM and&amp;nbsp;capabilities, impact the kernel's exposed interfaces - for better or worse. At&amp;nbsp;this point it was clear, if it wasn't already, that the Linux Kernel remains&amp;nbsp;far too exposed to malicious users/applications and some additional hardening&amp;nbsp;techniques are needed.&lt;br /&gt;&lt;br /&gt;While many hardening ideas were discussed, the two main points of discussion&amp;nbsp;revolved around system call filtering/reduction and the hardening techniques&amp;nbsp;found in grsecurity. With respect to system call filtering, work has been&amp;nbsp;ongoing this year to expand the mainline seccomp functionality to be more&amp;nbsp;flexible and useful for a wider range of applications. Plenty of discussion&amp;nbsp;has already occurred on the mailing lists and more is expected as the enhanced&amp;nbsp;seccomp developer has promised a new round of patches soon. Similarly, work&amp;nbsp;has recently been ongoing to decompose the rejected grsecurity patch and&amp;nbsp;repackage it in a series of patches which will hopefully be acceptable to the&amp;nbsp;upstream kernel maintainers.&lt;br /&gt;&lt;br /&gt;&lt;span&gt;Sandbox powered by the current mainline seccomp:&amp;nbsp;&lt;a href=&quot;http://code.google.com/p/seccompsandbox&quot; rel=&quot;nofollow&quot;&gt;http://code.google.com/p/seccompsandbox&lt;/a&gt;&lt;br /&gt;Ubuntu Linux Kernel hardening tasks:&amp;nbsp;&lt;a href=&quot;http://wiki.ubuntu.com/SecurityTeam/Roadmap/KernelHardening#Upstream_Hardening&quot; rel=&quot;nofollow&quot;&gt;http://wiki.ubuntu.com/SecurityTeam/Roadmap/KernelHardening#Upstream_Hardening&lt;/a&gt;&lt;br /&gt;Linux Kernel hardening mailing lists:&amp;nbsp;&lt;a href=&quot;http://www.openwall.com/lists&quot; rel=&quot;nofollow&quot;&gt;http://www.openwall.com/lists&lt;/a&gt; (see the kernel-hardening list)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;LSM Architecture Roundtable, Kees Cook and Casey Schaufler&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;This roundtable dealt primarily with the issues related to multiple LSMs, from&amp;nbsp;APIs and determining which LSM was enabled in the kernel to architectural issues&amp;nbsp;blocking multiple concurrent LSMs. With respect to determining the active LSM&amp;nbsp;and LSM APIs, the discussion was largely a group brainstorming session with&amp;nbsp;developers discussing the pros and cons of various solutions; while most agreed&amp;nbsp;the a general LSM userspace API was more problem than it was worth, there was&amp;nbsp;some general agreement on LSM conventions that should help unify some of the&amp;nbsp;most basic LSM API functionality in the future.&lt;br /&gt;&lt;br /&gt;This discussion around running multiple concurrent LSMs was much more focused,&amp;nbsp;with patches being proposed as recently as February, although everyone did&amp;nbsp;agree that the patches had serious limitations due to shortcomings with the LSM&amp;nbsp;hooks/blobs in the kernel. In the end, several inherent blockers to concurrent&amp;nbsp;LSM operation remained, but the &amp;quot;religious&amp;quot; arguments against the idea seemed&amp;nbsp;to be less than in past years.</content:encoded>
	<dc:date>2011-09-09T06:55:34+00:00</dc:date>
</item>
<item rdf:about="http://danwalsh.livejournal.com/46018.html">
	<title>Dan Walsh: Fedora 16 Alpha available part II, New SELinux Feature/File Name Transitions</title>
	<link>http://danwalsh.livejournal.com/46018.html</link>
	<content:encoded>&lt;a href=&quot;https://fedoraproject.org/get-prerelease&quot; rel=&quot;nofollow&quot;&gt;Fedora 16 Alpha&lt;/a&gt; was just released: The announcement include the following:&lt;br /&gt;&lt;ul&gt; &lt;li&gt;SELinux Enhancements. SELinux policy package now includes a pre-built policy that will only rebuild policy if any customizations have been made. A sample test run shows 4 times speedup on installing the package from 48 Seconds to 12 Seconds and max memory usage from 38M to 6M. In addition to that, &lt;span&gt; SELinux file name transition allows better policy management. For instance, policy writers can take advantage of this and write a policy rule that states, if a SELinux unconfined process creates a file named resolv.conf in a directory labelled etc_t, the file should get labeled appropriately. This results is less chances of mislabeled files. &lt;/span&gt;Also, from this release onwards, selinuxfs is mounted at /sys/fs/selinux instead of in /selinux. All the affected components including anaconda, dracut, livecd-tools and policycoreutils have been modified to work with this change.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span&gt;&lt;a href=&quot;https://fedoraproject.org/wiki/Features/SELinuxFileNameTransition&quot; rel=&quot;nofollow&quot;&gt; Named File Transitions Feature&lt;/a&gt; &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This feature was added to F16 to make labelling files easier for users and administrators.&amp;nbsp; The goal is to prevent accidental mislabelling of file objects.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Accidental mislabelling&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Users or administrators often create files or directories that do not have the same label as the parent directory, and then forget to fix the label. An example of this would be the administrator going into the /root directory and creating the .ssh directory. In previous versions of Fedora, the directory would get created admin_home_t, even though the policy requires it to be labelled ssh_home_t.&amp;nbsp;&amp;nbsp; Later when he tries to use the content of the .ssh directory to login without a password, sshd (sshd_t) fails to read the directories contents because sshd is not allowed to read files labelled admin_home_t.&lt;br /&gt;&lt;br /&gt;Another example would be a user creating the public_html directory in his home directory.&amp;nbsp; The default label for content in the home directory is user_home_t, but SELinux requires the public_html directory to be labelled http_user_content_t or the apache process (httpd_t) will not be allowed to read it.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;File Transitions Policy&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Policy writers have always be able to write a file transition rule that includes the type of the processes creating the file object (NetworkManger_t), the type of the directory that will contain the file object (etc_t) and the class of the file object (file).&amp;nbsp; Then specify the type of the created object (net_conf_t).&lt;br /&gt;&lt;br /&gt;filetrans_pattern(NetworkManager_t, etc_t, file, net_conf_t)&lt;br /&gt;&lt;br /&gt;This policy line says that a process running as NetworkManager_t creating any file in a directory labelled etc_t will create it with the label net_conf_t.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Named File Transitions Policy&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Eric Paris added a cool feature to the kernel that allows the kernel to label a file based on 4 characteristics instead of just three.&amp;nbsp; He added the base file name.&amp;nbsp; (Not the path).&lt;p&gt;Now we can write policy rules that state:&lt;/p&gt;&lt;ul&gt; &lt;li&gt;If the unconfined_t user process creates the &amp;quot;.ssh&amp;quot; directory in a directory labelled admin_home_t, then it will get created with the label ssh_home_t.&lt;br /&gt;  &lt;br /&gt;filetrans_pattern(unconfined_t, admin_home_t, dir, ssh_home_t, &amp;quot;.ssh&amp;quot;)&lt;br /&gt; &lt;/li&gt; &lt;li&gt;If the staff_t user process creates a directory named public_html in a directory labeled user_home_dir_t it will get labeled&lt;br /&gt;  &lt;br /&gt;http_user_content_t. filetrans_pattern(staff_t, user_home_dir_t, dir, http_user_content_t, &amp;quot;public_html&amp;quot;)&lt;/li&gt;&lt;/ul&gt;Additionally we have added rules to make sure if the kernel creates content in /dev it will label it correctly rather then waiting for udev to fix the label.&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;filetrans_pattern(kernel_t, device_t, chr_file, wireless_device_t, &amp;quot;rfkill&amp;quot;)&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Bottom line.&amp;nbsp; &lt;/b&gt;&lt;br /&gt;&lt;br /&gt;There should be less occurrences of accidental mislabels by users and hopefully a more secure and better running SELinux system.</content:encoded>
	<dc:date>2011-08-30T13:41:01+00:00</dc:date>
	<dc:creator>dwalsh@redhat.com</dc:creator>
</item>
<item rdf:about="http://danwalsh.livejournal.com/45712.html">
	<title>Dan Walsh: Fedora 16 Alpha available, New SELinux Feature/Prebuilt Policy.</title>
	<link>http://danwalsh.livejournal.com/45712.html</link>
	<content:encoded>&lt;a href=&quot;https://fedoraproject.org/get-prerelease&quot; rel=&quot;nofollow&quot;&gt;Fedora 16 Alpha&lt;/a&gt; was just released: The announcement include the following:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt; &lt;li&gt;SELinux Enhancements.&lt;br /&gt;  &lt;span&gt;SELinux policy package now includes a pre-built policy that will only rebuild policy if any customizations have been made. A sample test run shows 4 times speedup on installing the package from 48 Seconds to 12 Seconds and max memory usage from 38M to 6M. &lt;/span&gt;In addition to that, SELinux file name transition allows better policy management. For instance, policy writers can take advantage of this and write a policy rule that states, if a SELinux unconfined process creates a file named resolv.conf in a directory labelled etc_t, the file should get labeled appropriately. This results is less chances of mislabeled files. Also, from this release onwards, selinuxfs is mounted at /sys/fs/selinux instead of in /selinux. All the affected components including anaconda, dracut, livecd-tools and policycoreutils have been modified to work with this change.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;&lt;b&gt;Pre-Built Policy&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;We made major changes to the selinux-policy-TYPE rpm. (selinux-policy-targeted-3.10.0-21.fc16)&lt;div&gt; &lt;br /&gt;The rpm now includes a pre-built /etc/selinux/targeted/policy/policy.26.&amp;nbsp; This policy file can be loaded right away in a fresh install.&amp;nbsp; In all previous versions of SELinux for RHEL and Fedora, we rebuilt this file in the post install.&amp;nbsp; The reason for this is we&amp;nbsp; need to recompile in local customizations that the user/administrator might have made on your system.&amp;nbsp; Additionally if any package shipped&amp;nbsp; with a policy we would need to recompile in those policy packages.&amp;nbsp; But as the size of policy grew we were seeing Anaconda installation times&amp;nbsp; grow and memory requirements grow because of selinux-policy package.&amp;nbsp; We were even seeing virtual machine installations blow up on selinux-policy package installs because of limited memory.&amp;nbsp; When we looked at the problem, we realized that on initial install of policy, no user would have made local customizations and very few packages are shipping with their own policy.&amp;nbsp;&amp;nbsp;&lt;br /&gt; &lt;br /&gt;I reworked the tools to include the policy packages within the payload and now the package will check in the pre-install if there was any local customizations, if yes, the post install will recompile the policy, but if not the policy will just install.&lt;br /&gt; &lt;br /&gt;We also used to have to ship all of the policy modules, over 300, in the directory /usr/share/selinux/targeted and these would be copied into /etc/selinux/targeted/modules/active/, were we would never touch the files in /usr/share/selinux/targeted again.&amp;nbsp; Now we install directly into /etc/selinux/targeted/modules/active/.&lt;br /&gt; &lt;br /&gt;What you should see is faster initial installs and faster selinux-package updates.&amp;nbsp; In Fedora 15 a policy-package update would take around 45-50 seconds, in Fedora 16 on an unmodified selinux-policy system it should take &amp;lt; 15 seconds.&amp;nbsp; If you are updating from Fedora 15 the first time, it will still take a long time, but the next update should go quick.&amp;nbsp; If you have modified the SELinux system by adding pp&lt;br /&gt;files you will still see the recompile times that you always have.&amp;nbsp; :^(&lt;/div&gt;</content:encoded>
	<dc:date>2011-08-30T13:37:13+00:00</dc:date>
	<dc:creator>dwalsh@redhat.com</dc:creator>
</item>
<item rdf:about="http://danwalsh.livejournal.com/45414.html">
	<title>Dan Walsh: Fedora 16 Alpha available part II, New SELinux Feature/File Name Transitions</title>
	<link>http://danwalsh.livejournal.com/45414.html</link>
	<content:encoded>&lt;a href=&quot;https://fedoraproject.org/get-prerelease&quot; rel=&quot;nofollow&quot;&gt;Fedora 16 Alpha&lt;/a&gt; was just released:&lt;br /&gt;&lt;br /&gt;The announcement include the following:&lt;br /&gt;&lt;ul&gt; &lt;li&gt;SELinux Enhancements. SELinux policy package now includes a pre-built policy that will only rebuild policy if any customizations have been made. A sample test run shows 4 times speedup on installing the package from 48 Seconds to 12 Seconds and max memory usage from 38M to 6M. In addition to that, &lt;span&gt; SELinux file name transition allows better policy management. For instance, policy writers can take advantage of this and write a policy rule that states, if a SELinux unconfined process creates a file named resolv.conf in a directory labelled etc_t, the file should get labeled appropriately. This results is less chances of mislabeled files. &lt;/span&gt;Also, from this release onwards, selinuxfs is mounted at /sys/fs/selinux instead of in /selinux. All the affected components including anaconda, dracut, livecd-tools and policycoreutils have been modified to work with this change. &lt;span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span&gt;&lt;a href=&quot;https://fedoraproject.org/wiki/Features/SELinuxFileNameTransition&quot; rel=&quot;nofollow&quot;&gt;&lt;br /&gt;Named File Transitions Feature&lt;/a&gt; &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This feature was added to F16 to make labelling files easier for users and administrators.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;The goal is to prevent accidental mislabelling of file objects.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Accidental mislabelling&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Users or administrators often create files or directories that do not have the same label as the parent directory, and then forget to fix the label. An example of this would be the administrator going into the /root directory and creating the .ssh directory.&lt;br /&gt;&lt;br /&gt;In previous versions of Fedora, the directory would get created admin_home_t, even though the policy requires it to be labelled ssh_home_t.&amp;nbsp;&amp;nbsp; Later when he tries to use the content of the .ssh directory to login without a password, sshd (sshd_t) fails to read the directories contents because sshd is not allowed to read files labelled admin_home_t.&lt;br /&gt;&lt;br /&gt;Another example would be a user creating the public_html directory in his home directory.&amp;nbsp; The default label for content in the home directory is user_home_t, but SELinux requires the public_html directory to be labelled http_user_content_t or the apache process (httpd_t) will not be allowed to read it.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;File Transitions Policy&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Policy writers have always be able to write a file transition rule that includes the type of the processes creating the file object (NetworkManger_t), the type of the directory that will contain the file object (etc_t) and the class of the file object (file).&amp;nbsp; Then specify the type of the created object (net_conf_t).&lt;br /&gt;&lt;br /&gt;filetrans_pattern(NetworkManager_t, etc_t, file, net_conf_t)&lt;br /&gt;&lt;br /&gt;This policy line says that a process running as NetworkManager_t creating any file in a directory labelled etc_t will create it with the label net_conf_t.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Named File Transitions Policy&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Eric Paris added a cool feature to the kernel that allows the kernel to label a file based on 4 characteristics instead of just three.&amp;nbsp; He added the base file name.&amp;nbsp; (Not the path).&lt;p&gt;Now we can write policy rules that state:&lt;/p&gt;&lt;ul&gt; &lt;li&gt;If the unconfined_t user process creates the &amp;quot;.ssh&amp;quot; directory in a directory labelled admin_home_t, then it will get created with the label ssh_home_t.&lt;br /&gt;  &lt;br /&gt;filetrans_pattern(unconfined_t, admin_home_t, dir, ssh_home_t, &amp;quot;.ssh&amp;quot;)&lt;br /&gt; &lt;/li&gt; &lt;li&gt;If the staff_t user process creates a directory named public_html in a directory labeled user_home_dir_t it will get labeled http_user_content_t.&lt;br /&gt;  &lt;br /&gt;filetrans_pattern(staff_t, user_home_dir_t, dir, http_user_content_t, &amp;quot;public_html&amp;quot;)&lt;/li&gt;&lt;/ul&gt;Additionally we have added rules to make sure if the kernel creates content in /dev it will label it correctly rather then waiting for udev to fix the label.&amp;nbsp; &amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; filetrans_pattern(kernel_t, device_t, chr_file, wireless_device_t, &amp;quot;rfkill&amp;quot;)&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Bottom line.&amp;nbsp; &lt;/b&gt;&lt;br /&gt;&lt;br /&gt;There should be less occurrences of accidental mislabels by users and hopefully a more secure and better running SELinux system.</content:encoded>
	<dc:date>2011-08-26T13:28:51+00:00</dc:date>
	<dc:creator>dwalsh@redhat.com</dc:creator>
</item>
<item rdf:about="http://danwalsh.livejournal.com/45194.html">
	<title>Dan Walsh: sVirt to the Rescue</title>
	<link>http://danwalsh.livejournal.com/45194.html</link>
	<content:encoded>At the recent &lt;a href=&quot;http://www.blackhat.com/html/bh-us-11/bh-us-11-briefings.html&quot; rel=&quot;nofollow&quot;&gt;Black Hat conference&lt;/a&gt; Nelson Elhage presented:&lt;br /&gt;&lt;br /&gt;&lt;i&gt;&lt;a href=&quot;https://media.blackhat.com/bh-us-11/Elhage/BH_US_11_Elhage_Virtunoid_Slides.pdf&quot; rel=&quot;nofollow&quot;&gt;Virtualization Under Attack: Breaking out of KVM&lt;/a&gt;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;The exploit, &lt;a href=&quot;http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-1751&quot; rel=&quot;nofollow&quot;&gt;CVE-2011-1751&lt;/a&gt;, would allow a cracker to execute code in qemu-kvm process on the host.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span&gt;Note: Red Hat fixed this problem back in May 2011 prior to the publication of the paper and exploit. Customers who applied our security updates are not affected by this issue. So 0 days of exposure.&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;In the presentation there is this bullet point:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt; &lt;li&gt;&lt;br /&gt;  &lt;b&gt;qemu-kvm is often sandboxed using SELinux or similar, meaning that&lt;br /&gt;successful exploitation will often require a second privesc within the&lt;br /&gt;host.&lt;br /&gt;(Fortunately, Linux never has any of those)&lt;/b&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span&gt;This means that SELinux/sVirt on Red Hat Enterprise Linux and Fedora confines this outbreak!&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In a previous blog, &lt;a href=&quot;http://danwalsh.livejournal.com/44090.html&quot;&gt;Fun with sVirt.&lt;/a&gt;, I showed how you can simulate this vulnerability to see what access was available. Not much...&lt;br /&gt;&lt;br /&gt;Nelson mentioned SELinux sandboxing could be bypassed by a theoretical second &amp;quot;privesc&amp;quot; vulnerability, meaning a bug in the kernel. SELinux or any kind of Mandatory Access Control is enforced by the Kernel.&amp;nbsp; Bugs in that Kernel, that a process is allowed to access, can subvirt SELinux. But SELinux is putting up a significant second barrier to the cracker.&lt;br /&gt;&lt;br /&gt;Security is all about Layers, making each layer as secure as possible and then fixing vulnerabilities as quickly as you know about them. &lt;br /&gt;&lt;br /&gt;This presentation exposes the risk associated with virtualization, but also shows the secondary security controls Linux KVM is using&amp;nbsp; to minimize the risk and giving us time to fix problems as soon as we know about them.&lt;br /&gt;&lt;br /&gt;Bottom line, this is why you leave SELinux enabled in enforcing mode. :^)</content:encoded>
	<dc:date>2011-08-25T18:07:17+00:00</dc:date>
	<dc:creator>dwalsh@redhat.com</dc:creator>
</item>
<item rdf:about="tag:blogger.com,1999:blog-5024703430482213163.post-4238326997061638222">
	<title>Dominick Grift: Git daemon and SELinux with RHEL6</title>
	<link>http://selinux-mac.blogspot.com/2011/08/git-daemon-and-selinux-with-rhel6.html</link>
	<content:encoded>RHEL6 does not ship with a manual page for configuring Git daemon SELinux policy, and so decided to publish a demonstration on youtube:
&lt;br /&gt;
&lt;br /&gt;Part 1. Git system daemon, shared repositories.
&lt;br /&gt;
&lt;br /&gt;http://www.youtube.com/watch?v=vgm89P5nbBQ
&lt;br /&gt;
&lt;br /&gt;Part 2. Git session daemon, personal repositories.
&lt;br /&gt;
&lt;br /&gt;http://www.youtube.com/watch?v=XHEPj80217o
&lt;br /&gt;
&lt;br /&gt;By the way you can look at the manual page (source) here:
&lt;br /&gt;
&lt;br /&gt;http://git.fedorahosted.org/git/?p=selinux-policy.git;a=blob;f=man/man8/git_selinux.8;h=e9c43b190c394f8ea7e68d9dd29f45c831340bf5;hb=ccadbe7d6ae709cdfd3b06d496477e069a2f13ee&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width=&quot;1&quot; height=&quot;1&quot; src=&quot;https://blogger.googleusercontent.com/tracker/5024703430482213163-4238326997061638222?l=selinux-mac.blogspot.com&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;</content:encoded>
	<dc:date>2011-08-23T12:17:12+00:00</dc:date>
	<dc:creator>Dominick &quot;domg472&quot; Grift (noreply@blogger.com)</dc:creator>
</item>
<item rdf:about="urn:lj:livejournal.com:atom1:paulmoore:6463">
	<title>Paul Moore: Twitter Too</title>
	<link>http://paulmoore.livejournal.com/6463.html</link>
	<content:encoded>To add to the recent email updates, I thought I would mention that I'm now on twitter too at &lt;a href=&quot;http://twitter.com/#!/paul_via_tweet&quot; rel=&quot;nofollow&quot;&gt;@paul_via_tweet&lt;/a&gt;.  Not much there right now, but since all the &quot;cool kids&quot; are on the twitter these days, how could I resist?</content:encoded>
	<dc:date>2011-08-15T22:39:18+00:00</dc:date>
</item>
<item rdf:about="http://danwalsh.livejournal.com/44836.html">
	<title>Dan Walsh: Fedora 16 is about to go to Alpha release, some SELinux changes.</title>
	<link>http://danwalsh.livejournal.com/44836.html</link>
	<content:encoded>First with the move to systemd, we were asked to move the /selinux file system to a more standard location.&lt;br /&gt;&lt;br /&gt;From this point forward the selinuxfs will be mounted under /sys/fs/selinux.&lt;br /&gt;&lt;br /&gt;This seems to be the new location for kernel interface file systems, like cgroup&lt;br /&gt; &lt;br /&gt;# ls /sys/fs/&lt;br /&gt;cgroup&amp;nbsp;&amp;nbsp;&amp;nbsp; ext4&amp;nbsp; fuse&amp;nbsp; selinux&lt;br /&gt;&lt;br /&gt;libselinux has been modified to mount the selinuxfs file system on the /sys/fs/selinux directory if it exists, otherwise libselinux will fall back to mounting on the /selinux directory if it exists.&lt;br /&gt;&lt;br /&gt;One problem I foresee and we are beginning to fix is any application that hard coded &amp;quot;/selinux&amp;quot; in to the application. &amp;nbsp;So far we have had to fix anaconda, livecd-tools, policycoreutils, and dracut.&amp;nbsp; In most cases you should use the command line tools like setenforce or selinuxenabeled, or use the python bindings &lt;br /&gt;&lt;br /&gt;python&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; import selinux&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; print (selinux.is_selinux_enabled())&lt;br /&gt;1&lt;br /&gt;&lt;br /&gt;And not hard code the path.&lt;br /&gt;&lt;br /&gt;Another option is to grep /proc/self/mountinfo&lt;br /&gt;&lt;br /&gt; # grep selinuxfs /proc/self/mountinfo&amp;nbsp; | head -1 | awk '{ print $5 }'&lt;br /&gt;/sys/fs/selinux&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If you know of any applications that hard code /selinux into them, please let me know and I can work with the maintainer or developer to fix the code.</content:encoded>
	<dc:date>2011-08-11T13:24:44+00:00</dc:date>
	<dc:creator>dwalsh@redhat.com</dc:creator>
</item>
<item rdf:about="urn:lj:livejournal.com:atom1:paulmoore:6360">
	<title>Paul Moore: New Email Address Part Two</title>
	<link>http://paulmoore.livejournal.com/6360.html</link>
	<content:encoded>Hello again, last week I made a quick post to say that my @hp.com email address was going away; the reason for that, as many had guessed, was that I was leaving HP for a new employer.  As of this past Monday, August 8th, 2011, I'm happy to say that I am now working for Red Hat.  This should be good news for anyone interested in the Linux labeled networking bits and the assorted LSM network access controls as my new employer should allow me to spend more time maintaining and working on these things than I have over the past few years.&lt;br /&gt;&lt;br /&gt;So, with a new job comes a new email address; you can continue to send me email at paul@paul-moore.com, but now you can also reach me at pmoore@redhat.com.</content:encoded>
	<dc:date>2011-08-10T18:08:11+00:00</dc:date>
</item>
<item rdf:about="urn:lj:livejournal.com:atom1:paulmoore:6109">
	<title>Paul Moore: New Email Address</title>
	<link>http://paulmoore.livejournal.com/6109.html</link>
	<content:encoded>Just a quick update to let everyone know that my @hp.com email address is going to stop working on Friday, August 5, 2011.  If you need to get in touch with me please send me email at paul@paul-moore.com.</content:encoded>
	<dc:date>2011-08-01T21:16:45+00:00</dc:date>
</item>
<item rdf:about="tag:blogger.com,1999:blog-5240359826706545510.post-3790794325190251494">
	<title>Thomas Biege (Security): Scanny will replace the ror-sec-scanner</title>
	<link>http://thetoms-random-thoughts.blogspot.com/2011/07/scanny-will-replace-ror-sec-scanner.html</link>
	<content:encoded>David and Flavio created a new &lt;a href=&quot;https://github.com/openSUSE/scanny&quot;&gt;github project&lt;/a&gt; to replace my ror-sec-scanner. &quot;&lt;a href=&quot;https://github.com/openSUSE/scanny&quot;&gt;Scanny&lt;/a&gt;&quot; doesn't uses regex but the AST and emits fewer false positives. So lets start adding rules/checks to it to become more powerful.&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;!-- BlogCounter Code START --&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://www.blogcounter.de/&quot; id=&quot;bclink&quot; title=&quot;kostenloser Counter fuer Weblogs&quot;&gt;&lt;span id=&quot;bccount&quot;&gt;kostenloser Counter&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://www.blogcounter.de/&quot;&gt;&lt;img alt=&quot;Weblog counter&quot; src=&quot;http://track.blogcounter.de/log.php?id=thetom_blog&quot; /&gt;&lt;/a&gt; - &lt;/p&gt;&lt;!-- BlogCounter Code END --&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width=&quot;1&quot; height=&quot;1&quot; src=&quot;https://blogger.googleusercontent.com/tracker/5240359826706545510-3790794325190251494?l=thetoms-random-thoughts.blogspot.com&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;</content:encoded>
	<dc:date>2011-07-26T05:08:50+00:00</dc:date>
	<dc:creator>Thomas (noreply@blogger.com)</dc:creator>
</item>
<item rdf:about="http://etbe.coker.com.au/?p=2916">
	<title>Russell Coker (security): SE Linux File Context Precedence</title>
	<link>http://etbe.coker.com.au/2011/07/24/se-linux-file-context-precedence/</link>
	<content:encoded>&lt;p&gt;&lt;a href=&quot;http://etbe.coker.com.au/2011/07/22/run-se-linux-policy/&quot;&gt;In my previous post I expressed a desire to use regular expressions for files that may appear in multiple places in the tree due to bind mounts for /run and /var/run etc [1]&lt;/a&gt;. However there is a problem with this idea.&lt;/p&gt;
&lt;p&gt;The SE Linux file labeling program &lt;b&gt;restorecon&lt;/b&gt; reads the file &lt;b&gt;/etc/selinux/$SELINUXTYPE/contexts/files/file_contexts&lt;/b&gt; which contains a set of regular expressions to assign labels to files. That file is ordered and the last entry which matches is the one that counts. When the file_contexts file is created the order is based on how many characters at the start of the file specification aren&amp;#8217;t regular expression meta-characters. For example the entry &amp;#8220;/.*&amp;#8221; is at the top of the file (and therefore has the lowest precedence), which makes it the catch-all entry for files that have no other match. So an entry for &amp;#8220;/var/run/REGEX&amp;#8221; will have a higher precedence than one for &amp;#8220;/var/REGEX&amp;#8221;, this means however that when I replaced the &amp;#8220;/var/run&amp;#8221; part with a regular expression then it had a lower precedence and it didn&amp;#8217;t work properly.&lt;/p&gt;
&lt;p&gt;I should have remembered this as I did a lot of work on setfiles (which became restorecon) in the early days. I have now developed a new way of solving this and this time I&amp;#8217;m testing it before blogging about it.&lt;/p&gt;
&lt;p&gt;I have written the following PERL program to fix the file contexts, this adds multiple lines and uses a &lt;b&gt;distro_debian&lt;/b&gt; conditional on them so that they don&amp;#8217;t slip into upstream use &amp;#8211; and so that if I lose track of where each patch came from I&amp;#8217;ll know that I can delete them in future because it only matters to Debian.&lt;/p&gt;
&lt;p&gt;#!/usr/bin/perl&lt;br /&gt;
use warnings;&lt;br /&gt;
use strict;&lt;/p&gt;
&lt;p&gt;open(LIST, &quot;find . -name \&quot;*.fc\&quot;|xargs egrep \&quot;^/(var.*run)|(var/lock)|(dev/shm)\&quot;|cut -f1 -d:|uniq|&quot;) or die &quot;Can't get file list\n&quot;;&lt;br /&gt;
while(&amp;lt;LIST&amp;gt;)&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; my $filename = $_;&lt;br /&gt;
&amp;nbsp; chomp $filename;&lt;br /&gt;
&amp;nbsp; open(my $infile, &quot;&amp;lt;&quot;, $filename) or die &quot;Can't open file $filename&quot;;&lt;br /&gt;
&amp;nbsp; open(my $outfile, &quot;&amp;gt;&quot;, $filename . &quot;.new&quot;) or die &quot;Can't open file &quot;. $filename . &quot;.new&quot;;&lt;br /&gt;
&amp;nbsp; while(&amp;lt;$infile&amp;gt;)&lt;br /&gt;
&amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; print $outfile $_;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; my $newline;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; if($_ =~ /^\/var\/run/)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; print $outfile &quot;ifdef(&amp;#96;distro_debian', &amp;#96;\n&quot;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; $newline = $_;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; $newline =~ s/^\/var//;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; print $outfile $newline;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; print $outfile &quot;')\n&quot;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; if($_ =~ /^\/var\/lock/)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; print $outfile &quot;ifdef(&amp;#96;distro_debian', &amp;#96;\n&quot;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; $newline = $_;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; $newline =~ s/^\/var/\/var\/run/;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; print $outfile $newline;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; $newline =~ s/^\/var//;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; print $outfile $newline;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; print $outfile &quot;')\n&quot;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; if($_ =~ /^\/dev\/shm/)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; print $outfile &quot;ifdef(&amp;#96;distro_debian', &amp;#96;\n&quot;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; $newline = $_;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; $newline =~ s/^\/dev/\/run/;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; print $outfile $newline;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; print $outfile &quot;/var&quot; . $newline;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; print $outfile &quot;')\n&quot;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; }&lt;br /&gt;
&amp;nbsp; close($infile);&lt;br /&gt;
&amp;nbsp; close($outfile);&lt;br /&gt;
&amp;nbsp; rename $filename . &quot;.new&quot;, $filename or die &quot;Can't rename &quot; . $filename . &quot;.new to &quot; . $filename;&lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt;The next policy thing that I have to work on is systemd. From a quick test it seems that systemd policy changes will be more invasive than is suitable for Squeeze. This means that someone who wants to upgrade from Squeeze to Wheezy+systemd will have to upgrade to Wheeze policy before installing systemd. I think that I will make 0.2.20100524-10 the last version in Unstable based on the 2010 release, I will now start work on packaging the latest upstream policy for Unstable.&lt;/p&gt;
&lt;p&gt;PS I&amp;#8217;m not much of a PERL programmer, so if anyone has suggestions for how to improve the above PERL code then please let me know. Please note however that I&amp;#8217;m not interested in making my code look like line-noise.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;[1]&lt;a href=&quot;http://etbe.coker.com.au/2011/07/22/run-se-linux-policy/&quot;&gt; http://etbe.coker.com.au/2011/07/22/run-se-linux-policy/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Related posts:&lt;/p&gt;&lt;ol&gt;
&lt;li&gt;&lt;a href=&quot;http://etbe.coker.com.au/2007/03/15/se-linux-on/&quot; rel=&quot;bookmark&quot; title=&quot;SE Linux on /.&quot;&gt;SE Linux on /.&lt;/a&gt; &lt;small&gt;The book SE Linux by Example has been reviewed on...&lt;/small&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://etbe.coker.com.au/2011/07/22/run-se-linux-policy/&quot; rel=&quot;bookmark&quot; title=&quot;/run and SE Linux Policy&quot;&gt;/run and SE Linux Policy&lt;/a&gt; &lt;small&gt;Currently Debian/Unstable is going through a transition to using /run...&lt;/small&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://etbe.coker.com.au/2007/09/23/context-of-devxvc0/&quot; rel=&quot;bookmark&quot; title=&quot;Context of /dev/xvc0&quot;&gt;Context of /dev/xvc0&lt;/a&gt; &lt;small&gt;I have just converted a Fedora Core 5 server to...&lt;/small&gt;&lt;/li&gt;
&lt;/ol&gt;</content:encoded>
	<dc:date>2011-07-24T05:54:20+00:00</dc:date>
	<dc:creator>etbe</dc:creator>
</item>
<item rdf:about="http://etbe.coker.com.au/?p=2913">
	<title>Russell Coker (security): /run and SE Linux Policy</title>
	<link>http://etbe.coker.com.au/2011/07/22/run-se-linux-policy/</link>
	<content:encoded>&lt;p&gt;Currently Debian/Unstable is going through a transition to using /run instead of /var/run. Naturally any significant change to the filesystem layout requires matching changes to SE Linux policy. We currently have &lt;a href=&quot;http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=626720&quot;&gt;Debian bug #626720&lt;/a&gt; open about this. Currently the initscripts package breaks selinux-policy-default in Debian/Unstable so that you can&amp;#8217;t have initscripts using /run if the SE Linux policy doesn&amp;#8217;t support it.&lt;/p&gt;
&lt;p&gt;A patch has been suggested to the policy which uses a &lt;b&gt;subst&lt;/b&gt; file, basically that causes the SE Linux labeling programs to treat one directory tree the same way as another. The problem with this is that it depends on a libselinux patch that is not in any yet released version of libselinux (and certainly won&amp;#8217;t be in a Squeeze update). The upside of such a fix is that it would work for policy that I package as well as custom policy, so if someone wrote custom policy referring to /var/run it would automatically work with /run without any extra effort.&lt;/p&gt;
&lt;p&gt;I think that the only way to do this is to just have regular expressions that deal with this in the file contexts. It&amp;#8217;s a bit ugly and slows the relabel process down a little (probably no more than about 10%) but it will work &amp;#8211; and work on Squeeze as well. One thing I really like to do is to have the SE Linux policy for version X of Debian work with version X+1. This makes upgrades a lot easier for the users. Ideally upgrading a server could be a process that involves separate upgrades of the kernel, the SE Linux policy, and user-space in any particular order &amp;#8211; because upgrading everything at once almost guarantees that something will break and it may be difficult to determine the cause.&lt;/p&gt;
&lt;p&gt;At this time I&amp;#8217;m not sure whether I&amp;#8217;ll add a new policy using the subs file before the release of Wheezy (the next stable release of Debian) or just keep using regular expressions. I can have the Wheezy policy depend on a new enough libselinux so it won&amp;#8217;t be a problem in that regard (a new upstream version of libselinux with the subst feature should be released soon). In any case I need a back-port to Squeeze to use regular expressions to make an upgrade to Wheezy easier.&lt;/p&gt;
&lt;p&gt;for n in $(find . -name &quot;*.fc&quot;|xargs grep var/run|cut -f1 -d:|uniq) ; do&lt;br /&gt;
&amp;nbsp; sed -e &quot;s/\/var\/run/\/(var\/)?run/&quot; &amp;lt; $n &amp;gt; $n.new&lt;br /&gt;
&amp;nbsp; mv $n.new $n&lt;br /&gt;
done&lt;br /&gt;
for n in $(find . -name &quot;*.fc&quot;|xargs grep var/lock|cut -f1 -d:|uniq) ; do&lt;br /&gt;
&amp;nbsp; sed -e &quot;s/\/var\/lock/\/((var\/run)|(run)|(var))\/lock/&quot; &amp;lt; $n &amp;gt; $n.new&lt;br /&gt;
&amp;nbsp; mv $n.new $n&lt;br /&gt;
done&lt;br /&gt;
for n in $(find . -name &quot;*.fc&quot;|xargs grep dev/shm|cut -f1 -d:|uniq) ; do&lt;br /&gt;
&amp;nbsp; sed -e &quot;s/\/dev\/shm/\/((var\/run)|(run)|(dev))\/shm/&quot; &amp;lt; $n &amp;gt; $n.new&lt;br /&gt;
&amp;nbsp; mv $n.new $n&lt;br /&gt;
done&lt;/p&gt;
&lt;p&gt;I used the above fragment of shell code to change &amp;#8220;/var/run&amp;#8221; to &amp;#8220;/(var/)?run&amp;#8221;, &amp;#8220;/var/lock&amp;#8221; to &amp;#8220;/((var/run)|(run)|(var))/lock&amp;#8221;, and change &amp;#8220;/dev/shm&amp;#8221; to &amp;#8220;/(var/run)|(run)|(dev))/shm&amp;#8221;. It involves a reasonable number of changes to policy (mostly for /var/run), but hopefully this will be acceptable to the release team for inclusion in the next Squeeze update as the changes are relatively simple and obvious and the size of the patch is due to it being generated code.&lt;/p&gt;
&lt;p&gt;There is one final complication, Squeeze currently has selinux-policy-default version 2:0.2.20100524-7+squeeze1, but initscripts in Unstable breaks versions &amp;lt;= 2:0.2.20100524-9. So I guess I could submit a proposed version 2:0.2.20100524-9+squeeze1 to the release team to fix this. I would really like to have the Squeeze policy work with initscripts from Unstable or Wheezy.&lt;/p&gt;
&lt;p&gt;Any suggestions for how to deal with this?&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Update:&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;I wrote the above before testing the code, and it turned out to not work. &lt;a href=&quot;http://etbe.coker.com.au/2011/07/24/se-linux-file-context-precedence/&quot;&gt;I&amp;#8217;ve written another post describing a better solution that I have now uploaded to Unstable&lt;/a&gt;. I still have to sort something out with an update for Squeeze.&lt;/p&gt;
&lt;p&gt;Related posts:&lt;/p&gt;&lt;ol&gt;
&lt;li&gt;&lt;a href=&quot;http://etbe.coker.com.au/2010/06/29/se-linux-policy-squeeze/&quot; rel=&quot;bookmark&quot; title=&quot;New SE Linux Policy for Squeeze&quot;&gt;New SE Linux Policy for Squeeze&lt;/a&gt; &lt;small&gt;I have just uploaded refpolicy version 0.2.20100524-1 to Unstable. This...&lt;/small&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://etbe.coker.com.au/2008/09/21/dkim-signing-and-selinux-policy/&quot; rel=&quot;bookmark&quot; title=&quot;An Update on DKIM Signing and SE Linux Policy&quot;&gt;An Update on DKIM Signing and SE Linux Policy&lt;/a&gt; &lt;small&gt;In my previous post about DKIM [1] I forgot to...&lt;/small&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://etbe.coker.com.au/2009/11/17/debian-ssh-se-linux/&quot; rel=&quot;bookmark&quot; title=&quot;Debian SSH and SE Linux&quot;&gt;Debian SSH and SE Linux&lt;/a&gt; &lt;small&gt;I have just filed Debian bug report #556644 against the...&lt;/small&gt;&lt;/li&gt;
&lt;/ol&gt;</content:encoded>
	<dc:date>2011-07-22T13:50:22+00:00</dc:date>
	<dc:creator>etbe</dc:creator>
</item>
<item rdf:about="http://danwalsh.livejournal.com/44763.html">
	<title>Dan Walsh: A new short video starring yours truly available to RHEL subscribers.</title>
	<link>http://danwalsh.livejournal.com/44763.html</link>
	<content:encoded>&lt;a href=&quot;https://access.redhat.com/knowledge/videos/new-features-selinux-red-hat-enterprise-linux-6&quot; rel=&quot;nofollow&quot;&gt;&lt;br /&gt;New SELinux Features in Red Hat Enterprise Linux 6&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The Red Hat Video Team did a great job in attempting to make this old guy look good.&amp;nbsp; :^)&lt;br /&gt;&lt;br /&gt;Check it out...&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;</content:encoded>
	<dc:date>2011-07-13T21:15:44+00:00</dc:date>
	<dc:creator>dwalsh@redhat.com</dc:creator>
</item>
<item rdf:about="http://danwalsh.livejournal.com/44398.html">
	<title>Dan Walsh: New Kiosk OS posted for Fedora 15</title>
	<link>http://danwalsh.livejournal.com/44398.html</link>
	<content:encoded>Thanks to Miroslav Grepl, he has put together a working Kiosk OS&amp;nbsp;for Fedora 15.&lt;br /&gt;&lt;br /&gt;http://people.fedoraproject.org/~dwalsh/SELinux/kiosk/&lt;br /&gt;                     &lt;div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt; &lt;pre&gt;&lt;a href=&quot;http://people.fedoraproject.org/%7Edwalsh/SELinux/kiosk/?C=N;O=D&quot; rel=&quot;nofollow&quot;&gt;Name&lt;/a&gt;                    &lt;a href=&quot;http://people.fedoraproject.org/%7Edwalsh/SELinux/kiosk/?C=M;O=A&quot; rel=&quot;nofollow&quot;&gt;Last modified&lt;/a&gt;      &lt;a href=&quot;http://people.fedoraproject.org/%7Edwalsh/SELinux/kiosk/?C=S;O=A&quot; rel=&quot;nofollow&quot;&gt;Size&lt;/a&gt;  
&lt;a href=&quot;http://people.fedoraproject.org/%7Edwalsh/SELinux/&quot; rel=&quot;nofollow&quot;&gt;Parent Directory&lt;/a&gt;                             -   
&lt;a href=&quot;http://people.fedoraproject.org/%7Edwalsh/SELinux/kiosk/kiosk.iso&quot; rel=&quot;nofollow&quot;&gt;kiosk.iso&lt;/a&gt;               12-Jul-2011 19:51  1.2G  
&lt;a href=&quot;http://people.fedoraproject.org/%7Edwalsh/SELinux/kiosk/kiosk.ks&quot; rel=&quot;nofollow&quot;&gt;kiosk.ks&lt;/a&gt;                12-Jul-2011 19:46   11K  
&lt;/pre&gt;&lt;/div&gt;As you can see the ISO is quite large since we added &lt;a href=&quot;http://www.libreoffice.org/&quot; rel=&quot;nofollow&quot;&gt;LibreOffice&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;The Kiosk OS was originally written for Fedora 13 and explained in my Blog &lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://danwalsh.livejournal.com/35761.html?thread=231345&quot;&gt;http://danwalsh.livejournal.com/35761.html?thread=231345&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;If you want to make this into a uninterruptable boot you should create the USB or DVD with the &lt;br /&gt;&lt;br /&gt;&lt;br /&gt; livecd-iso-to-disk&amp;nbsp; --totaltimeout 1 myiso /dev/sdb&lt;br /&gt;&lt;br /&gt;man livecd-iso-to-disk&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; --totaltimeout&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Adds a bootloader totaltimeout, which indicates how long to wait&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; before booting automatically.&amp;nbsp; This is used to force an automatic&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; boot.&amp;nbsp; This timeout cannot be canceled by the user.&amp;nbsp; Units are 1/10s.&lt;br /&gt;&lt;br /&gt;Meaning the livedvd or liveusb will boot automatically in .1 seconds and can not be stopped.&lt;br /&gt;&lt;br /&gt;</content:encoded>
	<dc:date>2011-07-12T20:24:55+00:00</dc:date>
	<dc:creator>dwalsh@redhat.com</dc:creator>
</item>
<item rdf:about="http://etbe.coker.com.au/?p=2904">
	<title>Russell Coker (security): Multiple Filesystems for Security</title>
	<link>http://etbe.coker.com.au/2011/07/08/multiple-filesystems-security/</link>
	<content:encoded>&lt;p&gt;There is always been an ongoing debate about how to assign disk space into multiple partitions. I think that nowadays the best thing to do is to assign about 10G for the root filesystem for every desktop and server system because 10G is a small fraction of the disk space available (even the smallest laptops seem to all have disks larger than 100G nowadays). Even if 10G turns out not to be enough using separate filesystems for /var or /usr provides little benefit now that it&amp;#8217;s easy to resize the root filesystem with LVM &amp;#8211; and &lt;a href=&quot;http://www.freedesktop.org/wiki/Software/systemd/separate-usr-is-broken&quot;&gt;a separate /usr is known to be broken [1]&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;In a discussion on a private mailing list there was a suggestion that multiple filesystems should be used for security.&lt;/p&gt;
&lt;h3&gt;DoS Attacks&lt;/h3&gt;
&lt;p&gt;There are some minor security benefits in having multiple filesystems. If a critical program will fail when there is no free disk space then allowing an unprivileged process to use up all the space on that filesystem is a minor security issue, so having unprivileged processes not being permitted to write to important filesystems is a benefit. But most failures of this type are merely DoS attacks which usually aren&amp;#8217;t a big deal &amp;#8211; if you can control a local process there are usually lots of other ways of DoSing a system.&lt;/p&gt;
&lt;h3&gt;Links&lt;/h3&gt;
&lt;p&gt;Links have been the cause of many security issues in Unix over the years. Using different filesystems for different tasks can prevent the use of hard links in attacks aimed at exploiting race conditions. But even if you prevent hard links there are similar issues with symbolic links. SE Linux is one of many security improvements for Linux which allow restrictions on the creation of hard links. SE Linux also allows restricting the ability of processes to follow symbolic links, so a privileged process can be denied access to follow a sym-link that was created by an unprivileged process.&lt;/p&gt;
&lt;h3&gt;NFS&lt;/h3&gt;
&lt;p&gt;The &lt;b&gt;subtree_check&lt;/b&gt; option in &lt;b&gt;/etc/exports&lt;/b&gt; causes the NFS server to verify that file access is in the correct subtree. So if you export only one subdirectory of a filesystem to a given server then hostile code on that server (or on a network device which impersonates that server) can&amp;#8217;t access other subdirectories. This option is documented as having performance implications and working best for filesystems that are mostly read-only, for this reason it&amp;#8217;s turned off by default in recent versions of the NFS utilities.&lt;/p&gt;
&lt;p&gt;So if you want to NFS export /home then it&amp;#8217;s probably a good idea to have /home be on a separate filesystem to prevent attacks on the root filesystem. But of the systems with significant use of /home (IE anything other than accounts used solely for &amp;#8220;&lt;b&gt;su -&lt;/b&gt;&amp;#8220;) most of them have a separate filesystem for /home anyway so this shouldn&amp;#8217;t be an issue.&lt;/p&gt;
&lt;h3&gt;SE Linux&lt;/h3&gt;
&lt;p&gt;When mounting filesystems with SE Linux there is a &amp;#8220;&lt;b&gt;context=&lt;/b&gt;&amp;#8221; mount option that allows specifying the context for all files on the filesystem. This can save a small amount of storage space for XATTRs and theoretically improve performance (although the difference is unlikely to show up on benchmarks for anything other than fsck). Generally the context mount option is only used for a filesystem that has a huge number of files with the same context, such as a mail spool that uses Maildir, Cyrus, or any of the other formats that involve one file per message. But again such data is generally stored on a separate filesystem for other reasons anyway.&lt;/p&gt;
&lt;p&gt;I found one interesting corner case in regard to SE Linux systems mounting files from an NFS server. When an NFS server exports multiple subdirectories of a filesystem mounted on /foo then if one NFS client running SE Linux is to mount two subdirectories of /foo with different contexts then the second mount attempt will give the error &amp;#8220;an incorrect mount option was specified&amp;#8221;. This is because as of kernel 2.6.18 by default it&amp;#8217;s not permitted to mount parts of the same filesystem with different mount options. The option &amp;#8220;&lt;b&gt;nosharecache&lt;/b&gt;&amp;#8221; allows you to use different mount options, but does apparently permit some undesirable behavior in the case of hard links that cross between the subtrees. Thanks to Eric Paris for the tip about nosharecache.&lt;/p&gt;
&lt;p&gt;The best example I can think of for which you might want context mount options that differ among files that are used for the same purpose on an NFS mount is a web server which has data files and CGI-BIN scripts. So it seems that a SE Linux web server that mounts it&amp;#8217;s data over NFS and is at risk of having hard links between the CGI-BIN directory and the data directory is a corner case in which multiple filesystems is required for security. This seems to be a very unlikely case.&lt;/p&gt;
&lt;h3&gt;Conclusion&lt;/h3&gt;
&lt;p&gt;Servers that are deployed in the real world are complex enough that there are always systems with some unusual corner cases demanding configuration choices that aren&amp;#8217;t expected. There are some real corner cases for SE Linux where multiple filesystems are compelled for security or for a combination of security and best performance.&lt;/p&gt;
&lt;p&gt;But I wouldn&amp;#8217;t make a generic recommendation of using lots of filesystems for security. I think that the people who encounter the strange corner cases can usually work out that they need to do something different. So a small number of filesystems seems like a good general aim that doesn&amp;#8217;t conflict with security.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;[1]&lt;a href=&quot;http://www.freedesktop.org/wiki/Software/systemd/separate-usr-is-broken&quot;&gt; http://www.freedesktop.org/wiki/Software/systemd/separate-usr-is-broken&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content:encoded>
	<dc:date>2011-07-08T13:27:49+00:00</dc:date>
	<dc:creator>etbe</dc:creator>
</item>
<item rdf:about="http://danwalsh.livejournal.com/44090.html">
	<title>Dan Walsh: Fun with sVirt.</title>
	<link>http://danwalsh.livejournal.com/44090.html</link>
	<content:encoded>I have been in Washington DC for the last few days talking about SELinux and sVirt, Secure Virtualization.&amp;nbsp; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;sVirt is the combining of SELinux with kvm/qemu virtualization.&amp;nbsp; The libvirt daemon launches virtual guests in Red Hat operating systems.&amp;nbsp; Before an virtual machine&amp;nbsp; is started libvirt picks a random MCS&amp;nbsp;label with two categories, like s0:c1,c2 and then labels all of the virtual machines content as svirt_image_t:s0:c1,c2.&amp;nbsp; Then it executes qemu with the label svirt_t:c0:c1,c2.&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;br /&gt;One of the questions on sVirt I have been asked is how can I test out the sVirt policy, to make sure it works?&lt;br /&gt;&lt;br /&gt;I thought about it and I came up with an easy way that someone can play with it.&amp;nbsp; &lt;br /&gt;&lt;br /&gt;One of the major goals of a hacker is to get a root shell on the host, lets see what you can do with the root shell running as svirt_t.&lt;br /&gt;&lt;br /&gt;Note: the unconfined_t user type is allowed to transition to svirt_t in Fedora 14-16 and RHEL6 I&amp;nbsp;believe.&amp;nbsp; &lt;br /&gt;&lt;br /&gt;In order to test the svirt_t, we need a program to run, I&amp;nbsp;copied /bin/sh to /bin/svirt. &amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;# cp /bin/sh /bin/svirt&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;The policy requires that the entry point for svirt_t must be labeled qemu_exec_t.&lt;br /&gt;&lt;br /&gt;&lt;span&gt;# chcon -t qemu_exec_t /bin/svirt&lt;/span&gt;&lt;span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;Now I&amp;nbsp;use the runcon command to force a transition from unconfined_t to svirt and pick out an MCS&amp;nbsp;label s0:c1,c2 to run with the svirt shell.&lt;br /&gt;&lt;br /&gt;&lt;span&gt;# runcon -t svirt_t -l s0:c1,c2 /bin/svirt &lt;/span&gt;&lt;br /&gt;&lt;span&gt;svirt: /root/.bashrc: Permission denied&lt;/span&gt;&lt;br /&gt;&lt;span&gt;# id&lt;/span&gt;&lt;br /&gt;&lt;span&gt;svirt: child setpgid (6962 to 6962): Permission denied&lt;br /&gt;uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel) context=unconfined_u:unconfined_r:svirt_t:s0:c1,c2&lt;/span&gt;&lt;br /&gt;First the shell tried to read /root/.bashrc and was denied. because svirt_t is not allowed to read the admin_home_t label.&amp;nbsp; The shell attempts to setpgid for every command that is executed which SELinux denies svirt_t and prints an error to the screen. &amp;nbsp;I have removed these errors from the blog just for clarity.&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span&gt;# ping 4.2.2.2&lt;br /&gt;svirt: ping: command not found&lt;br /&gt;# cat /etc/shadow&lt;br /&gt;cat: /etc/shadow: Permission denied&lt;/span&gt;&lt;br /&gt;&lt;span&gt;# touch /tmp/svirt&lt;/span&gt;&lt;br /&gt;&lt;span&gt;# ls -lZ /tmp/svirt&lt;br /&gt;-rw-r--r--. root root unconfined_u:object_r:svirt_tmp_t:s0:c1,c2 /tmp/svirt&lt;/span&gt;&lt;br /&gt;&lt;span&gt;Note Notice the touch succeeded, allowing me to create a file in the /tmp directory labeled svirt_tmp_t:s0:c0,c2&lt;/span&gt;&lt;br /&gt;&lt;span&gt;# ^D&lt;br /&gt;&lt;/span&gt;&lt;strong&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;span&gt;Now I exit this shell and start another svirt shell with a slightly different MCS&amp;nbsp;label s0:c1,c3&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;# runcon -t svirt_t -l s0:c1,c3 /bin/svirt &lt;/span&gt;&lt;br /&gt;&lt;span&gt;svirt: /root/.bashrc: Permission denied&lt;br /&gt;# id&lt;br /&gt;uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel) context=unconfined_u:unconfined_r:svirt_t:s0:c1,c3&lt;br /&gt;# touch /tmp/svirt&lt;br /&gt;touch: cannot touch `/tmp/svirt': Permission denied&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;br /&gt;Note: This svirt shell is denied the ability to use the previously created /tmp/svirt file since this file has a label s0:c1,c2 but this svirt shell is running as s0:c1,c3. This would simulate one svirt guest process attacking another svirt_t process.&lt;br /&gt;&lt;br /&gt;Have fun with this and see what svirt can do.&amp;nbsp; If you find what you believe to be a vulnerability please report it in bugzilla.&amp;nbsp; If you build a test script with this, we would love to use it.&lt;br /&gt; &lt;/span&gt;&lt;br /&gt;You will fill your /var/log/audit/audit.log file with audit messages and setroubleshoot will not be happy, but it is pretty good test.</content:encoded>
	<dc:date>2011-07-07T22:14:35+00:00</dc:date>
	<dc:creator>dwalsh@redhat.com</dc:creator>
</item>
<item rdf:about="http://danwalsh.livejournal.com/43816.html">
	<title>Dan Walsh: Follow up to #7 Does an SELinux Audit Log message always mean something was blocked?</title>
	<link>http://danwalsh.livejournal.com/43816.html</link>
	<content:encoded>In my previous blog&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://danwalsh.livejournal.com/43730.html&quot;&gt;10 things you probably did not know about SELinux.. #7&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I stated that one of the times you can get a syscall to succeed even though AVC's were generated was:&lt;br /&gt;&lt;br /&gt;3. An AVC was generated but the syscall still succeeded by going down a  different code path within the kernel.  This is not that common.&lt;br /&gt;&lt;br /&gt;Eric Paris pointed out to me in an email and example of this:&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;span&gt;(People have a) &amp;quot; fundemental misconception is the belief that there is a 1-1 mapping between a syscall and an selinux permissions check.  SELinux is NOT a syscall filter.  We check the security state between objects (aka between a task and a file, or a task and a socket, or a task and task) and the result of that check may or may not cause the intended purpose of the request syscall which triggered this check to fail.&lt;br /&gt;&lt;br /&gt;A great example of a syscall which is likely to generate AVCs but still give success=yes is execve().  On execve SELinux will check the permissions between the new task and any file descriptors passed from the parent to the child.  Notice the check is not about the syscall, execve(), but between the new task and the file descriptors.  If the new task is not allowed to access one of the passed file descriptors we will generate an AVC, and will close the fd and open /dev/null in it's place.  This is an example of an alternate code path.  The syscall is still going to succeed since we will have resolved the security violation that caused the AVC.  It's not common, but other such places exist in the kernel, place where we are able to resolve the security issue by doing some other operation and thus the syscall does not need to fail.&amp;quot;&lt;/span&gt;&lt;/em&gt;</content:encoded>
	<dc:date>2011-06-28T11:43:39+00:00</dc:date>
	<dc:creator>dwalsh@redhat.com</dc:creator>
</item>
<item rdf:about="http://danwalsh.livejournal.com/43730.html">
	<title>Dan Walsh: 10 things you probably did not know about SELinux.. #7</title>
	<link>http://danwalsh.livejournal.com/43730.html</link>
	<content:encoded>&lt;span&gt;&lt;strong&gt;#7 Does an SELinux Audit Log message always mean something was blocked?&amp;nbsp; &lt;/strong&gt;&lt;span&gt;&lt;strong&gt;NO&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;First off lets get rid of a misconception.&amp;nbsp; An SELinux AVC&amp;nbsp;message consist of a single message in the audit log.&amp;nbsp; &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;This is false.&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;SELinux messages in the Audit log usually consist of more then one record, and they don't even need to contain an AVC&amp;nbsp;record.&lt;br /&gt;&lt;br /&gt;SELinux is all about preventing syscalls, so if something gets denied you will usually see an SELinux message describing the AVC, as well as the SYSCALL.&amp;nbsp; If you have full auditing turned on, or the kernel has gathered path information, you could also get a PATH record as part of the overall audit record.&lt;br /&gt;&lt;br /&gt;The way to view all the records within an AVC&amp;nbsp;message is to use the&lt;em&gt; ausearch -m avc&lt;/em&gt; command.&lt;br /&gt;&lt;br /&gt;If you look at the SYSCALL&amp;nbsp;record you will see a Name/Value pair with the name &amp;quot;&lt;em&gt;success&lt;/em&gt;&amp;quot;.&amp;nbsp; This field indicates whether they SYSCALL&amp;nbsp;record actually succeeded or failed. &amp;quot;&lt;em&gt;success=yes&lt;/em&gt;&amp;quot; indicates the syscall was successful.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I&amp;nbsp;can think of 4 different situations where a SELinux message is generated and the SYSCALL&amp;nbsp;record returns success=yes.&lt;br /&gt;&lt;ol&gt;&lt;li&gt;The system is in permissive, meaning AVC's are recorded but not enforced.&lt;/li&gt;&lt;p&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&amp;gt; getenforce&lt;br /&gt;Permissive&lt;/p&gt;&lt;li&gt;The process that caused the domain is a&lt;a href=&quot;http://danwalsh.livejournal.com/42394.html&quot;&gt; permissive domain&lt;/a&gt; (Latest Fedoras/RHEL6 only).&amp;nbsp; The AVC for this process type is not enforced.&amp;nbsp;&lt;/li&gt;&lt;p&gt;&amp;gt; seinfo --permissive |grep SOURCETYPE&lt;/p&gt;&lt;li&gt;An AVC was generated but the syscall still succeeded by going down a different code path within the kernel.  This is not that common.&lt;/li&gt;&lt;li&gt;An auditallow record was added to the policy.  auditallow says to the kernel, generate an audit SYSCALL message any time this access is granted.  Currently we do this with load_policy and setting booleans, setenforce.&lt;/li&gt;&lt;/ol&gt;&lt;div&gt;&lt;span&gt;type=SYSCALL msg=audit(06/23/2011 13:33:58.044:280) : arch=x86_64 syscall=write &lt;span&gt;success=yes&lt;/span&gt; exit=1 a0=3 a1=7fff406c5ce0 a2=1 a3=0 items=0 ppid=4408 pid=4546 auid=dwalsh uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=pts0 ses=4 &lt;span&gt;comm=setenforce &lt;/span&gt;exe=/usr/sbin/setenforce subj=staff_u:sysadm_r:sysadm_t:s0-s0:c0.c1023 key=(null) type=MAC_STATUS msg=audit(06/23/2011 13:33:58.044:280) : &lt;span&gt;enforcing=1 old_enforcing=0 &lt;/span&gt;auid=dwalsh ses=4 &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;</content:encoded>
	<dc:date>2011-06-24T13:42:36+00:00</dc:date>
	<dc:creator>dwalsh@redhat.com</dc:creator>
</item>
<item rdf:about="tag:blogger.com,1999:blog-5240359826706545510.post-8319060620358119756">
	<title>Thomas Biege (Security): SUSE Manager Security Update</title>
	<link>http://thetoms-random-thoughts.blogspot.com/2011/06/suse-manager-security-update.html</link>
	<content:encoded>Last Friday we released a security update for SUSE Manager. It eliminates four vulnerabilities which I will describe in detail here:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;CSRF (CVE-2009-4139): This is the most dangerous issue fixed by this update. It was found during a penetration-test executed by me before we released the SUSE Manager. You may wonder why we released the fix after the &quot;gold master&quot; (GM) and why it has a CVE-ID from 2009. Red Hat was informed about this issue in 2009 already (by another person) and after some back and forth we decided to release it together with Red Hat and not earlier. But not only the release date was coordinated, we also coordinate fixing and testing.&lt;/li&gt;&lt;li&gt;The default SSL ciphersuite configuration that comes with our apache2 package (this also affects the SM proxy) was made up to support as much and as old client as possible. This results in a config that is insecure because it support &quot;export ciphers&quot;, SSLv2, short keys, etc. If you install this update before you configured your SM you will have a up-to-date and secure config. Use &lt;span&gt;sslscan&lt;/span&gt; to verify your setup. If it is still insecure go to &lt;span&gt;/etc/apache2/ssl-global.conf&lt;/span&gt; and change it to something like:&lt;blockquote&gt;ssl_protocols TLSv1&lt;/blockquote&gt;&lt;blockquote&gt;ssl_ciphers ALL:!aNULL:!eNULL:!SSLv2:!LOW:!EXP:!MD5:@STRENGTH&lt;/blockquote&gt;&lt;/li&gt;&lt;li&gt;Open Redirect (CVE-2011-1594): A hidden field named &quot;url_bounce&quot; allows HTTP redirects and therefore phishing attacks. Found during penetration-test, released after GM because it was too minor to hold release.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;XML remote denial of service (CVE-2011-1755): jabber2 server can be dos'ed (&quot;billion laughs attack&quot;), not found by us.&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;p&gt;&lt;!-- BlogCounter Code START --&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://www.blogcounter.de/&quot; id=&quot;bclink&quot; title=&quot;kostenloser Counter fuer Weblogs&quot;&gt;&lt;span id=&quot;bccount&quot;&gt;kostenloser Counter&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://www.blogcounter.de/&quot;&gt;&lt;img alt=&quot;Weblog counter&quot; src=&quot;http://track.blogcounter.de/log.php?id=thetom_blog&quot; /&gt;&lt;/a&gt; - &lt;/p&gt;&lt;!-- BlogCounter Code END --&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width=&quot;1&quot; height=&quot;1&quot; src=&quot;https://blogger.googleusercontent.com/tracker/5240359826706545510-8319060620358119756?l=thetoms-random-thoughts.blogspot.com&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;</content:encoded>
	<dc:date>2011-06-21T01:38:04+00:00</dc:date>
	<dc:creator>Thomas (noreply@blogger.com)</dc:creator>
</item>
<item rdf:about="http://danwalsh.livejournal.com/43264.html">
	<title>Dan Walsh: SELinux Policy RPM in Rawhide/F16 includes prebuilt policy file.</title>
	<link>http://danwalsh.livejournal.com/43264.html</link>
	<content:encoded>The selinux-policy-TYPE&amp;nbsp;packages has always rebuilt the policy in their post install.&amp;nbsp; We do this in order to merge any customizations to the policy that an administrator might have made.&amp;nbsp; The selinux policy rpm package also needs to rebuild the policy if any policies were installed by other rpms or&amp;nbsp; by the administrator.&lt;br /&gt;&lt;br /&gt;Over time as the size of policy has grown and gotten more complex, the installation procedure has required more memory and more time.&amp;nbsp; We have seen stats stating during installations, one of the biggest memory hogs was the selinux-policy-targeted package.&lt;br /&gt;&lt;br /&gt;Over the last couple of weeks,&amp;nbsp; I decided to re-examine the situation.&amp;nbsp;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;The selinux-policy-TYPE&amp;nbsp;packages will now ship with a pre-built policy package and will only rebuild the policy iff the existing policy has been customized. &amp;nbsp;&lt;br /&gt;&lt;br /&gt;The following test shows a 4 times speedup on installing the package 48 Seconds -&amp;gt; 12&amp;nbsp;Seconds.&amp;nbsp; And max Memory Usage from 38 M to 6 Meg.&lt;br /&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;Modified:&lt;br /&gt;# time -v rpm -Uhv /home/devel/dwalsh/sources/RPMS/noarch/selinux-policy-targeted-3.9.16-29.1.fc16.noarch.rpm --force&lt;br /&gt;Preparing...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ########################################### [100%]&lt;br /&gt;&amp;nbsp;&amp;nbsp; 1:selinux-policy-targeted########################################### [100%]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Command being timed: &amp;quot;rpm -Uhv /home/devel/dwalsh/sources/RPMS/noarch/selinux-policy-targeted-3.9.16-29.1.fc16.noarch.rpm --force&amp;quot;&lt;br /&gt;&amp;lt;snip&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Elapsed (wall clock) time (h:mm:ss or m:ss): 0:48.11&lt;br /&gt;&amp;lt;snip&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Maximum resident set size (kbytes): 377608&lt;br /&gt;&amp;lt;snip&amp;gt; &amp;nbsp; &lt;br /&gt;&lt;br /&gt;Unmodified:&lt;br /&gt;# time -v rpm -Uhv /home/devel/dwalsh/sources/RPMS/noarch/selinux-policy-targeted-3.9.16-29.1.fc16.noarch.rpm --force&lt;br /&gt;Preparing...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ########################################### [100%]&lt;br /&gt;&amp;nbsp;&amp;nbsp; 1:selinux-policy-targeted########################################### [100%]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Command being timed: &amp;quot;rpm -Uhv /home/devel/dwalsh/sources/RPMS/noarch/selinux-policy-targeted-3.9.16-29.1.fc16.noarch.rpm --force&amp;quot;&lt;br /&gt;&amp;lt;snip&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Elapsed (wall clock) time (h:mm:ss or m:ss): 0:12.32&lt;br /&gt;&amp;lt;snip&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Maximum resident set size (kbytes): 60112&lt;br /&gt;&amp;lt;snip&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;You will only see this improvement on a fresh install.&amp;nbsp; And should continue to see it on all updates, although updates can still do a partial relabel after install.&amp;nbsp; &lt;br /&gt;&lt;br /&gt;If you are doing an update and would like to see the improvement, you can do the following.&lt;br /&gt;&lt;span&gt;&lt;br /&gt;# setenforce 0&lt;br /&gt;# rm -rf /etc/selinux/targeted&lt;br /&gt;#&amp;nbsp;yum -y reinstall selinux-policy selinux-policy-targeted&lt;br /&gt;# restorecon -R -v /etc/selinux/targeted &lt;br /&gt;# setenforce 1&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Then you would be seen as a fresh install.&lt;br /&gt;&lt;br /&gt;Try it out.</content:encoded>
	<dc:date>2011-06-16T17:27:16+00:00</dc:date>
	<dc:creator>dwalsh@redhat.com</dc:creator>
</item>
<item rdf:about="http://blog.namei.org/?p=497">
	<title>James Morris: Linux Security Summit 2011 – Schedule Published</title>
	<link>http://blog.namei.org/2011/06/16/linux-security-summit-2011-schedule-published/</link>
	<content:encoded>&lt;p&gt;For those that didn&amp;#8217;t catch the &lt;a href=&quot;http://lkml.indiana.edu/hypermail//linux/kernel/1106.1/03206.html&quot;&gt;email announcement&lt;/a&gt;, the schedule for the &lt;a href=&quot;https://security.wiki.kernel.org/index.php/LinuxSecuritySummit2011&quot;&gt;2011 Linux Security Summit&lt;/a&gt; is now &lt;a href=&quot;https://security.wiki.kernel.org/index.php/LinuxSecuritySummit2011/Schedule&quot;&gt;published&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The format of the conference is refereed talk sessions, followed by in-depth roundtable discussions.&lt;/p&gt;
&lt;p&gt;Here&amp;#8217;s a summary of the programme:&lt;/p&gt;
&lt;p&gt;Refereed talks:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&amp;#8220;Smack is Alive and Well&amp;#8221;&lt;br /&gt;
Casey Schaufler&lt;/li&gt;
&lt;p&gt;&lt;/p&gt;
&lt;li&gt;&amp;#8220;MeeGo Security Update&amp;#8221;&lt;br /&gt;
Ryan Ware, Intel&lt;/li&gt;
&lt;p&gt;&lt;/p&gt;
&lt;li&gt;&amp;#8220;An Overview of the Linux Integrity Subsystem: Use Cases and Demonstration&amp;#8221;&lt;br /&gt;
David Safford and Mimi Zohar, IBM&lt;/li&gt;
&lt;p&gt;&lt;/p&gt;
&lt;li&gt;&amp;#8220;Digital Signature support for IMA/EVM&amp;#8221;&lt;br /&gt;
Dmitry Kasatkin and Ryan Ware, Intel&lt;/li&gt;
&lt;p&gt;&lt;/p&gt;
&lt;li&gt;&amp;#8220;Protecting the Filesystem Integrity of a Fedora 15 Virtual Machine from Offline Attacks using IMA/EVM&amp;#8221;&lt;br /&gt;
Peter Kruus, The Johns Hopkins University Applied Physics Laboratory&lt;/li&gt;
&lt;p&gt;&lt;/p&gt;
&lt;li&gt;&amp;#8220;Efficient, TPM-free system integrity checking with device mapper: dm-verity&amp;#8221;&lt;br /&gt;
Will Drewry and Mandeep Baines, Google&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Roundtable discussions:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Kernel Hardening&lt;br /&gt;
Lead by Kees Cook, Canonical and Will Drewry, Google&lt;/li&gt;
&lt;p&gt;&lt;/p&gt;
&lt;li&gt;LSM Architecture&lt;br /&gt;
Lead by Kees Cook, Canonical and Casey Schaufler&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;See the &lt;a href=&quot;https://security.wiki.kernel.org/index.php/LinuxSecuritySummit2011/Schedule&quot;&gt;full schedule&lt;/a&gt; for more detail.&lt;/p&gt;
&lt;p&gt;Attendance is open to all registered attendees of the &lt;a href=&quot;http://www.linuxplumbersconf.org/2011/&quot;&gt;Linux Plumbers Conference&lt;/a&gt;.  Early-bird registration is available for LPC until the end of today (US time).&lt;/p&gt;</content:encoded>
	<dc:date>2011-06-15T15:33:02+00:00</dc:date>
	<dc:creator>jamesm</dc:creator>
</item>
<item rdf:about="http://danwalsh.livejournal.com/43170.html">
	<title>Dan Walsh: 10 things you probably did not know about SELinux.. #6</title>
	<link>http://danwalsh.livejournal.com/43170.html</link>
	<content:encoded>&lt;span&gt;&lt;strong&gt;#6 How did those SELinux labels get there?&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;SELinux labels are placed on disk during the installation by a combination of Anaconda and rpm.&amp;nbsp; Anaconda actually includes the latest /etc/selinux/targeted/files/file_context and /etc/selinux/targeted/policy/policy.26 in its initrd.&amp;nbsp; When anaconda starts rpm, rpm reads this file and proceeds to place the labels on disk.&amp;nbsp; RPM has SELinux awareness built into it and asks the kernel to place the default label on the disk for every object that it creates from its payload.&amp;nbsp; If an rpm post install script runs during the install, the labels are created using the standard process labelling described below.&amp;nbsp;&amp;nbsp; Any file system objects created by Anaconda&amp;nbsp; before loading the policy into the kernel will be relabelled by Anaconda using restorecon.&lt;br /&gt;&lt;br /&gt;Any file system objects created by the post install scripts, or during boot, or by any process from then moving forward will create the file via one of the following three rules.&lt;ul&gt;&lt;li&gt;The object will get the label of the parent directory.&lt;ul&gt;&lt;li&gt;Files/Directories created in /etc, which is labelled etc_t, will get labelled etc_t by default.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;File transition rules can be written into policy.&amp;nbsp; File transition rules take into account the label of the process creating the file as well as the parent directory.&amp;nbsp; For example I can write a rule that says if NetworkManager_t creates a file in a directory labelled etc_t then this file will be labelled net_conf_t&lt;ul&gt;&lt;li&gt;&amp;nbsp;filetrans_pattern(NetworkManager_t, etc_t, net_conf_t, file)&lt;/li&gt;&lt;li&gt;When NetworkManager creates the /etc/resolv.conf file it gets labelled net_conf_f rather then etc_t.&lt;/li&gt;&lt;li&gt;Since you can only have one combination of ProcessLabel/DirectoryLabel/ObjectClass, you can not currently write a rule for a process to create two different labels within the same directory.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;The last way is to build SELinux awareness within an application.&amp;nbsp; &lt;ul&gt;&lt;li&gt;Applications can be programmed to ask the kernel to create a file system object with a particular label.&lt;ul&gt;&lt;li&gt;rpm, udev, passwd are examples of applications that request the kernel to label the object at creation time.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Applications can attempt to change a label from one label to another.&lt;ul&gt;&lt;li&gt;restorecon, udev, restorecond, chcon are examples of applications that modify labels.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;In Fedora 16 we are introducing a new concept which we are calling File Name Transitions.&amp;nbsp;&amp;nbsp; These will allow policy writers to take into account the actual file name (Not path) at file creation time,&amp;nbsp; giving us the ability to clear up some common bugs users have seen with SELinux.&lt;br /&gt;&lt;br /&gt;Read about it here and if you are running Fedora 16/Rawhide try it out...&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://fedoraproject.org/wiki/Features/SELinuxFileNameTransition&quot; rel=&quot;nofollow&quot;&gt;https://fedoraproject.org/wiki/Features/SELinuxFileNameTransition&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;</content:encoded>
	<dc:date>2011-06-10T18:52:19+00:00</dc:date>
	<dc:creator>dwalsh@redhat.com</dc:creator>
</item>
<item rdf:about="tag:blogger.com,1999:blog-5240359826706545510.post-5713951199572545408">
	<title>Thomas Biege (Security): SAD 4: Security Day</title>
	<link>http://thetoms-random-thoughts.blogspot.com/2011/05/sad-4-security-day.html</link>
	<content:encoded>Three weeks ago the SUSE Studio team had its first &quot;Security Day&quot; to fix the possible security vulnerabilities found by &lt;a href=&quot;https://gitorious.org/code-scanner/ror-sec-scanner&quot;&gt;ror-sec-scanner&lt;/a&gt;. (a Rails static code analyzer)&lt;br /&gt;The team eliminated:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;161 false positives&lt;br /&gt;&lt;/li&gt;&lt;li&gt;28 real bugs&lt;/li&gt;&lt;/ul&gt;Thank you folks! :-)&lt;br /&gt;&lt;br /&gt;Note:  Earlier this year another team consolidated its forces to fix potential  security problems in their code and reduced the number of bugs per KLOC  to 0.&lt;br /&gt;&lt;br /&gt;I hope we can have a &quot;Security Day&quot; prior every new release.&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;a href=&quot;http://www.blogcounter.de/&quot; id=&quot;bclink&quot; title=&quot;kostenloser Counter fuer Weblogs&quot;&gt;&lt;span id=&quot;bccount&quot;&gt;kostenloser Counter&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://www.blogcounter.de/&quot;&gt;&lt;img alt=&quot;Weblog counter&quot; src=&quot;http://track.blogcounter.de/log.php?id=thetom_blog&quot; /&gt;&lt;/a&gt; - &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;!-- BlogCounter Code END --&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width=&quot;1&quot; height=&quot;1&quot; src=&quot;https://blogger.googleusercontent.com/tracker/5240359826706545510-5713951199572545408?l=thetoms-random-thoughts.blogspot.com&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;</content:encoded>
	<dc:date>2011-05-24T12:14:00+00:00</dc:date>
	<dc:creator>Thomas (noreply@blogger.com)</dc:creator>
</item>
<item rdf:about="http://blog.namei.org/?p=493">
	<title>James Morris: Linux Security Summit 2011 – CFP closes in one week.</title>
	<link>http://blog.namei.org/2011/05/21/linux-security-summit-2011-cfp-closes-in-one-week/</link>
	<content:encoded>&lt;p&gt;We&amp;#8217;ve had a couple of queries about what to submit for the &lt;a href=&quot;https://security.wiki.kernel.org/index.php/LinuxSecuritySummit2011&quot;&gt;Linux Security Summit&lt;/a&gt; CFP.&lt;/p&gt;
&lt;p&gt;Proposals should be plain text abstracts up to 150 words in length, and emailed to the program committee:  lss-pc (_at_) ext.namei.org&lt;/p&gt;
&lt;p&gt;Also see the &lt;a href=&quot;https://security.wiki.kernel.org/index.php/LinuxSecuritySummit2011#CFP_Details&quot;&gt;CFP&lt;/a&gt; section on the wiki.&lt;/p&gt;</content:encoded>
	<dc:date>2011-05-20T22:48:01+00:00</dc:date>
	<dc:creator>jamesm</dc:creator>
</item>
<item rdf:about="http://d.hatena.ne.jp/kaigai/20110515/1305466803">
	<title>KaiGai Kohei: [OSS/Linux] Leaky VIEW まとめ</title>
	<link>http://d.hatena.ne.jp/kaigai/20110515/1305466803</link>
	<content:encoded>&lt;div class=&quot;section&quot;&gt;
&lt;p&gt;SELinuxとは関係のない、RDBMSでのセキュリティのお話。&lt;/p&gt;
&lt;p&gt;利用者に対して、テーブルに対する直接のアクセス権を与えず、特定のビューを通してだけアクセスを許可するのは、行レベルのアクセス制御でよく使われるテクニックである。&lt;/p&gt;
&lt;p&gt;つまり、ビューは不可視であるタプルをフィルタリングする役割を持つ。&lt;/p&gt;
&lt;p&gt;しかし、これで万全かというと、そうではない。&lt;/p&gt;
&lt;p&gt;クエリ最適化を上手く利用することで、利用者が見えないはずのタプルを参照する事は可能である。&lt;/p&gt;
&lt;p&gt;以下の例を見て頂きたい。&lt;/p&gt;
&lt;pre&gt;
postgres=# CREATE TABLE T1 (id int, name text);
CREATE TABLE
postgres=# CREATE TABLE T2 (id int, cred text);
CREATE TABLE
postgres=# INSERT INTO t1 VALUES (1, 'coke'), (2, 'soda'),
                                 (3, 'juice'), (4, 'fanta');
INSERT 0 4
postgres=# INSERT INTO t2 VALUES (1, 'public'), (2, 'hidden'),
                                 (3, 'hidden'), (4, 'public');
INSERT 0 4
postgres=# CREATE VIEW v1 AS SELECT &amp;#42; FROM t1 NATURAL JOIN t2
                                      WHERE t2.cred = 'public';
CREATE VIEW
postgres=# SELECT &amp;#42; FROM v1;
 id | name  |  cred
----+-------+--------
  1 | coke  | public
  4 | fanta | public
(2 rows)

postgres=# GRANT SELECT ON v1 TO alice;
GRANT
&lt;/pre&gt;

&lt;p&gt;ビュー v1 は、テーブル t1 と t2 を JOINし、ここでは t2.cred = 'public' が行レベルのセキュリティポリシー、すなわち、フィルタリング対象の行を定めるものとする。&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;ユーザ alice は t1 と t2 へのアクセス権を持っていないため、ビュー v1 を通してしか、これらの情報にアクセスできないはずである。&lt;/p&gt;
&lt;p&gt;だがしかし、以下のクエリの実行結果を見てもらいたい。&lt;/p&gt;
&lt;pre&gt;
postgres=&amp;#62; SELECT getpgusername();
 getpgusername
---------------
 alice
(1 row)

postgres=&amp;#62; SELECT &amp;#42; FROM t1;
ERROR:  permission denied for relation t1
postgres=&amp;#62; SELECT &amp;#42; FROM t2;
ERROR:  permission denied for relation t2
postgres=&amp;#62; SELECT &amp;#42; FROM v1;
 id | name  |  cred
----+-------+--------
  1 | coke  | public
  4 | fanta | public
(2 rows)
&lt;/pre&gt;

&lt;p&gt;上記の結果は想定通りだろう。&lt;/p&gt;
&lt;p&gt;では、続いて、WHERE句にユーザ定義関数を付加する。&lt;/p&gt;
&lt;p&gt;この関数は、常に true を返すが、引数を利用者のコンソールに出力する。&lt;/p&gt;
&lt;pre&gt;
postgres=&amp;#62; CREATE OR REPLACE FUNCTION f_leak(text)
               RETURNS bool LANGUAGE 'plpgsql'
               AS 'BEGIN
                       raise notice ''f_lead: (%)'', $1;
                       RETURN true;
                   END';
CREATE FUNCTION
postgres=&amp;#62; SELECT * FROM v1 WHERE f_leak(name);
&lt;span class=&quot;deco&quot;&gt;NOTICE:  f_lead: (coke)
NOTICE:  f_lead: (soda)
NOTICE:  f_lead: (juice)
NOTICE:  f_lead: (fanta)
&lt;/span&gt; id | name  |  cred
----+-------+--------
  1 | coke  | public
  4 | fanta | public
(2 rows)
&lt;/pre&gt;
&lt;p&gt;結果セットは２行だが、利用者コンソールには見えてはならないはずのタプルの内容が出力されている。&lt;/p&gt;
&lt;p&gt;その理由はEXPLAIN分の出力を見ると明らかである。&lt;/p&gt;
&lt;pre&gt;
postgres=&amp;#62; EXPLAIN SELECT * FROM v1 WHERE f_leak(name);
                           QUERY PLAN
----------------------------------------------------------------
 Hash Join  (cost=25.45..356.91 rows=12 width=68)
   Hash Cond: (t1.id = t2.id)
   -&amp;#62;  Seq Scan on t1  (cost=0.00..329.80 rows=410 width=36)
         Filter: &lt;span class=&quot;deco&quot;&gt;f_leak(name)&lt;/span&gt;
   -&amp;#62;  Hash  (cost=25.38..25.38 rows=6 width=36)
         -&amp;#62;  Seq Scan on t2  (cost=0.00..25.38 rows=6 width=36)
               Filter: (cred = 'public'::text)
(7 rows)
&lt;/pre&gt;
&lt;p&gt;f_leak()関数を探してみると、Join-Loopの内側で t1 テーブルを読み出す際のフィルタリング条件として実行されている事がわかる。&lt;/p&gt;
&lt;p&gt;これは、f_leak()の引数が t1 由来のデータだけを参照しているため、Joinすべき行数を減らすために、本来実行されるべき位置（t1.id = t2.id を評価した後）からオプティマイザによって移動させられた事による。&lt;/p&gt;
&lt;p&gt;とは言え、この手の最適化を行わなければビューを介したアクセスは極端に性能が悪くなるはずなので、問題は PostgreSQL に限った話ではないと思われる。&lt;/p&gt;
&lt;p&gt;例えば、100万件のタプルを持つテーブルでID列にインデックスが張られており、処理コストの比較的高い f_policy() 関数によってフィルタリングを行うビューを介してアクセスするとする。その場合、ビューの外から ID = 1234 という条件が来た場合に常に全件スキャンが走るようなら、泣ける。&lt;/p&gt;
&lt;p&gt;手元にOracleの環境がある友人に試してもらったところ、同様に、見えないはずのタプルの内容を出力できるそうな。&lt;/p&gt;&lt;p&gt;なお、PostgreSQLには、セキュリティポリシーの適用されている t2 の内容を見る方法もある。&lt;span class=&quot;footnote&quot;&gt;&lt;a href=&quot;http://d.hatena.ne.jp/kaigai/#f1&quot; name=&quot;fn1&quot; title=&quot;PostgreSQL固有というのは、他のRDBMSでユーザ定義関数のコストを指定する手段があるかどうか不明のため。&quot;&gt;*1&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;以下のような関数を定義する。ポイントは COST=0.0001 の部分。&lt;/p&gt;
&lt;pre&gt;
postgres=&amp;#62; CREATE OR REPLACE FUNCTION f_leak(text)
               RETURNS bool LANGUAGE 'plpgsql'
               &lt;span class=&quot;deco&quot;&gt;COST 0.0001&lt;/span&gt;
               AS 'BEGIN
                       raise notice ''f_lead: (%)'', $1;
                       RETURN true;
                   END';
CREATE FUNCTION
&lt;/pre&gt;
&lt;p&gt;今度は f_leak() 関数で t2 の情報を参照するようにすると、同様にフィルタリングされているはずの行の内容が出力される。&lt;/p&gt;
&lt;pre&gt;
postgres=&amp;#62; SELECT * FROM v1 WHERE f_leak(cred);
NOTICE:  f_lead: (public)
NOTICE:  f_lead: (hidden)
NOTICE:  f_lead: (hidden)
NOTICE:  f_lead: (public)
 id | name  |  cred
----+-------+--------
  1 | coke  | public
  4 | fanta | public
(2 rows)
&lt;/pre&gt;
&lt;p&gt;EXPLAIN文の結果&lt;/p&gt;
&lt;pre&gt;
postgres=&amp;#62; EXPLAIN SELECT * FROM v1 WHERE f_leak(cred);
                            QUERY PLAN
------------------------------------------------------------------
 Hash Join  (cost=25.40..52.43 rows=12 width=68)
   Hash Cond: (t1.id = t2.id)
   -&amp;#62;  Seq Scan on t1  (cost=0.00..22.30 rows=1230 width=36)
   -&amp;#62;  Hash  (cost=25.38..25.38 rows=2 width=36)
         -&amp;#62;  Seq Scan on t2  (cost=0.00..25.38 rows=2 width=36)
               Filter: (&lt;span class=&quot;deco&quot;&gt;f_leak(cred)&lt;/span&gt; AND (cred = 'public'::text))
(6 rows)
&lt;/pre&gt;
&lt;p&gt;今度は、f_leak()がt2のScan-Loopに結合されているが、注目すべきはその順序。&lt;/p&gt;
&lt;p&gt;f_leak()のコスト値を低く設定したために、複数のフィルタリング条件がScan-Loopに結合している場合、f_leak()が cred = 'public' よりも優先されている。&lt;/p&gt;
&lt;p&gt;後者のシナリオは、何もJoinを伴わない場合でも実行可能である。&lt;/p&gt;
&lt;p&gt;この問題は、既に開発者の中では既知の問題で、利用者から特定のタプルを不可視にする目的でビューを使うべきでない事が明記されている。&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.postgresql.jp/document/current/html/rules-privileges.html&quot; target=&quot;_blank&quot;&gt;http://www.postgresql.jp/document/current/html/rules-privileges.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;5/18にオタワで開催される PostgreSQL Developer Meeting では、この問題を議論するつもりである。&lt;/p&gt;
&lt;p&gt;一応、解決策の腹案は持っているが、そこまで踏み込まないにしても、先ずはこの辺のシナリオが『解決すべき課題である』というコンセンサス形成あたりを目標としたい。&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;footnote&quot;&gt;
&lt;p class=&quot;footnote&quot;&gt;&lt;a href=&quot;http://d.hatena.ne.jp/kaigai/#fn1&quot; name=&quot;f1&quot;&gt;*1&lt;/a&gt;：PostgreSQL固有というのは、他のRDBMSでユーザ定義関数のコストを指定する手段があるかどうか不明のため。&lt;/p&gt;
&lt;/div&gt;</content:encoded>
	<dc:date>2011-05-15T13:40:03+00:00</dc:date>
	<dc:creator>kaigai</dc:creator>
</item>
<item rdf:about="http://blog.namei.org/?p=480">
	<title>James Morris: Linux Security Summit 2011 – CFP reminder: 2 weeks!</title>
	<link>http://blog.namei.org/2011/05/13/linux-security-summit-2011-cfp-reminder-2-weeks/</link>
	<content:encoded>&lt;p&gt;Calling all Linux security folk!&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;center&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Shadow_of_a_Doubt&quot;&gt;&lt;img src=&quot;http://farm3.static.flickr.com/2354/5714374657_cd273c1085.jpg&quot; alt=&quot;the CFP closes in two weeks...&quot; title=&quot;the CFP closes in two weeks...&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;/center&gt;
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
Just a reminder that the &lt;a href=&quot;https://security.wiki.kernel.org/index.php/LinuxSecuritySummit2011#CFP_Details&quot;&gt;CFP&lt;/a&gt; for the &lt;a href=&quot;https://security.wiki.kernel.org/index.php/LinuxSecuritySummit2011&quot;&gt;2011 Linux Security Summit&lt;/a&gt; closes on the &lt;strong&gt;27th of May&lt;/strong&gt; &amp;#8212; two weeks away.  Please get your submissions in soon.&lt;/p&gt;
&lt;p&gt;Note again that we are co-located with the &lt;a href=&quot;http://www.linuxplumbersconf.org/2011/&quot;&gt;Linux Plumbers Conference&lt;/a&gt; in Santa Rosa, and that all Security Summit attendees, including speakers, will need to register for Plumbers.  Earlybird registration is available until 31st May.&lt;/p&gt;
&lt;p&gt;Trivia question: which Alfred Hitchcock film was shot on location in Santa Rosa in 1943?&lt;/p&gt;
&lt;p&gt;&lt;small&gt;&lt;i&gt;(Hint: click on the image)&lt;/i&gt;&lt;/small&gt;&lt;/p&gt;</content:encoded>
	<dc:date>2011-05-13T02:29:13+00:00</dc:date>
	<dc:creator>jamesm</dc:creator>
</item>
<item rdf:about="tag:blogger.com,1999:blog-5240359826706545510.post-5263008056347626545">
	<title>Thomas Biege (Security): SAD 3: At the Beginning there was a Thought</title>
	<link>http://thetoms-random-thoughts.blogspot.com/2011/05/sad-3-at-beginning-there-was-thought.html</link>
	<content:encoded>Last night I stumbled over some old docs of the Security Review Board. More than 5 years ago T.G. puts much effort in enhancing the development processes to create more secure products. I never saw numbers about that project to compare pre and past states of the products. Unfortunately she left a few years later but AFAIK some of her work is still in use today.&lt;br /&gt;&lt;br /&gt;Today I browsed Google Docs and found a 2 year old presentation I wrote during a train journey from Nuremberg to my home town. I never want to show the slides to other people I just brainstormed about how we could integrate security into our products. Let me show you some slides here because they describe  where we were 2-3 years ago. As I said I forgot the slides but funnily various things from them are real now or are on my TODO list.&lt;br /&gt;&lt;br /&gt;&lt;span&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span&gt;Slide 1: Where we are.&lt;/span&gt;&lt;br /&gt;- We have four different sources of code&lt;br /&gt;-- 1.) Mainly FLOSS&lt;br /&gt;-- 2.) In-house development&lt;br /&gt;-- 3.) 3rd-party commercial free binary code (like RealPlayer, acroread, etc.)&lt;br /&gt;-- 4.) 3rd-party code developed by contractors&lt;br /&gt;- We review FLOSS code but there is too much and we have not much&lt;br /&gt;influence on the developers beside sending patches upstream&lt;br /&gt;- We have much influence on our own developers but we have to develop&lt;br /&gt;a better security awareness as well as technical knowledge&lt;br /&gt;- We have no influence on the 3rd-party free binary code and just need&lt;br /&gt;to trust it.&lt;br /&gt;- Code developed by contractors can be reviewed by us&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;Today source 1. is still the main source for code contributions, the in-house development (2.) increases a lot over the past years, we try to reduce (openSUSE is completely free of them, see the &lt;span&gt;NonFree&lt;/span&gt; repo) the number of binary-only packages (3.), I am not aware of current contributions from source 4.&lt;br /&gt;In the past we provided workshops for secure programming (C, C++, Shell, Perl, Ruby on Rails, Web-security in general).&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&lt;span&gt;Slide 2: Where others are.&lt;/span&gt;&lt;br /&gt;- Microsoft&lt;br /&gt;-- founder of the Secure Software development Life Cycle (SDL)&lt;br /&gt;-- Separate, specialized teams&lt;br /&gt;-- Own and optimized tools for stress-testing (fuzzing) as well as code analysis&lt;br /&gt;-- See BSIMM study [&lt;a href=&quot;http://www.informit.com/articles/article.aspx?p=1592389&quot;&gt;1&lt;/a&gt;], [&lt;a href=&quot;http://www.cert.org/podcast/show/20090331mcgraw.html&quot;&gt;2&lt;/a&gt;]&lt;br /&gt;- Cisco&lt;br /&gt;-- &lt;a href=&quot;http://blogs.cisco.com/security/the_cisco_secure_development_lifecycle_an_overview/&quot;&gt;CMSDL&lt;/a&gt;&lt;br /&gt;- Adobe&lt;br /&gt;-- See BSIMM study [&lt;a href=&quot;http://www.informit.com/articles/article.aspx?p=1592389&quot;&gt;1&lt;/a&gt;], [&lt;a href=&quot;http://www.cert.org/podcast/show/20090331mcgraw.html&quot;&gt;2&lt;/a&gt;]&lt;br /&gt;- Google&lt;br /&gt;-- specialists/teams working on research topics and develop tools as well as guidelines&lt;br /&gt;-- See BSIMM study [&lt;a href=&quot;http://www.informit.com/articles/article.aspx?p=1592389&quot;&gt;1&lt;/a&gt;], [&lt;a href=&quot;http://www.cert.org/podcast/show/20090331mcgraw.html&quot;&gt;2&lt;/a&gt;]&lt;br /&gt;- Red Hat&lt;br /&gt;-- Specialized teams/persons&lt;br /&gt;-- Much more people working on security&lt;br /&gt;-- Better contact to developers?&lt;br /&gt;-- Only re-active not pro-active AFAIK&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;Currently we are introducing secure SDLC techniques and testing tools for our in-house products. Teams are planned to grow.&lt;br /&gt;&lt;br /&gt;&lt;span&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span&gt;Slide 3: We need to catch up because...&lt;/span&gt;&lt;br /&gt;- Releasing patches for avoidable bugs is a big waste of money and time&lt;br /&gt;- Customers critically watch software vendor's product quality and security vulnerabilities&lt;br /&gt;- These observations play a big role in buying new products or continuing support contracts because installing patches costs the customer money (see study &quot;The Total Cost of Security Patch Management&quot;) and therefore increases the cost of the product.&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&lt;span&gt;Slide 4: What we can do now!&lt;/span&gt;&lt;br /&gt;- Increase awareness by:&lt;br /&gt;-- Showing consequences by providing examples of security problems in our code&lt;br /&gt;- Increase code quality by:&lt;br /&gt;-- Online teaching of security best practice rules for common programming languages like C, C++, C# and Java (see CERT's SDI)&lt;br /&gt;-- Adopt secure SDLC processes for our in-house development&lt;br /&gt;-- Provide a standard development environment that includes easy-to-use code analysis tools for our programmers&lt;br /&gt;-- Teach how to use this tools.&lt;br /&gt;-- Do more sophisticated code analysis&lt;/blockquote&gt;&lt;br /&gt;We are on the right track.&lt;br /&gt;&lt;br /&gt;&lt;span&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span&gt;Slide 5: What we need to do in the future.&lt;/span&gt;&lt;br /&gt;- Develop/acquire better tools for code analysis, fuzzing, etc.&lt;br /&gt;- Incrementally refine our coding standards&lt;br /&gt;- Have separate teams for handling bugs (response team), create new tools and keep track of current software security development (research team), a team for shepherding code development (mentor team) and a pen-testing team to verify in-house, FLOSS code&lt;br /&gt;- Being part of secure development initiatives/groups/workshops&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;Well different teams is a dream that will never become true, but we will try to reach our goals using another way.&lt;br /&gt;&lt;br /&gt;&lt;span&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span&gt;Slide 6: Where we should be.&lt;/span&gt;&lt;br /&gt;&lt;a href=&quot;http://1.bp.blogspot.com/-K13_Izrznso/TcBvGGrqjrI/AAAAAAAAAfY/_SXtks2NLFY/s1600/Secure_Development_at_Novell.jpg&quot;&gt;&lt;img src=&quot;http://1.bp.blogspot.com/-K13_Izrznso/TcBvGGrqjrI/AAAAAAAAAfY/_SXtks2NLFY/s320/Secure_Development_at_Novell.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5602600087112552114&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;p&gt;&lt;!-- BlogCounter Code START --&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://www.blogcounter.de/&quot; id=&quot;bclink&quot; title=&quot;kostenloser Counter fuer Weblogs&quot;&gt;&lt;span id=&quot;bccount&quot;&gt;kostenloser Counter&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://www.blogcounter.de/&quot;&gt;&lt;img alt=&quot;Weblog counter&quot; src=&quot;http://track.blogcounter.de/log.php?id=thetom_blog&quot; /&gt;&lt;/a&gt; - &lt;/p&gt;&lt;!-- BlogCounter Code END --&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width=&quot;1&quot; height=&quot;1&quot; src=&quot;https://blogger.googleusercontent.com/tracker/5240359826706545510-5263008056347626545?l=thetoms-random-thoughts.blogspot.com&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;</content:encoded>
	<dc:date>2011-05-04T02:43:04+00:00</dc:date>
	<dc:creator>Thomas (noreply@blogger.com)</dc:creator>
</item>
<item rdf:about="http://etbe.coker.com.au/?p=2747">
	<title>Russell Coker (security): What is Valid SE Linux Policy?</title>
	<link>http://etbe.coker.com.au/2011/04/29/valid-se-linux-policy/</link>
	<content:encoded>&lt;p&gt;&lt;a href=&quot;http://oss.tresys.com/pipermail/refpolicy/2011-March/004115.html&quot;&gt;Guido Trentalancia started an interesting discussion on the SE Linux policy development list about how to manage the evolution of the policy [1]&lt;/a&gt;.&lt;/p&gt;
&lt;h3&gt;The Problem&lt;/h3&gt;
&lt;p&gt;The SE Linux policy is the set of rules that determine what access is granted. It assigns types to files and domains to processes and has a set of rules that specify all the permitted interactions between processes and files (among many other things). The policy evolves over time to match the requirements of programs (applications and daemons). As a program evolves the things that it does will change and the SE Linux policy will tend to evolve to permit the set of all operations that were requested by all versions because people only complain when things stop working not when excessive privilege is granted. So we need to periodically remove old allow rules from the policy.&lt;/p&gt;
&lt;p&gt;One difficulty in this regard is the fact that multiple versions of programs are often available for use at the same time. Debian in particular has a good history of providing separate packages for the old and new versions of programs such as Apache to meet the needs of users who want the tried and tested version and of users who want the newer version with better performance, more features, better documentation, or something else good. There is also a demand to have the same policy work with multiple versions of a distribution without excessive effort. Finally all the distributions that have SE Linux support have different people deciding when the new version of a daemon is ready for inclusion and therefore there is a need to support multiple versions for multiple distributions. So support for older versions of daemons can&amp;#8217;t be removed easily.&lt;/p&gt;
&lt;p&gt;One of the things I do to make these things a little easier to manage is to put &lt;b&gt;ifdef(&amp;#96;distro_debian', &amp;#96;&lt;/b&gt; before any Debian specific bits of policy. When policy is conditional and only used in Debian I can freely remove it at any future time if Debian works well without it. Also it doesn&amp;#8217;t matter if such Debian specific policy allows access that is not needed or desired in other distributions, the only down-side to this is that sometimes other distributions need to repeat work that I did, they determine what access is needed for their configuration and discover that it was already enabled for Debian.&lt;/p&gt;
&lt;h3&gt;What is Valid Policy?&lt;/h3&gt;
&lt;p&gt;We went to only have &amp;#8220;&lt;b&gt;Valid Policy&lt;/b&gt;&amp;#8221;  (as described by Christopher J. PeBenito), so the challenge is determining what is Valid Policy.&lt;/p&gt;
&lt;p&gt;It seems to me that there are three type of access granted by valid policy (it is debatable whether type #3 is valid):&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Access that is needed for an application to perform it&amp;#8217;s minimal designed task.&lt;/li&gt;
&lt;li&gt;Access that is needed for the application to perform all the optional configurations, EG an ftpd running from inetd or as a daemon, and daemons like http server being granted access to ssl keys or not.&lt;/li&gt;
&lt;li&gt;Access that is needed to perform all the operations the application requests, but which the application doesn&amp;#8217;t require or shouldn&amp;#8217;t require if it worked correctly.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Some common operations that aren&amp;#8217;t required include opening utmp for write, searching /root, and many other relatively innocuous access attempts which don&amp;#8217;t affect the program operation if they are denied. There are also many things such as writing temporary files to /root that don&amp;#8217;t seem unusual if the application developer is not considering SE Linux (but which are often considered bad practice anyway). Some of these things (like using /root for stuff that belongs in /var/lib) have the potential to break things (for the daemon or for other system processes) even if you don&amp;#8217;t consider SE Linux.&lt;/p&gt;
&lt;p&gt;How to deal with those types:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;In most cases this can be determined without too much effort. For example a web server needs to listen on port 80 and read files and directories that relate to data. When writing policy I can write a lot of the allow rules without even testing the application because I know from the design what it will do. A large part of the other access is obvious in a &amp;#8220;I can&amp;#8217;t believe I didn&amp;#8217;t realise it would need this&amp;#8221; sense.&lt;/li&gt;
&lt;li&gt;The main question here is whether we have booleans (settings which can be tuned at run-time by the sysadmin which determine how the policy works) to specify which optional tasks or whether we allow all access for optional configurations by default. The secondary question is when certain unusual corner cases should be not supported at all such that the people who do such unusual corner cases need to use &lt;b&gt;audit2allow&lt;/b&gt; to generate local policy to allow their operations.&lt;/li&gt;
&lt;li&gt;Sometimes we have to allow things that we really don&amp;#8217;t like. Even when we write policy to allow a daemon to do unusual things (such as using /root instead of /var/lib) it&amp;#8217;s still a lot better than running without SE Linux. Also SE Linux policy to allow such obviously broken things stands out and is a constant reminder that the daemon needs fixing, this is better than allowing symptoms of broken design to be forgotten.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;How to Improve the Situation&lt;/h3&gt;
&lt;p&gt;We could have comments in the policy source for everything that is in category 3. If the comments had a fixed format so that a recursive grep could find them all then it would allow us to more easily remove the gross things from the policy at a later date.&lt;/p&gt;
&lt;p&gt;But it seems to me that the main problem is a lack of people working on this. I am not aware of any people actively testing Debian policy for excessive privilege in regard to such issues.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;[1]&lt;a href=&quot;http://oss.tresys.com/pipermail/refpolicy/2011-March/004115.html&quot;&gt; http://oss.tresys.com/pipermail/refpolicy/2011-March/004115.html&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content:encoded>
	<dc:date>2011-04-28T21:00:18+00:00</dc:date>
	<dc:creator>etbe</dc:creator>
</item>
<item rdf:about="http://danwalsh.livejournal.com/42768.html">
	<title>Dan Walsh: 10 things you probably did not know about SELinux.. #5</title>
	<link>http://danwalsh.livejournal.com/42768.html</link>
	<content:encoded>&lt;span&gt;&lt;strong&gt;#5 How do I add new file systems/disks to an SELinux machine?&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Lets examine three use cases:&lt;br /&gt;&lt;br /&gt;1: You just got back from Best Buy with a brand new 100 Gig Disk that you want to mount on /home and store your homedirs.&amp;nbsp; You add the disk mount to /etc/fstab, mount it untar your entire backed up directory to the disk.&amp;nbsp; Now you attempt to login with a confined user. &amp;nbsp;Login fails, and the audit logs fill up with AVC&amp;nbsp;messages concerning &lt;span&gt;file_t&lt;/span&gt;.&amp;nbsp; Even without confined logins, applications like sshd can't read the ~/.ssh directory and Apache can no longer read the ~/public_html directory.&lt;br /&gt;&lt;br /&gt;SELinux reporting errors with the type &lt;span&gt;file_t&lt;/span&gt; indicates that the file/dir has no label.&amp;nbsp; SELinux has no idea what content is stored in a file without a label, therfore the kernel denies confined applications access to these files.&amp;nbsp; Ordinarily when I have seen random files all over the disk labelled file_t, I&amp;nbsp;have told the user to relabel the entire machine.&amp;nbsp; &lt;span&gt;touch /.autorelabel; reboot&lt;/span&gt;&amp;nbsp; In this case we know the user just added a disk, so all he needs to do is run restorecon on the disk.&amp;nbsp; &lt;span&gt;restorecon -R&amp;nbsp;-v /home&lt;/span&gt;.&amp;nbsp; The restorecon command will put the default labels on the entire disk. &amp;nbsp;This&amp;nbsp; also works on disks that you moved from one machine to another, especially important if the machine had SELinux disabled.&lt;br /&gt;&lt;br /&gt;2. You add a new lvm mount that you want to store all of your postgresql database directory on.&amp;nbsp; You create a new directory tree /data/postgresqldb and mount the disk here and mount the directory on /data/pgsql.&amp;nbsp;&amp;nbsp;&amp;nbsp; You are an advanced SELinux user so you know you need to put labels down,&amp;nbsp; you run &amp;quot;&lt;span&gt;restorecon -R&amp;nbsp;-v /data/pgsql&lt;/span&gt;&amp;quot;.&amp;nbsp; &amp;nbsp;Now you &lt;span&gt;service postgresql start&lt;/span&gt;, and POW it blows up.&amp;nbsp; The setroubleshoot star shows up and you read the analysys. &amp;nbsp;The analysys tells you that postgresql is trying to access a file in a directory labeled default_t.&amp;nbsp; Newly created directories in / are labelled &lt;span&gt;default_t.&amp;nbsp; &lt;/span&gt;Just like file_t, the SELinux kernel does not know what content is stored in a file/directory labeled default_t, so all confined applications are blocked from reading default_t files/directories.&amp;nbsp; The setroubleshoot analysis also tells you you need to put a label on the directory, and choose from a list of labels including &lt;span&gt;postgresql_db_t&lt;/span&gt;.&amp;nbsp; You figure that looks good and you follow the instructions, &lt;br /&gt;&lt;br /&gt;&lt;span&gt;# semanage fcontext -a -t postgresql_db_t '/data/pgsql(/.*)?'&lt;br /&gt;# restorecon -R&amp;nbsp;-v /data/pgsql&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The semanage command tells the SELinux system what the default label for this directory will be going forward.&amp;nbsp; The restorecon command actually puts the labels on the disk.&lt;br /&gt;&lt;br /&gt;Now you &lt;span&gt;service postgresql start&lt;/span&gt;, and POW it blows up again.&amp;nbsp; &amp;nbsp;At this point you are real unhappy with SELinux.&amp;nbsp; This time the AVC's indicate that &lt;span&gt;postgresql_t &lt;/span&gt;is not able to search through the /data directory which is labelled&lt;span&gt; default_t&lt;/span&gt;.&amp;nbsp; Your labelling was added at a directory a level below what you needed.&lt;br /&gt;&lt;br /&gt;&lt;span&gt;# semanage fcontext -d &lt;span&gt;'/data/pgsql(/.*)?'&lt;/span&gt;&lt;/span&gt;&lt;br /&gt; &lt;span&gt;# semanage fcontext -a -t postgresql_db_t '/data(/.*)?'&lt;br /&gt;# restorecon -R&amp;nbsp;-v /data&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I am sorry we blew it on this, but hopefully this example will help you understand a little of what SELinux is doing.&lt;br /&gt;&lt;br /&gt;&lt;span&gt;# service postgresql start&lt;br /&gt;&lt;/span&gt;&lt;span&gt;&lt;br /&gt;&lt;strong&gt;It works!!!&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Now you can take the pins out of the voodoo doll of me.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;NOTE:&amp;nbsp; If you were to store the postgresql database in a subdirectory of a normal file system directory, DO&amp;nbsp;NOT&amp;nbsp;change the label of that directory.&lt;br /&gt;For example /home/postgesql.&amp;nbsp; &lt;br /&gt;&lt;span&gt;&lt;br /&gt;# semanage fcontext -a -t postgresql_db_t '/home(/.*)?'&lt;br /&gt;# restorecon -R&amp;nbsp;-v /home&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span&gt;Would thoroughly screw up your machine.&amp;nbsp; In this case it is better to do &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;# semanage fcontext -a -t postgresql_db_t '/home/pgsql(/.*)?'&lt;br /&gt;# restorecon -R&amp;nbsp;-v /home&lt;/span&gt;/pgsql&lt;br /&gt;Then add allow rules for posqgresql_t to search through home_root_t using &lt;br /&gt;&lt;br /&gt;#grep postgresql_t /var/log/audit/audit.log |&amp;nbsp;audit2allow -M&amp;nbsp;mypostgresql&lt;br /&gt;# semodule -i mypostgresql.pp&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;3. You want to share Apache data on an NFS&amp;nbsp;share using multiple httpd hosts.&amp;nbsp;&amp;nbsp; You mount the remove nfs directory at /var/www/.&lt;br /&gt;&lt;br /&gt;&lt;span&gt;# service httpd start&lt;/span&gt;&lt;br /&gt;It blows up&amp;nbsp;permission denied.&amp;nbsp; This time setroubleshoot is complaining about &lt;span&gt;httpd_t &lt;/span&gt;trying to read &lt;span&gt;nfs_t&lt;/span&gt;.&amp;nbsp; The analysis tells you that you can allow &lt;span&gt;httpd_t&lt;/span&gt; to read all &lt;span&gt;nfs_t&lt;/span&gt; by setting a couple of different booleans.&lt;br /&gt;&lt;br /&gt;&lt;span&gt;httpd_use_nfs&lt;/span&gt; or &lt;span&gt;use_nfs_home_dirs&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Since you are not using nfs for your&amp;nbsp; home directories, it would be a bad idea from a security point of view to turn this boolean on.&amp;nbsp;&amp;nbsp;The &lt;span&gt;use_nfs_home_dirs&lt;/span&gt; boolean allows any confined domains that need access to&amp;nbsp; home directory content to get access to all files labeled &lt;span&gt;nfs_t.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Turning on &lt;span&gt;httpd_use_nfs &lt;/span&gt;will solve your problem.&amp;nbsp; &lt;br /&gt;But what if you had other nfs shares mounted which you did not want to grant access to Apache?&lt;br /&gt;&lt;br /&gt;The third option would be to use a mount option.&amp;nbsp; &lt;br /&gt;&lt;br /&gt;&lt;span&gt;# mount -o context=&amp;quot;system_u:object_r:httpd_sys_content_t:s0&amp;quot; REMOTEHOST:/var/www /var/www&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This command tells the SELinux kernel to treat all content in this file system as&lt;span&gt; httpd_sys_content_t.&lt;/span&gt;&amp;nbsp; &lt;span&gt;httpd_t &lt;/span&gt;will be allowed to access the content&amp;nbsp; mounted as &lt;span&gt;httpd_sys_content_t&lt;/span&gt;,&amp;nbsp; but the kernel will still deny httpd_t access to other NFS file systems mounted on the system.</content:encoded>
	<dc:date>2011-04-14T15:10:55+00:00</dc:date>
	<dc:creator>dwalsh@redhat.com</dc:creator>
</item>
<item rdf:about="http://blog.namei.org/?p=474">
	<title>James Morris: Linux Security Summit 2011 (Santa Rosa) – CFP Open</title>
	<link>http://blog.namei.org/2011/04/04/linux-security-summit-2011-santa-rosa-cfp-open/</link>
	<content:encoded>&lt;p&gt;The &lt;a href=&quot;https://security.wiki.kernel.org/index.php/LinuxSecuritySummit2011&quot;&gt;2011 Linux Security Summit&lt;/a&gt; has been &lt;a href=&quot;http://marc.info/?l=linux-security-module&amp;#038;m=130190646900423&amp;#038;w=2&quot;&gt;announced&lt;/a&gt;, and the CFP is open until the &lt;b&gt;27th of May&lt;/b&gt;.&lt;/p&gt;
&lt;p&gt;Following &lt;a href=&quot;https://security.wiki.kernel.org/index.php/LinuxSecuritySummit2010&quot;&gt;last year&amp;#8217;s successful event in Boston&lt;/a&gt;,  the 2011 Linux Security Summit (LSS2011) will be held on the 8th of September this year in conjunction with the &lt;a href=&quot;http://www.linuxplumbersconf.org/2011/&quot;&gt;Linux Plumbers Conference&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The program committee is looking for submissions from developers, researchers, and implementors.&lt;/p&gt;
&lt;p&gt;If you&amp;#8217;ve done anything interesting in Linux security over the last year, it&amp;#8217;s time to get a proposal ready and send it in!&lt;/p&gt;</content:encoded>
	<dc:date>2011-04-04T09:07:19+00:00</dc:date>
	<dc:creator>jamesm</dc:creator>
</item>
<item rdf:about="http://danwalsh.livejournal.com/42689.html">
	<title>Dan Walsh: I will be presenting SELinux at Boston Securty Meetup Tonight.</title>
	<link>http://danwalsh.livejournal.com/42689.html</link>
	<content:encoded>&lt;a href=&quot;http://www.meetup.com/boston-security-meetup/events/16738054/&quot; rel=&quot;nofollow&quot;&gt;http://www.meetup.com/boston-security-meetup/events/16738054/&lt;/a&gt;</content:encoded>
	<dc:date>2011-03-31T11:57:14+00:00</dc:date>
	<dc:creator>dwalsh@redhat.com</dc:creator>
</item>
<item rdf:about="http://danwalsh.livejournal.com/42394.html">
	<title>Dan Walsh: 10 things you probably did not know about SELinux.. #4</title>
	<link>http://danwalsh.livejournal.com/42394.html</link>
	<content:encoded>&lt;span&gt;&lt;strong&gt;#4 How do I tell whether a domain is &lt;em&gt;confined&lt;/em&gt; on an SELinux System?&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;On SELinux targeted systems, we have confined domains and unconfined domains, and as of RHEL6 and all supported Fedoras we also have permissive domains.&amp;nbsp; SELinux does not block access on processes running in these domains, for the most part.&lt;br /&gt;&lt;br /&gt;&lt;span&gt;&lt;strong&gt;Unconfined Domains&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;An unconfined domain is supposed to be a process that has the same rights as it would if SELinux was disabled.&amp;nbsp; There are a few caveats to this though.&amp;nbsp; &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Process Transitions&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;A process transition says when process running as label a_t executes a file labeled b_exec_t it should execute the process as b_t&amp;nbsp; An example of this would be service httpd start.&amp;nbsp; In this case we have unconfined_t running an init script labeled initrc_exec_t and SELinux starts the process as initrc_t.&amp;nbsp; &lt;br /&gt;&lt;br /&gt;&lt;span&gt;# sesearch -T -s unconfined_t -t initrc_exec_t&lt;br /&gt;Found 1 semantic te rules:&lt;br /&gt;&amp;nbsp;&amp;nbsp; type_transition unconfined_t initrc_exec_t : process initrc_t; &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Then the init script has a rule that says initrc_t executing httpd_exec_t will transition to httpd_t&lt;br /&gt;&lt;br /&gt;&lt;span&gt;# sesearch -T -s initrc_t -t httpd_exec_t&lt;br /&gt;Found 1 semantic te rules:&lt;br /&gt;&amp;nbsp;&amp;nbsp; type_transition initrc_t httpd_exec_t : process httpd_t; &lt;/span&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;This means that even though the process that started another process was unconfined, the new process can be confined.&amp;nbsp; We tend to discourage transitions from the unconfined_t user domain, since this can surprise the user.&amp;nbsp; &amp;quot;I thought I was unconfined, why when I start XYZ does SELinux block it?&amp;quot;&lt;br /&gt;&lt;br /&gt;Other then transitioning to initrc_t there are currently 55 executables that transition out of the unconfined_t domain.&lt;br /&gt;&lt;br /&gt;&lt;span&gt;#&amp;nbsp; sesearch -T -s unconfined_t -c process -C| grep -v initrc_t| grep -v ^D | wc -l&lt;br /&gt;55&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;A lot of these domains are also unconfined.&amp;nbsp; unconfined_java_t for example is the same as unconfined_t except it has execstack and execmem privilege always.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Minor Denials&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;In some cases I have been convinced to add minor confinement to even unconfined domains.&amp;nbsp; The most seen one of these was the executable memory checks.&amp;nbsp; execmem, execmod, execheap and execstack.&amp;nbsp; There are booleans to turn on and off the checks for the unconfined domains.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Listing unconfined domains &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;You can use seinfo to list the unconfined domains.&lt;br /&gt;&lt;br /&gt;&lt;span&gt;# seinfo -aunconfined_domain_type -x | wc -l&lt;br /&gt;54&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Disabling unconfined domains&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;You can easily disable lots of domains unconfined domains to make your machine more locked down.&amp;nbsp; In RHEL6 and Fedora their are two policy modules unconfined and unconfineduser.&amp;nbsp; If you disable unconfined it will lock down most of system space.&lt;br /&gt;&lt;br /&gt;&lt;span&gt;# semodule -d unconfined&lt;br /&gt;# seinfo -aunconfined_domain_type -x | wc -l&lt;br /&gt;14&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This is how I usually run.&amp;nbsp; In this mode, it will require you to have policy for all apps launched out of init system or xinetd.&lt;br /&gt;&lt;br /&gt;You can also disable the unconfined user, by executing the following commands.&lt;br /&gt;&lt;span&gt;&lt;br /&gt;# semanage login -m -s staff_u root&lt;br /&gt;# semanage login -m -s staff_u __default__&lt;br /&gt;# semanage user -d unconfined_u&lt;br /&gt;# semanage user -m -R &amp;quot;staff_r system_r sysadm_r&amp;quot; staff_u&lt;/span&gt;&lt;span&gt;&lt;br /&gt;# semodule -d unconfineduser&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;As long as unconfined is not defined in either the semanage user or semanage login database this should work and you pretty much get back to what used to be strict policy.&lt;br /&gt;&lt;br /&gt;I tend to leave unconfineduser enabled, but setup all my users as confined, and allow staff_t to transition to unconfined_t through sudo.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Adding unconfined domains to when building policy modules&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;If you were building your own policy module and you wanted to build an unconfined domain, you would write code like:&lt;br /&gt;&lt;span&gt;&lt;br /&gt;type mydomian_t;&lt;br /&gt;domain_type(mydomain_t)&lt;br /&gt;&lt;br /&gt;optional_policy(`&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; unconfined_domain(mydomain_t)&lt;/span&gt;&lt;br /&gt;')&lt;br /&gt;&lt;br /&gt;&lt;span&gt;&lt;strong&gt;Permissive Domains&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The other type of domain that SELinux does not block is the permissive domain.&amp;nbsp;&amp;nbsp;&amp;nbsp; These are usually domains under construction. &amp;nbsp;SELinux allows these domains to do any thing but reports AVC;s on them when they do something not allowed in policy.&amp;nbsp; When we develop policy for Fedora, we define all new domains as permissive and allow them to run permissive through an entire run of a release.&amp;nbsp; Then in the next release we turn them to enforcing.&amp;nbsp; One difference between F15 and F16 policy is we just removed the permissive flag from all domains in F15.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Listing Permissive Domains&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;You can see the permissive domains in two ways.&lt;br /&gt;&lt;br /&gt;&lt;span&gt;# seinfo&amp;nbsp; --permissive&amp;nbsp; | wc -l&lt;br /&gt;18&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Or you can use the semanage command to list them&lt;br /&gt;&lt;span&gt;&lt;br /&gt;# semanage permissive -l&lt;br /&gt;&lt;br /&gt;Builtin Permissive Types &lt;br /&gt;&lt;br /&gt;staff_gkeyringd_t&lt;br /&gt;staff_gkeyringd_t&lt;br /&gt;mock_t&lt;br /&gt;keyboardd_t&lt;br /&gt;matahari_serviced_t&lt;br /&gt;firewalld_t&lt;br /&gt;colord_t&lt;br /&gt;systemd_notify_t&lt;br /&gt;systemd_passwd_agent_t&lt;br /&gt;mozilla_plugin_t&lt;br /&gt;matahari_hostd_t&lt;br /&gt;matahari_netd_t&lt;br /&gt;passenger_t&lt;br /&gt;systemd_tmpfiles_t&lt;br /&gt;foghorn_t&lt;br /&gt;namespace_init_t&lt;br /&gt;&lt;br /&gt;Customized Permissive Types&lt;br /&gt;&lt;br /&gt;qpidd_t&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Adding Permissive Domains&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Notice that the semanage command differentiates between customized permissive domains and built-ins.&amp;nbsp; With the semanage command, the administrator can choose to make a domain permissive, by executing &lt;br /&gt;&lt;br /&gt;&lt;span&gt;# semanage permissive -a httpd_t&lt;/span&gt;&lt;br /&gt;&lt;span&gt;# seinfo&amp;nbsp; --permissive&amp;nbsp; |grep http&lt;br /&gt;&amp;nbsp;&amp;nbsp; httpd_t&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Removing Permissive Domains&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;You can remove a customized permissive domain by executing:&lt;br /&gt;&lt;span&gt;&lt;br /&gt;# semanage permissive -d httpd_t&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;You &lt;strong&gt;&lt;em&gt;can not&lt;/em&gt;&lt;/strong&gt; currently remove permissive domains if they are the built-in into policy.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Adding permissive domains to when building policy modules&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;If you were building your own policy module and you wanted to build a permissive domain, you would write code like:&lt;br /&gt;&lt;span&gt;&lt;br /&gt;type mydomian_t;&lt;br /&gt;domain_type(mydomain_t)&lt;br /&gt;&lt;br /&gt;permissive mydomain_t;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&lt;/div&gt;</content:encoded>
	<dc:date>2011-03-25T12:59:24+00:00</dc:date>
	<dc:creator>dwalsh@redhat.com</dc:creator>
</item>
<item rdf:about="tag:blogger.com,1999:blog-5240359826706545510.post-2132013955084852516">
	<title>Thomas Biege (Security): SAD 2: Security Awareness or melting Realities together</title>
	<link>http://thetoms-random-thoughts.blogspot.com/2011/02/sad-2-security-awareness-or-melting.html</link>
	<content:encoded>Most people know that smoking causes cancer, that eating too much and not doing sports increases the probability of a cardiovascular disease, that drinking too much is bad for your psyche and lever and so on.&lt;br /&gt;&lt;br /&gt;But does just knowing about it change their behavior? No, it does not!&lt;br /&gt;&lt;br /&gt;The reason is that these &quot;invisible&quot; negative effects do not influence their living, the integrity of their reality is intact until it is too late and the disease dramatically decrease the quality of their life.&lt;br /&gt;&lt;br /&gt;Only a few people are clever and strong enough to reflect about their bad behaviors and change them. I assume more people change their bad habits as soon as they &lt;span&gt;see&lt;/span&gt; what happens to their body. Seeing means measuring the cardiovascular levels, taking x-ray pictures of organs, making chemical analysis of body liquids and tissue and so on.&lt;br /&gt;&lt;br /&gt;I see a strong analogy here to software development and security.&lt;br /&gt;&lt;br /&gt;Developers and project-managers often do not have security in mind, or do not have the technical background and daily practice to make the resulting product a nightmare for penetration-testers and hackers. (How often do you read this already?)&lt;br /&gt;&lt;br /&gt;Let's not stress this doctor vs. patient analogy too far. This blog entry is not about good vs. bad or dumb vs. clever... it's about the experience I made and psychology.&lt;br /&gt;&lt;br /&gt;First of all, measurement (of the right things) is the key to success! You do not have to create a bulletproof plan, just some goals, continue measurement, and adapt your plan (Hello agile development/management!).&lt;br /&gt;&lt;br /&gt;I hold three talks/workshops in 2010, every talk has the same topic: &quot;secure design and development&quot; and I got the same result: &lt;span&gt;Code quality did not increase!&lt;/span&gt; The number of potential security bugs per 1000 &quot;physical&quot; LOC (Hits/KSLOC) stayed the same or even increased.&lt;br /&gt;Based on the responses from my audience I experimented with the content and with the methodology. The first workshop was very long and mostly theoretical with threat models, potential problems in Rails, risk assessment, showing some tools (which gets the most attention, because it potentially helped solving their problems).&lt;br /&gt;The second one was much more practical, I had shown real examples from the in-house software projects, real attacks and presenting some tools. The session was much shorter and caused more attention by the developers and a bit more attention by the technical managers (Still, tools caused the the most attention). And the last one... the last one was a wake-up call, less technical, analogies and examples, cost of security updates (Attention!) and I hit the target.&lt;br /&gt;&lt;br /&gt;Result: The first talk was a waste of time, my statistics had shown no decrease in the potential vulnerabilities, the second one also had no affect on quality but the awareness and communication (developers) increased, and the third talk... well the code quality did not increase but awareness and maybe acceptance in the upper food chain increased.&lt;br /&gt;&lt;br /&gt;Retrospectively I can say I should have done the talks/workshops in reverse order but when I started is was a &quot;fire-fighter job&quot; and I had no time for a real plan.&lt;br /&gt;&lt;br /&gt;Code quality is still a critical issue and therefore I took the next, more aggressive step by sending the (cleaned-up) results of my code scanner to the developers mailing list. And at least one team responded to it and we reduced the number of potential security problems and false positives to a minimum within just two weeks. In the meanwhile all teams responded in some way and I hope code fixing will start soon.&lt;br /&gt;&lt;br /&gt;On balance:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;If you want to increase awareness, invite the right people and omit technical details, speak the language of the audience, use numbers (costs) and statistics, use analogies instead of theoretical information. Melt realities by creating feelings and concernment! (The last point is not easy to do of course.)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;If you want to increase code quality, use tools that directly show the problematic code with a description and help fixing it! Don't create too much confusion and don't steal the developer's time.&lt;/li&gt;&lt;/ul&gt;BTW, the increase of awareness or the expertise of the developers resulted in adding security features and fixing existing security features...&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;!-- BlogCounter Code START --&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://www.blogcounter.de/&quot; id=&quot;bclink&quot; title=&quot;kostenloser Counter fuer Weblogs&quot;&gt;&lt;span id=&quot;bccount&quot;&gt;kostenloser Counter&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://www.blogcounter.de/&quot;&gt;&lt;img alt=&quot;Weblog counter&quot; src=&quot;http://track.blogcounter.de/log.php?id=thetom_blog&quot; /&gt;&lt;/a&gt; - &lt;/p&gt;&lt;!-- BlogCounter Code END --&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width=&quot;1&quot; height=&quot;1&quot; src=&quot;https://blogger.googleusercontent.com/tracker/5240359826706545510-2132013955084852516?l=thetoms-random-thoughts.blogspot.com&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;</content:encoded>
	<dc:date>2011-03-25T06:36:23+00:00</dc:date>
	<dc:creator>Thomas (noreply@blogger.com)</dc:creator>
</item>
<item rdf:about="http://danwalsh.livejournal.com/42186.html">
	<title>Dan Walsh: 10 things you probably did not know about SELinux.. #3</title>
	<link>http://danwalsh.livejournal.com/42186.html</link>
	<content:encoded>&lt;strong&gt;SELInux versus nsswitch.conf&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Many confined domains call getpwnam, getpwuid, getpwent functions.&amp;nbsp; Traditionally these function calls just read the the /etc/passwd file.&amp;nbsp; In a modern Linux system the glibc has added nsswitch.&lt;br /&gt;&lt;span&gt;&lt;br /&gt;man nssswitch.conf&lt;br /&gt;...&lt;br /&gt;NAME&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nsswitch.conf - System Databases and Name Service Switch configuration file&lt;br /&gt;&lt;br /&gt;DESCRIPTION&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Various functions in the C Library need to be configured to work correctly in the local environment.&amp;nbsp; Tra‐&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ditionally, this was done by using files (e.g., /etc/passwd), but other&amp;nbsp; nameservices&amp;nbsp; (like&amp;nbsp; the&amp;nbsp; Network&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Information&amp;nbsp; Service&amp;nbsp; (NIS)&amp;nbsp; and the Domain Name Service (DNS)) became popular, and were hacked &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; into the C library, usually with a fixed search order.&lt;br /&gt;...&lt;/span&gt;&lt;br /&gt;&lt;br /&gt; nsswitch functionality allows multiple back-ends for the getpw*. These back-ends can change the access required by a process, and SELinux has to allow for these different back-ends. &lt;br /&gt;&lt;br /&gt;If you have setup your system with your passwd data in ldap, SELinux is forced to allow all confined domains that call getpw* to connect to the ldap_port_t ports in order to get passwd data.&lt;br /&gt;&lt;span&gt;&lt;br /&gt;# semanage&amp;nbsp; port -l | grep ldap&lt;br /&gt;ldap_port_t&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tcp&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 389, 636, 3268&lt;br /&gt;ldap_port_t&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; udp&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 389, 636&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Also since the confined application needs to resolve the hostname of the ldap server, the confined application needs to be able to connect to dns_port_t.&lt;br /&gt;&lt;span&gt;&lt;br /&gt; # semanage&amp;nbsp; port -l | grep dns&lt;br /&gt;dns_port_t&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tcp&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 53&lt;br /&gt;dns_port_t&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; udp&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 53&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Even worse if you are using NIS all of these applications have to be able to connect all ports and bind to all ports.&lt;br /&gt;&lt;br /&gt;We have had a boolean allow_ypbind since RHEL5, luckily this is turned off by default and eliminates a lot of access.&amp;nbsp; You only need to turn it on if you are using NIS.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;sssd (System Security Services Daemon) to the rescue.&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;sssd provides a new back end for nsswitch.&amp;nbsp; This backend causes all callers of getpw*&amp;nbsp;functions to used a named socket, /var/lib/sss/nss.&amp;nbsp; The beauty of the sssd backend is the sssd daemon does all of the ldap communications for the confined applications, rather then the confined applications needing to connect directly to the ldap server/port.&lt;br /&gt; &lt;br /&gt;In Fedora 15 we added a new boolean authlogin_nsswitch_use_ldap that allows you to turn off this access.&amp;nbsp; &lt;br /&gt;&lt;br /&gt;NOTE:&amp;nbsp; You can turn off this boolean even if you are using ldap for passwd entry resolution if you are using sssd.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;How many rules does this eliminate?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Using sesearch to look for rules tat allow a domain to connect to the ldap_port_t.&lt;br /&gt;&lt;br /&gt;&lt;span&gt;# sesearch -A -t ldap_port_t -p name_connect -C | wc -l&lt;br /&gt;717&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If we eliminate the allow_ypbind boolean&lt;br /&gt;&lt;br /&gt;&lt;span&gt;# sesearch -A -t ldap_port_t -p name_connect -C | grep -v allow_ypbind | wc&amp;nbsp; -l&lt;br /&gt;386&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Now if we further eliminate authlogin_nsswitch_use_ldap&lt;br /&gt;&lt;br /&gt;&lt;span&gt;# sesearch -A -t ldap_port_t -p name_connect -C | grep -v allow_ypbind | grep -v authlogin_nsswitch_use_ldap | wc -l&lt;br /&gt;112&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Meaning we have eliminate over 600 rules that allow confined domains to connect to the ldap_port_t.&lt;br /&gt;&lt;br /&gt;You can turn &lt;strong&gt;off&lt;/strong&gt; both booleans by executing.&lt;br /&gt;&lt;br /&gt;&lt;span&gt;# setsebool -P&amp;nbsp;allow_ypbind=0 authlogin_nsswitch_use_ldap=0&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I&amp;nbsp;plan on turning both booleans off by default in Fedora 16. &amp;nbsp;&lt;br /&gt;</content:encoded>
	<dc:date>2011-03-24T16:04:06+00:00</dc:date>
	<dc:creator>dwalsh@redhat.com</dc:creator>
</item>
<item rdf:about="http://danwalsh.livejournal.com/41794.html">
	<title>Dan Walsh: 10 things you probably did not know about SELinux.. #2</title>
	<link>http://danwalsh.livejournal.com/41794.html</link>
	<content:encoded>&lt;strong&gt;#2&lt;/strong&gt; Outputting your semanage configuration&lt;br /&gt;&lt;br /&gt;You set up a machine with a bunch of SELinux customizations.&amp;nbsp; You want to take those customizations and make 5 other machines look the same.&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;How would I do this?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;semanage -o /tmp/selinux.customizations&lt;br /&gt;&lt;br /&gt;man semanage &lt;br /&gt;...&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Output local customizations&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; semanage [ -S store ] -o [ output_file | - ]&lt;br /&gt;&lt;br /&gt;SYNOPSIS&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Output local customizations&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; semanage [ -S store ] -o [ output_file | - ]&lt;br /&gt;&lt;br /&gt;The semanage -o command will output all semanage customizations into a file that the semanage -i command can read.&amp;nbsp; &lt;br /&gt;&lt;span&gt;&lt;br /&gt;&lt;span&gt;# semanage -i /tmp/selinux.customizations&lt;br /&gt;# scp /tmp/selinux.customizations root@otherhost.mycompany.com&lt;br /&gt;# ssh otherhost.mycompany.com root@otherhost.mycompany.com semanage -i selinux.customizations&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Here is the output of this command on my laptop.&lt;br /&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;# semanage output -o -&lt;br /&gt;boolean -D&lt;br /&gt;boolean -1 allow_polyinstantiation&lt;br /&gt;boolean -0 authlogin_nsswitch_use_ldap&lt;br /&gt;boolean -1 httpd_can_sendmail&lt;br /&gt;boolean -1 xguest_connect_network&lt;br /&gt;boolean -1 xguest_mount_media&lt;br /&gt;boolean -1 xguest_use_bluetooth&lt;br /&gt;login -D&lt;br /&gt;login -a -s guest_u -r 's0' __default__&lt;br /&gt;login -a -s unconfined_u -r 's0-s0:c0.c1023' root&lt;br /&gt;login -a -s system_u -r 's0-s0:c0.c1023' system_u&lt;br /&gt;login -a -s xguest_u -r 's0' xguest&lt;br /&gt;user -D&lt;br /&gt;user -a -r s0-s0:c0.c1023 -R 'staff_r system_r webadm_r' webadm_u&lt;br /&gt;user -a -r s0 -R 'xguest_r' xguest_u&lt;br /&gt;port -D&lt;br /&gt;port -a -t http_port_t -p tcp 81&lt;br /&gt;interface -D&lt;br /&gt;interface -a -t netif_t eth*&lt;br /&gt;node -D&lt;br /&gt;node -a -M 0.0.0.0 -p ipv4 -t defaultif_t 0.0.0.0&lt;br /&gt;node -a -M 255.255.255.255 -p ipv4 -t internalif_t 127.0.0.1&lt;br /&gt;fcontext -D&lt;br /&gt;fcontext -a -f 'all files' -t httpd_sys_content_t '/myweb(/.*)?'&lt;br /&gt;fcontext -a -f 'all files' -t public_content_t '/shared(/.*)?'&lt;br /&gt;fcontext -a -f 'all files' -t samba_share_t '/shared/samba(/.*)?'&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Notice the -D commands, these are used to delete all local customizations.&amp;nbsp; If you were to install this selinux configuration on your machine, you would have the same configuration as my laptop.&lt;br /&gt;&lt;br /&gt;Note:&amp;nbsp;&amp;nbsp;You would also need to make sure the policy modules were the same on each machine.</content:encoded>
	<dc:date>2011-03-23T12:13:28+00:00</dc:date>
	<dc:creator>dwalsh@redhat.com</dc:creator>
</item>
<item rdf:about="http://danwalsh.livejournal.com/41593.html">
	<title>Dan Walsh: 10 things you probably did not know about SELinux..</title>
	<link>http://danwalsh.livejournal.com/41593.html</link>
	<content:encoded>&lt;strong&gt;Over the next few days, I am going to blog about things you probably did not know about SELinux&lt;br /&gt;&lt;br /&gt;1:&lt;/strong&gt;&amp;nbsp; Multiple semanage commands:&lt;br /&gt;&lt;br /&gt;The semanage command is pretty slow.&amp;nbsp; It can take 10-20 seconds for a semanage command to complete.&amp;nbsp;  &amp;nbsp; semanage recompiles&amp;nbsp; a huge amount of policy.&amp;nbsp; In Fedora 15 we have almost 500,000 allow and dontaudit rules.&amp;nbsp; The compiler checking each type, user, role, etc to make sure they are valid.&amp;nbsp;&amp;nbsp; I&amp;nbsp;have seen people executing multiple semanage commands in post install of rpm spec files as well as people customizing lots of machines by executing setsebool, semodule and semanage commands.&amp;nbsp; Not too many people realize you can run them all within the same transaction.&lt;br /&gt;&lt;br /&gt;man semanage&lt;br /&gt;...&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Input local customizations&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; semanage [ -S store ] -i [ input_file | - ]&lt;br /&gt;...&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; -i, --input&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Take a set of commands from a specified file and load them in&amp;nbsp; a&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; single transaction.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The xguest uses this in its post install.&lt;br /&gt;&lt;span&gt;&lt;span&gt;&lt;br /&gt;semanage -S targeted -i - &amp;lt;&amp;lt; _EOF&lt;br /&gt;boolean -m --on allow_polyinstantiation &lt;br /&gt;boolean -m --on xguest_connect_network&lt;br /&gt;boolean -m --on xguest_mount_media&lt;br /&gt;boolean -m --on xguest_use_bluetooth&lt;br /&gt;_EOF&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;It sets a bunch of boolean values.&amp;nbsp; You can also manage different semanage commands within the same transaction.&amp;nbsp; &lt;br /&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;semanage -i - &amp;lt;&amp;lt; _EOF&lt;br /&gt;port -a -t http_port_t -p tcp 81&lt;br /&gt;fcontext -a -t httpd_sys_content_t &amp;quot;/myweb(/.*)?&amp;quot;&lt;br /&gt;boolean -m --on httpd_can_sendmail&lt;br /&gt;user -a -R &amp;quot;staff_r system_r webadm_r&amp;quot; -r s0-s0:c0.c1023 webadm_u &lt;br /&gt;login -m -s guest_u -r s0 __default__&lt;br /&gt;_EOF&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;</content:encoded>
	<dc:date>2011-03-22T18:33:58+00:00</dc:date>
	<dc:creator>dwalsh@redhat.com</dc:creator>
</item>
<item rdf:about="tag:blogger.com,1999:blog-5240359826706545510.post-2155535332855749669">
	<title>Thomas Biege (Security): Forgotten Password and Birthday Attacks</title>
	<link>http://thetoms-random-thoughts.blogspot.com/2011/03/forgotten-password-and-birthday-attacks.html</link>
	<content:encoded>I just stumbled over a piece of code that might be interesting for you as well. A web-app let's click you on a &quot;forgotten password&quot; link and will send a token to the (valid/known) email address you specified. When you return to the web-app and provide the token that was mailed to you, and the token was found by looking it up for ANY user, you are allowed to set a new password. So, theoretically (I didn't test it) this code is vulnerable to a &lt;span&gt;birthday attack&lt;/span&gt; (random pair collision), the impact depends on the number of users and the length of the token.&lt;br /&gt;&lt;br /&gt;For example, and I hope I get the math correct here, if the token is 8 bit long (8 bit of entropy, equally distributed) an attacker only needs to call the &quot;forgotten password&quot; functionality for 16 (birthday bound, 2^{n/2}) users and try 16 different tokens to have a probability of success  close to 50%.&lt;br /&gt;&lt;br /&gt;The solution is to look-up the user by email address or another unique identifier and verify if the token for this user matches or not.&lt;br /&gt;&lt;br /&gt;Here is an example diagram for a 16 bit token (DNS TRXID) to compare &lt;span&gt;brute force&lt;/span&gt; vs. &lt;span&gt;birthday attack&lt;/span&gt;.&lt;br /&gt;&lt;a href=&quot;http://3.bp.blogspot.com/-un8k-4vIBTw/TYM16SXMdvI/AAAAAAAAAeY/7dhAdj5ed3Q/s1600/Birthday_vs_conventional_attack.jpg&quot;&gt;&lt;img src=&quot;http://3.bp.blogspot.com/-un8k-4vIBTw/TYM16SXMdvI/AAAAAAAAAeY/7dhAdj5ed3Q/s320/Birthday_vs_conventional_attack.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5585367238347355890&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;!-- BlogCounter Code START --&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://www.blogcounter.de/&quot; id=&quot;bclink&quot; title=&quot;kostenloser Counter fuer Weblogs&quot;&gt;&lt;span id=&quot;bccount&quot;&gt;kostenloser Counter&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://www.blogcounter.de/&quot;&gt;&lt;img alt=&quot;Weblog counter&quot; src=&quot;http://track.blogcounter.de/log.php?id=thetom_blog&quot; /&gt;&lt;/a&gt; - &lt;/p&gt;&lt;!-- BlogCounter Code END --&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width=&quot;1&quot; height=&quot;1&quot; src=&quot;https://blogger.googleusercontent.com/tracker/5240359826706545510-2155535332855749669?l=thetoms-random-thoughts.blogspot.com&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;</content:encoded>
	<dc:date>2011-03-18T08:42:28+00:00</dc:date>
	<dc:creator>Thomas (noreply@blogger.com)</dc:creator>
</item>
<item rdf:about="tag:blogger.com,1999:blog-5240359826706545510.post-655568822192184808">
	<title>Thomas Biege (Security): Oops, RSA hacked and SecurID code stolen?</title>
	<link>http://thetoms-random-thoughts.blogspot.com/2011/03/oops-rsa-hacked-and-secuid-code-stolen.html</link>
	<content:encoded>&lt;a href=&quot;http://www.rsa.com/node.aspx?id=3872&quot;&gt;http://www.rsa.com/node.aspx?id=3872&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;!-- BlogCounter Code START --&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://www.blogcounter.de/&quot; id=&quot;bclink&quot; title=&quot;kostenloser Counter fuer Weblogs&quot;&gt;&lt;span id=&quot;bccount&quot;&gt;kostenloser Counter&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://www.blogcounter.de/&quot;&gt;&lt;img alt=&quot;Weblog counter&quot; src=&quot;http://track.blogcounter.de/log.php?id=thetom_blog&quot; /&gt;&lt;/a&gt; - &lt;/p&gt;&lt;!-- BlogCounter Code END --&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width=&quot;1&quot; height=&quot;1&quot; src=&quot;https://blogger.googleusercontent.com/tracker/5240359826706545510-655568822192184808?l=thetoms-random-thoughts.blogspot.com&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;</content:encoded>
	<dc:date>2011-03-18T04:44:37+00:00</dc:date>
	<dc:creator>Thomas (noreply@blogger.com)</dc:creator>
</item>
<item rdf:about="tag:blogger.com,1999:blog-7673377107942959487.post-5665729863540851325">
	<title>Andrey Markelov (SELinux): Использование SELinux совместно с iptables</title>
	<link>http://markelov.blogspot.com/2011/03/selinux-iptables.html</link>
	<content:encoded>&lt;div&gt;Dan Walsh, отвечающий в Red Hat за развитие SELinux опубликовал на Linux.com статью, посвященную использованию SELinux совместно с брандмауэром. &lt;a href=&quot;http://www.linux.com/learn/tutorials/421152-using-selinux-and-iptables-together&quot;&gt;Ссылка&lt;/a&gt;.&lt;/div&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width=&quot;1&quot; height=&quot;1&quot; src=&quot;https://blogger.googleusercontent.com/tracker/7673377107942959487-5665729863540851325?l=markelov.blogspot.com&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;</content:encoded>
	<dc:date>2011-03-17T13:05:47+00:00</dc:date>
	<dc:creator>Andrey Markelov (noreply@blogger.com)</dc:creator>
</item>
<item rdf:about="http://danwalsh.livejournal.com/41441.html">
	<title>Dan Walsh: I have been fooling around with using SELinux and network labels.</title>
	<link>http://danwalsh.livejournal.com/41441.html</link>
	<content:encoded>I am constantly playing with new ways of using SELinux to enhance level of security.&amp;nbsp; Lately I&amp;nbsp;have been playing with adding labels related to network connections.&amp;nbsp; I wrote an article that was a little long for a blog, and linux.com was nice enough to publish it for me.&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://www.linux.com/learn/tutorials/421152-using-selinux-and-iptables-together&quot; rel=&quot;nofollow&quot;&gt;http://www.linux.com/learn/tutorials/421152-using-selinux-and-iptables-together&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Hope you enjoy it, or at least understand it.&lt;br /&gt;&lt;br /&gt;Dan</content:encoded>
	<dc:date>2011-03-16T17:20:50+00:00</dc:date>
	<dc:creator>dwalsh@redhat.com</dc:creator>
</item>
<item rdf:about="http://danwalsh.livejournal.com/40992.html">
	<title>Dan Walsh: I appeared this week on FLOSS Weekly, live from my kitchen...</title>
	<link>http://danwalsh.livejournal.com/40992.html</link>
	<content:encoded>&lt;p&gt;&lt;br /&gt;  &lt;a href=&quot;http://twit.tv/floss156&quot; rel=&quot;nofollow&quot;&gt;The TWiT Netcast Network with Leo Laporte&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;  &lt;a href=&quot;http://twit.tv/floss156&quot; rel=&quot;nofollow&quot;&gt;156&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;</content:encoded>
	<dc:date>2011-03-10T14:01:20+00:00</dc:date>
	<dc:creator>dwalsh@redhat.com</dc:creator>
</item>
<item rdf:about="tag:blogger.com,1999:blog-5240359826706545510.post-2471259512934613505">
	<title>Thomas Biege (Security): Comdirect bank TAN handling</title>
	<link>http://thetoms-random-thoughts.blogspot.com/2011/03/comdirect-bank-tan-handling.html</link>
	<content:encoded>Just recognized that the web-app for Comdirect online banking does not ask for another TAN if you choose back and change the bankwire details like the recipient. Execution flow:&lt;br /&gt;&lt;br /&gt;Enter bankwire details ---&gt; click next ----&gt; asked to enter TAN n ---&gt; click back ----&gt; change bankwire details ----&gt; click next ---&gt; again asked for TAN n&lt;br /&gt;&lt;br /&gt;I would generate a new TAN...&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;!-- BlogCounter Code START --&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://www.blogcounter.de/&quot; id=&quot;bclink&quot; title=&quot;kostenloser Counter fuer Weblogs&quot;&gt;&lt;span id=&quot;bccount&quot;&gt;kostenloser Counter&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://www.blogcounter.de/&quot;&gt;&lt;img alt=&quot;Weblog counter&quot; src=&quot;http://track.blogcounter.de/log.php?id=thetom_blog&quot; /&gt;&lt;/a&gt; - &lt;/p&gt;&lt;!-- BlogCounter Code END --&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width=&quot;1&quot; height=&quot;1&quot; src=&quot;https://blogger.googleusercontent.com/tracker/5240359826706545510-2471259512934613505?l=thetoms-random-thoughts.blogspot.com&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;</content:encoded>
	<dc:date>2011-03-10T02:23:03+00:00</dc:date>
	<dc:creator>Thomas (noreply@blogger.com)</dc:creator>
</item>
<item rdf:about="http://danwalsh.livejournal.com/40752.html">
	<title>Dan Walsh: Trusted Computing SIG in Fedora</title>
	<link>http://danwalsh.livejournal.com/40752.html</link>
	<content:encoded>&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;br /&gt; &lt;div lang=&quot;x-western&quot; class=&quot;moz-text-plain&quot;&gt;&lt;pre&gt;
We have just created a SIG (Special Interest Group) in Fedora On Trusted Computing.
&lt;a href=&quot;https://fedoraproject.org/wiki/SIGs/Trusted_computing&quot; rel=&quot;nofollow&quot;&gt; &lt;span class=&quot;moz-txt-link-freetext&quot;&gt;https://fedoraproject.org/wiki/SIGs/Trusted_computing&lt;/span&gt;&lt;/a&gt;

Check it out and sign up for the Mailing List if you are interested.

&lt;/pre&gt;&lt;/div&gt;</content:encoded>
	<dc:date>2011-03-02T18:23:09+00:00</dc:date>
	<dc:creator>dwalsh@redhat.com</dc:creator>
</item>
<item rdf:about="http://blogs.fedoraproject.org/wp/mgrepl/?p=207">
	<title>Miroslav Grepl: Can you develop your service and keep SELinux in the game?</title>
	<link>http://blogs.fedoraproject.org/wp/mgrepl/2011/02/16/can-you-develop-your-service-and-keep-selinux-in-the-game/</link>
	<content:encoded>&lt;p&gt;I still get questions why a service can not be started directly. We (Dan Walsh and me) described this situation many times. So one example could be&lt;/p&gt;
&lt;p&gt;&lt;span&gt;# abrtd -d -v&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;But what does it cause?&lt;/p&gt;
&lt;p&gt;* from your point of view &lt;/p&gt;
&lt;p&gt;&lt;span&gt;user @ abrtd binary -&amp;gt; abrtd runs&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;* in SELinux perspective&lt;/p&gt;
&lt;p&gt;&lt;span&gt;unconfined_t -&amp;gt; abrtd_exec_t -&amp;gt; unconfined_t&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;So question is how we can get all your changes to SELinux policy at the time if you develop your service. And you really want or you need to test it this way.&lt;/p&gt;
&lt;p&gt;We can not. &lt;/p&gt;
&lt;p&gt;But we have a solution for you. Try to use runcon and keep SELinux and us in the game.&lt;/p&gt;
&lt;p&gt;It is really easy. Just one or two steps are needed.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;1.&lt;/strong&gt; Make your service running in the proper context. &lt;/p&gt;
&lt;p&gt;&lt;span&gt;# runcon -u system_u -r system_r -t initrc_t &amp;#8212; runcon -t abrt_t -l s0  &amp;#8212; abrtd -d -v&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;2.&lt;/strong&gt; Maybe everything  will not work correctly and you will not see any AVC messages. Maybe because of dontaudit rules.&lt;/p&gt;
&lt;p&gt;So just execute&lt;/p&gt;
&lt;p&gt;&lt;span&gt;# semanage permissive -a abrt_t&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;or you can swith to permissive mode globally if you develop&lt;/p&gt;
&lt;p&gt;&lt;span&gt;# setenforce 0&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;What do you think?&lt;/p&gt;</content:encoded>
	<dc:date>2011-02-16T17:39:07+00:00</dc:date>
	<dc:creator>mgrepl</dc:creator>
</item>
<item rdf:about="http://etbe.coker.com.au/?p=2641">
	<title>Russell Coker (security): Mplayer, Squeeze, and SE Linux on i386</title>
	<link>http://etbe.coker.com.au/2011/02/16/mplayer-squeeze-selinux/</link>
	<content:encoded>&lt;p&gt;I&amp;#8217;ve just updated my SE Linux repository for Squeeze to better support running mplayer on the i386 architecture, below is the APT sources.list line:&lt;/p&gt;
&lt;p&gt;deb http://www.coker.com.au squeeze selinux&lt;/p&gt;
&lt;p&gt;The first issue is &lt;a href=&quot;http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=613535&quot;&gt;a bug in the compilation of the SDL libraries which makes them request an executable stack (bug #613535)&lt;/a&gt;.  Recompiling the libraries on my system caused this bug to go away, so it must be some issue with the compilation process.  &lt;a href=&quot;http://etbe.coker.com.au/2008/08/11/executable-stacks-lenny/&quot;&gt;I have previously summarised the execstack issue, but we haven&amp;#8217;t solved this yet [1]&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The next issue is the fact that the ffmpeg libraries require execmod access (&lt;a href=&quot;http://etbe.coker.com.au/2008/09/11/execmod-and-se-linux-i386-must-die/&quot;&gt;see my previous post for the details of the execmod issue [2]&lt;/a&gt;.  &lt;a href=&quot;http://etbe.coker.com.au/2008/09/12/fixing-execmod-textrel-problems-in-lenny/&quot;&gt;The execmod issue with ffmpeg is pretty much the same as it was when I first wrote about the issue in 2008 [3]&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Finally the &lt;b&gt;allow_execmem&lt;/b&gt; boolean needs to be set on i386 with the command &amp;#8220;&lt;b&gt;setsebool -P allow_execmem 1&lt;/b&gt;&amp;#8221; to allow libGL the access it needs.  This is an issue I haven&amp;#8217;t been able to solve, I don&amp;#8217;t know why libGL needs write and execute access to memory, &lt;a href=&quot;http://comments.gmane.org/gmane.comp.security.selinux/14128&quot;&gt;I posted to the SE Linux list about this some time ago but didn&amp;#8217;t get any good answers [4]&lt;/a&gt;.  Any suggestions would be appreciated.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;[1]&lt;a href=&quot;http://etbe.coker.com.au/2008/08/11/executable-stacks-lenny/&quot;&gt; http://etbe.coker.com.au/2008/08/11/executable-stacks-lenny/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;[2]&lt;a href=&quot;http://etbe.coker.com.au/2008/09/11/execmod-and-se-linux-i386-must-die/&quot;&gt; http://etbe.coker.com.au/2008/09/11/execmod-and-se-linux-i386-must-die/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;[3]&lt;a href=&quot;http://etbe.coker.com.au/2008/09/12/fixing-execmod-textrel-problems-in-lenny/&quot;&gt; http://etbe.coker.com.au/2008/09/12/fixing-execmod-textrel-problems-in-lenny/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;[4]&lt;a href=&quot;http://comments.gmane.org/gmane.comp.security.selinux/14128&quot;&gt; http://comments.gmane.org/gmane.comp.security.selinux/14128&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content:encoded>
	<dc:date>2011-02-16T00:02:59+00:00</dc:date>
	<dc:creator>etbe</dc:creator>
</item>
<item rdf:about="http://danwalsh.livejournal.com/40455.html">
	<title>Dan Walsh: Strange SELinux AVC's</title>
	<link>http://danwalsh.livejournal.com/40455.html</link>
	<content:encoded>A bug was just closed where the google chrome plugin sandbox was trying to read a link file within the homedir.&lt;br /&gt;&lt;br /&gt;SELinux is preventing /opt/google/chrome/chrome from read access on the lnk_file &lt;strong&gt;/home/physics-tools/clhep/clhep&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Here is the AVC.&lt;br /&gt;&lt;br /&gt;type=AVC msg=audit(1297435306.238:20321): avc:&amp;nbsp; denied&amp;nbsp; { read } for&amp;nbsp; pid=22631 comm=&amp;quot;chrome&amp;quot; name=&amp;quot;&lt;strong&gt;clhep&lt;/strong&gt;&amp;quot; dev=sda5 ino=8195388 scontext=unconfined_u:unconfined_r:chrome_sandbox_t:s0-s0:c0.c1023&lt;br /&gt;tcontext=unconfined_u:object_r:user_home_t:s0 tclass=lnk_file&lt;br /&gt;&lt;br /&gt;type=SYSCALL msg=audit(1297435306.238:20321): arch=c000003e syscall=2 success=no exit=-2 a0=7fffb3534570 a1=0 a2=0 a3=2f7065686c632f70 items=0 ppid=0&lt;br /&gt;pid=22631 auid=500 uid=500 gid=500 euid=500 suid=500 fsuid=500 egid=500 sgid=500 fsgid=500 tty=(none) ses=7 comm=&amp;quot;chrome&amp;quot;&lt;br /&gt;exe=&amp;quot;/opt/google/chrome/chrome&amp;quot; subj=unconfined_u:unconfined_r:chrome_sandbox_t:s0-s0:c0.c1023 key=(null)&lt;br /&gt;&lt;br /&gt;clhep is included in a high energy physics library &lt;br /&gt;&lt;br /&gt;On the surface this makes no sense at all.&amp;nbsp; You would figure there is not way the chrome sandbox would be reading this random link in the users home directory to the high energy physics library. &lt;br /&gt;&lt;br /&gt;But digging further we found that the .bashrc was executing /home/physics-tools/env/clhep_scr.&amp;nbsp; This script was modifying the LD_LIBRARY_PATH to include many new paths including&lt;strong&gt; /home/physics-tools/clhep/clhep.&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;When you start any application including chome, all paths within the LD_LIBRARY_PATH will be searched.&lt;br /&gt;&lt;br /&gt;This explains why the AVC was generated.&lt;br /&gt;</content:encoded>
	<dc:date>2011-02-14T15:59:57+00:00</dc:date>
	<dc:creator>dwalsh@redhat.com</dc:creator>
</item>
<item rdf:about="http://blogs.fedoraproject.org/wp/mgrepl/?p=149">
	<title>Miroslav Grepl: PLAYING WITH SELINUX … PART #3</title>
	<link>http://blogs.fedoraproject.org/wp/mgrepl/2011/02/08/playing-with-selinux-part-3/</link>
	<content:encoded>&lt;p&gt;The third part of our playing with SELinux is about vncserver. Why vncserver? I want to show you creating new policies is not always necessary.  Also I remember we had really hard time to make vncserver working &lt;img src=&quot;http://blogs.fedoraproject.org/wp/mgrepl/wp-includes/images/smilies/icon_smile.gif&quot; alt=&quot;:-)&quot; class=&quot;wp-smiley&quot; /&gt; .&lt;/p&gt;
&lt;p&gt;First, we need to setup vncserver.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;# yum install tigervnc-server&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;# chcon -t bin_t `which /usr/bin/vncserver`&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Make your /etc/sysconfig/vncserver looking like&lt;/p&gt;
&lt;p&gt;&lt;span&gt;# cat /etc/sysconfig/vncservers&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;VNCSERVERS=&amp;#8221;1:myusername&amp;#8221;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;VNCSERVERARGS[2]=&amp;#8221;-geometry 800&amp;#215;600 -nolisten tcp -localhost&amp;#8221;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Add vnc password and start vncserver&lt;/p&gt;
&lt;p&gt;&lt;span&gt;# vncpasswd $myusername&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;# service vncserver start&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;# ps -eZ | grep vnc&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;
&lt;span&gt;system_u:system_r:initrc_t:s0    5558 ?        00:00:00 Xvnc&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;system_u:system_r:initrc_t:s0    5568 ?        00:00:00 vncconfig&lt;/span&gt; 
&lt;p&gt;How you know from the first part of blog&lt;/p&gt;
&lt;p&gt;&lt;span&gt;initrc_t -&amp;gt; bin_t -&amp;gt; initrc_t&lt;/span&gt; &lt;/p&gt;
&lt;p&gt;Now try to use the vncserver&lt;/p&gt;
&lt;p&gt;&lt;span&gt;# vncviewer localhost:1&lt;/span&gt; &lt;/p&gt;
&lt;p&gt;You might want to say: &quot;It looks good, it works&quot;. But really? Try to run terminal in the vncviewer&lt;/p&gt;
&lt;p&gt;&lt;span&gt;# id -Z&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;system_u:system_r:initrc_t:s0&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt; &lt;br /&gt;
&lt;img src=&quot;http://mgrepl.fedorapeople.org/vnc_initrc.png&quot; width=&quot;900&quot; height=&quot;600&quot; /&gt; &lt;/p&gt;
&lt;p&gt;Bingo. You ended up with the wrong context. What does it mean? You could screw up your machine with wrong labels. For example:&lt;/p&gt;
&lt;p&gt;&lt;span&gt;# touch /tmp/test&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;# ls -lZ /tmp/test&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;-rw-rw-r--. mgrepl mgrepl system_u:object_r:initrc_tmp_t:s0 /tmp/test&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;But this is a wrong context for user's files in the /tmp directory. Should be:&lt;/p&gt;
&lt;p&gt;&lt;span&gt;# ls -lZ /tmp/test1&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;-rw-rw-r--. mgrepl mgrepl staff_u:object_r:user_tmp_t:s0   /tmp/test1&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;So how to fix it? By a new policy? It does not make sense in this case. The vncserver would end up as unconfined domain and screw up our machines. We needed to find out a different solution.&lt;/p&gt;
&lt;p&gt;... SELinux is all about labels.&lt;/p&gt;
&lt;p&gt;Now run.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;# restorecon -v `which vncserver`&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;restorecon reset /usr/bin/vncserver context system_u:object_r:bin_t:s0-&amp;gt;system_u:object_r:unconfined_exec_t:s0&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;And yes, you are seeing our solution. We added the &quot;unconfined_exec_t&quot; label for the vncserver binary.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;# service vncserver restart&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;# ps -eZ | grep vnc&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;system_u:unconfined_r:unconfined_t:s0 6237 ?   00:00:00 Xvnc&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;system_u:unconfined_r:unconfined_t:s0 6245 ?   00:00:00 vncconfig&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;# vncviewer localhost:1&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;# id -Z&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;system_u:unconfined_r:unconfined_t:s0&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt; &lt;br /&gt;
&lt;img src=&quot;http://mgrepl.fedorapeople.org/vnc_unconfined.png&quot; width=&quot;900&quot; height=&quot;600&quot; /&gt; &lt;/p&gt;
&lt;p&gt;And we got the right context for unconfined SELinux user.&lt;/p&gt;</content:encoded>
	<dc:date>2011-02-08T15:23:36+00:00</dc:date>
	<dc:creator>mgrepl</dc:creator>
</item>
<item rdf:about="http://blogs.fedoraproject.org/wp/mgrepl/?p=134">
	<title>Miroslav Grepl: Playing with SELinux … part #2</title>
	<link>http://blogs.fedoraproject.org/wp/mgrepl/2011/02/08/playing-with-selinux-part-2/</link>
	<content:encoded>&lt;p&gt;But we want to see whether it really works and how we can use &lt;strong&gt;&lt;a href=&quot;http://danwalsh.livejournal.com/24537.html&quot;&gt;Permissive Domains&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;We will setup the httpd service to listen on 631/tcp port which is used by CUPS. The portreserve service should prevent to apache from using this port. This is a way how portreserve works.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;# man portreserve&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;portreserve &amp;#8211; reserve ports to prevent portmap mapping them&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Make sure portreserve is running.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;# service portreserve status 2&amp;gt;&amp;amp;1 &amp;gt;/dev/null; echo $?;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;0&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Setup apache, portreserve and try to start apache.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;# if [ -e /etc/portreserve/cups ]; then echo &amp;#8220;The file exists&amp;#8221;; else `echo &amp;#8220;ipp&amp;#8221; &amp;gt; /etc/portreserve/cups`;service portreserve restart;fi;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;# sed -i s/^Listen\ [0-9][0-9]*/Listen\ 631/ /etc/httpd/conf/httpd.conf&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;# date_time=`date +%T`&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;# service httpd start 2&amp;gt;&amp;amp;1 &amp;gt;/dev/null; echo $?;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;1&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;What is a reason apache is not running? Either because portreserve works or because of SELinux? We should analyze it. &lt;/p&gt;
&lt;p&gt;&lt;span&gt;# ausearch -m avc -ts $date_time | audit2allow&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;#&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;#&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;# #============= httpd_t ==============&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;# #!!!! This avc can be allowed using the boolean &amp;#8216;allow_ypbind&amp;#8217;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;#&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;# allow httpd_t ipp_port_t:tcp_socket name_bind;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;In deed, apache is not allowed to use 631/tcp port which is expected. But we want to allow it for our test. How can we do it?&lt;/p&gt;
&lt;p&gt;Turn off SELinux, set a machine to permissive mode?&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Answer is NO&lt;/strong&gt;!!!&lt;/p&gt;
&lt;p&gt;You can allow it using a local policy.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;# grep avc /var/log/audit/audit.log | audit2alow -M mypol&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;# semodule -i mypol.pp&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;or use &amp;#8220;Permissive Domains&amp;#8221;.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;# semanage permissive -a httpd_t&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;This is a way how we do it. How we debug an existing policy, how people can really help us with testing of policies. I like this feature. Make our and your life easier and safer!&lt;/p&gt;
&lt;p&gt;&lt;span&gt;# semanage permissive -l | grep -w httpd_t&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;httpd_t&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;So now we can restart apache and finally see if portreserve works.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;# service httpd start 2&amp;gt;&amp;amp;1 &amp;gt;/dev/null; echo $?;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;1&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;It works! Are you sceptic?&lt;/p&gt;
&lt;p&gt;&lt;span&gt;# service portreserve stop&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;# service httpd start&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;# echo $?&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;0&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;We are done. I believe you like SELinux more now.&lt;/p&gt;
&lt;p&gt;Also you should replace your local portreserve policy by the defaul policy.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;# semodule -r portreserve.pp -i /usr/share/selinux/targeted/portreserve.pp.bz2&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;# for files in `rpm -ql portreserve | grep -E &amp;#8220;(etc|bin|log|lib|run)&amp;#8221;`;do restorecon -R -v $files;done;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;# semanage permissive -d httpd&lt;/span&gt;&lt;/p&gt;</content:encoded>
	<dc:date>2011-02-08T15:20:35+00:00</dc:date>
	<dc:creator>mgrepl</dc:creator>
</item>
<item rdf:about="tag:blogger.com,1999:blog-5024703430482213163.post-3872935420517166958">
	<title>Dominick Grift: selinux q&amp;amp;a</title>
	<link>http://selinux-mac.blogspot.com/2011/02/selinux-q.html</link>
	<content:encoded>23:15  someone&gt; What's the difference between httpd_sys_rw_content_t and &lt;br /&gt;                  httpd_sys_content_rw_t?&lt;br /&gt;23:19  dgrift&gt; none&lt;br /&gt;23:19  dgrift&gt; their aliased&lt;br /&gt;23:19  dgrift&gt; theyre&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width=&quot;1&quot; height=&quot;1&quot; src=&quot;https://blogger.googleusercontent.com/tracker/5024703430482213163-3872935420517166958?l=selinux-mac.blogspot.com&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;</content:encoded>
	<dc:date>2011-02-08T14:22:41+00:00</dc:date>
	<dc:creator>Dominick &quot;domg472&quot; Grift (noreply@blogger.com)</dc:creator>
</item>
<item rdf:about="http://blogs.fedoraproject.org/wp/mgrepl/?p=113">
	<title>Miroslav Grepl: Playing with SELinux … part #1</title>
	<link>http://blogs.fedoraproject.org/wp/mgrepl/2011/02/07/playing-with-selinux-part-1/</link>
	<content:encoded>&lt;p&gt;This Friday I am going to have a speech/workshop at &lt;a href=&quot;https://fedoraproject.org/wiki/DeveloperConference2011&quot;&gt;DeveloperConference2011&lt;/a&gt;. Together with Eduard Benes we will guide you through a process of using permissive domains  for developing a SELinux policy and using it for your advantage and tell you something about sVirt.&lt;br /&gt;
 &lt;/p&gt;
&lt;p&gt;I decided to write a blog related to this workshop. You can go through this blog, try it and prepare some questions. I would also recommend you to look at &lt;a href=&quot;http://danwalsh.livejournal.com/39815.html&quot;&gt;writing SELinux Policy&lt;/a&gt; blog in which Dan Walsh explains some basics of SELinux.&lt;/p&gt;
&lt;p&gt;But now back to my blog &lt;img src=&quot;http://blogs.fedoraproject.org/wp/mgrepl/wp-includes/images/smilies/icon_wink.gif&quot; alt=&quot;;-)&quot; class=&quot;wp-smiley&quot; /&gt; . I was thinking during my Friday&amp;#8217;s travelling which a good example I would show you.  An example which really works. I chose the combination of apache, CUPS and portreserve services (btw. portreserve was my first policy written in Red Hat).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Ready to play with SELinux?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;1.&lt;/strong&gt; First, we need to setup our environment. Stop all intended services and remove the default portreserve policy.  We also need to run the restorecon command to restoring contexts.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;# for s in portreserve cups httpd; do service $s status 2&amp;gt;&amp;amp;1 &amp;gt;/dev/null; if [ $? -eq 0 ]; then service $s stop; fi; done;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;# semodule -r portreserve&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;# for files in `rpm -ql portreserve | grep -E &amp;#8220;(etc|bin|log|lib|run)&amp;#8221;`; do restorecon -R -v $files; done;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;# service portreserve start&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;2.&lt;/strong&gt; Now you can check the context of portreserve service.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;# ps -eZ | grep initrc&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;system_u:system_r:initrc_t:s0    3374 ?        00:00:00 portreserve&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;What happened while we were starting the service? Init script executing the portreserve binary labeled bin_t did not transition and stayed in the same context as the parent process.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;initrc_t -&amp;gt; bin_t -&amp;gt; initrc_t&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Really important to understand.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://danwalsh.livejournal.com/22347.html&quot;&gt;&lt;strong&gt;!! SELinux is all about labels!!&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;If we had tried to setup the cupsd_exec_t context for the portreserve binary, the service would have run in the cupsd_t domain.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;initrc_t -&amp;gt; cupsd_exec_t -&amp;gt; cupsd_t&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;since we define this transition. So let&amp;#8217;s create a new policy which will say&lt;/p&gt;
&lt;p&gt;&lt;span&gt;initrc_t -&amp;gt; portrserve_exec_t -&amp;gt; portreserve_t&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;3.&lt;/strong&gt; Use the sepolgen command.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;# sepolgen –help&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Since the portreserve is a standard init daemon.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;# service portreserve stop&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;# sepolgen -t 0 `which portreserve`&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Created the following files in:&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;./&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;portreserve.te # Type Enforcement file&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;portreserve.if # Interface file&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;portreserve.fc # File Contexts file&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;portreserve.sh # Setup Script&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;4.&lt;/strong&gt; Install the portreserve policy.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;# sh portreserve.sh&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Do some checks.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;# semodule -l | grep portreserve&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;portreserve     1.0.0&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;# ls -Z `which portreserve`&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;-rwxr-xr-x. root root system_u:object_r:portreserve_exec_t:s0 /sbin/portreserve&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;It was really easy &lt;img src=&quot;http://blogs.fedoraproject.org/wp/mgrepl/wp-includes/images/smilies/icon_wink.gif&quot; alt=&quot;;-)&quot; class=&quot;wp-smiley&quot; /&gt; . We have now the basic portreserve policy. Why not try it?&lt;/p&gt;
&lt;p&gt;&lt;span&gt;# service portreserve start&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;# ps -eZ | grep portre&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;system_u:system_r:portreserve_t:s0 3498 ?      00:00:00 portreserve&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Maybe you would like to ask me: &amp;#8220;Is this policy really working? We have Enforcing mode and the daemon is running&amp;#8221;. Well I have two answers for you &lt;img src=&quot;http://blogs.fedoraproject.org/wp/mgrepl/wp-includes/images/smilies/icon_wink.gif&quot; alt=&quot;;-)&quot; class=&quot;wp-smiley&quot; /&gt; .&lt;/p&gt;
&lt;p&gt;a. You can check how the initial policy is good using&lt;/p&gt;
&lt;p&gt;&lt;span&gt;# ausearch -m avc -ts recent&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Probably you will see some AVC messages which are really important for the next steps.&lt;/p&gt;
&lt;p&gt;b. The magic there is the portreserve is running as a permissive domain.&lt;/p&gt;
&lt;p&gt;This means while SELinux access ckecks are performed for these domains, but they are not enforced. The kernel allows the access and reports it as an AVC denial. We can push out a new policy as permissive domain and simply collect AVC messages. Users don’t have to switch to permissive mode globally and they can stay in the enforcing mode.&lt;/p&gt;
&lt;p&gt;Now we can easily to complete/finish our policy using ausearch, audit2allow tools (which are my favourite)&lt;/p&gt;
&lt;p&gt;&lt;span&gt;# service portreserve restart&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;# ausearch -m avc -ts today | grep portreserve | audit2allow -R &amp;gt;&amp;gt; portreserve.te&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Compile and load it:&lt;/p&gt;
&lt;p&gt;&lt;span&gt;# make -f /usr/share/selinux/devel/Makefile&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;# semodule -i portreserve.pp&lt;/span&gt; &lt;/p&gt;
&lt;p&gt;Now we should test if the policy works without the &amp;#8220;permissive domain&amp;#8221; declaration.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;# date_time=`date +%T`&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;# sed -i s/^permissive/#permissive/ portreserve.te&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;# make -f /usr/share/selinux/devel/Makefile&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;# semodule -i portreserve.pp&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;# service portreserve restart 2&amp;gt;&amp;amp;1 &amp;gt;/dev/null; echo $?;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;0&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Looks good. Maybe one additional check would be fine.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;# ausearch -m avc -ts $date_time&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;no matches&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;CONGRATULATIONS.&lt;/p&gt;</content:encoded>
	<dc:date>2011-02-07T22:11:00+00:00</dc:date>
	<dc:creator>mgrepl</dc:creator>
</item>
<item rdf:about="tag:blogger.com,1999:blog-5024703430482213163.post-8991280132991920661">
	<title>Dominick Grift: frequently asked questions: selinux booleans in detail.</title>
	<link>http://selinux-mac.blogspot.com/2011/02/frequently-asked-questions-selinux.html</link>
	<content:encoded>Q: &lt;span&gt;&quot;btw, anyone know if each of the selinux booleans are documented in detail somewhere?&quot;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;A: two levels of detail here:&lt;br /&gt;&lt;br /&gt;   1. &lt;span&gt;semanage boolean -l | grep httpd_enable_homedirs&lt;/span&gt;&lt;br /&gt;   A written description (usually not very detailed) for the &quot;httpd_enable_homedirs&quot; boolean.&lt;br /&gt;&lt;br /&gt;   2. &lt;span&gt;sesearch --allow -SC -T | grep httpd_enable_homedirs&lt;/span&gt;&lt;br /&gt;   All the &quot;allow&quot; type statement rules and type transition rules related to the &quot;httpd_enable_homedirs&quot; boolean. Very detailed but hard to interpret.&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width=&quot;1&quot; height=&quot;1&quot; src=&quot;https://blogger.googleusercontent.com/tracker/5024703430482213163-8991280132991920661?l=selinux-mac.blogspot.com&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;</content:encoded>
	<dc:date>2011-02-06T14:53:32+00:00</dc:date>
	<dc:creator>Dominick &quot;domg472&quot; Grift (noreply@blogger.com)</dc:creator>
</item>
<item rdf:about="tag:blogger.com,1999:blog-5024703430482213163.post-5546042921201310113">
	<title>Dominick Grift: common issues -- part 1</title>
	<link>http://selinux-mac.blogspot.com/2011/02/common-issues-part-1.html</link>
	<content:encoded>22:13  _Tassadar&gt; hi&lt;br /&gt;22:14  _Tassadar&gt; http://fedoraproject.org/wiki/SELinux/samba  -  i'm reading this document, on how to &lt;br /&gt;                   configure selinux to allow samba to share a certain directory&lt;br /&gt;22:14  _Tassadar&gt; now i'd like to share /data/files so i issued chcon -t samba_share_t /data/files&lt;br /&gt;22:14  _Tassadar&gt; it worked, according to ls -Z&lt;br /&gt;22:14  _Tassadar&gt; but access is still denied&lt;br /&gt;22:15  _Tassadar&gt; should i recursively set that label to every file in the share as well?&lt;br /&gt;22:16  SwifT&gt; _Tassadar: (without reading the file) check your AVC denials on what is actually denied, but I &lt;br /&gt;               would say &quot;yes, you'll probably want to recursively set the type&quot;&lt;br /&gt;22:17  _Tassadar&gt; SwifT: what is the best way to check my AVC denials?&lt;br /&gt;22:17  _Tassadar&gt; it's a server, i don't have any gui tools&lt;br /&gt;22:20  dgrift&gt; _Tassadar: try Fedora manage confined services&lt;br /&gt;22:20  _Tassadar&gt; hm no new entries appear in /var/log/audit/audit.log&lt;br /&gt;22:20  SwifT&gt; _Tassadar: depends on your system log configuration; try tail -f /var/log/messages or &lt;br /&gt;               /var/log/audit.log&lt;br /&gt;22:20  _Tassadar&gt; some stuff from cron appears every five mins, but nothing from smb&lt;br /&gt;22:20  dgrift&gt; _Tassadar this is a common issue&lt;br /&gt;22:20  dgrift&gt; its this:&lt;br /&gt;22:21  dgrift&gt; youve created a new mountpoint called /data&lt;br /&gt;22:21  dgrift&gt; selinux doesnt know that location&lt;br /&gt;22:21  dgrift&gt; and so it labels it with a type: default_t&lt;br /&gt;22:21  dgrift&gt; this is a type for locations unknown to selinux&lt;br /&gt;22:21  dgrift&gt; and selinux silently denies access to type default_t&lt;br /&gt;22:22  dgrift&gt; because it should not happen&lt;br /&gt;22:22  dgrift&gt; all locations should be labelled properly&lt;br /&gt;22:22  _Tassadar&gt; ah&lt;br /&gt;22:22  _Tassadar&gt; i see&lt;br /&gt;22:22  dgrift&gt; so how to fix it?:&lt;br /&gt;22:22  _Tassadar&gt; with restorecon probably&lt;br /&gt;22:22  dgrift&gt; well you should start by labelling /data&lt;br /&gt;22:22  dgrift&gt; what type to label it, that depends on your requirements for /data&lt;br /&gt;22:23  _Tassadar&gt; well it's all user data&lt;br /&gt;22:23  dgrift&gt; var_t should probably do&lt;br /&gt;22:23  dgrift&gt; i see&lt;br /&gt;22:23  _Tassadar&gt; no binaries, no devices&lt;br /&gt;22:23  _Tassadar&gt; lots of mp3's :)&lt;br /&gt;22:23  dgrift&gt; whats in /data?&lt;br /&gt;22:23  dgrift&gt; only dirs?&lt;br /&gt;22:23  _Tassadar&gt; yes&lt;br /&gt;22:23  _Tassadar&gt; /data/home/user1 /data/home/user2&lt;br /&gt;22:24  _Tassadar&gt; /data/home/public_area&lt;br /&gt;22:24  _Tassadar&gt; /data/public_area i mean&lt;br /&gt;22:24  dgrift&gt; whats your distro?&lt;br /&gt;22:24  _Tassadar&gt; Fedora 14&lt;br /&gt;22:24  dgrift&gt; ok heres my suggestion&lt;br /&gt;22:24  dgrift&gt; what is /data/home/user1 labelled?&lt;br /&gt;22:24  _Tassadar&gt; nothing yet&lt;br /&gt;22:25  dgrift&gt; but thats a user home dir?&lt;br /&gt;22:25  _Tassadar&gt; drwx------. joe    users unconfined_u:object_r:samba_share_t:s0 joe&lt;br /&gt;22:25  _Tassadar&gt; well&lt;br /&gt;22:25  _Tassadar&gt; i labelled it samba_share_t&lt;br /&gt;22:25  dgrift&gt; ok&lt;br /&gt;22:25  _Tassadar&gt; that's what the docs told me to do :)&lt;br /&gt;22:26  dgrift&gt; what do you want?&lt;br /&gt;22:26  _Tassadar&gt; well it doesn't work yet&lt;br /&gt;22:26  dgrift&gt; what do you want with those dirs?&lt;br /&gt;22:26  _Tassadar&gt; i would like the user to be able to mount his directory from a windows workstation&lt;br /&gt;22:26  dgrift&gt; what is your requirement&lt;br /&gt;22:26  dgrift&gt; i see&lt;br /&gt;22:26  _Tassadar&gt; users are allowed read/write access to their own directories&lt;br /&gt;22:26  dgrift&gt; and not use it locally?&lt;br /&gt;22:26  _Tassadar&gt; and also in the public_area&lt;br /&gt;22:26  _Tassadar&gt; no&lt;br /&gt;22:26  dgrift&gt; ok&lt;br /&gt;22:26  _Tassadar&gt; no shell access&lt;br /&gt;22:27  _Tassadar&gt; no local processes are to be started from /data&lt;br /&gt;22:27  dgrift&gt; so label /data root_t and the other dirs in there samba_share_t&lt;br /&gt;22:27  _Tassadar&gt; recursively?&lt;br /&gt;22:27  dgrift&gt; semanage -a -t root_t -f -d /data&lt;br /&gt;22:28  dgrift&gt; semanage -a -t samba_share_t &quot;/data/home(/.*)?&quot;&lt;br /&gt;22:28  dgrift&gt; restorecon -R -v /data&lt;br /&gt;22:28  dgrift&gt; that will label the data dir root_t&lt;br /&gt;22:28  _Tassadar&gt; nice&lt;br /&gt;22:28  _Tassadar&gt; what does root_t mean?&lt;br /&gt;22:28  dgrift&gt; and /data/home and all below it samba_share_t&lt;br /&gt;22:29  dgrift&gt; it means it the type for filesystem roots&lt;br /&gt;22:29  dgrift&gt; basically its accessable by all&lt;br /&gt;22:29  _Tassadar&gt; oh okay, that makes sense in this case&lt;br /&gt;22:29  dgrift&gt; see if it work&lt;br /&gt;22:29  _Tassadar&gt; what would the -a option do?&lt;br /&gt;22:29  _Tassadar&gt; my system doesn't know -a&lt;br /&gt;22:29  _Tassadar&gt; oh&lt;br /&gt;22:29  _Tassadar&gt; it does&lt;br /&gt;22:29  dgrift&gt; oops&lt;br /&gt;22:30  _Tassadar&gt; something else is wrong&lt;br /&gt;22:30  dgrift&gt; non i made a booboo&lt;br /&gt;22:30  _Tassadar&gt; okay&lt;br /&gt;22:30  dgrift&gt; semanage fcontext -a -t root_t -f -d /data&lt;br /&gt;22:30  dgrift&gt; semanage fcontext -a -t samba_share_t &quot;/data/home(/.*)?&quot;&lt;br /&gt;22:30  dgrift&gt; restorecon -R -v /data&lt;br /&gt;22:31  _Tassadar&gt; lol okay that could take a while&lt;br /&gt;22:31  _Tassadar&gt; i'll run it without -v&lt;br /&gt;22:31  dgrift&gt; hopefully it works for you&lt;br /&gt;22:31  dgrift&gt; yes ok&lt;br /&gt;22:31  _Tassadar&gt; it's a 11TB mount ;)&lt;br /&gt;22:31  dgrift&gt; ouch....&lt;br /&gt;22:31  dgrift&gt; all data on it?&lt;br /&gt;22:31  _Tassadar&gt; yeah, no worries though, i'm not in a hurry&lt;br /&gt;22:32  _Tassadar&gt; it's 60% used ;)&lt;br /&gt;22:32  dgrift&gt; geez&lt;br /&gt;22:32  dgrift&gt; i hope we get this right first time...&lt;br /&gt;22:32  dgrift&gt; might want to test first&lt;br /&gt;22:32  dgrift&gt; with a small dir&lt;br /&gt;22:32  _Tassadar&gt; heh&lt;br /&gt;22:32  _Tassadar&gt; i suppose so&lt;br /&gt;22:32  _Tassadar&gt; ....&lt;br /&gt;22:33  dgrift&gt; chcon -R -t samba_share_t /data/home/smalluserdir&lt;br /&gt;22:33  dgrift&gt; chcon -t root_t /data&lt;br /&gt;22:34  _Tassadar&gt; okay i'll try that&lt;br /&gt;22:34  dgrift&gt; errr&lt;br /&gt;22:34  dgrift&gt; its like this:&lt;br /&gt;22:34  dgrift&gt; chcon -t root_t /data&lt;br /&gt;22:34  dgrift&gt; chcon -t /data/home&lt;br /&gt;22:34  dgrift&gt; err&lt;br /&gt;22:34  _Tassadar&gt; ?&lt;br /&gt;22:34  _Tassadar&gt; lol&lt;br /&gt;22:34  dgrift&gt; chcon -t samba_share_t /data/home&lt;br /&gt;22:34  dgrift&gt; chcon -R -t samba_share_t /data/home/smalluserdir&lt;br /&gt;22:35  dgrift&gt; so three lines&lt;br /&gt;22:35  _Tassadar&gt; yeah i understand, but restorecon is already running so /data and /data/home are already done &lt;br /&gt;                   ;)&lt;br /&gt;22:35  dgrift&gt; because theres 3 dirs&lt;br /&gt;22:35  _Tassadar&gt; i just tried with a small userdir and it works great !&lt;br /&gt;22:35  dgrift&gt; ok&lt;br /&gt;22:35  _Tassadar&gt; but, how do i keep everything neat&lt;br /&gt;22:35  _Tassadar&gt; does restorecond do that?&lt;br /&gt;22:35  _Tassadar&gt; i mean every time someone adds a file&lt;br /&gt;22:36  _Tassadar&gt; it should get the right label immediately&lt;br /&gt;22:36  dgrift&gt; it inherites the type of the parent dir&lt;br /&gt;22:36  dgrift&gt; so should be fine&lt;br /&gt;22:36  _Tassadar&gt; ah i see&lt;br /&gt;22:36  _Tassadar&gt; so what does restorecond do then?&lt;br /&gt;22:36  dgrift&gt; try it&lt;br /&gt;22:36  dgrift&gt; well it watches directories for mislabelled files&lt;br /&gt;22:36  dgrift&gt; but in your case its not applicable&lt;br /&gt;22:37  dgrift&gt; because theres only one type&lt;br /&gt;22:37  _Tassadar&gt; -rw-rw----. joe    users unconfined_u:object_r:samba_share_t:s0 zzzzz.txt&lt;br /&gt;22:37  _Tassadar&gt; yeah that works&lt;br /&gt;22:37  dgrift&gt; samba_share_t&lt;br /&gt;22:37  _Tassadar&gt; ah mislabelled, so not unlabelled&lt;br /&gt;22:37  _Tassadar&gt; i understand&lt;br /&gt;22:37  _Tassadar&gt; real    5m32.340s&lt;br /&gt;22:37  dgrift&gt; well and unlabelled aswell&lt;br /&gt;22:37  _Tassadar&gt; done :)&lt;br /&gt;22:37  dgrift&gt; fast system&lt;br /&gt;22:37  _Tassadar&gt; yeah :)&lt;br /&gt;22:38  dgrift&gt; i should blog about this issue&lt;br /&gt;22:38  dgrift&gt; its very common&lt;br /&gt;22:38  _Tassadar&gt; definately&lt;br /&gt;22:39  dgrift&gt; and people wonder why its not logging denials&lt;br /&gt;22:39  _Tassadar&gt; yeah and the fact that audit.log doesn't show anything makes it hard to track for newbies like &lt;br /&gt;                   me&lt;br /&gt;22:39  _Tassadar&gt; exactly :)&lt;br /&gt;22:39  dgrift&gt; can i use this chat log?&lt;br /&gt;22:39  dgrift&gt; to publish?&lt;br /&gt;22:39  _Tassadar&gt; errrr :)&lt;br /&gt;22:39  _Tassadar&gt; i suppose&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width=&quot;1&quot; height=&quot;1&quot; src=&quot;https://blogger.googleusercontent.com/tracker/5024703430482213163-5546042921201310113?l=selinux-mac.blogspot.com&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;</content:encoded>
	<dc:date>2011-02-06T13:49:16+00:00</dc:date>
	<dc:creator>Dominick &quot;domg472&quot; Grift (noreply@blogger.com)</dc:creator>
</item>
<item rdf:about="http://danwalsh.livejournal.com/40350.html">
	<title>Dan Walsh: selinux-polgengui</title>
	<link>http://danwalsh.livejournal.com/40350.html</link>
	<content:encoded>I&amp;nbsp;am working on preparing a course for Writing Policy with SELinux for the Red Hat Summit.&amp;nbsp; I gave the first version of the talk at FudCon 2011 in Tempe.&amp;nbsp; I noticed the selinux-polgengui was getting a little old looking.&amp;nbsp; This is the tool I&amp;nbsp;advise people to use in order to start writing policy.&amp;nbsp; It generates a group of policy files for you based on you answering a series of questions.&amp;nbsp; Once you have your initial policy you can go use audit2allow or slide to continue writing the policy.&lt;br /&gt;&lt;br /&gt;&lt;a name=&quot;cutid1&quot;&gt;&lt;/a&gt;Any ways here is what the latest tool looks like in Fedora 15.&amp;nbsp; I&amp;nbsp;will demonstrate writing a policy for sandbox. &amp;nbsp;I&amp;nbsp;thought about writing policy to run thunderbird within a sandbox.&lt;br /&gt;&lt;br /&gt;&lt;span&gt;# selinux-polgengui&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;img alt=&quot;&quot; src=&quot;http://people.fedoraproject.org/~dwalsh/SELinux/sepolgen/sandboxtype.jpg&quot; /&gt;&lt;br /&gt;&lt;br /&gt;Select Sandbox, Hit Forward&lt;br /&gt;&lt;br /&gt;&lt;img alt=&quot;&quot; src=&quot;http://people.fedoraproject.org/~dwalsh/SELinux/sepolgen/sandboxname.jpg&quot; /&gt;&lt;br /&gt;&lt;br /&gt;You need to name the policy, In this case I called it sandbox_mail.&amp;nbsp; Click Forward&lt;br /&gt;&lt;br /&gt;&lt;img alt=&quot;&quot; src=&quot;http://people.fedoraproject.org/~dwalsh/SELinux/sepolgen/sandboxbind.jpg&quot; /&gt;&lt;br /&gt; &lt;br /&gt;Since the sandbox_mail app will not be binding to any network ports, I&amp;nbsp;click Forward again.&lt;br /&gt;&lt;br /&gt;&lt;img alt=&quot;&quot; src=&quot;http://people.fedoraproject.org/~dwalsh/SELinux/sepolgen/sandboxconnect.jpg&quot; /&gt;&lt;br /&gt;&lt;br /&gt;I&amp;nbsp;add ports 25, 143, 993 as ports the sandbox will be allowed to connect to.&amp;nbsp; Forward.&lt;br /&gt;&lt;br /&gt;&lt;img alt=&quot;&quot; src=&quot;http://people.fedoraproject.org/~dwalsh/SELinux/sepolgen/sandboxbooleanadd.jpg&quot; /&gt;&lt;br /&gt;&lt;br /&gt;I&amp;nbsp;decide I&amp;nbsp;want to create a boolean called sandbox_mail_connect_all, with the goal of allowing the domain to connect to the entire network.&lt;br /&gt;&lt;br /&gt;&lt;img alt=&quot;&quot; src=&quot;http://people.fedoraproject.org/~dwalsh/SELinux/sepolgen/sandboxboolean.jpg&quot; /&gt;&lt;br /&gt;&lt;br /&gt;Click forward.&lt;br /&gt;&lt;br /&gt;&lt;img alt=&quot;&quot; src=&quot;http://people.fedoraproject.org/~dwalsh/SELinux/sepolgen/sandboxgenerate.jpg&quot; /&gt;&lt;br /&gt;&lt;br /&gt;I&amp;nbsp;tell the tool to create the policy files in the /tmp directory and click Apply.&lt;br /&gt;&lt;br /&gt;&lt;img alt=&quot;&quot; src=&quot;http://people.fedoraproject.org/~dwalsh/SELinux/sepolgen/sandboxfinal.jpg&quot; /&gt;&lt;br /&gt;&lt;br /&gt;The selinux-polgengui tool creates the the policy files and a script to install them.&lt;br /&gt;&lt;br /&gt;Now you execute the sandbox_mail.sh install script.&lt;br /&gt;&lt;span&gt;&lt;br /&gt;# sh sandbox_mail.sh &lt;br /&gt;Building and Loading Policy&lt;br /&gt;+ make -f /usr/share/selinux/devel/Makefile&lt;br /&gt;Compiling targeted sandbox_mail module&lt;br /&gt;/usr/bin/checkmodule:&amp;nbsp; loading policy configuration from tmp/sandbox_mail.tmp&lt;br /&gt;/usr/bin/checkmodule:&amp;nbsp; policy configuration loaded&lt;br /&gt;/usr/bin/checkmodule:&amp;nbsp; writing binary representation (version 10) to tmp/sandbox_mail.mod&lt;br /&gt;Creating targeted sandbox_mail.pp policy package&lt;br /&gt;rm tmp/sandbox_mail.mod tmp/sandbox_mail.mod.fc&lt;br /&gt;+ /usr/sbin/semodule -i sandbox_mail.pp&lt;/span&gt;&lt;span&gt;&lt;br /&gt;&lt;br /&gt;Now you can test out your policy in a different terminal&lt;br /&gt;&lt;br /&gt;&amp;gt; sandbox -X -t sandbox_mail_t thunderbird&lt;br /&gt;&lt;br /&gt;Thunderbird should run fine, since selinux-polgengui defined the SELinux types as permissive.&amp;nbsp; You might want to use a permanent Home and Tmp since you will need to configure the thunderbird setup.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;After running some test with thunderbird, you can use the audit2allow tool to generate more rules for your sandbox_mail sandbox.&lt;br /&gt;&lt;br /&gt;&lt;span&gt;# grep sandbox_mail_t /var/log/audit/audit.log |&amp;nbsp;audit2allow -R &amp;gt;&amp;gt;&amp;nbsp;sandbox_mail.te&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Examine the generated rules to see if they make sense.&lt;br /&gt;&lt;br /&gt;&lt;span&gt;# shell sandbox_mail.sh&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;Try the sandbox again and see if you eliminated all of the AVC's. &amp;nbsp;When you are satisfied the policy works the way you want, you can remove the permissive lines from the te file.&lt;br /&gt;&lt;br /&gt;Please send any Ideas on improving the GUI to me.&lt;/span&gt;&lt;br /&gt;&lt;a name=&quot;cutid1-end&quot;&gt;&lt;/a&gt;</content:encoded>
	<dc:date>2011-02-04T19:28:53+00:00</dc:date>
	<dc:creator>dwalsh@redhat.com</dc:creator>
</item>
<item rdf:about="http://blogs.fedoraproject.org/wp/mgrepl/?p=84">
	<title>Miroslav Grepl: Does a new mod_rails AKA Passenger work with the current Fedora SELinux policy?</title>
	<link>http://blogs.fedoraproject.org/wp/mgrepl/2011/02/03/does-a-new-mod_rails-aka-passenger-work-with-the-current-fedora-selinux-policy/</link>
	<content:encoded>&lt;p&gt;Sometime ago I got the first email about new version Passenger which was not working with our passenger policy.&lt;/p&gt;
&lt;p&gt;How some of you know there is a blog which gives you a lot of useful information how to do Passenger working on Fedora. &lt;/p&gt;
&lt;p&gt;I mean &lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://mifo.sk/posts/passenger-selinux-for-fedora/&quot;&gt;http://mifo.sk/posts/passenger-selinux-for-fedora/ &lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The blog will be updated to provide correct instructions to make Passenger v2 and newer version working. Actually just one step will be changed. It is the fifth point looking like:&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt; 5. Use restorecon to fix labels:&lt;/strong&gt;&lt;br /&gt;
&lt;span&gt;# restorecon -R -v  /usr/lib/ruby/gems/1.8/gems/passenger*&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;# restorecon -R -v /var/run/passenger* /var/lib/passenger*&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
The restorecon command will be needed until Passenger is packaged by Fedora (AFAIK it will be soon).&lt;/p&gt;
&lt;p&gt;I believe these are great news for people.&lt;/p&gt;
&lt;p&gt;Also I have re-written the Fedora passenger policy (changes are based on Dominick&amp;#8217;s policy). This policy is much more safer and passenger guys are testing it this time. &lt;/p&gt;
&lt;p&gt;But if you are interested, send me an email and I can provide you the policy for testing. I will be happy &lt;img src=&quot;http://blogs.fedoraproject.org/wp/mgrepl/wp-includes/images/smilies/icon_wink.gif&quot; alt=&quot;;-)&quot; class=&quot;wp-smiley&quot; /&gt; .&lt;/p&gt;</content:encoded>
	<dc:date>2011-02-03T21:55:34+00:00</dc:date>
	<dc:creator>mgrepl</dc:creator>
</item>
<item rdf:about="http://danwalsh.livejournal.com/39974.html">
	<title>Dan Walsh: Dan Walsh Tweeting?  Follow rhatdan</title>
	<link>http://danwalsh.livejournal.com/39974.html</link>
	<content:encoded>I&amp;nbsp;have finally broken down and did my first tweet,&amp;nbsp; not sure how often I will do it or if it will always be about SELinux/Open&amp;nbsp;Source. &amp;nbsp; Then again I&amp;nbsp;never thought I&amp;nbsp;would blog much.&lt;br /&gt;&lt;br /&gt;But if you want to follow me, sign up for rhatdan.</content:encoded>
	<dc:date>2011-02-03T17:50:07+00:00</dc:date>
	<dc:creator>dwalsh@redhat.com</dc:creator>
</item>
<item rdf:about="http://danwalsh.livejournal.com/39815.html">
	<title>Dan Walsh: Presenting at Fudcon.</title>
	<link>http://danwalsh.livejournal.com/39815.html</link>
	<content:encoded>These are the links to the presentations I&amp;nbsp;have given at Fudcon.&lt;br /&gt;&lt;br /&gt;Writing SELinux Policy&lt;br /&gt;&lt;a href=&quot;http://people.fedoraproject.org/~dwalsh/SELinux/Presentations/PolicyGeneration.odp&quot; rel=&quot;nofollow&quot;&gt;http://people.fedoraproject.org/~dwalsh/SELinux/Presentations/PolicyGeneration.odp&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Introducingthe SELinux Sandbox&lt;br /&gt;&lt;a href=&quot;http://people.fedoraproject.org/~dwalsh/SELinux/Presentations/sandbox.odp&quot; rel=&quot;nofollow&quot;&gt;http://people.fedoraproject.org/~dwalsh/SELinux/Presentations/sandbox.odp&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;FudCon talks:&lt;br /&gt;Interesting talks on autoQA.&amp;nbsp; The basic idea of this tool was to look at Updates and make sure they don't break the distribution.&lt;br /&gt;For example they are doing a dependency check on an update package, and if it fails, the package will not be allowed to be pushed.&lt;br /&gt;One suggestion I&amp;nbsp;had for the tool was to make sure the updated package did not cause the Minimal Install to increase size.&amp;nbsp; Similarly it could make sure the desktop livecd would still fit on a cdrom or whatever the maximum size is.&lt;br /&gt;&lt;br /&gt;Only saw the tail end of the Matahari talk, but looks like an interesting product, that we might be able to take advantage of.&amp;nbsp; &amp;nbsp;We need to write SELinux policy for it, and some how figure we could use sectool/openscap with it.&lt;br /&gt;&lt;br /&gt;Attended the Spins Talk, which I&amp;nbsp;am still interested in integrating the ability to build the kiosk OS.&lt;br /&gt;</content:encoded>
	<dc:date>2011-01-30T19:23:42+00:00</dc:date>
	<dc:creator>dwalsh@redhat.com</dc:creator>
</item>
<item rdf:about="tag:blogger.com,1999:blog-5240359826706545510.post-6518269643502648066">
	<title>Thomas Biege (Security): Mail: recent security breaches of open-source sites</title>
	<link>http://thetoms-random-thoughts.blogspot.com/2011/01/mail-recent-security-breaches-of-open.html</link>
	<content:encoded>This mail was sent out to some &lt;span&gt;opensuse&lt;/span&gt; mailing lists to increase awareness.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;Dear community members and contributors,&lt;br /&gt;&lt;br /&gt;in the last few month we saw security breaches at gnu.org[1], at&lt;br /&gt;sourceforge.net[2] and at fedora[3].&lt;br /&gt;&lt;br /&gt;Even if it is believed that the integrity of the hosted projects&lt;br /&gt;was not affected I want to take the opportunity to remind you to&lt;br /&gt;always verify the cryptographic checksums of downloaded archive&lt;br /&gt;files, review patches and keep a healthy relationship/communication&lt;br /&gt;to the upstream authors.&lt;br /&gt;&lt;br /&gt;It is good practise to change your password from time to time and make&lt;br /&gt;it hard to guess[4][5]. Take extra care using public wifi hotspots,&lt;br /&gt;crowded places[6], like trains, and other peoples computer etc.&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;Thomas&lt;br /&gt;&lt;br /&gt;[1] http://blog.sucuri.net/2010/11/savannah-gnu-org-hacked-and-currently-offline.html&lt;br /&gt;[2] http://sourceforge.net/apps/wordpress/sourceforge/2011/01/27/service-downtime/&lt;br /&gt;[3] http://lists.fedoraproject.org/pipermail/announce/2011-January/002911.html&lt;br /&gt;[4] http://en.wikipedia.org/wiki/Password_strength&lt;br /&gt;[5] http://sourceforge.net/projects/pwgen/&lt;br /&gt;[6] http://en.wikipedia.org/wiki/Shoulder_surfing_%28computer_security%29&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;!-- BlogCounter Code START --&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://www.blogcounter.de/&quot; id=&quot;bclink&quot; title=&quot;kostenloser Counter fuer Weblogs&quot;&gt;&lt;span id=&quot;bccount&quot;&gt;kostenloser Counter&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://www.blogcounter.de/&quot;&gt;&lt;img alt=&quot;Weblog counter&quot; src=&quot;http://track.blogcounter.de/log.php?id=thetom_blog&quot; /&gt;&lt;/a&gt; - &lt;/p&gt;&lt;!-- BlogCounter Code END --&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width=&quot;1&quot; height=&quot;1&quot; src=&quot;https://blogger.googleusercontent.com/tracker/5240359826706545510-6518269643502648066?l=thetoms-random-thoughts.blogspot.com&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;</content:encoded>
	<dc:date>2011-01-28T06:10:17+00:00</dc:date>
	<dc:creator>Thomas (noreply@blogger.com)</dc:creator>
</item>
<item rdf:about="http://danwalsh.livejournal.com/39534.html">
	<title>Dan Walsh: Red Hat Virtual Experience January 26, 2011 1PM EST</title>
	<link>http://danwalsh.livejournal.com/39534.html</link>
	<content:encoded>&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://www.redhat.com/virtual/&quot; rel=&quot;nofollow&quot;&gt;http://www.redhat.com/virtual/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;Red Hat Enterprise Linux 6: Security  &lt;/span&gt;&lt;h4&gt;&lt;a href=&quot;http://www.redhat.com/virtual/speakers/index.html#walsh&quot; rel=&quot;nofollow&quot;&gt;Daniel Walsh&lt;/a&gt; &amp;mdash; Principal Software Engineer, Red Hat&lt;/h4&gt;  In this session, Daniel Walsh will show attendees new SELinux features  and explain how to use them in Red Hat Enterprise Linux 6. He will cover  several SELinux topics, including:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Confining users&lt;/li&gt;&lt;li&gt;Securing your virtual environment&lt;/li&gt;&lt;li&gt;Securing the desktop&lt;/li&gt;&lt;li&gt;Controlling grid jobs&lt;/li&gt;&lt;li&gt;Sandboxing: putting the power into the hands of the administrator&lt;/li&gt;&lt;li&gt;Building and shipping your own SELinux policy&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;</content:encoded>
	<dc:date>2011-01-25T15:24:07+00:00</dc:date>
	<dc:creator>dwalsh@redhat.com</dc:creator>
</item>
<item rdf:about="http://danwalsh.livejournal.com/39197.html">
	<title>Dan Walsh: Attending FudCon in Tempe Arizona this weekend.</title>
	<link>http://danwalsh.livejournal.com/39197.html</link>
	<content:encoded>If you are going to be there stop by and say hi.&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;br /&gt;Will probably do some talks on SELinux, including talking about Writing Policy and Using Iptables and SELinux together to confine applications.&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://fedoraproject.org/wiki/FUDCon:Tempe_2011&quot; rel=&quot;nofollow&quot;&gt;http://fedoraproject.org/wiki/FUDCon:Tempe_2011&lt;/a&gt;</content:encoded>
	<dc:date>2011-01-25T15:11:32+00:00</dc:date>
	<dc:creator>dwalsh@redhat.com</dc:creator>
</item>
<item rdf:about="tag:blogger.com,1999:blog-5024703430482213163.post-3822209684765812282">
	<title>Dominick Grift: Yet another step by step introduction to policy development.</title>
	<link>http://selinux-mac.blogspot.com/2011/01/yet-another-step-by-step-introduction.html</link>
	<content:encoded>Due to several requests for guides to writing SELinux policy i have decided to create another screen cast detailing how to create a policy for a user application, and some of the things that may help one get familiar with policy writing.&lt;br /&gt;&lt;br /&gt;As per usual by now, it is just a amateur production for amateurs. These recordings are pretty boring and long. I do advise that you view the whole thing in the proper order. Because things may not be explained well all the time, but most of it should become more clear in the course of the series.&lt;br /&gt;&lt;br /&gt;Sometimes i make mistakes that i later notice. By the end of the series everything is pretty much sorted out (except atleast one pretty minor issue that i consider as an exercise to the watcher to troubleshoot and solve).&lt;br /&gt;&lt;br /&gt;Also note that i encountered a conflict with restorecond -u (run in a gnome-session) with regard to labelling a file in the user home directory. I worked around that issue, but it will work fine when one logs out and back in, when it occurs.&lt;br /&gt;&lt;br /&gt;part 1. Setting up an optimal environment for policy writing and in the mean time i explain my view on policy writing and every aspect of it.&lt;br /&gt;&lt;br /&gt;http://www.youtube.com/watch?v=s4EyoW_7riQ&lt;br /&gt;&lt;br /&gt;part 2. Do it yourself: create a simple script and write raw policy for it. Introduction to type transition, allow, dontaudit and other type statements. A start at translating raw policy that SELinux understands into policy that is maintainable and readable by humans and that is scalable in a modular environment.&lt;br /&gt;&lt;br /&gt;http://www.youtube.com/watch?v=G5gUt1-ttGg&lt;br /&gt;&lt;br /&gt;part 3. Proceed with translation of raw policy to m4 macro language powered policy. Merge our loadable policy module into upstream tresys reference policy.&lt;br /&gt;&lt;br /&gt;http://www.youtube.com/watch?v=nbFnchVAgYs&lt;br /&gt;&lt;br /&gt;part 4. troubleshoot remaining issues and fix them.&lt;br /&gt;&lt;br /&gt;http://www.youtube.com/watch?v=rUGBgzTr92A&lt;br /&gt;&lt;br /&gt;If you have specific question with regard to the series above feel free to ask for clarification.&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width=&quot;1&quot; height=&quot;1&quot; src=&quot;https://blogger.googleusercontent.com/tracker/5024703430482213163-3822209684765812282?l=selinux-mac.blogspot.com&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;</content:encoded>
	<dc:date>2011-01-24T06:52:17+00:00</dc:date>
	<dc:creator>Dominick &quot;domg472&quot; Grift (noreply@blogger.com)</dc:creator>
</item>
<item rdf:about="http://etbe.coker.com.au/?p=2597">
	<title>Russell Coker (security): Continuously Usable Testing of SE Linux</title>
	<link>http://etbe.coker.com.au/2011/01/22/cut-se-linux/</link>
	<content:encoded>&lt;p&gt;&lt;a href=&quot;http://kitenet.net/~joey/code/debian/cut/&quot;&gt;Joey has proposed a new concept of &amp;#8220;Continuously Usable Testing&amp;#8221; for Debian [1]&lt;/a&gt;, basically testing should be usable at all times and packages that aren&amp;#8217;t usable should be dropped.  But to properly achieve this goal we need continual testing of usability.&lt;/p&gt;
&lt;h3&gt;The Plan For SE Linux&lt;/h3&gt;
&lt;p&gt;To do this for SE Linux I&amp;#8217;m setting up a Xen server which will have a number of different DomUs for testing a variety of server applications.  The system has 1.5G of RAM and 160G of mirrored storage.  An image of a typical server will take about 4G of disk space, so we could have something like 40 images online and ready for testing.  I have already setup Squid on another system on the same LAN to cache Debian packages, so running &amp;#8220;&lt;i&gt;apt-get dist-upgrade&lt;/i&gt;&amp;#8221; on a number of DomUs won&amp;#8217;t take that long.  With 256M for a typical server image I could have 5 images running at the same time.  If the hardware isn&amp;#8217;t enough then I can expand it, I hope to get some donations of DDR-266 or DDR-333 RAM (or maybe DDR-400) to upgrade the system to 4G of RAM, I can add more hard drives, and I could even install more servers.&lt;/p&gt;
&lt;p&gt;I want to have testing be very usable for SE Linux throughout the development cycle so that I don&amp;#8217;t have to rush things before release.&lt;/p&gt;
&lt;p&gt;At this stage I&amp;#8217;m not sure whether to track Unstable or Testing for this.  I guess it might be best to track Testing most of the time and only track Unstable for daemons that are changing rapidly.  It might get boring testing every version that comes through Unstable, but if people want to do this then I won&amp;#8217;t stop them.&lt;/p&gt;
&lt;h3&gt;Setting up the Tests&lt;/h3&gt;
&lt;p&gt;What I need are interested people who want to install server configurations for testing.  If you have some favorite combination of daemons that you want tested for SE Linux support (even if it&amp;#8217;s daemons that have no current policy) then I can give you root access to a DomU to develop test cases.  Ideally there would be automated tests used for most things for example testing a mail server by using &lt;i&gt;swaks&lt;/i&gt; to deliver mail and a POP or IMAP client script to retrieve it.  But some things can&amp;#8217;t be tested properly without human intervention.&lt;/p&gt;
&lt;p&gt;For the automated tests I want to script the creation of DomUs, upgrading the packages in the DomU, testing it, and then shutting down the DomU if it all works.  If at any time the tests fail (or the upgrade fails) then it would wait for human intervention.  That would be me fixing SE Linux problems and other people fixing the application problems.  I think that discovering SE Linux issues will only be a part of this project.&lt;/p&gt;
&lt;p&gt;For the manual tests I will grant access to create and destroy the DomUs in question to people who can run the tests.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;m thinking of having a couple of DomUs running permanently for things which are test candidates but also useful for the project, such as a MediaWiki instance.  It really depends on the interest of people who might use such things.&lt;/p&gt;
&lt;p&gt;Also I&amp;#8217;m thinking of setting up some Ubuntu DomUs too, I probably should join Ubuntu and get involved with SE Linux there.&lt;/p&gt;
&lt;h3&gt;Sharing the Images&lt;/h3&gt;
&lt;p&gt;I have a web server in Germany with almost unlimited bandwidth and storage.  For every image that is created I want to upload a version to the server in Germany to allow anyone in the world to test it.  There are lots of possible ways of using this for software development.  For example if you had a patched version of Apache that you wanted to test then you could download every image that had Apache installed and test that they all work.  That would be easier than configuring Apache in different ways and also possibly provide better coverage.&lt;/p&gt;
&lt;p&gt;Also if someone can&amp;#8217;t figure out how to configure a daemon correctly then downloading a Xen image of a working configuration could be helpful (if a little bandwidth intensive).  Note that deploying such an image in production would be a really bad idea, among other things there are lots of places where passwords are stored and you wouldn&amp;#8217;t want to risk missing one.&lt;/p&gt;
&lt;p&gt;I also plan to share the scripts used in running the Dom0 and anything else that seems useful along the way.&lt;/p&gt;
&lt;h3&gt;What We Need&lt;/h3&gt;
&lt;p&gt;The main thing we need is volunteers to configure virtual machines with their favorite daemons.  Note that I don&amp;#8217;t plan to have only one daemon per DomU, if we can get multiple daemons running that don&amp;#8217;t conflict (EG file server and mail server) or multiple daemons that can interact (EG database server and a mail server or anything else that can be a database client) running on the same system then that&amp;#8217;s a good thing.  So there will be some degree of interaction with other people.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;m happy to accept contributions from people who aren&amp;#8217;t interested in SE Linux.  But SE Linux will run on all DomUs.&lt;/p&gt;
&lt;p&gt;Finally I also need more RAM for a HP D530S, DU875PA (that&amp;#8217;s a Celeron 2.4GHz).  I&amp;#8217;ll accept donations of complete systems too once my HP system gets full, preferably relatively low power systems as they will be housed in a location that&amp;#8217;s not as well ventilated as I would like (cost and availability of IP addresses were the main criteria).  A laptop with a broken screen would be great!&lt;/p&gt;
&lt;p&gt;The system won&amp;#8217;t go live until Monday, but I think that probably people won&amp;#8217;t be ready to do much work with less than two days notice anyway.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;[1]&lt;a href=&quot;http://kitenet.net/~joey/code/debian/cut/&quot;&gt; http://kitenet.net/~joey/code/debian/cut/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content:encoded>
	<dc:date>2011-01-22T08:48:31+00:00</dc:date>
	<dc:creator>etbe</dc:creator>
</item>
<item rdf:about="http://danwalsh.livejournal.com/39155.html">
	<title>Dan Walsh: execstack on the rampage II</title>
	<link>http://danwalsh.livejournal.com/39155.html</link>
	<content:encoded>In one of the allow_execstack bug reports someone asked me, shouldn't the tools do a better job of discovering the cause of the execstack?&amp;nbsp; I needed a better way of figuring out what library was causing the execstack AVC,&amp;nbsp; &lt;br /&gt;&lt;br /&gt;Since all I have in the AVC&amp;nbsp;is the source path, I&amp;nbsp;figured could use ldd to list the libraries used by it.&amp;nbsp; Then I&amp;nbsp;could examine these libraries using execstack -q and see if any had the flag execstack flag turned on.&lt;br /&gt;&lt;br /&gt;Nalin Dahyabhai suggested that I should also search /proc/PID/maps for shared libraries that might have been dlopened.&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;br /&gt;I wrote the python script &lt;a href=&quot;http://people.fedoraproject.org/~dwalsh/SELinux/findexecstack&quot; rel=&quot;nofollow&quot;&gt;findexecstack&lt;/a&gt; which takes an executable path and optional pid as parameters.&amp;nbsp; It then reports any execstack libraries that if finds used by the executable or PID.&lt;br /&gt;&lt;br /&gt;I am now adding this code to the allow_execstack setroubleshoot plugin which should give us a better troubleshooting and say something like: &lt;br /&gt;&lt;br /&gt;If you believe the APPLICATION does not need execstack and you have a libary /usr/lib/libxvid.s0 requiring it you can execute&lt;br /&gt;&lt;br /&gt;execstack -c  /usr/lib/libxvid.s0 &lt;br /&gt;&lt;br /&gt;And try the app again.&lt;br /&gt;&lt;br /&gt;If you get the execstack violation, please try out the script until I&amp;nbsp;get the new plugin pushed.</content:encoded>
	<dc:date>2011-01-17T18:54:27+00:00</dc:date>
	<dc:creator>dwalsh@redhat.com</dc:creator>
</item>
<item rdf:about="tag:blogger.com,1999:blog-5240359826706545510.post-7711893362827725942">
	<title>Thomas Biege (Security): Tool: OWASP test-suite</title>
	<link>http://thetoms-random-thoughts.blogspot.com/2011/01/tool-owasp-test-suite.html</link>
	<content:encoded>A happy new year!&lt;br /&gt;&lt;br /&gt;I quickly hacked a test-suite based on the OWASP testing-guide. You can find the code here: &lt;a href=&quot;http://gitorious.org/sectestsuite/websec&quot;&gt;http://gitorious.org/sectestsuite/websec&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Take care, this time it is untested, incomplete and unfancy.&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;prompt&gt;  src/websec.pl myconfig.ini output=short&lt;br /&gt;=====&gt; OWASP_CM_001::sslv2: CWE-XYZ (): code = 0 (msg = 'PASS')&lt;br /&gt;=====&gt; OWASP_CM_001::weak_ciphers: CWE-327 (Use of a Broken or Risky Cryptographic Algorithm): code = 0 (msg = 'PASS')&lt;br /&gt;=====&gt; OWASP_CM_008::http_dangerous_methods: CWE-749 (Exposed Dangerous Method or Function): code = 0 (msg = 'PASS')&lt;br /&gt;=====&gt; OWASP_CM_008::http_arbitrary_methods: CWE-749:CWE-650 (Exposed Dangerous Method or Function:Trusting HTTP Permission Methods on the Server Side): code = 1 (msg = 'FAIL:HTTP arbitrary/dangerous methods allowed (UNLOCK)')&lt;br /&gt;=====&gt; OWASP_CM_008::http_bypass_head: CWE-650 (Trusting HTTP Permission Methods on the Server Side): code = 0 (msg = 'PASS')&lt;br /&gt;=====&gt; OWASP_AT_002::user_enumerate: CWE-204 (Response Discrepancy Information Exposure): code = 0 (msg = 'PASS')&lt;br /&gt;=====&gt; OWASP_AT_002::uri_probing: CWE-204 (Response Discrepancy Information Exposure): code = 1 (msg = 'FAIL:URI probing emits different HTTP status code (200 vs 404)')&lt;br /&gt;=====&gt; OWASP_AT_007::user_really_logged_out: CWE-672 (Operation on a Resource after Expiration or Release): code = 1 (msg = 'FAIL: Still able to access private page even after logging out.')&lt;br /&gt;        OWASP_AT_007::session_timeout_used: wait for 120 + 10 seconds&lt;br /&gt;=====&gt; OWASP_AT_007::session_timeout_used: CWE-613 (Insufficient Session Expiration): code = 0 (msg = 'FAIL: Private page was still accessible after timeout (120 + 10 secs).')&lt;br /&gt;=====&gt; OWASP_AZ_001::path_traversal: CWE-22 (Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')): code = 0 (msg = 'PASS')&lt;br /&gt;=====&gt; OWASP_SM_002::cookie_security: CWE-614 (Sensitive Cookie in HTTPS Session Without 'Secure' Attribute): code = 1 (msg = 'FAIL:Path attribute points to '/'')&lt;br /&gt;=====&gt; OWASP_SM_003::session_fixation_public: CWE-384 (Session Fixation): code = -2 (msg = 'INFO: Unable to get Cookie from public page')&lt;br /&gt;=====&gt; OWASP_SM_003::session_fixation_private: CWE-384 (Session Fixation): code = 1 (msg = 'FAIL:Vulnerable to Session Fixation Attack by authenticated users')&lt;br /&gt;=====&gt; OWASP_SM_004::cookie_not_fresh: CWE-323 (Reusing a Nonce, Key Pair in Encryption): code = 1 (msg = 'FAIL: Vulnerable of re-using session cookies')&lt;br /&gt;=====&gt; OWASP_SM_004::cookie_secure_storage: CWE-312:CWE-613 (Cleartext Storage of Sensitive Information:Insufficient Session Expiration): code = 1 (msg = 'FAIL:'Expires' header not set:Cache-Control header not set.')&lt;br /&gt;=====&gt; OWASP_SM_004::cookie_via_get:  (): code = 0 (msg = 'PASS: Unable to login via GET.')&lt;br /&gt;=====&gt; OWASP_SM_005::csrf: CWE-352 (Cross-Site Request Forgery (CSRF)): code = 1 (msg = 'FAIL:Vulnerable to CSRF Attack (HTTP code 200)')&lt;br /&gt;&lt;br /&gt;17 test in 155 secs.&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;!-- BlogCounter Code START --&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://www.blogcounter.de/&quot; id=&quot;bclink&quot; title=&quot;kostenloser Counter fuer Weblogs&quot;&gt;&lt;span id=&quot;bccount&quot;&gt;kostenloser Counter&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://www.blogcounter.de/&quot;&gt;&lt;img alt=&quot;Weblog counter&quot; src=&quot;http://track.blogcounter.de/log.php?id=thetom_blog&quot; /&gt;&lt;/a&gt; - &lt;/p&gt;&lt;!-- BlogCounter Code END --&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width=&quot;1&quot; height=&quot;1&quot; src=&quot;https://blogger.googleusercontent.com/tracker/5240359826706545510-7711893362827725942?l=thetoms-random-thoughts.blogspot.com&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;</content:encoded>
	<dc:date>2011-01-12T06:06:26+00:00</dc:date>
	<dc:creator>Thomas (noreply@blogger.com)</dc:creator>
</item>
<item rdf:about="http://danwalsh.livejournal.com/38736.html">
	<title>Dan Walsh: execstack on the rampage.</title>
	<link>http://danwalsh.livejournal.com/38736.html</link>
	<content:encoded>Currently in Fedora 14 execstack avc's seem to be popping up all over the place.&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://www.akkadia.org/drepper/selinux-mem.html&quot; rel=&quot;nofollow&quot;&gt;As Uli Drepper describes:&lt;/a&gt;&lt;div&gt;&lt;dl&gt;&lt;/dl&gt;&lt;/div&gt;&lt;div&gt;&lt;dl&gt;&lt;/dl&gt;&lt;/div&gt;&lt;dl&gt;&lt;dt&gt;&lt;span&gt;&lt;tt&gt;execstack&lt;/tt&gt;&lt;/span&gt;&lt;/dt&gt;&lt;dt&gt;&lt;span&gt;       &lt;br /&gt;&lt;/span&gt;&lt;/dt&gt;&lt;/dl&gt;&lt;div&gt;&lt;dl&gt;&lt;dd&gt;&lt;/dd&gt;&lt;/dl&gt;&lt;dl&gt;&lt;dd&gt;&lt;/dd&gt;&lt;/dl&gt;&lt;/div&gt;&lt;dl&gt;&lt;dd&gt;&lt;p&gt;&lt;span&gt;As the name suggests, this error is raised if a program       tries to make its stack (or parts thereof) executable with an       &lt;tt&gt;mprotect&lt;/tt&gt; call.  This should never, ever be necessary.       Stack memory is not executable on most OSes these days and this       won't change.  Executable stack memory is one of the biggest       security problems.  An &lt;tt&gt;execstack&lt;/tt&gt; error might in fact be       most likely raised by malicious code.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;See &lt;/span&gt;&lt;a href=&quot;http://people.redhat.com/drepper/nonselsec.pdf&quot; rel=&quot;nofollow&quot;&gt;&lt;span&gt;my       overview of security features&lt;/span&gt;&lt;/a&gt;&lt;span&gt; in Fedora and RHEL for more       information, specifically appendix A.  It explains how to avoid       executable stacks.&lt;/span&gt;&lt;/p&gt;&lt;/dd&gt;&lt;dt&gt;What exactly caused this, I am not sure.&amp;nbsp; We have been telling people to search for libraries marked with the execstack flag.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;/dt&gt;&lt;dt&gt;&lt;span&gt; # find /lib -exec execstack -q {} \; -print 2&amp;gt; /dev/null | grep ^X  &lt;br /&gt;# find /usr/lib -exec execstack -q {} \; -print 2&amp;gt; /dev/null | grep ^X  &lt;br /&gt;&lt;/span&gt;&lt;/dt&gt;&lt;dt&gt;&lt;span&gt;or&lt;br /&gt;# find /lib64 -exec execstack -q {} \; -print 2&amp;gt; /dev/null | grep ^X  &lt;/span&gt;&lt;/dt&gt;&lt;dt&gt;&lt;span&gt;# find /usr/lib64 -exec execstack -q {} \; -print 2&amp;gt; /dev/null | grep ^X&lt;/span&gt;&lt;/dt&gt;&lt;/dl&gt;                            &lt;span class=&quot;bz_comment_actions&quot;&gt;                                       &lt;/span&gt;If you find one, you can turn off the execstack flag using:&lt;br /&gt;&lt;br /&gt; &lt;div&gt;&lt;span&gt;/usr/bin/execstack -c BADLIB.so.&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;Now you can try the application again and make sure everything continues to work.&amp;nbsp; In most cases the app will work fine and the execstack avc will be eliminated.&lt;br /&gt;&lt;br /&gt;John Reiser comments in the &lt;a href=&quot;https://bugzilla.redhat.com/show_bug.cgi?id=652297&quot; rel=&quot;nofollow&quot;&gt;bugzilla&lt;/a&gt; that if you build a library that is asking for execstack you can fix it:&lt;span&gt;&lt;span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;The package maintainer can turn off execstack when linking the app by&amp;nbsp;&amp;nbsp; &lt;br /&gt;adding &amp;quot;-Wl,-z,noexecstack&amp;quot; to the LDFLAGS (or CFLAGS) in the Makefile.&amp;nbsp;&lt;/div&gt;&lt;div&gt;This takes precedence over .o files or libraries that request execstack,&amp;nbsp; &lt;br /&gt;either deliberately or because some .S assembly language file forgot to&amp;nbsp;&lt;/div&gt;&lt;div&gt;use &amp;quot;.section .note.GNU-stack,&amp;quot;&amp;quot;,@progbits&amp;quot; where the empty attribute&amp;nbsp;&amp;nbsp; &lt;br /&gt;string &amp;quot;&amp;quot; turns off execstack.&lt;/div&gt;&lt;br /&gt;&lt;/span&gt; &lt;/span&gt;Finally there has been some indication that the culprit has been libxvidcore... &lt;br /&gt;&lt;pre class=&quot;bz_comment_text&quot;&gt;&lt;span&gt;execstack -c /usr/lib/libxvidcore.so*&lt;/span&gt;&lt;/pre&gt;</content:encoded>
	<dc:date>2011-01-10T20:36:49+00:00</dc:date>
	<dc:creator>dwalsh@redhat.com</dc:creator>
</item>
<item rdf:about="http://blogs.fedoraproject.org/wp/mgrepl/?p=22">
	<title>Miroslav Grepl: New policies and your help are still needed …</title>
	<link>http://blogs.fedoraproject.org/wp/mgrepl/2011/01/09/new-policies-and-your-help-are-still-needed/</link>
	<content:encoded>&lt;p&gt;Sunday, another rainy day in the Czech Republic, because of this I started to explore some new features in Fedora15. Bingo, one of them, which I like,  &amp;#8220;&lt;a href=&quot;http://fedoraproject.org/wiki/Features/DynamicFirewall&quot;&gt;dynamic firewall&lt;/a&gt;&amp;#8221; is not confined by SELinux.&lt;/p&gt;
&lt;p&gt;How can we find it out? It is pretty easy. Either SELinux is complaining and an application/service does not work or just using&lt;/p&gt;
&lt;p&gt;&lt;span&gt;# ps -eZ | grep initrc_t&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Since initrc_t is the default label we give to procesess started by the init system.  If we see a process running as initrc_t, we know the process does not have policy written for it.&lt;/p&gt;
&lt;p&gt;So I am seeing:&lt;/p&gt;
&lt;p&gt;&lt;span&gt;# service firewalld start&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;# ps -eZ | grep initrc_t&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;system_u:system_r:initrc_t:s0    2267 ?        00:00:00 firewalld&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Which tells me the service is not confined and I should do more investigation about that and probably I will need to confine this service. &lt;/p&gt;
&lt;p&gt;Discovering new unconfined services makes me happy. I will have fine work.&lt;/p&gt;
&lt;p&gt;But it also reminds me:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&amp;#8220;You should tell people to report these new unconfined applications/services to you, Dan Walsh or bugzilla and thank them they are heads-up&amp;#8221;&lt;/strong&gt;. &lt;/p&gt;
&lt;p&gt;The earlier we confine a process the better SELinux will work in the next Fedora release.  Maybe some people would like to better understand writing SELinux policy themselves. It is easy too. &lt;/p&gt;
&lt;p&gt;Let’s follow my steps:&lt;/p&gt;
&lt;p&gt;1. Use the sepolgen command.  &lt;/p&gt;
&lt;p&gt;&lt;span&gt;# sepolgen &amp;#8211;help&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Since the firewalld is a standard init daemon.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;# sepolgen -t 0 `which firewalld`&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Which gives us the firewalld policy files and the firewalld.sh script to install a new policy.&lt;/p&gt;
&lt;p&gt;3. Install the firewalld policy.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;# sh firewall.sh&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;4. Do some checks.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;# semodule -l | grep firewalld&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;firewalld	1.0.0&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;# ls -Z `which firewalld`&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;-rwxr-xr-x. root root system_u:object_r:firewalld_exec_t:s0       /usr/sbin/firewalld&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;# ps -eZ | grep firewalld&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;system_u:system_r:firewalld_t:s0 2679 ?        00:00:00 firewalld&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;That&amp;#8217;s all.&lt;/p&gt;
&lt;p&gt;You have the basic SELinux policy for the firewalld which will run as a permissive domain. Now you could just catch all AVC messages, use audit2allow to generate policy&lt;/p&gt;
&lt;p&gt;&lt;span&gt;# grep firewalld /var/log/audit/audit.log | audit2allow -R &amp;gt;&amp;gt; firewalld.te&lt;br /&gt;
&lt;span&gt;# sh firewalld.sh&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;and tell me you have great news for us &lt;img src=&quot;http://blogs.fedoraproject.org/wp/mgrepl/wp-includes/images/smilies/icon_smile.gif&quot; alt=&quot;:-)&quot; class=&quot;wp-smiley&quot; /&gt; .&lt;/p&gt;
&lt;p&gt;Who said SELinux is complicated? :^)&lt;/p&gt;</content:encoded>
	<dc:date>2011-01-09T22:27:31+00:00</dc:date>
	<dc:creator>mgrepl</dc:creator>
</item>
<item rdf:about="tag:blogger.com,1999:blog-5024703430482213163.post-8543066306813862089">
	<title>Dominick Grift: Note to self: all the stuff a pulseaudio client needs.</title>
	<link>http://selinux-mac.blogspot.com/2010/12/note-to-self-all-stuff-pulseaudio.html</link>
	<content:encoded>basically i figured out about three scenarios so far:&lt;br /&gt;&lt;br /&gt;1: The basics.&lt;br /&gt;Pulseaudio is running normally, and the pulseaudio client needs to make some sound i guess&lt;br /&gt;&lt;br /&gt;# manage a pulse-shm file in /dev/shm&lt;br /&gt;manage_files_pattern($1, $2_tmpfs_t, $2_tmpfs_t)&lt;br /&gt;fs_tmpfs_filetrans($1_t, $2_tmpfs_t, file)&lt;br /&gt;fs_getattr_tmpfs($1_t)&lt;br /&gt;&lt;br /&gt;# allow the user of the app to manage and relabel that file as well&lt;br /&gt;allow $3 $2_tmpfs_t:file { relabel_file_perms manage_file_perms };&lt;br /&gt;&lt;br /&gt;# 1. This add an attribute to the pulse client process so that i can allow each pulse client progress to signull any other pulse client process&lt;br /&gt;# 2, This also adds an attribute to the pulse client tmpfs file so that i can allow each pulse client to read write and delete any others pulse client tmpfs file.&lt;br /&gt;gnome_pulseaudio_client($1, $2)&lt;br /&gt;# read write pulseaudio files in ~/pulse (a directory that is actually owned by gnome settings daemon)&lt;br /&gt;gnome_rw_gsettingsd_pulseaudio_files($1)&lt;br /&gt;# read gnome settings daemon home content for example some symlink in ~/.pulse to a pulseaudio sock file&lt;br /&gt;gnome_read_gsettingsd_home_content($1)&lt;br /&gt;# connect to pulseaudio with a unix stream socket&lt;br /&gt;gnome_stream_connect_gsettingsd_pulseaudio($1, $2)&lt;br /&gt;# search /tmp/pulse-*&lt;br /&gt;gnome_search_gsettingsd_tmp_dirs($1)&lt;br /&gt;# set attributes of ~/.pulse directory&lt;br /&gt;gnome_setattr_gsettingsd_home_dirs($1)&lt;br /&gt;&lt;br /&gt;# manage /.cache sound-event-cache files.&lt;br /&gt;xdg_manage_generic_user_cache_files($1)&lt;br /&gt;&lt;br /&gt;2: The not so basics.&lt;br /&gt;These pulse client seem to be required to be able to (re) start the main pulseaudio process as well in some particular cases)&lt;br /&gt;&lt;br /&gt;# domain transition to the gnome settingsd daemon pulseaudio domain when pulseaudio is executed.&lt;br /&gt;gnome_spec_domtrans_gsettingsd_pulseaudio($1, $2)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;3: When pulseaudio is not running.&lt;br /&gt;When you kill pulseaudio and run a pulseaudio client app. It, i guess, expects some pulse audio network functionality because pulse is not running on the local system.&lt;br /&gt;&lt;br /&gt;# the pulse client is trying to find pulseaudio on the network i guess...&lt;br /&gt;allow $1 self:netlink_route_socket r_netlink_socket_perms;&lt;br /&gt;allow $1 self:tcp_socket create_socket_perms;&lt;br /&gt;allow $1 self:unix_dgram_socket sendto;&lt;br /&gt;&lt;br /&gt;corenet_all_recvfrom_netlabel($1_t)&lt;br /&gt;corenet_all_recvfrom_unlabeled($1_t)&lt;br /&gt;corenet_tcp_bind_generic_node($1_t)&lt;br /&gt;corenet_tcp_sendrecv_generic_if($1_t)&lt;br /&gt;corenet_tcp_sendrecv_generic_node($1_t)&lt;br /&gt;corenet_tcp_connect_pulseaudio_port($1_t)&lt;br /&gt;corenet_tcp_sendrecv_pulseaudio_port($1_t)&lt;br /&gt;corenet_sendrecv_pulseaudio_client_packets($1_t)&lt;br /&gt;&lt;br /&gt;# if that isnt enough, the pulseaudio client wants to be a dbus system bus client. Dont ask me why but&lt;br /&gt;its probably looking for pulseaudio run as a dbus system domain or init daemon.&lt;br /&gt;dbus_system_bus_client($1)&lt;br /&gt;&lt;br /&gt;..Heck it may even need more like maybe sysnet_read_config, i have not been able to confirm this yet.&lt;br /&gt;&lt;br /&gt;The amount of access(policy) a simple gui application needs to be able to spit out a sound with pulseaudio is simply amazing.&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width=&quot;1&quot; height=&quot;1&quot; src=&quot;https://blogger.googleusercontent.com/tracker/5024703430482213163-8543066306813862089?l=selinux-mac.blogspot.com&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;</content:encoded>
	<dc:date>2010-12-16T03:32:32+00:00</dc:date>
	<dc:creator>Dominick &quot;domg472&quot; Grift (noreply@blogger.com)</dc:creator>
</item>
<item rdf:about="tag:blogger.com,1999:blog-5240359826706545510.post-1222885404529095949">
	<title>Thomas Biege (Security): SAD 1: The Change... and no, we are not in the &quot;House of Flies&quot; here</title>
	<link>http://thetoms-random-thoughts.blogspot.com/2010/09/sad-1-change-and-no-we-are-not-in-house.html</link>
	<content:encoded>I told you that future isn't predictable, that it is dominated by change. So here is what has to change: First (maybe) &lt;span&gt;you&lt;/span&gt;!&lt;br /&gt;&lt;br /&gt;Power is what most people lack of, people that feel the time for a change is now, or that see the disadvantages in their private and/or working life, often  are too powerless. Either their psyche/mind is powerless, or maybe they don't have the executive power, or they do not have ever made the social connections to the right people with the power and mind needed to go a new way.&lt;br /&gt;&lt;br /&gt;Well your way of getting your job and more done should be based on a strong mind. If your  psychological hygienic is in a bad shape you are lost either way. Stop  reading here! Go and change (or start loving!) the ill parts of your  character before it is too late.&lt;br /&gt;&lt;br /&gt;Will I come to a point in this post. Yes! Read on... :-)&lt;br /&gt;&lt;br /&gt;When you are not happy about the security awareness in your company's software department or alike and your boss does not equip you with the power to do the job, the alternative is not to bury your head in the sand but &lt;span&gt;just do it&lt;/span&gt;! (Warning: In big companies games are played differently as in small companies, means: Changes in big companies are often not wanted because they introduce risk. &quot;Loser's Game&quot; vs. &quot;Winner's Game&quot;)&lt;br /&gt;&lt;br /&gt;Of course you cannot go up to the software development department and force them to change their processes to an industry standard (MS SDL, SAMM, etc.). But you can offer the project- or team-leads your HELP. By it I mean you can offer them the parts of your favorite secure code development process that don't cost them much time and money, this means they cost your time of course. Go ahead!&lt;br /&gt;&lt;br /&gt;&lt;span&gt;Starting points.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The most less invasive and helpful tasks IMO are:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;doing code reviews and filing bugs in their bug tracking system&lt;/li&gt;&lt;li&gt;provide security documents (secure coding, secure design, helpful links) in a wiki or any other internal CMS&lt;br /&gt;&lt;/li&gt;&lt;li&gt;offer security trainings directly related to their work&lt;/li&gt;&lt;li&gt;ask project leaders to include you in the application design process&lt;/li&gt;&lt;/ul&gt;Take care: Don't be a nit-picker or too restrictive. :)&lt;br /&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;Tips: Presentation, Training&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;What I found most useful and which is no magic is:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;be short&lt;/li&gt;&lt;li&gt;only the most dangerous/important vulnerabilities&lt;/li&gt;&lt;li&gt;don't get lost in details&lt;br /&gt;&lt;/li&gt;&lt;li&gt;many examples, try use the team's code&lt;/li&gt;&lt;li&gt;live-sessions&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt; The secure development trainings are really important (I often miss that *sigh*) because you stay in-front of the team and can influence their view on security and the way they develop code in the future. So, be friendly and helpful but also mandatory. Take a look in your soft-skill toolbox to see what techniques might be useful. (I always forget it... unfortunately)&lt;br /&gt;&lt;br /&gt;&lt;span&gt;Techniques: The appeal.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Five steps to formulate a clear appeal:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;span&gt;introduction&lt;/span&gt;: In the introduction phase you have to set the context by telling your dialog partner (dp) about the topic you are talking about. &lt;span&gt;&quot;I beg you to keep security in mind when developing our applications because security updates cost everybody's time, costs money, and put the customer at risk.&quot;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;facts&lt;/span&gt;: Who should do what when exactly. But take care with the competencies here. Sounding too harsh is too easy. &lt;span&gt;&quot;During my penetration-test I saw simple flaws with high impact like cross-site scripting bugs in our social-network solution. Additionally I also stumbled over design issues like sending credential over the network without using SSL. Please review your code to fix all cross-site scripting vulnerabilities before the next beta-release. Tools for testing and descriptions of the bug as well as possible solutions are described in our Intranet wiki. For the next major version or re-design of our product xyz, I can offer you to be part of it and review the design.&quot;&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;context&lt;/span&gt;: People accept and fulfill additional tasks better if they know about he corresponding context. &lt;span&gt;&quot;When we deliver the code as-is with all it's big security holes, hackers will have a lot of fun stealing personal information easily from your customer's servers . We will chip away our image and have additional work releasing security updates. Not releasing bugs is cheaper than providing security updates.&quot;&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;comprehension&lt;/span&gt;:  Do not ask so called closed questions like &lt;span&gt;&quot;Is everything clear?&quot;&lt;/span&gt; or &lt;span&gt;&quot;Is something unclear?&quot;&lt;/span&gt; you will get &lt;span&gt;&quot;Yes.&quot;&lt;/span&gt; respectively &lt;span&gt;&quot;No.&quot;&lt;/span&gt; as a reflex from your dialog partner.  Better use open questions: &lt;span&gt;&quot;I know this kind of vulnerability is very abstract. Where are open questions I can answer for you?&quot;, &quot;What can I do for you to make this work?&quot;, &quot;Which questions do you have?&quot; &lt;/span&gt;And after each question make a long pause, this encourages your dp to react.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;acceptance&lt;/span&gt;: At the end you need to verify if your appeal was really accepted by your dialog partner. There is a gap between understanding and accepting. The first 4 steps of a clear appeal try to bridge over this gap and at the end you need to verify if you were successful. If you don't like it you can omit this final step and hope for the best. You may also received signals from your dp that shows acceptance or reluctance and adopt the final step based on that.  The easiest way would be to ask: &lt;span&gt;&quot;Will you fulfill this task until the next beta-release?&quot;&lt;/span&gt; This is of course not the right way if you work on an equal footing. Alternatives might be: &lt;span&gt;&quot;Where can I help you to get this done until next beta-release?&quot;&lt;/span&gt; etc.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;I should start following my own advises and... also never write a novel. ;)&lt;br /&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;&lt;/span&gt;(for the topic see the &lt;a href=&quot;http://www.stlyrics.com/lyrics/littlenicky/changeinthehouseofflies.htm&quot;&gt;following lyrics&lt;/a&gt;)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;!-- BlogCounter Code START --&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://www.blogcounter.de/&quot; id=&quot;bclink&quot; title=&quot;kostenloser Counter fuer Weblogs&quot;&gt;&lt;span id=&quot;bccount&quot;&gt;kostenloser Counter&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://www.blogcounter.de/&quot;&gt;&lt;img alt=&quot;Weblog counter&quot; src=&quot;http://track.blogcounter.de/log.php?id=thetom_blog&quot; /&gt;&lt;/a&gt; - &lt;/p&gt;&lt;!-- BlogCounter Code END --&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width=&quot;1&quot; height=&quot;1&quot; src=&quot;https://blogger.googleusercontent.com/tracker/5240359826706545510-1222885404529095949?l=thetoms-random-thoughts.blogspot.com&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;</content:encoded>
	<dc:date>2010-12-06T06:40:54+00:00</dc:date>
	<dc:creator>Thomas (noreply@blogger.com)</dc:creator>
</item>
<item rdf:about="tag:blogger.com,1999:blog-5240359826706545510.post-6228856452899647198">
	<title>Thomas Biege (Security): Tool: simple XSS fuzzer</title>
	<link>http://thetoms-random-thoughts.blogspot.com/2010/10/simpe-xss-fuzzer.html</link>
	<content:encoded>just found none that worked for me and wrote my own. &lt;a href=&quot;http://gitorious.org/fuzzer/fuzz-xss&quot;&gt;check out fuzz-xss&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;!-- BlogCounter Code START --&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://www.blogcounter.de/&quot; id=&quot;bclink&quot; title=&quot;kostenloser Counter fuer Weblogs&quot;&gt;&lt;span id=&quot;bccount&quot;&gt;kostenloser Counter&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://www.blogcounter.de/&quot;&gt;&lt;img alt=&quot;Weblog counter&quot; src=&quot;http://track.blogcounter.de/log.php?id=thetom_blog&quot; /&gt;&lt;/a&gt; - &lt;/p&gt;&lt;!-- BlogCounter Code END --&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width=&quot;1&quot; height=&quot;1&quot; src=&quot;https://blogger.googleusercontent.com/tracker/5240359826706545510-6228856452899647198?l=thetoms-random-thoughts.blogspot.com&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;</content:encoded>
	<dc:date>2010-12-03T07:37:43+00:00</dc:date>
	<dc:creator>Thomas (noreply@blogger.com)</dc:creator>
</item>

</rdf:RDF>

