Information about XSELinux
Hi everyone!
I'm desperately trying to implement proper privilege seperation while using X.
Currently I'm looking into XSELinux but am having a really hard time finding any information, documention etc.
What's the development status?
Where can I get it?
Is it included in any major distributions? (Currently using Ubuntu 12.04)
Any hint on where to find information would be highly appreciated!
Many thanks in advance and best regards,
Ole
Quoted 2 lines · Ole Kliemann
Is it included in any major distributions? (Currently using Ubuntu 12.04)
Unless Ubuntu have done some significant enhancements over my Debian work without telling me then it's not going to work.
It's something I want to do though, hopefully by Wheezy+1.
Signature · 7 lines
My Main Blog http://etbe.coker.com.au/ My Documents Blog http://doc.coker.com.au/ -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 6 lines · Russell Coker
Quoted 2 lines · Ole Kliemann
Is it included in any major distributions? (Currently using Ubuntu 12.04)
Unless Ubuntu have done some significant enhancements over my Debian work without telling me then it's not going to work.
I'm no expert, but as far as I can tell, it's just not there in Ubuntu.
I understood from a bug report on this list that it's included in Fedora. So I installed it on a test system and could reproduce the bug (X server fails to start when xserver_object_manager is set).
I'm willing to switch to whatever distribution is providing the means to seperate user contexts under X.
Quoted 11 lines · Ole Kliemann
Quoted 6 lines · Russell Coker
Quoted 2 lines · Ole Kliemann
Is it included in any major distributions? (Currently using Ubuntu 12.04)
Unless Ubuntu have done some significant enhancements over my Debian work without telling me then it's not going to work.
I'm no expert, but as far as I can tell, it's just not there in Ubuntu.
Quoted 7 lines
I understood from a bug report on this list that it's included in Fedora. So I installed it on a test system and could reproduce the bug (X server fails to start when
xserver_object_manageris set).I'm willing to switch to whatever distribution is providing the means to seperate user contexts under X.
XSELinux is included in Fedora, but they don't enable it by default so it doesn't get much testing. They took a different approach for isolating X applications via nested Xephyr servers in their sandbox tool.
Signature · 8 lines
Stephen Smalley National Security Agency -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Quoted 15 lines · Stephen Smalley
Quoted 14 lines · Ole Kliemann
Quoted 6 lines · Russell Coker
Quoted 2 lines · Ole Kliemann
Is it included in any major distributions? (Currently using Ubuntu 12.04)
Unless Ubuntu have done some significant enhancements over my Debian work without telling me then it's not going to work.
I'm no expert, but as far as I can tell, it's just not there in Ubuntu.
I understood from a bug report on this list that it's included in Fedora. So I installed it on a test system and could reproduce the bug (X server fails to start when
xserver_object_manageris set).
Quoted 7 lines
Quoted 2 lines
I'm willing to switch to whatever distribution is providing the means to seperate user contexts under X.
XSELinux is included in Fedora, but they don't enable it by default so it doesn't get much testing. They took a different approach for isolating X applications via nested Xephyr servers in their sandbox tool.
My opinion is that XAce or XSELinux works ok with the MLS model, but not with the type enforcement model. In my opinion isolating applications within the own sandbox/containers is a simpler and more sustainable approach.
XClients that get a permission denied, are likely to misbehave (die) since they were coded with the assumption that they either get full access to X or no access to X.
Finally trying to write confinement policy for a type enforcement model on X is very difficult, how do I isolate two instances of firefox? If Firefox execs a open office, how does this libreoffice interact with the existing libreoffice that might be running under a different context. How does cut/paste work, how about one window obscuring another, transparent windows ... Way too complicated. Sandbox model is just total separation. They do not even know the other apps exist.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAlAIFUEACgkQrlYvE4MpobNosQCfWwKjjPONs5WHNbDGit3NYGXt iegAn1mav7HlS21m5q89xy47pXDXpw8x
=fZVQ
-----END PGP SIGNATURE-----
--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 14 lines · Daniel J Walsh
Quoted 4 lines · Stephen Smalley
XSELinux is included in Fedora, but they don't enable it by default so it doesn't get much testing. They took a different approach for isolating X applications via nested Xephyr servers in their sandbox tool.
My opinion is that XAce or XSELinux works ok with the MLS model, but not with the type enforcement model. In my opinion isolating applications within the own sandbox/containers is a simpler and more sustainable approach.
XClients that get a permission denied, are likely to misbehave (die) since they were coded with the assumption that they either get full access to X or no access to X.
Quoted 7 lines
Finally trying to write confinement policy for a type enforcement model on X is very difficult, how do I isolate two instances of firefox? If Firefox execs a open office, how does this libreoffice interact with the existing libreoffice that might be running under a different context. How does cut/paste work, how about one window obscuring another, transparent windows ... Way too complicated. Sandbox model is just total separation. They do not even know the other apps exist.
Xephyr is what I have been using so far under Ubuntu. I don't know how it runs under Fedora, but I notice here a performance decrease. Sluggish cursor, sluggish scrolling etc.
So I wanted to get away from this. But I think my goals are simple.
Right now I have one (standard linux) user as main user and several (standard linux) users as subusers. I have a suid root program that checks a database on disk and allows the main user to drop privileges to one of his subusers. I use a subuser for each job (mail, browser, writing etc.).
Seperation under X is achieved using "terminal-chains" (mainuser starts a subuser with X access who starts a terminal and a subuser of his own with no X access who than runs the shell inside the terminal - an idea my brother had years ago), or using "xephyr-chains" which I think is more or less how sandbox does it.
Terminal-chains are fast but have no X, xephyr-chains have X but lose performance.
What I want to do is to extend the standard linux user seperation to X. Assign the mainuser and every subuser a context and then make sure X-applications in one context can't mess with those in other contexts. Selinux here has only to make sure X is secured. I'll still be using different linux users for every context.
I don't need no "fancy stuff" like automatic domain transitions using certain applications as entrypoints. I can perfectly understand the beauty of this in an integrated desktop environment. But something in my wants simplicity when it comes to security concepts. ;-)
I'm not exactly sure how MLS works, but I'd intuitively would say, my approach is more MLS-like because change of privileges only goes in one direction. Privileges are only dropped, never gained. (Mainuser drops to subuser, subuser never elevates back to mainuser or any other subuser.)
I started working on a policy for X using TE. Do you think, what I want could be better expressed in MLS?
Quoted 8 lines · Ole Kliemann
I'm not exactly sure how MLS works, but I'd intuitively would say, my approach is more MLS-like because change of privileges only goes in one direction. Privileges are only dropped, never gained. (Mainuser drops to subuser, subuser never elevates back to mainuser or any other subuser.)
I started working on a policy for X using TE. Do you think, what I want could be better expressed in MLS?
MLS is about sensitivity levels of data with a theoretical model of allowing processes with a high clearance to read data of a low sensitivity so data can migratre to a higher classification. While that could be used for standard X access control it probably isn't what most people want. What you probably want is for example to have mozilla_t not be able to mess with X apps running as user_t or unconfined_t.
In terms of MLS and X access controls I guess you could have different ssh servers configured to have different levels and then run "ssh -X" (or "ssh -Y"
- how does that interact with X access controls) to each of the servers from a different level and therefore not allow processes from server A to mess with processes from server B via X on your workstation.
Quoted 10 lines · Ole Kliemann
I'm running X in enforcing too now with a simple setup. There is a domain for every job (browser, mail, ...). These domains can't access each other. The WM has access to all of them. Copy/paste works like a charm with every domain having its own cutbuffer and a small script called from the WM to copy the cutbuffer to other domains.
Of course I had to allow some things in X that I do not fully understand. But there is definitely no more sending synthetic input events to foreign windows and no more keylogging.
Could you blog about all the details?
I've wanted to get X access control in Debian for a while.
Signature · 7 lines
My Main Blog http://etbe.coker.com.au/ My Documents Blog http://doc.coker.com.au/ -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 3 lines · Russell Coker
Could you blog about all the details?
I've wanted to get X access control in Debian for a while.
Sure! I'm just not sure how helpful it's gonna be, because my policy is from scratch and pretty specialised for me. I'm scared of the reference policy and frankly believe it's faster for me to write the things I need from scratch than to find out how to do this within the reference policy.
Of course I could use the reference policy as a base and write only my stuff for user separation under X from scratch. But here Ubuntu comes into play. I have to admit I haven't extensively tested SELinux under Ubuntu, but I did look quite old. And from what I read, AppArmor is the supported LSM under Ubuntu and one should not expect much support for SELinux.
I need something that is either maintained actively or can be maintained by myself with minimal effort. Neither applies to reference policy under Ubuntu. I wouldn't want to leave Ubuntu unless neccessary, so I'm writing from scratch.
Besides, I have some doubts about the underlying paradigm of a security policy that gets _that_ complicated. But that's nothing I really thought through so far.
Getting X11 with XSELinux was pretty easy actually. I just got the source package, changed 'debian/rules' replacing the '--disable-selinux' with '--enable-selinux' and build and installed the package. Did 'setsebool -P xserver_object_manager true' and XSELinux was good to go.
I then wrote a monolithic policy. I still use traditional linux users to separate the different contexts I work with (mail, browser, ...), like I have done for years. But instead of using the crappy trusted/untrusted-model of the old SECURITY extension, I separated the user contexts under X using SELinux.
So I specificly target only user contexts and only the X-portion of access vectors. I could send you this policy, but it's messy and probably useless to you.
I'm currently writing a new, modular policy targeting some system daemons and separating my user contexts by SELinux without the need for traditional linux users. I can tell you when it's done. But again, it will be pretty specialised for my needs.
Was there anything specific you wanted to know?
Ole
Quoted 8 lines · Ole Kliemann
Hi everyone!
I'm desperately trying to implement proper privilege seperation while using X.
Currently I'm looking into XSELinux but am having a really hard time finding any information, documention etc.
Some of this could be out of date, but it should get you started.
http://www.nsa.gov/research/_files/selinux/papers/xorg07-abs.shtml
http://www.x.org/releases/X11R7.5/doc/security/XACE-Spec.html
http://selinuxproject.org/page/NB_XWIN
http://selinuxproject.org/page/Experimenting_With_X-Windows#Calling_the_XSELinux_Functions
Quoted 5 lines
What's the development status?
Where can I get it?
Is it included in any major distributions? (Currently using Ubuntu 12.04)
It is in Fedora.
Enable the xserver_object_manager_boolean (setsebool -P xserver_object_manager=1) and restart the X server.
The file /etc/selinux/POLICY/contexts/x_contexts contains an X event to context mapping.
The xserver module contains the current policy for the X server.
Signature · 8 lines
James Carter <[email protected]> National Security Agency -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.