When I first started working on SELinux about a couple of hundred years ago, or so it seems, SELinux was used to confined "logged in" users. I define a "logged in" user as a user who has used credentials (Username/Password) to login to a system via a login program like login, xdm or sshd.
When we first shipped SELinux in Fedora Core 2, we went out with the example policy from NSA, later renamed "strict" policy, and it was a disaster. Hundreds of bugs per day, and everyone was clamoring how to turn off SELinux. Fedora Core for the most part is a single user OS and that user does not want to be confined. Also much to my chagrin people all over the world did not want to setup their machines the way Dan Walsh wanted them to. :^( Strict policy and confining of users requires file context to be setup correctly in the users home directories. Labeling for these home directories proved to be very difficult to maintain. Finally using SELinux to confine something requires a "security policy", by this I mean you need to define what access you want an application/user to have.
For example; everyone wants to confine the web browser. But no one agrees on how the web browser should be confined. Should it only be allowed to view web pages? Should it be allowed to run helper applications? If I launch OpenOffice from inside the web browser, should I allow a transition from firefox_t to ooffice_t? Or stay in firefox_t? If still in firefox_t, and the user uses the open button in ooffice, what should happen? When the web browser downloads a file to disk should it be able to place it anywhere? Should it be able to upload files from anywhere on the system? On the modern desktop, applications like the mail program have embedded web browsers, how should they react? How should applications interact?
Since almost no one agrees on these, it quickly became apparent that confining "logged in users" was not going to work on a general purpose OS. This is when we decided to re-look at policy and "Target" the domains that we wanted and new how to confine. Targeted policy was born.
SELinux has all this power that we were not taking advantage of...
So now as we ship Red Hat Enterprise Linux 5 and Fedora 7 (No more core), I have begun to look into how we can start to confined certain types of "logged in users" in a targeted policy system
A little background:
SELinux has a feature called RBAC which stands for Roles Based Access Control. The idea here is to control what a user can do by the roles that he is assigned. SELinux uses type enforcement to control the "transitioning" from one role to another. In Strict and MLS policy you would use the newrole command to switch from one role to another. The newrole package is available in policycoreutils-newrole.
During the past few months I have been noticing a discussion of handling a "guest" account. The kernel policy source repository system uses "git" and "git" requires a account on the server to be able to manipulate the repository. So if you want to allow a kernel maintainer to update the source code repository you need to set him up an ssh account. Similarly at "Red Hat", most of engineering has small accounts on people.redhat.com, where we can upload files and make them available to the public. http://people.redhat.com/dwalsh is my home page at Red Hat. I ssh into this account and can change my directory. Terminal servers and other shared home/directory servers are other examples.
The users on these systems need to be able to log onto the system, run a few commands and that is about it. They probably should never run a setuid app. They probably don't need to network out of the box.
I have been experimenting with the guest policy. http://people.redhat.com/dwalsh/SELinux/u sers/guest.te
You can copy this policy file onto your machine, and execute the following commands to set it up.
Copy guest.te to its own directory. In that directory execute
# Compile and load the policy
make -f /usr/share/selinux/devel/Makefile
semodule -i guest.pp
# Setup guest_u SELinux user
semanage user -a -P guest -R guest_r guest_u
# add user with this SELinux mapping
useradd -Z guest_u guest
# In FC6 useradd -Z is not supported
# semanage login -a -s guest_u guest
# restorecon -R -v ~guest
# set the guest password
passwd guest
# Now there are a couple of files that you need to edit to tell the login programs that guest_r:guest_t are valid logins.
echo "guest_r:guest_t" >> /etc/selinux/targeted/contexts/default_t ype
echo """
system_r:sshd_t:s0 guest_r:guest_t:s0
system_r:local_login_t:s0 guest_r:guest_t:s0
""" > /etc/selinux/targeted/contexts/users/gue st_u
# If you only want ssh access don't add the local_login line. The guest user would not be able to login via xdm.
Now you should be able to login to the system as the guest user and have very limited access. Beware
as you attempt to do certain activities you will be generating AVC messages that will trigger setroubleshoot. But try it out and let me know what you think. I will be posting other policies for confining user space in future blogs.
I have not upstreamed this policy but plan on working with upstream to make creating a new "logged in user type" as
userdom_unpriv_login_user(myuser)
Then if you want to add additional privs to this user you would just add additional interfaces.
For example adding networking would just be
userdom_basic_networking_template(myuser)
When we first shipped SELinux in Fedora Core 2, we went out with the example policy from NSA, later renamed "strict" policy, and it was a disaster. Hundreds of bugs per day, and everyone was clamoring how to turn off SELinux. Fedora Core for the most part is a single user OS and that user does not want to be confined. Also much to my chagrin people all over the world did not want to setup their machines the way Dan Walsh wanted them to. :^( Strict policy and confining of users requires file context to be setup correctly in the users home directories. Labeling for these home directories proved to be very difficult to maintain. Finally using SELinux to confine something requires a "security policy", by this I mean you need to define what access you want an application/user to have.
For example; everyone wants to confine the web browser. But no one agrees on how the web browser should be confined. Should it only be allowed to view web pages? Should it be allowed to run helper applications? If I launch OpenOffice from inside the web browser, should I allow a transition from firefox_t to ooffice_t? Or stay in firefox_t? If still in firefox_t, and the user uses the open button in ooffice, what should happen? When the web browser downloads a file to disk should it be able to place it anywhere? Should it be able to upload files from anywhere on the system? On the modern desktop, applications like the mail program have embedded web browsers, how should they react? How should applications interact?
Since almost no one agrees on these, it quickly became apparent that confining "logged in users" was not going to work on a general purpose OS. This is when we decided to re-look at policy and "Target" the domains that we wanted and new how to confine. Targeted policy was born.
SELinux has all this power that we were not taking advantage of...
So now as we ship Red Hat Enterprise Linux 5 and Fedora 7 (No more core), I have begun to look into how we can start to confined certain types of "logged in users" in a targeted policy system
A little background:
SELinux has a feature called RBAC which stands for Roles Based Access Control. The idea here is to control what a user can do by the roles that he is assigned. SELinux uses type enforcement to control the "transitioning" from one role to another. In Strict and MLS policy you would use the newrole command to switch from one role to another. The newrole package is available in policycoreutils-newrole.
During the past few months I have been noticing a discussion of handling a "guest" account. The kernel policy source repository system uses "git" and "git" requires a account on the server to be able to manipulate the repository. So if you want to allow a kernel maintainer to update the source code repository you need to set him up an ssh account. Similarly at "Red Hat", most of engineering has small accounts on people.redhat.com, where we can upload files and make them available to the public. http://people.redhat.com/dwalsh is my home page at Red Hat. I ssh into this account and can change my directory. Terminal servers and other shared home/directory servers are other examples.
The users on these systems need to be able to log onto the system, run a few commands and that is about it. They probably should never run a setuid app. They probably don't need to network out of the box.
I have been experimenting with the guest policy. http://people.redhat.com/dwalsh/SELinux/u
You can copy this policy file onto your machine, and execute the following commands to set it up.
Copy guest.te to its own directory. In that directory execute
# Compile and load the policy
make -f /usr/share/selinux/devel/Makefile
semodule -i guest.pp
# Setup guest_u SELinux user
semanage user -a -P guest -R guest_r guest_u
# add user with this SELinux mapping
useradd -Z guest_u guest
# In FC6 useradd -Z is not supported
# semanage login -a -s guest_u guest
# restorecon -R -v ~guest
# set the guest password
passwd guest
# Now there are a couple of files that you need to edit to tell the login programs that guest_r:guest_t are valid logins.
echo "guest_r:guest_t" >> /etc/selinux/targeted/contexts/default_t
echo """
system_r:sshd_t:s0 guest_r:guest_t:s0
system_r:local_login_t:s0 guest_r:guest_t:s0
""" > /etc/selinux/targeted/contexts/users/gue
# If you only want ssh access don't add the local_login line. The guest user would not be able to login via xdm.
Now you should be able to login to the system as the guest user and have very limited access. Beware
as you attempt to do certain activities you will be generating AVC messages that will trigger setroubleshoot. But try it out and let me know what you think. I will be posting other policies for confining user space in future blogs.
I have not upstreamed this policy but plan on working with upstream to make creating a new "logged in user type" as
userdom_unpriv_login_user(myuser)
Then if you want to add additional privs to this user you would just add additional interfaces.
For example adding networking would just be
userdom_basic_networking_template(myuser)
(Anonymous)
2007-05-29 06:19 pm (UTC)
Another policy would be very helpful, too: Limit the user to read and write only into his $HOME like a chroot. Is something like this possible?
cheers
This is somewhat vague and difficult
2007-05-30 04:50 pm (UTC)
Most other directories this user would not have access to.
RBAC goodness
(Anonymous)
2007-06-04 05:51 pm (UTC)
The "AllowTcpForwarding no" sshd_config option works, but it's pretty coarse. RBAC would be useful here.
Great post man
Can you do something related for executables?
(Anonymous)
2007-07-18 03:53 pm (UTC)
Cannot get this to work with CentOS 5
(Anonymous)
2007-10-08 01:43 pm (UTC)
Compiling targeted guest module
/usr/bin/checkmodule: loading policy configuration from tmp/guest.tmp
guest.te:150:ERROR 'syntax error' at token 'manage_dirs_pattern' on line 85533:
#line 150
manage_dirs_pattern(privhome,{ guest_home_dir_t guest_home_t },guest_home_t)
/usr/bin/checkmodule: error(s) encountered while parsing configuration
make: *** [tmp/guest.mod] Error 1
Re: Cannot get this to work with CentOS 5
2007-10-08 01:48 pm (UTC)
http://people.redhat.com/dwalsh/SEL
Thomas
(Anonymous)
2007-12-02 03:32 pm (UTC)
http://www.games2web.com/forums/viewtopi
http://www.games2web.com/forums/viewtopi
http://www.games2web.com/forums/viewtopi
http://www.games2web.com/forums/viewtopi
http://www.games2web.com/forums/viewtopi
http://zacefronforum.com/forums/viewtopi
Acne Proactive Solution Treatment
http://zacefronforum.com/forums/viewtopi
http://zacefronforum.com/forums/viewtopi
http://zacefronforum.com/forums/viewtopi
http://zacefronforum.com/forums/viewtopi
Cheap Phentermine Free Shipping (http://www.games2web.com/forums/viewtopic.php?t=16396)
free ringtone for nokia cingular phone (http://www.games2web.com/forums/viewtopic.php?t=22172)
airfare car cheap cruise discount hotel insurance las rental travel vacation vegas (http://www.games2web.com/forums/viewtopic.php?t=22174)
Cheapest Domain Registration And Web Site Hosting (http://www.games2web.com/forums/viewtopic.php?t=22177)
employee free motivation survey (http://www.games2web.com/forums/viewtopic.php?t=22179)
Acne Proactive Solution Treatment (http://zacefronforum.com/forums/viewtopic.php?p=58794)
Dessert Food Kraft Recipe (http://zacefronforum.com/forums/viewtopic.php?p=58802)
3000 Bad Credit Loan Personal (http://zacefronforum.com/forums/viewtopic.php?p=30087)
Consumer Credit Counseling (http://zacefronforum.com/forums/viewtopic.php?p=30088)
Iron And Glass Coffee Table (http://zacefronforum.com/forums/viewtopic.php?p=58805)
Ass Parade
(Anonymous)
2007-12-22 03:17 pm (UTC)
Big Breast Picture
(Anonymous)
2007-12-25 08:19 pm (UTC)
adult2008.info/lesbiangangbang lesbian gangbang
adult2008.info/freeporn free incest porn videos
adult2008.info/teennudity teen nudity
adult2008.info/vaginalcumshot vaginal cum shot
adult2008.info/proposalxxx xxx proposal
adult2008.info/narutoxxx naruto xxx
adult2008.info/myfirstsexteacher my first sex teacher
adult2008.info/catfasterkillpussy cat faster kill pussy
adult2008.info/venezuelanpussy venezuelan pussy
assbigparade
(Anonymous)
2007-12-27 01:43 pm (UTC)
bigbreast.today.com big breast picture
freeporn.today.com free porn
frogsex.today.com free frog video sex
lesbian.today.com lesbian gangbang
freemotorolaringtones.today.com free motorola ringtones
nokia3360freeringtones.today.com nokia 3360 free ringtones
polyphonicringtones.today.com absolutely free polyphonic ringtones
cingularringtones.today.com free cingular ringtones
totallyfreeringtones.today.com totally free ringtones
You have
2007-12-28 12:52 am (UTC)
www.r10.net küresel ısınmaya hayır seo yarışması
freemotorolaringtones
(Anonymous)
2007-12-30 01:05 pm (UTC)
forum.radiohouse.org/index.php?showuser=5
www.clantags.netsons.org/forum/index.php?s
pdonline.keypress.com/user/view.php?id=3
www.wirelessforums.org/members/thomas15k.h
sixsigmaonline.org/aveta/aveta/user/view.p
thomas15k.phpnet.us tracfone ringtone
thomas15k.prohosts.org sprint pcs ringtone
www.islam.com.az/forum/index.php?showuse
www.althanas.com/world/member.php?u=7179 Order Cheap ambien online
www.poorrichardrocks.com/forums/index.ph
www.realityport.com/forum/members/thomas
www.irishisptest.com/forum/members/thoma
www.clublavela.com/forums/member.php?u=8
www.visualtron.com/forums/index.php?show
cfhelp.ru/forum/index.php?showuser=2722 Adderall xr anger
board.thesacredyoga.com/members/thomaskk
www.wildcatarmy.com/forum/index.php?show
www.recomp.com/forum/member.php?u=67 payday cash advance
voip-forum.tmcnet.com/forum/forum_posts.a
easypaydayloan
(Anonymous)
2008-01-03 07:35 am (UTC)
www.1house.fm/forum/member.php?u=3503 payday advance loan
www.babelistings.com/forums/member.php?u=3
glutenfreeworks.com/forums/member.php?u=9
www.tokio-hotel-fan.ro/forum/member.php?u=1
www.nokiaclub.ro/forum/member.php?u=4562 cialis online discount
www.bingo.org.uk/forum/member.php?u=2929 buy discount cialis
forum.commonpassion.org/profile.php?id=2
www.maidireborsa.it/member.php?u=3344 teen bikini
www.assopoker.com/forumvbulletin/member.p
www.zamzata.com/forums/member.php?u=2013
www.quilledcreations.com/quillingforum/m
www.animeitalia.com/forum/member.php?u=2
psychostick.com/forums/member.php?u=6391 big naturals
www.bollywood2000.com/forums/member.php?u=9
thydoom.com/forum/member.php?u=5564 suicide girls
www.viperalley.com/forum/members/chuvisk
www.gambling.co.uk/forums/members/chuvis
rsforums.com/member.php?u=1064 micro bikini
forum.athletes.com/member.php?u=161511 anna nicole
www.tamilterminal.net/forum/member.php?u=6
www.collegehoopsnet.com/community/member.p
copyforum.de/member.php?u=11668 bow wow
www.my-bulldog-hell.co.uk/forum/member.p
bad credit personal loan
(Anonymous)
2008-01-06 12:02 pm (UTC)
There are many bad credit personal loans online. More and more companies are offering quick cash loans (like Internet Cash Advance) to people with bad credit, without the inconvenience of having to go to a bank of office and fill out paperwork.
http://www.geckoforums.net/member.php?u=6
http://www.gedichte.com/member.php?u=354
http://pix-hoster.com/forums/member.php?u=4
http://ldsfiles.com/newforums/members/ch
bad credit personal loan
(Anonymous)
2008-01-06 09:50 pm (UTC)
There are many bad credit personal loans online. More and more companies are offering quick cash loans (like Internet Cash Advance) to people with bad credit, without the inconvenience of having to go to a bank of office and fill out paperwork.
http://www.thefanatics.com/forumsvb/memb
http://www.scotland.com/forums/members/c
http://www.thinkreel.com/member.php?u=99
http://www.studentsforum.co.uk/member.ph
badcreditpersonalloan
(Anonymous)
2008-01-07 01:58 pm (UTC)
http://www.royharris.com/forum/member.ph
http://www.ducati1098.net/forum/member.p
http://forums.rofmagazine.com/member.php?u=8
http://www.learn-guitar.net/member.php?u=3
Hello.! Happy New Year 2008.!Ïðèâåò.! Ñ íîâûì ãîäîì2008.!Bonjour. ! Bonne annee 200
(Anonymous)
2008-01-12 05:08 am (UTC)
Bonne annee 2008.!
viagra.online
(Anonymous)
2008-01-13 09:22 pm (UTC)
expenses. Our goal is to be your complete solution when it comes
to your medications. We are committed not only to bringing you
the finest products for health.
http://forums.ipodhacks.com/showthread.p
http://forums.ipodhacks.com/showthread.p
http://www.ewealth.com/member.php?u=3298
http://www.thedieselgarage.com/forums/me
2008-01-21 11:14 am (UTC)
> like this for a while...
> Képeslap
spyware
(Anonymous)
2008-01-23 02:05 pm (UTC)
http://forums.ipodhacks.com/showthread.p
http://forums.ipodhacks.com/showthread.p
http://forums.ipodhacks.com/showthread.p
http://forums.ipodhacks.com/showthread.p
buyviagraonline
(Anonymous)
2008-02-07 05:16 pm (UTC)
Viagra (sildenafil citrate) was the first FDA-approved pill to treat erectile dysfunction (ED). Viagra went on the market in 1998 and has since become the most popular ED treatment on the market. Viagra works for most men regardless of age, starts to work quickly and lasts up to four hours.
Viagra relaxes muscles and increases blood flow to particular areas of the body.
http://forums.ipodhacks.com/showthread.p
http://forums.ipodhacks.com/showthread.p
http://forums.ipodhacks.com/showthread.p
http://forums.ipodhacks.com/showthread.p
mycelebrity
(Anonymous)
2008-03-13 08:35 am (UTC)
http://mycelebrity.wordpress.com my celebrity
http://celebrityclub.wordpress.com celebrity club
http://celebrityhotnews.wordpress.com celebrity hot
http://sexycelebrity.wordpress.com sexy celebrity
letsgo
(Anonymous)
2008-03-19 05:50 pm (UTC)
http://letsgo.kz