2009/8/25 Serge E. Hallyn <span dir="ltr"><<a href="mailto:serue@us.ibm.com" target="_blank">serue@us.ibm.com</a>></span><br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

<div><div></div><div>Quoting Krzysztof Taraszka (<a href="mailto:krzysztof.taraszka@gnuhosting.net" target="_blank">krzysztof.taraszka@gnuhosting.net</a>):<br>
> 2009/8/25 Serge E. Hallyn <<a href="mailto:serue@us.ibm.com" target="_blank">serue@us.ibm.com</a>><br>
><br>
> > Quoting Daniel Lezcano (<a href="mailto:daniel.lezcano@free.fr" target="_blank">daniel.lezcano@free.fr</a>):<br>
> > > Krzysztof Taraszka wrote:<br>
> > >> Hi,<br>
> > >><br>
> > >> I was looking for possibility to secure lxc container to do not allow<br>
> > 'root<br>
> > >> container user'  from changing limits from cgroup. Right now without<br>
> > STACK64<br>
> > >> or SELinux he can do this easily.<br>
> > >> I read the<br>
> > <a href="http://www.ibm.com/developerworks/linux/library/l-lxc-security/cookbook" target="_blank">http://www.ibm.com/developerworks/linux/library/l-lxc-security/cookbook</a><br>
> > >> and decided to use STACK64 kernel mechanism.<br>
> > >> Well... mounting cgroup inside container fails (great!, i am looked for<br>
> > that<br>
> > >> ;)) but networking fails too (interface bring up, sshd bring up,<br>
> > connection<br>
> > >> beetween host and container is, but 'mtr', 'ping' even 'apt-get update'<br>
> > >> fails and I do not know why). I secure my container exactly like in the<br>
> > >> cookbook.<br>
> ><br>
> > Yeah, smack's use of cipso can make things tricky, and it's possible things<br>
> > have changed a bit recently.  Although I'm currently running smack in my<br>
> > everyday s390 kernel to test checkpointing of its labels, and networking<br>
> > is working fine.<br>
><br>
><br>
> > Can you give me a few details - what distro, smack policy, and precise<br>
> > kernel<br>
> > version are you using, for starters?<br>
> ><br>
><br>
> debian lenny amd64,<br>
> kernel 2.6.30.5<br>
> lxc-tools from git<br>
><br>
> lxc1amd64:~# cat /etc/smackaccesses<br>
> debian _ rwa<br>
> _ debian rwa<br>
> _ host rwax<br>
> host _ rwax<br>
<br>
</div></div>Ok, I think what you want to do is use /smack/netlabel as shown around line<br>
425 in linux-2.6/Documentation/Smack.txt.  I haven't played with it yet,<br>
but will tomorrow if you don't get a chance.  So basically I think you should<br>
be able to do:<br>
<br>
echo 127.0.0.1 -CIPSO > /smack/netlabel<br>
echo <a href="http://0.0.0.0/0" target="_blank">0.0.0.0/0</a> @      > /smack/netlabel<br>
<br>
to open up the network.<br>
<br>
Does that work?<br>
<font color="#888888"></font></blockquote><div><br>Yep :))<br>Works.<br>Anyway - are you going to update your cookbook on the ibm webpage?<br><br>-- <br>Krzysztof Taraszka<br></div></div>