Skip to contentSkip to conversation

As we move to use Linux Containers User Namespace

DISCUSSION Daniel J Walsh 5 participants 5 messages Jan 15, 2014 – Jan 26, 2014 SELinux security module

lore
Share & tools
lore
#0 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I think we need the kernel to start checking container Capabilities rather then system capabilities.

I would like to be able to say something like

allow svirt_lxc_net_t self:nscapability sys_admin;

This way we can use MAC to better control break out of user namespace.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlLW998ACgkQrlYvE4MpobP6IgCglpmgF8XKjr1W1xzPU6eGU6k+ h8EAniQwwEhMAOeAy4e1NUw/8o2h/oWs
=g8UL
-----END PGP SIGNATURE-----

#1 lore raw

Just to blow everyone's minds: The first thought that came to me was that the only way to make this useful is to actually put a label on the user namespace.

If I create a container, and then a container inside that container, I'd think selinux should be able to control the capabilities at the second level down. Dan's only asking about one level down...

Quoted 27 lines · Daniel J Walsh

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I think we need the kernel to start checking container Capabilities rather then system capabilities.

I would like to be able to say something like

allow svirt_lxc_net_t self:nscapability sys_admin;

This way we can use MAC to better control break out of user namespace.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlLW998ACgkQrlYvE4MpobP6IgCglpmgF8XKjr1W1xzPU6eGU6k+ h8EAniQwwEhMAOeAy4e1NUw/8o2h/oWs
=g8UL
-----END PGP SIGNATURE-----
_______________________________________________
Selinux mailing list
[email protected]
To unsubscribe, send email to [email protected].
To get help, send an email containing "help" to [email protected].

#2 lore raw

Booom...mind is blown. namespaces are kernel resources, and labeling them has been working so far.

Quoted 41 lines · Eric Paris

Just to blow everyone's minds: The first thought that came to me was that the only way to make this useful is to actually put a label on the user namespace.

If I create a container, and then a container inside that container, I'd think selinux should be able to control the capabilities at the second level down. Dan's only asking about one level down...

Quoted 18 lines · Daniel J Walsh

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I think we need the kernel to start checking container Capabilities rather then system capabilities.

I would like to be able to say something like

allow svirt_lxc_net_t self:nscapability sys_admin;

This way we can use MAC to better control break out of user namespace.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

Quoted 9 lines

iEYEARECAAYFAlLW998ACgkQrlYvE4MpobP6IgCglpmgF8XKjr1W1xzPU6eGU6k+ h8EAniQwwEhMAOeAy4e1NUw/8o2h/oWs
=g8UL
-----END PGP SIGNATURE-----
_______________________________________________
Selinux mailing list
[email protected]
To unsubscribe, send email to [email protected].
To get help, send an email containing "help" to [email protected].

_______________________________________________
Selinux mailing list
[email protected]
To unsubscribe, send email to [email protected].
To get help, send an email containing "help" to [email protected].

Signature · 3 lines
Respectfully,

William C Roberts
maintainer
#3 lore raw
In reply to Eric Paris
Quoted 7 lines · Eric Paris

Just to blow everyone's minds: The first thought that came to me was that the only way to make this useful is to actually put a label on the user namespace.

If I create a container, and then a container inside that container, I'd think selinux should be able to control the capabilities at the second level down. Dan's only asking about one level down...

Turtles all the way down.

If we are going to do it for one level, we should do it for all levels.

Signature · 2 lines
paul moore
www.paul-moore.com
#4 lore raw
Quoted 1 line · Paul Moore

On Wednesday, January 15, 2014 06:25:05 PM Eric Paris wrote:

Note first off that you'll rarely want to check for capabilities against yourself, because any unprivileged task can unshare a new user namespace with his own (host) uid mapped to root in the new namespace, and pass that test. However, checking for capabilities against an open file (meaning a inode_capable() check) makes sense.

Quoted 7 lines
Quoted 7 lines

Just to blow everyone's minds: The first thought that came to me was that the only way to make this useful is to actually put a label on the user namespace.

If I create a container, and then a container inside that container, I'd think selinux should be able to control the capabilities at the second level down. Dan's only asking about one level down...

(Not sure whether you mean up or down? :)

Quoted 3 lines

Turtles all the way down.

If we are going to do it for one level, we should do it for all levels.

Speaking in non-selinux terms, it would make sense to simply ask whether task T1 has Capability C1 against object O1, where O1 is a task, a nic, a file, a mountpoint, etc. Referring to a specific user namespace by its own label would be awkward, I believe.

I'm not sure how to put that in selinux terms, since labels will certainly cross namespaces.

-serge