Of applications and separating configuration systems
Hi,
Having started looking at SELinux a thought struck me.
As a general matter of practice wouldn't it be better for desktop like applications to have the preference editing done by a separate program (binary) whose only job is to edit those preferences and configurations.
The thought is bought about by hearing of some of the viruses/worms that have happened where a virus has disabled some of the other security
features in an app. If the main app that was exposed to user
data couldn't alter its own preferences file then this risk would be greatly reduced.
It strikes me that normal users of a system might want to have multiple contexts to them within a windowing system; for example with seperate permissions for normal stuff, a web browser, the web browser they use for confidential stuff, and building things they downloaded. Is it easy to set such a system up? What about allowing normal users to see the policy violations that are causing their individual programs are making?
Dave
-----Open up your eyes, open up your mind, open up your code -------
/ Dr. David Alan Gilbert | Running GNU/Linux on Alpha,68K| Happy \ \ gro.gilbert @ treblig.org | MIPS,x86,ARM,SPARC,PPC & HPPA | In Hex / \ _________________________|_____ http://www.treblig.org |_______/
--
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 5 lines · Dr. David Alan Gilbert
Having started looking at SELinux a thought struck me.
As a general matter of practice wouldn't it be better for desktop like applications to have the preference editing done by a separate program (binary) whose only job is to edit those preferences and configurations.
I agree. However there is the issue of maintaining correct labeling.
We don't necessarily want a regular shell session for the user to be able to edit some of the config files, but they have to be able to get access to them when necessary. Also we don't want to accidentally lose the correct types on such files either through system relabeling or through user error.
Quoted 5 lines
The thought is bought about by hearing of some of the viruses/worms that have happened where a virus has disabled some of the other security
features in an app. If the main app that was exposed to user
data couldn't alter its own preferences file then this risk would be greatly reduced.
True. Also we want to protect files that contain private keys for SSL and other encryption systems, and public keys for remote servers as used for verifying SSL connections etc. Then there are files containing passwords such as the config of every MUA which uses POP.
For POP and SSL I think that we want to have a proxy that runs in a different domain so it can access the config files, the proxy will start the connection to the server. In the case of POP a file handle could be passed back to the calling application, in the case of SSL all data would have to be proxied.
Quoted 4 lines
It strikes me that normal users of a system might want to have multiple contexts to them within a windowing system; for example with seperate permissions for normal stuff, a web browser, the web browser they use for confidential stuff, and building things they downloaded.
There are some difficulties with this. Mozilla 1.6 seems to want to access files all over the user's home directory. Lots of gconf sub-dirs etc. Getting the labelling on all those sub-directories and files correct is difficult, and any mistakes will result in Mozilla aborting without displaying an error!
Work is being done on Security Enhanced X. This will make it possible to give different X clients different levels of access to the display (a pre-requisite for any serious control of graphical programs). I'm not sure whether SE-X will support distinguishing between multiple copies of an application that have different contexts. Even when those problems are solved we are still left with the situation that Mozilla checks for other copies of itself and aborts if it finds any.
The problem for KDE is that programs are not exec'd, they are mmap'd into a running process, so domain_auto_trans() does not work for Konqueror!
Quoted 3 lines
Is it easy to set such a system up? What about allowing normal users to see the policy violations that are causing their individual programs are making?
This is not really possible at the moment. Allowing all users to see all messages is easy but usually not desirable. Writing a program to sort through the syslogd output and make some of the messages involving a user's account available to them would be possible, but no-one has worked on it AFAIK.
Signature · 10 lines
http://www.coker.com.au/selinux/ My NSA Security Enhanced Linux packages http://www.coker.com.au/bonnie++/ Bonnie++ hard drive benchmark http://www.coker.com.au/postal/ Postal SMTP/POP benchmark http://www.coker.com.au/~russell/ My home page -- 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.
* Russell Coker ([email protected]) wrote:
(In reply to my comments about separating config/preference editing out of apps)
Quoted 6 lines
I agree. However there is the issue of maintaining correct labeling.
We don't necessarily want a regular shell session for the user to be able to edit some of the config files, but they have to be able to get access to them when necessary. Also we don't want to accidentally lose the correct types on such files either through system relabeling or through user error.
True - that could be a pain to maintain.
Quoted 4 lines
For POP and SSL I think that we want to have a proxy that runs in a different domain so it can access the config files, the proxy will start the connection to the server. In the case of POP a file handle could be passed back to the calling application, in the case of SSL all data would have to be proxied.
The problem with proxy's is ensuring that only the right clients access them - how can that be checked?
Quoted 11 lines
Quoted 5 lines
It strikes me that normal users of a system might want to have multiple contexts to them within a windowing system; for example with seperate permissions for normal stuff, a web browser, the web browser they use for confidential stuff, and building things they downloaded.
There are some difficulties with this. Mozilla 1.6 seems to want to access files all over the user's home directory. Lots of gconf sub-dirs etc. Getting the labelling on all those sub-directories and files correct is difficult, and any mistakes will result in Mozilla aborting without displaying an error!
Sigh yes - although there is no excuse for applications not displaying decent errors.
Quoted 7 lines
Work is being done on Security Enhanced X. This will make it possible to give different X clients different levels of access to the display (a pre-requisite for any serious control of graphical programs). I'm not sure whether SE-X will support distinguishing between multiple copies of an application that have different contexts. Even when those problems are solved we are still left with the situation that Mozilla checks for other copies of itself and aborts if it finds any.
Thats quite interesting; because I do worry about apps stealing selected text or producing fake dialogs. Another example (easier to deal with using less exotic tools) is stopping accidental pasting of confidential info into some windows (e.g. many people worry about accidentally pasting things into irc or chat windows).
Quoted 2 lines
The problem for KDE is that programs are not exec'd, they are mmap'd into a running process, so
domain_auto_trans()does not work for Konqueror!
Sigh - that really isn't going to make it easy to control; a pity really because bits of KDE are quite nice - but if it can't be made secure then its future will be limited.
Quoted 9 lines
Quoted 3 lines
Is it easy to set such a system up? What about allowing normal users to see the policy violations that are causing their individual programs are making?
This is not really possible at the moment. Allowing all users to see all messages is easy but usually not desirable. Writing a program to sort through the syslogd output and make some of the messages involving a user's account available to them would be possible, but no-one has worked on it AFAIK.
Hmm doesn't sound that hard to do.
Well I've created a new issue in the OpenOffice database
(http://qa.openoffice.org/issues/show_bug.cgi?id=25503)
suggesting splitting the config/options out into a separate binary.
Dave
-----Open up your eyes, open up your mind, open up your code -------
/ Dr. David Alan Gilbert | Running GNU/Linux on Alpha,68K| Happy \ \ gro.gilbert @ treblig.org | MIPS,x86,ARM,SPARC,PPC & HPPA | In Hex / \ _________________________|_____ http://www.treblig.org |_______/
--
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 8 lines · Dr. David Alan Gilbert
Quoted 5 lines
For POP and SSL I think that we want to have a proxy that runs in a different domain so it can access the config files, the proxy will start the connection to the server. In the case of POP a file handle could be passed back to the calling application, in the case of SSL all data would have to be proxied.
The problem with proxy's is ensuring that only the right clients access them - how can that be checked?
That depends on the application. For Apache we can have something like the following:domain_auto_trans(httpd_t, ssl_proxy_exec_t, httpd_ssl_t)
allow httpd_ssl_t httpd_private_key_t:file { getattr read };
For user-space proxies it gets more difficult. For a proxy for POP connections we could have the MUA running in it's own domain. Or we could just accept that some programs could make unauthorised POP connections but that as they can't steal the password it's less of a concern.
Quoted 8 lines
Quoted 7 lines
Work is being done on Security Enhanced X. This will make it possible to give different X clients different levels of access to the display (a pre-requisite for any serious control of graphical programs). I'm not sure whether SE-X will support distinguishing between multiple copies of an application that have different contexts. Even when those problems are solved we are still left with the situation that Mozilla checks for other copies of itself and aborts if it finds any.
Quoted 5 lines
Thats quite interesting; because I do worry about apps stealing selected text or producing fake dialogs. Another example (easier to deal with using less exotic tools) is stopping accidental pasting of confidential info into some windows (e.g. many people worry about accidentally pasting things into irc or chat windows).
Many people do accidentally paste passwords in IRC, you see it happen all the time.
I believe that SE-X will also control the clipboard and stop accidental pasting into the wrong window.
Quoted 6 lines
Quoted 2 lines
The problem for KDE is that programs are not exec'd, they are mmap'd into a running process, so
domain_auto_trans()does not work for Konqueror!Sigh - that really isn't going to make it easy to control; a pity really because bits of KDE are quite nice - but if it can't be made secure then its future will be limited.
It wouldn't be THAT difficult to change the code in question and spend a few hours recompiling it...
Quoted 10 lines
Quoted 9 lines
Quoted 3 lines
Is it easy to set such a system up? What about allowing normal users to see the policy violations that are causing their individual programs are making?
This is not really possible at the moment. Allowing all users to see all messages is easy but usually not desirable. Writing a program to sort through the syslogd output and make some of the messages involving a user's account available to them would be possible, but no-one has worked on it AFAIK.
Quoted 5 lines
Hmm doesn't sound that hard to do.
Well I've created a new issue in the OpenOffice database
(http://qa.openoffice.org/issues/show_bug.cgi?id=25503)
suggesting splitting the config/options out into a separate binary.
Great!
Signature · 10 lines
http://www.coker.com.au/selinux/ My NSA Security Enhanced Linux packages http://www.coker.com.au/bonnie++/ Bonnie++ hard drive benchmark http://www.coker.com.au/postal/ Postal SMTP/POP benchmark http://www.coker.com.au/~russell/ My home page -- 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 9 lines · Russell Coker
Quoted 3 lines
Is it easy to set such a system up? What about allowing normal users to see the policy violations that are causing their individual programs are making?
This is not really possible at the moment. Allowing all users to see all messages is easy but usually not desirable. Writing a program to sort through the syslogd output and make some of the messages involving a user's account available to them would be possible, but no-one has worked on it AFAIK.
Though we are not working directly on this problem, our audit analysis tool seaudit has much of the needed infrastructure to support this. Additionally, all of the syslog parsing, filtering, and sorting functionality for seaudit is packaged as a separate library (look in libseaudit in the setools distribution).
Karl
Signature · 11 lines
Karl MacMillan Tresys Technology [email protected] http://www.tresys.com (410) 290-1411 x134 -- 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.