Slashdot Mirror


Red Hat Boosts SELinux With RHEL 5

E. Stride writes "Many IT managers find Security Enhanced Linux, or SELinux, to be wildly complex. The mandatory access controls originally developed by the NSA have developed a reputation for being too complicated to deal with, and many IT shops simply turn the feature off. However, Red Hat's Dan Walsh says it's the only way to ensure 100% protection in the data center."

175 comments

  1. lol by Anonymous Coward · · Score: 0

    lol 100% safe

    1. Re:lol by timmarhy · · Score: 2, Funny

      i can sell you a 100% safe pc if you want - it has no hd and no psu.

      --
      If you mod me down, I will become more powerful than you can imagine....
    2. Re:lol by Anonymous Coward · · Score: 0

      Seen it. It is a nice stable system. Only time I've seen it crash is when I've dropped it.

      http://www.geocities.com/rcwoolley/

  2. 100%? by mkro · · Score: 4, Informative

    There will never be a 100% protection. A good GUI with a wizard, like with SUSE's AppArmor, will help a lot of people from falling between the "naah, it broke something on my webserver, turning it off" and "I'll dedicate the two next months of my life to learn SELinux" chairs.

    --
    I shall go and tell the indestructible man that someone plans to murder him.
    1. Re:100%? by weapon · · Score: 5, Informative

      I run fedora and on *many* message boards I see the first trouble shooting idea is to turn off SELinux. What most people forget is that you can set SELinux to be permissive, so it is still turned on, and it lets you know when applications would be doing something that would be prevented. I think changing to permissive mode SELinux is more useful than turning it off as it lets you know what applications are misbehaving. I think part of this problem is that previously there has been no easy way to look as SELinux messages and manage the policies.

      The main disadvantage of AppArmor is that it relies on file paths, not the inodes. All you need to do is be able to create a hard link in the right directory to get around it.

    2. Re:100%? by CajunArson · · Score: 5, Informative

      100% agree that there is no such thing as 100% protection. I think both SELinux and AppArmor are great things (I did my MS thesis (woefully out of date) on Domain & Type enforcement which is one of the major systems (along with RBAC & Bell-Lepadula/Biba) in Mandatory Access Control (MAC). The SELinux approach is (usually) a more 'pure' variety in that it encompasses the entire system, all of the namespaces in the system in one setup. When I say 'namespace' think of that scene in the Matrix when Neo can't open his mouth to make a phone call..... Tell me Mr. HAcker, how are you going to steal my passwords when you can't even name the /etc/shadow file? SELinux will allow policies where even the root user (under certain contexts) cannot screw with the system. This can make administration harder like in some SELinux setups you literally have to login as root from the physical console to have full access, su'ing to root or SSHing in as root will not get the same privileges. In the most extreme cases, an SELinux policy could literally require you to reboot the box off of a rescue CD to get full access to certain files. The controls are extremely fine grained and very powerful, but potentially cumbersome.
            AppArmor's main approach is somewhat less broad. It is more like putting certain applications into a MAC container to limit what an application can do, no matter who the user using the application is. A great example of this that most Slashdot readers should look into is putting the browser into a safety container. I've been using Linux since right before 2.4 came out, and I can't count the number of times I've heard 'Linux is more secure because even if your account gets hacked the system isn't hacked' While there is certainly truth to that from the perspective of the full system, it fails to mention that the only data I actually give a rat's ass about is the data in my account, I can always get the rest of the crap from CD/downloading! AppArmor can help fix this by saying: Hey Firefox, just because you are running as user CajunArson, you DON'T get to do everything CajunArson can do, we will only let you operate on some files, and you can't get full access to his data, you can't fork/exec any ol' program that CajunArson can, and in general you are limited to doing what you are supposed to do: Browse the Web. The underlying concepts are still based on the MAC used by SELinux, but the implementation, while not as air-tight theoretically, is also easier to adjust. If there is something I really need firefox to do that the profile will not allow, AppArmor makes the process of tweaking the security easier than SELinux in general (although RedHat could be working on better SELinux tools to fix that).
          Sorry for the long post, but remember: the next time someone says Linux is more secure than Windows, remember that things like SELinux and AppArmor really are what make it better, not just because it has a mean looking penguin!

      --
      AntiFA: An abbreviation for Anti First Amendment.
    3. Re:100%? by Niten · · Score: 4, Informative

      Good GUIs are a wonderful thing, but I want to emphasize that SELinux isn't really all that difficult to begin with. High quality SELinux rules shipped with solid distributions such as RHEL 5 eliminate many of the problems that early adopters faced; indeed, that's more or less the subject of this article.

      Many people (such as myself) consider SELinux much less of a "patch job" than AppArmor. For instance, with AppArmor security attributes are not stored with the filesystem inodes, but are specified according to path name. That might simplify AppArmor's implementation a bit, but consider what happens to the security policy when you have two different path names hard linked to the same inode...

      Those of us who are partial to SELinux's implementation of mandatory access controls are thrilled to see the strides that Red Hat has made in their latest enterprise release.

    4. Re:100%? by ryanov · · Score: 2, Informative

      I agree. This REALLY bothers me from a Sysadmin chair. It's clear that that feature was placed there in order to help you secure your system -- turning it off ought to be grounds for a reprimand from above. You wouldn't leave telnet open to the world in this day and age, so why would you turn off SELinux on a system that used it? At the very least, assigning files to the same context that contains the privileges that you need is something that does not take months to configure, but makes many of the problems go away.

      I run a ColdFusion server with SELinux enabled (permissive yet, but I'm getting there)... that is a bit of a challenge, but it protects me from questions later, like "why was that privilege escalation possible?"

    5. Re:100%? by Anonymous Coward · · Score: 2, Insightful

      "Good GUIs are a wonderful thing, but I want to emphasize that SELinux isn't really all that difficult to begin with."

      Not difficult? I guess that's why *on a stock Fedora system* SELinux prevents my desktop computer from writing back the time to the hardware clock. Or why SELinux prevents UDEV from creating /dev/watchdog on my laptop.

      If it isn't difficult how come the guys who cobble together the distro can't get it right?

      I just turn it off and life is soooo much easier.

    6. Re:100%? by Architect_sasyr · · Score: 1

      Is there an indepth but easy to read guide on SELinux? I turn it off and rely on a few network based defenses for most of my stuff simply because I don't have two months to dedicate to it. But if there was something I could be flicking through while I post responses on slashdot, I'm sure that would be useful.

      --
      Me failed English...
      FreeBSD over Linux. If my comments seem odd, this may explain...
    7. Re:100%? by ryanov · · Score: 2, Funny

      Wouldn't that be a sign that it's time to get a better distro than to disable security features? :)

    8. Re:100%? by Anonymous Coward · · Score: 5, Informative

      Permissive mode is only useful for policy development. The kernel does not enforce the security policy in permissive mode so it is no more secure than turning it off.

      Enforcing mode = Security policy decisions are enforced, policy violations are logged.
      Permissive mode = Security policy decisions are not enforced, policy violations are logged.
      Disabled = Security policy decisions are not computed.

    9. Re:100%? by ryanov · · Score: 2, Informative

      His point was that at least you KNOW about violations, even if they aren't enforced. That's at least something.

      Where it gets tricky is when permissive allows something to happen that triggers another violation, whereas enforcing would have stopped things earlier in the chain. Things can look a little inconsistent in that way.

    10. Re:100%? by ryanov · · Score: 2

      Lots of them on the web. I posted my favorite someplace below that was put out by RedHat (easiest for me since it's the manual for the system I'm running anyway).

    11. Re:100%? by Anonymous Coward · · Score: 0

      "Remember: the next time someone says Linux is more secure than Windows, remember that things like SELinux and AppArmor really are what make it better, not just because it has a mean looking penguin!" - by CajunArson (465943) on Tuesday June 05, @09:30PM (#19405809)

      Agreed, 110%... & the "100% secure" the initial thread post here states that somebody from RedHat stated is possible? ISN'T, no way (what one person can lock, another WILL eventually, unlock - more OR less + new threat types emerge constantly).

      Windows CAN be secured very well, but, you have to go thru some "GYRATIONS/EFFORT" to do it, but, it IS doable (but not to any 100% levels, because again - see what I stated last paragraph of mine above).

      Here I am running Windows Server 2003 SP #2, fully current patched by MS update pages, here (I check it every 2nd Tuesday of the month of course, on "Patch Tuesday's"):

      It is a personally 'security-hardened' model I have been working on for many years, using principals I learned & used since the NT 3.5x days onward to this version of the OS: As is now?

      I score an 84.735 on the CIS Tool 1.x currently as of 06/01/2007!

      (For CIS Tool - There are Linux, MacOS X, Solaris, & other OS models ports of this are available too by the way - not really "ports" strictly speaking, they require JAVA to run)

      DOWNLOAD URL FOR CIS TOOL (for multiple platforms), from "The Center for Internet Security" here:

      http://www.cisecurity.org/bench.html

      (IMPORTANT: This tool IS invaluable in guiding you to a more secure OS, on any OS platform really!)

      APK 14 STEPS TO FOLLOW TO SECURE YOUR WINDOWS NT-BASED SYSTEM (2000/XP/SERVER 2003/VISTA):

      1.) Windows Server 2003's SCW was run over it FIRST (this only exists on Windows Server 2003, not on 2000/XP (you have to install this, it does NOT install by default) first to help security it (SCW = security configuration wizard, & it's pretty damn good believe-it-or-not, @ least, as as starting point))...

      Directions for its installation are as follows:

      Start the Add or Remove Programs Control Panel applet.

      Click Add/Remove Windows Components.

      On the Windows Components Wizard screen, select the "Security Configuration Wizard" check box, as the figure shows. Click Next.

      The Windows Components Wizard builds a list of files to be copied and finishes installing SCW. Click Finish.

      DONE!

      (Then, @ that point? I pull ANY Networking clients &/or Protocols in the Local Area Connection, other than Tcp/IP typically, on a stand-alone machine that is not dependent on Microsoft's File Sharing etc. on a LAN/WAN. I also disable that too!)

      2.) Disable Microsoft "File & Print Sharing" as well as "Client for Microsoft Networks" in your LOCAL AREA CONNECTION (if you do not need them that is for say, running your home LAN)!

      3.) Use IP security policies (modded AnalogX one, very good for starters, you can edit & add/remove from it as needed) - Download url link is here for that:

      http://www.analogx.com/contents/articles/ipsec.htm

      (Search "AnalogX Public Server IPSec Configuration v1.00 (29k zip file)" on that page & follow the directions on the page!)

      NOTE: This can be 'troublesome' though, for folks that run filesharing clients though. An alternative to this is using IP Ports Filtrations, in combination with a GOOD software firewall &/or NAT 'firewalling' (or true stateful inspection type) router. All of these work in combination w/ one another perfectly.

      (HOWEVER - Should you choose to use it, and do filesharing programs? No problem really, because you can turn them on/off @ will using secpol.msc & the IP stack in Windows 2000/XP/Server 2003/VISTA is of "plug-N-play" design largely, & will allow it).

      4.) USE General security

    12. Re:100%? by BigBuckHunter · · Score: 4, Informative

      Permissive mode is only useful for policy development.

      I wholeheartedly agree.
      Step 1: Install RHEL, disable SELinux
      Step 2: Install and configure your stack (apache, jboss, tomcat, mysql, whatever)
      Step 3: Enable permissive mode, light up the stack, watch logs
      Step 4: Tweak the rules, repeat step 3 until the logs are clean.
      Step 5: Enable Enforcing Mode

      You can now rest a little bit easier knowing that you have SELinux enabled. The only drawback is that you sometimes have to repeat the process as new versions of your stack are released (mysql, jboss). It's basically a monthly process.

      BBH

    13. Re:100%? by Znork · · Score: 2, Informative

      "What most people forget is that you can set SELinux to be permissive"

      Unfortunately, there's also a whole bunch of people who naively thought permissive mode would only log and not interfere with anything, spent two days troubleshooting some problem, finally _disabled_ SELinux and had it work perfectly from the default two days ago.

      I'm sure there were perfectly logical reasons for it to happen, but it's that kind of random, seemingly inexplicable and above all, unlogged problems that turn people off of MAC security. It's not unique to SELinux, I've seen the same kind of crap on other systems like eTrust.

      And unfortunately, once you start distrusting the security software (and it doesnt take many instances of such failures), the first line of debugging always becomes - shut it off, shut it off completely and utterly, because I'm not wasting my time again.

      "I think part of this problem is that previously there has been no easy way to look as SELinux messages and manage the policies."

      I'd say it's the the most important part of the problem. For some reason, designers of these kinds of softwares tend to act as if it's a wholly separate part of the system, with the common result that they're signalling errors in encrypted morse code on a LED on the dark side of the moon. There are standard ways to signal system errors, standard header files defining system messages, and many programs use these facilities to signal what was wrong (such as permission denied). It would be far more acceptable if these were used, and a program would signal 'Permission denied by MAC policy', which would give an easy way to know what to fix.

    14. Re:100%? by Anonymous Coward · · Score: 0

      Please kill yourself.

    15. Re:100%? by bl8n8r · · Score: 1

      > "I'll dedicate the two next months of my life to learn SELinux"

      Why is learning something new so horrid? I know a lot of admins (sorry, most are windows admins) that are very troubled when they can't fully understand something in 10 seconds. These same guys will sit there staring at a progress bar for two hours during a windows update though (wtf?). Some things worth learning _will_ take time, and some things you learn won't be worth it. You need to take that risk sometimes, even if it seems to suck at first.

      --
      boycott slashdot February 10th - 17th check out: altSlashdot.org
    16. Re:100%? by arivanov · · Score: 2, Interesting

      Yep, been there, seen that. I have seen SEL on fedora (4) in permissive mode still breaking an app and had it fixed by turning the damn thing off (it did work properly on Debian 4.0 though). The app was using tty functions from a web-server CGI context which is a requirement for working expect scripts.

      As far as your comment on error codes and 'Permission denied by MAC policy', quite a few (if not most) of app developers do not handle all possible error codes returned by the OS and do not have a "catch-all" clause when handling errors. So returning a "new and wonderfull" error code is actually likely to cause more mayhem, than returning one of the "well known" error codes like -EACCES. I would rather have the actual error code configurable on a per-item basis (dunno if SEL can do that as I have not yet committed to the several days necessary to learn its deep internals).

      --
      Baker's Law: Misery no longer loves company. Nowadays it insists on it
      http://www.sigsegv.cx/
    17. Re:100%? by mkro · · Score: 1

      As someone else just mentioned, there is always a "tradeoff between security and usability". There are lots of admins (and "admins") that are not given the opportunity to learn these things. If they can explain to their managers why they need to learn it, and they are given time for it, fine, but there still are places where the guy running the web server also is the same guy who has to run around the office helping people select the correct printer in Word and restore deleted shortcuts in Outlook. We really don't get anywhere with an "either you admin or don't" attitude.

      --
      I shall go and tell the indestructible man that someone plans to murder him.
    18. Re:100%? by sirambrose · · Score: 4, Insightful

      The problem in using a selinux system is when most of the software on the system is custom written or custom configured. Although I believe that the using the common combinations of web servers and database servers are easy to combine now, I can easily imagine wanting my web application to do things that are prohibited by policy. Customizing selinux looks somewhat challenging. If you just run a standard mail server or something it is probably great.

      Everybody says that app-armor sucks with hard links, but I just don't see it. If your configuration looks like

      allow all
      deny read,write /root/mysecretfile

      then you have a problem with hard links, but it isn't relevant. In that case you have already decided to try to solve the impossible problem of listing every important file on the system. Anyone interested in security would write:

      deny all
      allow read /etc/daemon.conf
      allow read,write /var/daemon/data

      Then I don't have to attempt to list all the secure files on the system. All I have to do is decide what I want to grant the daemon access to. If there is a hard link to /etc/daemon.conf, the program can't read it and shouldn't be trying to read it anyway.

      Storing the labels in the filesystem only works if you are the distribution maintainer. If all the programs that create a particular kind of file don't agree on the label, the on-disk labels can get messed up. The simple config file in app-armor allows easy auditing.

      That said, I like the possibility of securing dbus and X with the same framework as the filesystem. I'm hoping that we will see a document file access daemon for linux that allows the user to securely load and save files from a sandboxed firefox or openoffice process. Until selinux gets used for this type of desktop security instead of just network daemon security, the added power of selinux is mostly useless.

    19. Re:100%? by largenumber · · Score: 1

      Not to get sidetracked here, but Red Hat's Dan Walsh does NOT say '100% protection'... At least he doesn't in the article linked to.

    20. Re:100%? by GooberToo · · Score: 1

      It's clear that that feature was placed there in order to help you secure your system -- turning it off ought to be grounds for a reprimand from above. You wouldn't leave telnet open to the world in this day and age, so why would you turn off SELinux on a system that used it?

      Of course you wouldn't unless your manager, out of fear and ignorance, forces you to disable it as step one following installation. This is the same manager that has root access which I must constantly go behind to fix things he's messed up, or configured in a non-standard way making updates painful. Hypothetically speaking of course.

    21. Re:100%? by Znork · · Score: 1

      'So returning a "new and wonderfull" error code'

      Actually, I was thinking more about messing around with perror and the human readable versions (that are translated and such). Of course, it might not be possible to intercept and add code to perror, but if anything could, that would be something as intrusive as SELinux or other MAC layers, as intercepting system calls is their main territory.

    22. Re:100%? by baggins2001 · · Score: 1

      I think a good start here would be developers of software begin incorporating SELinux in their HowTo's, instead of just saying turn it off. DSPAM is a case in point.
      AppArmors GUI interface reminds me of various tools which ask the user "This wants to do this" Is it okay "Yes" "No".
      SELinux has a little higher learning curve. [Took me four days] But quite a bit of that was understanding what the system was doing or trying to do.
      I believe that AppArmor is probably good enough for the casual linux enthusiast who redoes their systems every six months when the latest version comes out, but SELinux is more for security of enterprise systems .
      This is one of the ways I determine whether someone belongs in the position where they have responsibility for configuring systems. Install a perl script with network sockets, have it do a couple of things, tell them what you want to allow it to do. Here set up an SELinux module for it.
      I really wouldn't want somebody who could only use a security GUI wizard have responsibility for setting up security on enterprise systems.
      The results will give you an idea of what kind of documentation the user will give you and an idea how easy it will be for others to follow what they have done.
      A lot of *nix systems need scripting and configuration without GUI's so this is a pretty good way to find out about someones technical interaction.

      --
      He who said 1,000,000 monkeys on 1,000,000 typewriters would eventually type the great novel, never saw an AOL chat room
    23. Re:100%? by Crispin+Cowan · · Score: 1

      The main disadvantage of AppArmor is that it relies on file paths, not the inodes. All you need to do is be able to create a hard link in the right directory to get around it.

      This is a mis-understanding of the AppArmor model. AppArmor confines the processes you tell it to, you are to confine any process that you think might be a threat. Therefore if some process made such a hard link, it is because you either left it unconfined, or you explicitly gave it permission to make such a hard link.

      You are not "getting around" AppArmor, it is doing exactly what you told it to. This is a common complaint from people who have read about AppArmor, but never used it. It does not happen in practice.

    24. Re:100%? by Anonymous Coward · · Score: 0

      "You are invited to take a drink from the Firehose" - well, so much for that! I saw that in my Opera screen today, & decided to post this version of it here on /. for feedback:

      http://it.slashdot.org/comments.pl?sid=237507&cid= 19410153

      So, I took the invite, & I posted the content in this thread, for feedback from other Win32 NT-based OS users here in the "FIREHOSE" section!

      Just to hopefully get critique on points I may have missed OR am inaccurate on in whatever regards is what I was after (OR just points I missed outright, that increase layered security)

      I was also looking for feedback from the Linux/BSD/MacOS X/UNIX crew around here, & for techniques they might use that I could adapt to a Windows NT-based OS environs (2000/XP/Server 2003/VISTA).

      I guess it did not "make-the-grade" here!

      Oh well, you can't "win 'em all", & please everyone!

      APK

      P.S.=> Too bad!

      So, it looks like you telling me to "please just die" is exactly what happened to this thread, as far as it being put up for others to use/learn from, OR to have more added to it!

      (You see, I feel it would have gotten stronger, & mainly, because I know there are some sharp people in this area that attend this site (& their feedback would have only made the material in it stronger in the end)).

      That all said & aside? Well, it appears that YOU, A/C, get the "last laugh" then, I suppose!

      (Congratulations A/C that told me to "just die", & I hope it makes your day!)...

      Still: Life goes on though!

      Time to go get an oil change for my ride:

      http://img.techpowerup.org/061213/APKTiburonGTV6Ph oto1596.jpg

      &

      http://img.techpowerup.org/061213/APKTiburonGTV6Ph oto2.jpg

      (Doing a FULL synthetic-oil changeover today, from the std. stuff - Mobil 1 15,000 mile grade & a Purolator Pure1 filter (accept NO substitutes!))! apk

    25. Re:100%? by Nevyn · · Score: 1

      This is a mis-characterization of the AppArmor model. AppArmor confines the processes to the filepaths you tell it to ... this is like if some random program created a link to /etc/passwd (say, to do some weird locking) the new filename would automatically get permissions of 666 or owned by a random user. Sane people don't expect crap like this to happen, for a very good reason.

      --
      ustr: Managed string API with ave. 44% overhead over strdup(), for 0-20B
    26. Re:100%? by WuphonsReach · · Score: 1

      Good GUIs are a wonderful thing, but I want to emphasize that SELinux isn't really all that difficult to begin with. High quality SELinux rules shipped with solid distributions such as RHEL 5 eliminate many of the problems that early adopters faced; indeed, that's more or less the subject of this article.

      Well... maybe. I'm using SELinux on CentOS5 in enforcing mode right now.

      Out of the box, there are still half-a-dozen things that SELinux is blocking that I would consider to be normal applications to install on a server. Such as NTP writing back to the hardware clock on shutdown, or LVM tools being able to update the cache files, and other trivial things like that.

      Fortunately, none of it is stopping operations (the machine works, so far). But it's going to take me a good solid few hours when I can go learn how SELinux works, and figure out how to adjust the profile to let it do what it should be doing.

      So, I'm glad that it's installed in Enforcing mode from the start. I'd always wanted to use SELinux on my old distro, but never got around to it. With RHEL5/CentOS5 having it installed from the start, it's forcing me to learn it.

      (Hopefully it's worth the effort and keeps the machine more secure.)

      --
      Wolde you bothe eate your cake, and have your cake?
    27. Re:100%? by Nevyn · · Score: 1

      Unfortunately, there's also a whole bunch of people who naively thought permissive mode would only log and not interfere with anything, spent two days troubleshooting some problem, finally _disabled_ SELinux and had it work perfectly from the default two days ago.

      To be fair this is almost always not directly the fault of SELinux, the Linux kernel has a few newer "security" options like "allow apps. to mmap() onto page 0" which they default to "off" for compatibility but SELinux defaults to "on" so that it can deny them per. process (SELinux, like most security software, doesn't like to grant privilages but just remove them).

      I appreciate that it doesn't help you when you are trying to debug the problem though.

      --
      ustr: Managed string API with ave. 44% overhead over strdup(), for 0-20B
  3. SELinux is a good thing by pembo13 · · Score: 4, Insightful

    It can save a system from being compromised due to other services which are either weaker, or poorly configured. Taking some time to get SELinux working properly in ones production environment (if that system is important) is more than worth the time it takes to read up on it. Being a lazy sys admin rarely pays off in the long run.

    --
    "Thanks for all the money you paid to us. We've used it to buy off ISO among other things" -Microsoft
    1. Re:SELinux is a good thing by garett_spencley · · Score: 4, Insightful

      But it all really boils down to your needs.

      For example, consider the typical LAMP server (linux + apache + mysql + php) that hosts a web application. What does it need to protect ? It needs to protect the database with all the user data, the publicly accessible html documents and php scripts and possibly the log files.

      You may also argue that it needs to protect the overall system from compromises involving using the system as a zombie or irc server etc. but in that situation a well managed server could simply have the software reinstalled. If the admins are competent and have access to spare servers they could configure the replacement machine and do a swap without incurring any downtime at all.

      In this situation SE Linux might just be total overkill. The extra paranoid could have the publicly accessible html docs + php scripts on a read-only partition. This is a production environment we're talking about so the need to upload new documents will only be when upgrading software versions. If the web application allows users to upload data then that will need to be handled separately. A cron job could change file permissions on newly updated documents so apache no longer has write access. The log files can be moved to a separate location once per day when they're rotated where apache (or any other services) don't have access to them. MySQL can run chrooted, only bind to 127.0.0.1 and the database files can only have read/write access from the mysql user. Daily, or even hourly, backups of the database to read-only media can be implemented. This is on top of running an intrusion detection system, installing security updates asap, and doing all of your other post-install locking down before the network cable is even plugged in to the machine (setting up your ssh keys, firewalls, uninstalling unnecessary software - including compilers - and obviously unused daemons and anything else the paranoid admin does before the machine goes live etc.)

      We're already talking about way more security than most LAMP based servers out there.

      I agree that the setup could still benefit from SE Linux, particularly for the database since it's still the weakest link and one of the areas in the most need of protection. MySQL needs to read/write to the database on a regular basis and so you need to allow write access to the data files, trust your software, trust your mysql binaries (all binary files and static config files can be on read-only partitions) and nothing is preventing a root process from changing the file permissions or corrupting the data. However, for most people this setup would be more than adequate and SE Linux would be total overkill.

    2. Re:SELinux is a good thing by xsuchy · · Score: 1

      For example, consider the typical LAMP server (linux + apache + mysql + php) that hosts a web application.
      Big advantage of SELinux is the fact, that if you have security hole in some service and attacker get root access, he still can not do everything. If properly set, root access in wrong context is totally unuseable.
      This can be very helpfull for freehosting, where you can expect a bunch of security holes in users CGI scripts.
    3. Re:SELinux is a good thing by ashayh · · Score: 1

      There was a Samba vulnerability recently whose damage was mitigated by SELinux. Link

    4. Re:SELinux is a good thing by illumin8 · · Score: 2, Interesting

      It can save a system from being compromised due to other services which are either weaker, or poorly configured. Taking some time to get SELinux working properly in ones production environment (if that system is important) is more than worth the time it takes to read up on it. Being a lazy sys admin rarely pays off in the long run.
      I agree that SELinux is a good idea, but how do we get vendors to "play nicely" with it? I'm a Linux sysadmin working on a lot of Oracle database servers. Oracle says I have to have SELinux turned off, and in our experience, Oracle won't even install or run with SELinux enabled. I would love to be able to turn SELinux on but Oracle says I can't. Is there any hope for those of us that run commercial apps on Linux and want to see better security?
      --
      "When the president does it, that means it's not illegal." - Richard M. Nixon
    5. Re:SELinux is a good thing by WuphonsReach · · Score: 1

      In this situation SE Linux might just be total overkill.

      We used to say the same about some other security precautions that are now commonplace. Down the road, I'm not sure it will be seen as overkill. Especially if it is effective and they can get the default policies correct.

      I'm still on the fence with SELinux. I'm glad that RHEL5 is putting it out there on the systems as part of the default install. I think that will help it shake bugs out of SELinux a lot faster then before (larger install base, plus RedHat's now invested in making it work). I've already cursed at it a few times on the CentOS5 box that I have, but it's forcing me to learn it. (And for the most part it is staying out of the way, except for half a dozen cases where I need to fix it and file bug reports.)

      --
      Wolde you bothe eate your cake, and have your cake?
    6. Re:SELinux is a good thing by pembo13 · · Score: 1

      LAMP solutions _need_ SELinux. I'll explain if you want.

      --
      "Thanks for all the money you paid to us. We've used it to buy off ISO among other things" -Microsoft
  4. just how good is this? by rucs_hack · · Score: 2, Interesting

    SElinux certainly sounds interesting. How relevant is it for the normal user?

    Is it better for my personal linux box to have this or is Iptables enough?

    1. Re:just how good is this? by sammy+baby · · Score: 4, Informative

      The short version: it's very good. But a huge pain in the ass.

      The slightly longer version: IPtables is about network access, firewalls, et cetera. SELinux is about ensuring the integrity and access rights of software on your system. It's designed to prevent, say, one process on your machine from overwriting a file it should be able to. There's a pretty good explanation of exactly what it buys you here. (Warning: government site. They're watching youuuuuu!)

      The problem with SELinux is that up until recently it has been a royal pain in the ass to configure. You'd go, "Sure, this sounds like a good idea", turn it on, and then curse it roundly when you tried updating MySQL from the version that ships with RHEL to the most recent supported release from MySQL. As a result, most folks just turned it off - they figured it wasn't worth the hassle.

      RHEL 5 apparently includes tools (see the article) for figuring out what's wrong with your SELinux configuration. Definitely worth looking into. But if you're not concerned with validating application integrity on your home box... and let's face it, it's a home box... probably not worth it for you until it becomes dead simple.

    2. Re:just how good is this? by ryanov · · Score: 1

      I'm not sure that it's at all worth it on a single-user system that is isolated from risky populations by firewalls, etc.

      I don't use it on my personal laptop... actually, that makes me wonder -- I don't know, does Ubuntu even use it by default?

    3. Re:just how good is this? by g1zmo · · Score: 4, Funny

      It's designed to prevent, say, one process on your machine from overwriting a file it should be able to.

      Yeah, that pretty much sums up my experience too.

      --
      I have found there are just two ways to go.
      It all comes down to livin' fast or dyin' slow.
      -REK, Jr.
    4. Re:just how good is this? by bzipitidoo · · Score: 2

      I haven't tried SELinux recently. Basically, it adds a whole lot more permissions and group types and hierarchies to the 3x3 standard "rwx" for user, group, world. You get permissions like "append allowed but no other writes allowed", and "editors running under your account can write to your source code files, but no other apps running under your account can write to those files". Unfortunately, managing all those permissions isn't as easy as running some chmod type of utility. Another knock against such security enhancements is it slows everything down. Might take a 5% performance hit just to run SELinux.

      I prefer the "air gap" and back ups. Do development on one PC, have another dedicated to database stuff, another for web services, etc. It's not like PCs and RAIDs are expensive. Could even do it with virtual PCs with something like VMWare. And you could probably manage several installations of an OS more easily and quickly than one installation of SELinux. Even with good tools, the sheer volume of permissions to manage makes SELinux unwieldy. With bad tools, you're probably opening up and watering down so much you might as well just turn it off.

      At least SELinux isn't a joke that can be cracked in 2 seconds, with huge holes of the sort all too easily configured in a utility such as sudo. Think you're going to write a sudoers file to prevent people from running certain system utilities such as passwd or halt? Easily circumvented by copying passwd to some name that isn't forbidden. Going to stop such copying by "chmod a-rw" to all those utilities? What chmod can do, chmod can just as easily undo. And, that doesn't stop all sorts of other ways around such a feeble barrier. That's the sort of thing SELinux can stop. The question is whether some security from those sorts of problems is worth the pain of administering SELinux. For most situations, SELinux isn't worth the trouble. If I wanted to take a step towards a tiny bit more security, I would run my browser under a different uid, so that if it picked up something bad, it couldn't do something like, say, trash my home directory. Go through the hassle of having to move downloads between user accounts all the time, just to guard against a very unlikely threat? Nah.

      --
      Intellectual Property is a monopolistic, selfish, and defective concept. It is "tyranny over the mind of man"
    5. Re:just how good is this? by fuego451 · · Score: 1

      does Ubuntu even use it by default?

      I know that Debian Etch does and the user selects the level of protection during install. From then on I guess it does its own thing. There is no man page and I haven't gotten around to reading up on it so I have no clue as to what it is or is not doing. I would guess that Ubuntu uses SELinux in a similar fashion. See if /etc/selinux and /usr/share/selinux exist.

    6. Re:just how good is this? by ryanov · · Score: 1

      Looks like no... but:

      $ aptitude search selinux
      v   libselinux-dev                  -
      i   libselinux1                     - SELinux shared libraries
      p   libselinux1-dev                 - SELinux development headers
      p   python-selinux                  - Python bindings to SELinux shared librarie
      p   python-selinux-dbg              - Python bindings to SELinux shared librarie
      v   python2.4-selinux               -
      v   python2.5-selinux               -
      p   selinux-basics                  - SELinux basic support
      p   selinux-doc                     - documentation for Security-Enhanced Linux
      v   selinux-policy                  -
      p   selinux-policy-default          - Policy config files and management for NSA
      p   selinux-policy-refpolicy-dev    - Headers from the SELinux reference policy
      p   selinux-policy-refpolicy-doc    - Documentation for the SELinux reference po
      p   selinux-policy-refpolicy-src    - Source of the SELinux reference policy for
      p   selinux-policy-refpolicy-strict - Strict variant of the SELinux reference po
      p   selinux-policy-refpolicy-target - Targeted variant of the SELinux reference
      p   selinux-utils                   - SELinux utility programs

      ...so a little is installed, and more could be.

    7. Re:just how good is this? by Alioth · · Score: 1

      The Windowsesque practise of one service per server is still no substitute for SElinux. Presuming you have one service per server, without SElinux, if someone pwns that buggy web app, they can still turn your box into a spam zombie. However, with an SElinux policy, you can lock that web app down so it can _only_ do what's authorized - so when the spammer pwns it, they find they can't actually make any use of what they've managed to pwn, because the SElinux policy on that application prevents it from opening any new network sockets, or even starting any other executables.

      Or to give another example, if on a webserver, you have a particular module that performs authentication for obtaining certain files, you can write an SElinux policy that only allows that module access - so if someone hacks your apache instance, they still can't steal the data you want to protect, because the apache process itself (even though it runs as the same unprivileged user as the module) can't actually get into that part of the filesystem. The SElinux policy can be written such that not even root can access that part of the filesystem unless the root user is logged onto the physical console.

  5. AVC (server) = UAC (desktop) by OutOnARock · · Score: 1, Insightful

    Seems an awful like the different implementations of the same idea.

    Of course MS sucks and Linux rules because its /., but how is "training" AVC to know what is allowed to touch the kernel and what is not, any different from "training" UAC to know what is allowed to touch the kernel and what is not?

    Let the flaming begin

    1. Re:AVC (server) = UAC (desktop) by compro01 · · Score: 1

      the idea is sound, but the implimentation is the thing.

      windows with it's constant prompts to do stuff while performing the same task gets very annoying and will quickly train the user to just click the allow, rendering it practically pointless.

      in my experiance, other implimentations of this will prompt once in a given task and also encourage the user to think a little more as they prompt for their password (yes, i know windows can do this, but it doesn't by default)

      --
      upon the advice of my lawyer, i have no sig at this time
    2. Re:AVC (server) = UAC (desktop) by Volante3192 · · Score: 3, Funny

      Very off topic, but I was just thinking...

      windows with it's constant prompts to do stuff while performing the same task gets very annoying and will quickly train the user to just click the allow, rendering it practically pointless.

      Clearly, in order to make users think about this, a 5 second delay has to be introduced before the Allow/Deny buttons are active...

  6. 100% Secure by whterbt · · Score: 4, Interesting

    Ignoring for now that nowhere in the article does he claim that SELinux provides or is required for "100% security", there's no such damn thing. Unless you pull out the power cord, of course.

    Yes, we disable SELinux at our shop. As the article mentions, it's a pain in the ass, and the tools to manage it are not mature enough. If all you have is RHEL, and you have nothing else to do, you can look at configuring it. If you have a bunch of corporate mucky-mucks breathing down your neck, and you have to get the latest version of GnuWhatever compiled for 5 different OSs, there's no time to deal with this nonsense.

    SELinux probably works just great for what it was designed for - NSA top-secret systems. There's always a tradeoff between security and usability, and right now, SELinux is just above yanking the power cord.

    --
    Too late to be known as Bush the First, he's sure to be known as Bush the Worst.
    1. Re:100% Secure by dbIII · · Score: 1

      SELinux probably works just great for what it was designed for - NSA top-secret systems. There's always a tradeoff between security and usability

      If it's for a webserver/ftpserver/mailserver with ssh access it's pretty trivial to set up and use. If it's for something running a commercial *nix app that uses a dozen ports for weird undocumented stuff plus NFS disk access via amd it then becomes a pain.

    2. Re:100% Secure by ryanov · · Score: 1

      Walk into your boss and tell them that you've decided to trade security for time (if indeed you're talking about multiuser systems here). My boss would tell me "sorry, that's not your call."

      SELinux is NOT one step above yanking the power cord -- how did this get moderated so high?

      I know, I must be new here.

    3. Re:100% Secure by jkrise · · Score: 1

      SELinux probably works just great for what it was designed for - NSA top-secret systems. There's always a tradeoff between security and usability, and right now, SELinux is just above yanking the power cord.

      I simply yank the network cable instead.

      Some good network security tools that I use.

      --
      If you keep throwing chairs, one day you'll break windows....
    4. Re:100% Secure by profplump · · Score: 1

      You're right, it's not always my call. But I've never, ever had the call go for security over time, no matter who makes it.

      How the hell did you get a boss with a clue?

    5. Re:100% Secure by ryanov · · Score: 1

      You know, I didn't even really get a boss with a clue. The boss that was let go recently (for being a fly in the ointment of the new VP) was originally a UNIX tech who worked his way up. My current boss was a DBA at one point, but years and years ago. Thing is, though, she trusts her staff generally (and can tell when someone's bullshitting her). So there are probably cases where if no one said anything to her, she wouldn't know something was important... but she gets CERT advisories just like the rest of us, etc.

    6. Re:100% Secure by init100 · · Score: 1

      SELinux is NOT one step above yanking the power cord -- how did this get moderated so high?

      Maybe because it was, back in the days. :)

      In other words, maybe some people need to update their opinions a bit. They install new releases of their distributions, but turn off SELinux just like last time without even looking at the new SELinux configuration tools, etc.

  7. Better, but still a way to go. by Cozminsky · · Score: 2, Interesting

    Although SELinux is a step in the right direction it's still basically a system of ACLs. It still suffers from the problem of the confused deputy. I think proponents of object-capability based security are correct in their thinking. Some interesting stuff going on in this respect is the E programing language.

  8. accursed beer makes me typo by sammy+baby · · Score: 1

    Damn beer.

    Obviously rather than "prevent one process on your machine from overwriting a file it should be able to," I meant "shouldn't". Feh.

    1. Re:accursed beer makes me typo by rucs_hack · · Score: 1

      Thanks for the info, sounds like its more then I need on my normal use machine.

      Never damn beer, I believe it positively enhances the slashdot experience :-)

  9. That's not entirely true. by bitbucketeer · · Score: 1

    There is no 100% protection. There are only SELinux rulesets for less than two dozen server applications, which is a very small percentage of the over 1100 packages which make up RHEL5. Even so, there's a decent book from O'Reilly, and Linux Journal recently covered SELinux... so only ignorant, overpaid sysadmins would blindly disable SELinux in the datacenter!

    1. Re:That's not entirely true. by timmarhy · · Score: 1

      not many employee's are overpaid in IT. consultants on the other hand.....

      --
      If you mod me down, I will become more powerful than you can imagine....
    2. Re:That's not entirely true. by crawly · · Score: 2, Funny

      consultants on the other hand.....

      So where do I go to sign up for one of those consultants jobs then. I'm sure I could turn off SELinux just as well as anyone else.
      --
      GCS/S d-x s+(+): a C++++$ UL+$ P+ L++$ !E--- W++@ N++>$ !o !K-- w++$ !O !M !V PS++>$ PE !Y PGP+ t+ 5++ X++ R tv b
    3. Re:That's not entirely true. by r00t · · Score: 1

      Maybe true: "two dozen server applications"

      Maybe true: "over 1100 packages which make up RHEL5"

      Not true: anywhere near 1100 server applications in RHEL5

      RHEL5 probably ships about two dozen server applications. That's plenty. What, you need a gopher server?

    4. Re:That's not entirely true. by hawaiian717 · · Score: 1

      There are only SELinux rulesets for less than two dozen server applications

      Less than two dozen = over 200? Must be that funky new math...
      --
      End of Line.
  10. Ulcers are a good thing by Anonymous Coward · · Score: 1

    "Being a lazy sys admin rarely pays off in the long run."

    Is it being a lazy sysadmin? Or just an overworked sysadmin?

    1. Re:Ulcers are a good thing by ryanov · · Score: 1

      One needs to put their foot down and do their job. That includes making the system as secure as reasonably possible. If that's the amount of time it takes, that's the amount of time it takes. I'd rather take the high ground than make excuses later on.

  11. I'm not sure of the advantages over xp sp2 by King_of_Prussia · · Score: 0, Troll
    It adds a "security center" which badgers people into running Windows Firewall, having antivirus software and letting security updates be downloaded and installed automatically. But that's not all!

    There are some neat updates to the wireless networking stuff, adding pretty boxes to make the whole thing somewhat more comprehensible to your average computer user, complete with a huge "this is an open network, anyone can connect to it!" type message.

    The update also adds the "information bar" to IE, a little bar that slides down when it blocks a pop-up or activex control. You have to click the bar and then click the right option on the menu to get either things to display. Dialog boxes make more sense: yes/no in activex prompts has been replaced with "install/don't install" and a "never install from [whoever]" option added. "Open/Save" becomes "Run/Save" in the dialog box for download executables. Little shields pop up all over the place to alert you if you're about to do something insecure.

    Compare this to SELinux, which -- quite apart from screwing things up whenever I try to install it -- has all sorts of insecure services that no-one would use enabled by default. If you sign up to something like the Mandrake security mailing list, you get a ludicruous number of emails -- and I don't think SELinux has any real equivalent to this completely-hands-off automatic update functionality.

    So which OS is more secure? Windows gives you the tools you need, while SELinux gives you just enough rope to hang yourself with.

    Incidentally, Snape dies so Harry can kill Voldemort and survive

    --

    Making the moon less necessary since 1998.

    1. Re:I'm not sure of the advantages over xp sp2 by thegrassyknowl · · Score: 1

      I am not sure whether this is funny, a stupid poster or a troll.

      I wish I had mod points or the time to address the post on the merits of all 3 points. I'm going to go with Stupid Poster, because that seems to be a good median place for the ~6bn people on earth!

      --
      I drink to make other people interesting!
    2. Re:I'm not sure of the advantages over xp sp2 by BKX · · Score: 1

      I don't why whoever modified you as interesting did so, considering how confused you seem (I don't mean to sound insulting; I'm just in one of those snarky moods. :) ). SELinux doesn't have any services to begin with. It's a security layer that provides fine grained control of permissions for individual executables and services. Perhaps you were refering to Red Hat Enterprise Linux (RHEL), which does come with a buttload of services at install (and can use SELinux), although I don't believe any are configured to run by default (except for sane services like ssh, and even then I'm not sure.).

    3. Re:I'm not sure of the advantages over xp sp2 by init100 · · Score: 1

      I don't think SELinux has any real equivalent to this completely-hands-off automatic update functionality.

      That is because SELinux is completely orthogonal to automatic update functionality. SELinux is a fine-grained mandatory access control system that controls access to files and other resources like network ports.

  12. SELinux is a problem by Henry+V+.009 · · Score: 1, Interesting

    I've never run an RHEL server for more than 24 hours without experiencing an SELinux problem. Every new release, the same story.

    Just the other day, I tried to install "rt" on a brand new RHEL 5 box for a demo (we're looking into new ticket systems). I found that "yum install mysql-server" hung forever. Same with the apache install. It turns out the SELinux thinks that useradd being run by the mysql rpm (to add user "mysql") was trying to attack /dev/random. So SELinux blocks reads to /dev/random and useradd hangs which makes yum hang. And yum is one process that I sure don't want to kill.

    This wasn't a hacked up RHEL box or anything. I had installed it that morning.

    There were suggested fixes in my logs, but they did not work. My solution? Disable SELinux. It's just not ready for prime-time. Or production environments.

    1. Re:SELinux is a problem by Anonymous Coward · · Score: 0

      My solution: install Solaris. Containers really do work.

    2. Re:SELinux is a problem by farkus888 · · Score: 3, Informative

      saying that you can't install things while selinux is running is a flaw of selinux is like complaining about needing to be root to install things. its job is to keep shit from changing, changes like installing mysql could be done while it was running it wouldn't be doing its job. disabling it long enough to make changes is just like su or sudo to get temporary root access inside your normal user environment.

      disclaimer -- I may be completely off base because I don't use it in a production environment, I disable it during install whenever putting a fedora box up for use.

      --
      thats right, I rarely use capitals. deal with it. but don't mistake my laziness for stupidity
    3. Re:SELinux is a problem by Henry+V+.009 · · Score: 1

      Sure, I've come to the conclusion that that's the only way to use SELinux if you're going to. But Red Hat documentation doesn't suggest that method of administering your server. Also, notice how yum gives no warning about SELinux being on when you use it to install packages? SELinux is always there to bite you, even if you're following all of Red Hat's system administration guidelines. It's not worth the aggravation.

    4. Re:SELinux is a problem by init100 · · Score: 1

      Also, notice how yum gives no warning about SELinux being on when you use it to install packages?

      Maybe because it isn't meant to be turned off when installing packages? I've never been bitten by SELinux while installing packages, but of course, I don't use SELinux in a production environment (just on my home desktop and my work laptop) since I haven't yet managed to convince my colleagues to even evaluate if we could turn it on for at least some systems.

    5. Re:SELinux is a problem by greg1104 · · Score: 1

      I had a similar issues with my own CentOS 5 install this morning. The very first time I let the package updater loose, the logs were filled with this type of message for several packages that were updated:

      setroubleshoot SELinux is preventing usr sbin groupadd (groupadd t) "read write" to socket 21434 (rpm t). For complete SELinux messages. run sealert -l d4c6570d-30ba-4e9f-898c-e7bb3fb6435f

      setroubleshoot SELinux is preventing /usr/sbin/useradd (useradd t) "read write" to socket 21434 (rpm t). For complete SELinux messages. run sealert -l ac582882-8aa9-45dc-a98d-1d8be86e3d52

      Now, maybe this is a CentOS packaging issue, but I kind of doubt it. The information provided by the new RHEL is much, much better than the previous versions--before I would have just gotten the "avc: denied" line and been stuck on a research adventure just to figure out what direction to go in, the sealert tool gave a lot more helpful error messages. But the default policy is still unpredictably broken in ways that are trivial to encounter.

      (But at least it doesn't suck as badly as the lameness filter, which refused to let me me post any more details of what I ran into without complaining about junk characters. I got a junk for you right here, Mr. Filter)

    6. Re:SELinux is a problem by Crispin+Cowan · · Score: 1

      AppArmor does not require you to disable AppArmor to install something. Notably, AppArmor's equivalent of 'permissive' mode (called 'complain') is per-profile, not system-wide, so you can do permissive learning on a new application while leaving others secured.

  13. Just disable it for certain apps by KidSock · · Score: 5, Informative

    For those who may not fully understand what SELinux actually does, let me give you an example.

    With SELinux enabled, by detault Apache will be prevented from accessing files other than those of very basic web apps, it cannot open sockets to other hosts, etc.

    For IntErnet applications this is quite reasonable and with the machine on the most hostile network around you really should use SELinux. It won't stop a break in but it can seriously curtail the effects of one.

    For an IntrAnet application that is trying to write to custom log files and talk to LDAP servers and such, SELinux is not going to let you do that. At this point you have two choices - 1) tweek SELinux properties to allow only the specific functionality required by the application or 2) disable SELinux for that entire application. Considering an IntrAnet affords some physical protection, SELinux is less important in that environment and therefore, in this scenario, if you're really not savvy with SELinux and you don't have the time to get into it, I recommend just disabling it for entire application using it.

    For example, to disable SELinux just for Apache you do:

    # setsebool -P httpd_disable_trans 1
    # service httpd restart

    Note that SELinux uses db files that remember these changes so they will persist across reboots and there are no config files to edit. It's a nice system because it's easy to add these commands to install scripts and such.

    So don't get bent about SELinux. Learn enough to disable it for specific apps and then turn it on all over. Keep an eye on the log files. If SELinux is stopping access to things by apps it will report it in the log file. Then determine if the app should be doing that and if so disable SELinux just for that app.

  14. Containers.... by thule · · Score: 1

    ..,under Trusted Solaris? Or how about a container that provides a trusted environment? Explain.

  15. anecdotes... by jdogalt · · Score: 1

    First, my name doesn't have to be Bruce Schneier to dismiss anybody claiming "100% protection".

    Second, I have nothing against SELinux, though I will consider it broken until a default install handles this situation correctly-

    1) I install the OS, leaving the default selinux enabled
    2) after running a webserver for awhile, I decide I want to move my apache's docroot from /var/www/html to /mnt/data/www/html, after having mkfs.ext3'd some partition and mounted it at /mnt/data.
    3) naturally after "cp -av /var/www /mnt/data" as root, I edit /etc/httpd/conf/httpd.conf, changing any instance of /var/www to /mnt/data/www"
    4) I run 'service httpd restart' (reload should work as well of course)

    The last time I tried this with a version of redhat/fedora that had selinux enabled, it failed. And for most of the sites I'm serving (many that are never seen outside my home non-internet-connected lan), I see no motivation to invest my time in selinux.

    Now mind you, I completely expect things like this to be worked out by the selinux folks, if they haven't been already. The last redhat person I spoke with who defended the above, claimed that they didn't want people mucking around with commandlines and editing configfiles. I then asked that person how I should have gone about changing my DocRoot in such a way that SELinux "just worked". I got no reply. Given no reply, I can speculate as to one- They expect /var/www/html to always be the docroot, and /var to be on LVM and online expandable. Ok. Whatever.

    1. Re:anecdotes... by farkus888 · · Score: 1

      of course they expect /var/www/html to always be the docroot. its an ACL. it expects certain important files to be in their default location so it can allow/deny access appropriately. if there is no way to change the config so selinux can be told the new docroot then there is a problem. personally I couldn't tell you how or if it can be changed but I wager its in the documentation somewhere.

      --
      thats right, I rarely use capitals. deal with it. but don't mistake my laziness for stupidity
    2. Re:anecdotes... by ScriptedReplay · · Score: 1

      Let me introduce you to the -c option of cp, also known as --preserve=context.

    3. Re:anecdotes... by ryanov · · Score: 2, Insightful

      Just because you don't know how to do something doesn't make it broken. There are additions to almost all of the common GNU fileutils that support SELinux. You could alias them in .profile or equivalent if you wanted, like many distros do with -i on rm, etc.

      Of course, it sounds like many of your uses don't call for it, but really, what's next? Saying "I yelled at the PC to copy my files -- it didn't. Until they work this out, I consider it broken."

    4. Re:anecdotes... by atomic-penguin · · Score: 1

      Let me introduce you to the -c option of cp, also known as --preserve=context. Here's the thing, cp -a implies -p or --preserve=context as you put it. So the parent was doing just as you described.

      It's not just Apache that will refuse to start after you've archived a mountpoint and moved it to a different device or location. I had a similar experience using RHEL with SELinux enabled. I cloned a RHEL template in VMWare virtual center. Then I went into single user mode, and stopped remaining services writing to /var, at this point I archived /var. I added a new virtual disk, formatted it, mounted it up as /var and restored from my archive.

      At this point I should be able to reboot or change the runlevel and start back up using the new /var mountpoint. Syslog hung on startup! I ended up troubleshooting this problem several hours with no logging available. The most puzzling part was when I tried to start up syslog from the command line and it would take off just fine. It would inexplicably hang every time it was called from an init script.

      It turns out SELinux was preventing syslog to startup. It was impossibly hard to track down why syslog was failing, and why syslog was the only thing writing to /var which seemed to be affected.

      Let me re-iterate the point. This problem I and the grandparent poster experienced has nothing to do with "preservation" of context, permission modes, ownership, timestamps, ACLS, or any other file or filesystem attribute.
      --
      /^([Ss]ame [Bb]at (time, |channel.)){2}$/
    5. Re:anecdotes... by jdogalt · · Score: 2

      Great, after decades with --archive --verbose being sufficient cp flag knowlege, now I have to pay attention to some new crap. (i.e. the main point I was making). Somehow having to learn to deal with and use --sparse for tar seemed less offensive to me. Mainly I suppose because the --sparse gives me immediate satisfaction of seeing the benefits of a new feature (i.e. free disk space, smaller files, etc...). Wheras the --preserve=context and selinux only give me "security". Personally I'll stick with the philosophy that security should be part of the foundation, invisible to the user interface. (not that I won't use selinux where appropriate, just that I'll continue to be vocally annoyed).

    6. Re:anecdotes... by ryanov · · Score: 1

      Only security, eh? I hope you are not responsible for major systems is all I can say. You might not like command line flags, but... come on. How can security be totally invisible to the person supposedly managing the system?

    7. Re:anecdotes... by jdogalt · · Score: 2

      I think at some point, SELinux was touted as being a *transparent* security enhancement. Which sounded really cool to me. Then I discovered that it was a _vastly complex beast that required constant attention in order to prevent breakage of applications in situations where those applications were being used precisely as the application developers had intended_.

      SELinux is hard to use. The amount of energy required by my brain to contemplate MAC policies for all the types of situations I run into, is not worth the security it is bringing me.

      Just because all the coders who wrote the linux kernel, apache webserver, and distribution I was using didn't know how to implement SELinux's features in the first place, does NOT mean that they were stupid, or that their code was broken.

      The question is whether or not selinux is worth the trouble. I'm arguing (not alone dare I say) that in a lot of situations (majority? vast majority?) it is not. But don't give me this bullshit about 'because I don't know how to use it doesn't mean it's broken'.

    8. Re:anecdotes... by jdogalt · · Score: 1

      It's called software design you idiot. The apache webserver was designed so that if I want to move docroot, I edit a setting in httpd.conf. THAT ADMINISTRATOR ACTION IS WHAT TELLS THE SYSTEM THAT APACHE IS NOW ALLOWED TO ACCESS THE FILES IN THE NEW LOCATION.

      Any further administrative actions required which DO NOTHING MORE THAN EMPHASIZE THE INTENTION OF THE ORIGINAL ACTION, are evidence of a poorly designed security system. IMO.

    9. Re:anecdotes... by fimbulvetr · · Score: 1

      Oh yeah, heh, that progress thing again. Sorry about that. Will try harder to keep everything at 1970s technology so you don't have to do that "learning" thing "again". KTHXBYE.

    10. Re:anecdotes... by chill · · Score: 2, Interesting

      The problem you and the grandparent have is not grokking what RBAC and MAC are and how the traditional Unix/Linux root == God method of security is fundamentally flawed.

      SELinux makes sure things that are set up don't get arbitrarily changed. It isn't prescient to know that YOU have proper authority to make those changes. You have to tell it that.

      So, with SELinux you have one more step when you make substantive changes. Tell SELinux about it.

      Simply moving folders or files around as root and modifying program config files is NOT enough. What the hell is the difference between YOU doing it and a HACKER doing it? SELinux doesn't know. Hell, things like moving my Apache docroot around is something I'd really want to have secured.

      SELinux (and Solaris 10) try to fix that by implementing RBAC, MAC and Type Enforcement. http://csrc.nist.gov/rbac/rbac-faq.html

      --
      Learning HOW to think is more important than learning WHAT to think.
    11. Re:anecdotes... by ScriptedReplay · · Score: 1
      Here's the thing, cp -a implies -p or --preserve=context as you put it. So the parent was doing just as you described. Here's the thing, straight from the horse's mouth ... err ... man (that is, man cp)

      -p same as --preserve=mode,ownership,timestamps
      --preserve[=ATTR_LIST] preserve the specified attributes (default: mode,ownership,timestamps), if possible additional attributes: links, all
      So -p does not preserve contexts; -c does. Hint: backwards compatibility.
    12. Re:anecdotes... by ryanov · · Score: 1

      It's really only transparent if the default installation is set up properly. This is really up to the person who is installing the software. In all cases I've seen, if you have something that is officially supported by RedHat, you're in the clear. I haven't had any problems with RedHat's Apache RPM's, or MySQL or the rest. The trouble I've had is from installing shit from scratch. In that case, yes, you do need to install stuff the right way.

      The features are properly implemented in those places from what I can see (and really, it's not Apache's place necessarily to "support SELinux," they just need to collaborate with the SELinux people to make the permissions they actually require known. Really, any group that can read source code could do that without Apache's help... from what I've seen, this has happened. If you build from source, though, you're probably on your own.

      Very few things on a computer can be completely transparent -- you do still have to know what you're doing if it is something at this level.

    13. Re:anecdotes... by ryanov · · Score: 1

      No, it is not. That administrator action is what tells the system that that is where Apache should look for the files, and that is all it does.

      If that directory does not exist or is chmoded 000, it is still not going to work -- that might require further administrative action to correct, but it doesn't mean that Linux or Apache have anything wrong with them; that is just how the system works.

      SELinux works in much the same way, except there are policy files you can edit that will automatically apply permissions for you if they are written right. You can set them by hand as well.

    14. Re:anecdotes... by atomic-penguin · · Score: 1

      The grandparents 'cp' flags are irrelevant in preventing what occurred. SELinux is hooking in and preventing him making that change before any file permission or filesystem attribute is ever taken into account. So enlighten me how context preservation applies to this situation whatsoever?

      Where in the manual of cp, coreutils documentation, or SELinux documentation, does it say context preservation has anything to do with SELinux?

      --
      /^([Ss]ame [Bb]at (time, |channel.)){2}$/
    15. Re:anecdotes... by ryanov · · Score: 1

      In addition, most fileutils commands accept the -Z flag, which does the SELinux related thing on whatever that command is:

      # ls -laZ
      drwxr-xr-x  root     root     system_u:object_r:var_log_t      .
      drwxr-xr-x  root     root     system_u:object_r:var_t          ..
      -rw-r-----  root     root     user_u:object_r:var_log_t        acpid
      -rw-------  root     root     user_u:object_r:var_log_t        anaconda.log
      -rw-------  root     root     user_u:object_r:var_log_t        anaconda.syslog
      drwxr-x---  root     root     system_u:object_r:var_log_t      audit
      -rw-------  root     root     system_u:object_r:var_log_t      boot.log
      -rw-------  root     root     system_u:object_r:var_log_t      boot.log.1
      -rw-------  root     root     system_u:object_r:var_log_t      boot.log.2
      -rw-------  root     root     system_u:object_r:var_log_t      boot.log.3
      -rw-------  root     root     system_u:object_r:var_log_t      boot.log.4

      ...etc.

    16. Re:anecdotes... by Anonymous Coward · · Score: 0

      context manipulation (for instance through -c, -Z) is a specific SELinux-related addition to cp, as it pertains to preserving the files' SELinux security context (aka label) on copy. In particular, a strict enough policy for Apache could forbid it to access files that do not have the correct security context - useful for instance in preventing write access to unauthorized areas (note that a SELinux write interdiction takes precedence over +w for the httpd user, so "cp -p" is not sufficient to ensure that things relying on write access won't break after copy)

      Do you feel enlightened yet? (I have some 1-8xx-ABUDDHA number that you can try if all else fails :-) barring that, this is the best I can do without RTFM-ing you)

    17. Re:anecdotes... by Anonymous Coward · · Score: 0

      If this guy fundamentally does not understand how this works, administering a public connected webserver is really not the right thing to do for him. The biggest security problem here is the admin's unwillingness to educate himself and keep up with new beneficial developments. This is not SELinux'es fault. SELinux is completely right protecting the machine from this admin :) .

    18. Re:anecdotes... by Anonymous Coward · · Score: 0

      If you were the guy in charge of my servers, I'd fire you immediately. Incompetence is the only word that comes to my mind when reading your philosophy on how things should work... The system's design makes the administration requirements, not you. It's how it works. If you don't like it, you seriously got the wrong job.

    19. Re:anecdotes... by init100 · · Score: 1

      I haven't been mucking around with SELinux, but my personal guess is that you need to set the right SELinux context for the new document tree. SELinux contexts may not be copied automatically by cp, I don't know. There is a --preserve argument to cp that claims to preserve security contexts according to the manual page.

    20. Re:anecdotes... by init100 · · Score: 1

      at this point I archived /var. I added a new virtual disk, formatted it, mounted it up as /var and restored from my archive.

      I guess you didn't use tar --selinux? From the tar manual page:

      --selinux
      this option causes tar to store each file's SELinux security context information in the archive.
    21. Re:anecdotes... by init100 · · Score: 1

      So you claim that SELinux, to be a well-designed system, needs to be able to read every config file format in the world so that it can "understand" that you just moved your document root and that it should update its context automatically?

      May I suggest you move to Windows instead? Unix has a philosophy that does not seem to fit your mindset.

    22. Re:anecdotes... by jdogalt · · Score: 1

      For the record, I was never talking about installing things from source. And what you said only applies to my case if "redhat does not officially support moving docroot away from /var/www". And that is only if they haven't tweaked things in the years since I recalled having that issue. I assumed (perhaps incorrectly) that there was an selinux policy config for apache that limited it's access to files there. Perhaps that is not the issue. Honestly given the perceived complexity of SELinux, I have never wanted to research the issue to conclusion (though I admit I've most likely wasted more time arguing about it).

      I'm quite certain that at some point this will be 'fixed' if it is not already. Perhaps a system event (watched file modification) notification system will cause edits to httpd.conf to trigger into some selinux intelligent subroutine that "does the right thing(tm)". Or perhaps the redhat vision is that all software that was designed to be configured via manual editing of files, will be eradicated from their distribution and replaced with some 'master configuration process' which selinux is intimitely tied to.

      whatever... I just hope to avoid it until somehow it's implemented so well that I can get its benefits without having to understand and administer it. Because that takes time, and attention that I'd rather spend elsewhere.

    23. Re:anecdotes... by ScriptedReplay · · Score: 1
      There is no need to be abusive. Especially when you're wrong.

      The apache webserver was designed so that if I want to move docroot, I edit a setting in httpd.conf. THAT ADMINISTRATOR ACTION IS WHAT TELLS THE SYSTEM THAT APACHE IS NOW ALLOWED TO ACCESS THE FILES IN THE NEW LOCATION.

      No, editing httpd.conf is what tels apache that its docroot has a new location. The -a flag for copy was your attempt to tell the system that apache has the required rights to access the new location, by preserving the ownership of the tree. However, for SELinux you need to also preserve file metadata, which cp does not do by default. Feel free to do --preserve=all if you don't want to care about extra flags though.
    24. Re:anecdotes... by xappax · · Score: 1

      So enlighten me how context preservation applies to this situation whatsoever?

      According to the core security policy, Apache is allowed (by SELinux) to read any files with type httpd_sys_content_t. The files under /var/www have this type, which is part of their context. When you copy files from there without preserving their context, they acquire the new type of wherever they were copied, which Apache probably isn't allowed to read.

      Therefore, if you make sure to preserve the context so that the type remains httpd_sys_content_t, you should have no problems.

    25. Re:anecdotes... by jdogalt · · Score: 1

      So are you telling me that cp --preserve=all will be sufficient, and that I won't run into problems because "/var/www" is 'hard coded' in config files under /etc/selinux? (I.e. are the /var/www entries in /etc/selinux/ just for initialization and won't interfere if I've done the cp --preserve=all)?

    26. Re:anecdotes... by jdogalt · · Score: 1

      Precisely sir, "the system's design makes the administration requirements". We are discussing system design here, and whether or not the addition of selinux is a benefit or a detriment. And for the sake of argument, we are not really discussing specific security measures, but rather selinux as a whole.

      As a whole, the introduction of selinux into your system design, will *ADD REDUNDANT* administration requirements. To me that is a negative. The security added by selinux is a positive. Each system you design will have varying needs for security, and those needs should dictate your system design, including whether or not to use selinux.

      I'm saying, that if selinux were smart enough to respect and obey the user intentions reflected by the httpd.conf file, rather than duplicately hard coding the defaults of those values into it's own config files, that the system would be (IMO much) better.

      But please, by all means, go on arguing why you have no complaints about a system design that requires redundant administration steps. And then reread my statements, and realize that when I say "the system" I mean the entire blackbox appliance, to which you have written an administration manual for, so that your employer needn't be tied to having to hire an expensive human administrator who is well versed in esoteric selinux management. And the real point to all of this, is to simplify that administration manual as much as possible, because when you have redundant steps, you are adding complexity to the system. And unnecessary administrative complexity makes a system LESS SECURE AND MORE PRONE TO FAILURE. Let alone the fact that your engineers could be dedicating those esoteric selinux brain cells to features in the actual product or service you are developing or supporting.

    27. Re:anecdotes... by ScriptedReplay · · Score: 1

      yes. The policies you're talking about (in file_contexts) are for policy installation purposes. Unless you need to relabel the full tree again (which you shouldn't) they won't matter. And if you do, it is expected that any customizations that you made in the tree without putting them in the default contexts of the policy will have to be redone. Same thing as overwriting httpd.conf with the distro default and having to recreate your changes, really. And about as unlikely to be necessary, too.

  16. Less complex alternatives exist to SELinux. by liftphreaker · · Score: 5, Interesting

    Whatever Redhat says, the fact remains that SELinux is an incredibly complex, and incredibly undocumented (or under-documented) piece of software. It took me two months to really understand how it worked and what exactly to configure when I needed to fine-tune access rights and permissions on our servers. That is a nightmare I wouldn't wish on anyone.

    Redhat is not going to get much traction from this unless there is a very easy to use tool (preferably with GUI) to configure and customize SELinux, out of the box. The default tools on RHEL allow a few options during install time, but it is truly primitive.

    There really doesn't need to be this huge love/hate relationship with SELinux, in fact why not just throw it out and use something far simpler and neater? There are several options out there. Off the top of my head I can think of GRSEC : http://www.grsecurity.net/

    We've been using this on two of our server farms and it's been doing a superb job, and it is very very easy to customize compared to the SElinux nightmare.

    1. Re:Less complex alternatives exist to SELinux. by ryanov · · Score: 1

      Undocumented you say? I think not.

      Something you may not be thinking about -- understanding where you need your permissions on your systems is something that I'd personally recommend REGARDLESS of SELinux.

  17. SELinux - set permissive temporarily by ancientt · · Score: 1

    You can set it to temporarily permissive with setenforce 0.

    Ironically enough when I install systems I leave it enabled, but our security administrator turns it off. He used to try to leave it on but after pulling out what little hair he had, he is opting for the easy solution these days. Fortunately he doesn't set many machines up. I think he'll go back to using it as we move to RHEL 5 since it seems to be more sanely configured.

    You can find a nice note on it at: http://preview.tinyurl.com/yqjmfv which is on an EnGarde Linux page; they're one of the groups who spend some time studying and working with SELinux.

    --
    B) Eliminate all the stupid users. This is frowned upon by society.
    1. Re:SELinux - set permissive temporarily by init100 · · Score: 1

      Ironically enough when I install systems I leave it enabled, but our security administrator turns it off.

      I hope that he just sets it to permissive, as disabling it altogether usually causes a (time-consuming) relabel of the entire filesystem, though maybe only on next reboot.

    2. Re:SELinux - set permissive temporarily by ancientt · · Score: 1

      I should clarify, he turns off the option to install SELinux during installations. He has done this after time and again he experienced trouble that was alleviated by doing temporary disables.

      --
      B) Eliminate all the stupid users. This is frowned upon by society.
  18. SE Linux creating problems. by Zombie+Ryushu · · Score: 1

    Yes, I've had my share of problems with SE Linux on CentOS. I tend to disable it. I've had SE Linux cause badly configured CentOS Boxes on a CentOS 5.0 Beta (4.92) hang the machine because of SE Linux Policies. However, correctly configured, SE Linux can prevent a unit from being tampered with.

    On the issue of security. There are some Network and Domain Level hiccups. Ideally, all Linux applications should support Kerberos for their Single Sign on facility. However, in a lapse of forethought, there are some important ones that do not.

    One of these is KDE's Kontact when using XMLRPC. Why is this a problem? If you use Kolab, or eGroupware, you have to manually enter username and passwords for Users. This is a replay vulnerability, and, if your password is changed in LDAP and Kerberos, Kontact doesn't know it, and Kontact repeatedly sends the wrong User name and password to the XMLRPC Server until it blocks the user. Now, with IMAP4 and IMAPS? Click the "Use GSSAPI" Checkbox in server properties in Kontact, and Mail will use Kerberos no problem.

    If advanced Linux projects like KDE are serious about security, and I think they are, extensive use of Kerberos in a Domain Environment like mine is a must.

  19. Vastly different... by Ayanami+Rei · · Score: 1

    UAC is all about getting the user's input on activities that the Administrator would normally do (but not necessarily want to do if it was done behind their back).

    AVC is a way for an end-administrator to customize policy (or get hints on what files or network features to label for access by a service). Generally, the system administrator SHOULD NOT have to create policy unless the administrator is deploying a novel service. And its' not interactive; you don't use it during normal use, you use it during testing to refine your policy.

    A similar approach with vastly different intents and use cases.

    --
    THIS THING CAN TURN ON A DIME, MACROSSZERO STYLE ALSO FUCK BETA, ~NYORON
  20. No thanks by Blackknight · · Score: 0, Troll

    SELinux is a huge pain in the ass and most apps don't support it. I know that Cpanel doesn't work with it which is pretty much the industry standard for web hosting control panels. I've even got our kickstart server configured to boot every new server with selinux=0, we simply don't have time to screw around with it trying to make things work.

    The traditional unix security model is fine, it's worked for over 40 years, why change it now? People that need more restrictions are free to install selinux, grsec, openwall, or anything else that they want, we don't need SELinux shoved down our throats by Redhat or any other vendor.

    1. Re:No thanks by ryanov · · Score: 1

      I defer to those with more SELinux-fu than me (apparently not you -- no offense), but is it even possible for an application to not be compatible, period, with SELinux? I'm under the impression that it's not -- that would almost be like saying that an app required all of its files to be chmoded 777 in order to run. That may be the easy way out, but there is certainly a more restrictive set of permissions that would work (for example, I doubt there are any binaries that need the permission to write to themselves as they run).

    2. Re:No thanks by fimbulvetr · · Score: 1

      You're talking about cpanel - I wouldn't recommend touching that with a 10 foot pole. Cpanel isn't even compatible with itself.

    3. Re:No thanks by Alioth · · Score: 1

      _NO_ application supports SElinux. SElinux is implemented at the kernel/filesystem level, not the application level.

      It is possible to write SElinux policies for Cpanel. Perhaps no one has done it yet.

      Like anything, it's all about the appropriate tool for the job. For my home desktop? Don't need it. For my nothing-really-important-hosted-here dedicated server? Don't need it. For the server at work which has confidential information on it? Absolutely. I sleep better at night knowing that regardless of your Unix uid, if you're not going through the application that retrieves this data, then you will be denied access. I sleep better at night knowing that application absolutely cannot open a network socket. Going through a few hours pain and headache to work out how it works is worthwhile for this application, if it means I sleep at night. Improvements to the process of designing SElinux policies, such as new tools in RHEL5, is a good move.

    4. Re:No thanks by Slashcrap · · Score: 1

      we don't need SELinux shoved down our throats by Redhat or any other vendor.

      I've even got our kickstart server configured to boot every new server with selinux=0

      I'm having a bit of trouble reconciling those two statements. On the one hand Red Hat is forcing SELinux down your throat. On the other hand, their install system provides an easy way to turn it off.

      I'm assuming you were modded "troll" due to an inability to mod you "-1 Self Contradicting in Less Than a Hundred Words". Slashdot really needs more Mod options.

  21. How relevant? by weighn · · Score: 1

    How relevant is it for the normal user?

    I've looked over a few setup guides recently for MythTV on Fedora or Ubuntu (sorry but the urls are on my home machine). They nearly all say "turn SELinux off and save days of configuration pain".

    I can't see the point of persisting with it if you have a SPI router and something like Firestarter.

    --
    Mongrel News all the news that fits and froths
    1. Re:How relevant? by init100 · · Score: 2, Informative

      I've looked over a few setup guides recently for MythTV on Fedora or Ubuntu (sorry but the urls are on my home machine). They nearly all say "turn SELinux off and save days of configuration pain".

      I think those guides may be a bit outdated. SELinux were a royal PITA back in the days, but you almost never run into it on the newer Fedoras. Fedora 7 even has a little icon popping up in the notification area when SELinux denied some access request. For me it have just happened after suspend and hibernate, and then it was only two blocked file accesses.

      I'm actually surprised how well Fedora 7 works. I installed it on my Dell Latitude D810 laptop yesterday, and both wireless network with WPA2, 3D desktop with Compiz on ATI Radeon Mobility X600, suspend and hibernate works fine out of the box. Never did before. And of course, running with SELinux enforcing and see almost no warnings.

  22. SE Linux is rarely noticable and easy to fix by r00t · · Score: 2, Informative

    I've never once hit an SE Linux problem when running the stuff shipped with Fedora Core 6 and Fedora 7.

    Stuff can get painful if you go grabbing 3rd-party crap from proprietary developers without neither a clue nor a care.

    Even there though, the popular stuff has already been figured out. For example, suppose you want acroread or flash or vmware. Use google, and search for the stuff being spewed into the log. Skip past the idiots who just disable SE Linux; it may help to add "chcon" (an SE Linux command that fixes many such problems) to your google query.

    Typically you find instructions for some "chcon -t foo_t /usr/lib/libfoo.so" command, often needed because the app developers were total idiots who couldn't figure out how to run gcc correctly. Run that and be happy.

    (not that you should trust 3rd-party binaries to be free of malware, but hey I understand...)

    1. Re:SE Linux is rarely noticable and easy to fix by andymadigan · · Score: 1

      Speaking as a developer:

      The binary was probably generated correctly, and cc was probably called correctly as well. Your system isn't behaving because you installed something that deals with permissions in a non-standard way (standard == POSIX). If the makers of your distro make sure the binaries they generate are tagged properly for whatever system they are using that is great, but I find it unlikely that there is anything in the binary that is there specifically for SE Linux.

      --
      The right to protest the State is more sacred than the State.
    2. Re:SE Linux is rarely noticable and easy to fix by init100 · · Score: 1

      it may help to add "chcon" (an SE Linux command that fixes many such problems) to your google query.

      It may also be easier to remember the chcon command if you know that it means CHange CONtext.

  23. nope, SE Linux solves that by r00t · · Score: 1

    Well actually you don't even need SE Linux.

    First of all, don't make the compiler have setuid-like rights and don't give it arbitrary write control over a home directory. That was pure idiocy.

    For ages, UNIX-like systems have used setgid (not setuid) to solve this for game high-score files. It does allow a bug in the game (an exploit perhaps) to corrupt the files, but your favored solution doesn't fix that either. Linux adds append-only files, which might be desirable for the compiler log example.

    SE Linux is overkill, but we can certainly use it as an alternative to setgid. Make the file world writable. Invent an SE Linux type for it, such as fort_stat_t. Invent an SE Linux role for the compiler, such as fort_r. Mark the files appropriately. Define SE Linux policy such that processes in the fort_r role can only write to files with type fort_stat_t or with the type you use for home directories. Also define SE Linux policy such that nothing else may write to files that have type fort_stat_t.

    1. Re:nope, SE Linux solves that by TheRaven64 · · Score: 1

      Linux adds append-only files, which might be desirable for the compiler log example Linux adds them? They've been in BSD since 4.4BSD, when running at securelevel 1 or above. See man chflags.

      When it comes to security, I much prefer the systrace approach to SE Linux (or SE BSD). It can be turned on on a per-process basis, and simply validates system call arguments, either denying, allowing, or allowing with elevated privilege each one. It's trivial with systrace to let your web server, running as an unprivileged user, bind to port 80, for example, and to enforce a limited chroot, where a process can load libraries from the standard locations, but can't access any other files outside its tree.

      --
      I am TheRaven on Soylent News
  24. doubt this is true by r00t · · Score: 1

    Granted, I'm using something a tad different. I've used all three of Fedora Core 5, Fedora Core 6, and Fedora 7. Not a one of them have had SE Linux prevent yum from working. I just su to root and install stuff. I can't imagine that RHEL would be worse than all 3 of the most recent Fedora versions.

    That's with the default policy. The strict policy is harder, but not by much. You just need to log in with the correct role; this is a RTFM problem.

    1. Re:doubt this is true by Henry+V+.009 · · Score: 1

      You think I'm making it up? Well, I can prove it with logs:

      May 21 07:56:34 mimir setroubleshoot: SELinux is preventing /usr/sbin/usera dd (useradd_t) "read" to random (random_device_t). For complete SELinux mes sages. run sealert -l 918e1f4a-e9d6-4703-8b36-29d2a444339a

      And I didn't even notice this until just now when I was greping the log:

      May 21 10:01:38 mimir setroubleshoot: SELinux prevented /usr/bin/procmail f rom reading files stored on a NFS filesytem. For complete SELinux messages. run sealert -l 1703d21b-1b0a-416d-ad2e-4e6c47d5f5a3

      Joy, it looks like SELinux sent some of my mail to oblivion.

    2. Re:doubt this is true by ryanov · · Score: 1

      Did you install something that changed the security context of /dev/random?

      Try "restorecon /dev/random"

      Better yet, run "man restorecon" and then decide what to type.

    3. Re:doubt this is true by Henry+V+.009 · · Score: 1

      That was the first thing I tried.

    4. Re:doubt this is true by r00t · · Score: 1

      Well, this is really off the wall. I find it hard to believe that the last 3 Fedora releases all worked fine, yet RHEL5 does not. Perhaps it was based on Fedora Core 4? It doesn't sound all that old.

      In case you hadn't noticed, "ls -Z" and "ps -M" are helpful.

    5. Re:doubt this is true by init100 · · Score: 1

      Perhaps it was based on Fedora Core 4?

      RHEL5 is based on Fedora Core 6.

  25. I'd rather just enable it for certain apps by Anonymous Coward · · Score: 0

    Like apache or whatever. That's probably the most gain for the least pain. But when you bleeding-edgers get it sorted maybe I'll turn it back on.

  26. RHEL = Red Hat Enterprise Linux by Anonymous Coward · · Score: 0

    For those of us wondering what the article is about, RHEL = Red Hat Enterprise Linux.

  27. Applications need to be reworked for SELinux by Animats · · Score: 1

    We know how to do serious security. Programs have to be divided into big parts that are untrusted, and small parts that are trusted. Only the latter get much in the way of privileges. The key concept is that only a small fraction of the code is trusted, and you make that code simple, paranoid, and well reviewed.

    That's the application model for which SELinux is designed. This was all figured out in the early 1980s and used in a few systems in the DoD community, but the commercial community wasn't worried about security back then. Which is how we got into the mess we have now.

    Complicating the problem is that these separate parts have to intercommunicate, and interprocess communication on Linux/Unix still isn't very good after thirty years. Pipes and FIFOs are too limited, and shared memory breaks security boundaries. System V IPC is the best mechanism for communication across a security boundary, and it's well supported in SELinux, but almost nobody uses it.

    1. Re:Applications need to be reworked for SELinux by diegocgteleline.es · · Score: 1

      SELinux is an implementation of what everybody - Solaris 10, Windows Vista's protected IE7, Free BSDs- are doing. It's not something from the 80's - in fact it's more like an idea from the 60's that didn't get copied into unix from the start; like ACLs

  28. example: text relocations by r00t · · Score: 3, Informative

    Common problem: you built a library (a *.so file) without compiling all the object files (the *.o things) with gcc's -fpic or -fPIC option, and/or you forgot to specify -shared when linking.

    When you make this kind of screw-up, you cause something called "text relocations". These don't even work on non-x86 and Debian bans them anyway for reasons related to memory usage. A text relocation means that the loader patches the code itself, rather slowly, when loading the shared library. This requires memory to be both writable and executable, which is a no-no for security against buffer overflows. SE Linux is usually set up to prohibit this by default.

    If your broken shit runs as a server or gets loaded into a web browser, you greatly decrease security. You suck. Fix your shit.

    I'm a developer too. I've upped my standards. Up yours!

    1. Re:example: text relocations by andymadigan · · Score: 1

      Interesting, except ld builds PIC libs by default.

      --
      The right to protest the State is more sacred than the State.
    2. Re:example: text relocations by r00t · · Score: 1

      Nope. You MUST use -fpic or -fPIC to build the object files. Without that, the code itself is not PIC.

  29. News flash buddy... by bitbucketeer · · Score: 1

    SELinux isn't just for protecting server applications. It's a per-app set of rules for how the program is expected to operate so that it keeps the unexpected from happening. Now, I'll give you that the very nature of free software development will make keeping an external ruleset in sync with a project very difficult. So, it's very unlikely to happen (generating rulesets for the rest of the apps in RHEL, that is).

    1. Re:News flash buddy... by init100 · · Score: 1

      SELinux isn't just for protecting server applications.

      No, but it is with server applications that it can be most useful, since they are the main entry port for crackers and worms. Properly configured SELinux policies prevent such attacks from succeeding.

      Of course, SELinux does not protect computers from the biggest hole, the wetware between the keyboard and chair. :)

    2. Re:News flash buddy... by xappax · · Score: 1

      Of course, SELinux does not protect computers from the biggest hole, the wetware between the keyboard and chair. :)

      Actually, when properly configured it does a pretty good job of that, too. One of the interesting features that's in the NSA spec is MLS (Multi Level Security), which is designed to grant very specific and strictly defined privileges to each user - for example in a government scenario where some people have "Secret" clearance, others "Top Secret", etc. This ensures that even if the person is a huge moron or being expertly scammed, they can still only fuck up the specific files and processes they've been given access to, which in SELinux can be very tightly limited without stepping on the legitimate user's toes too much.

  30. AppArmor by hweimer · · Score: 3, Informative

    AppArmor's main approach is somewhat less broad. It is more like putting certain applications into a MAC container to limit what an application can do, no matter who the user using the application is. A great example of this that most Slashdot readers should look into is putting the browser into a safety container.

    Some time ago, I wrote a review of AppArmor, finding that it solves problems that don't exist. Looking at your browser example, the functionality provided by AppArmor can be implemented completely by setting up a different user and setting appropriate file ACLs.

    For the real problems AppArmor provides little help. Can you confine network usage of a program, meaning your internal network cannot be accessed once your browser has been hacked? No. Can you limit the syscalls a program may use, reducing the risk of successful kernel exploits? No.

    As long as it stays this way, I recommend to everyone to use SELinux, even though it is much more difficult to setup and configure.

    --
    OS Reviews: Free and Open Source Software
    1. Re:AppArmor by FST777 · · Score: 2, Insightful

      I'm sorry, but your review is more than a year old. For example: it talks about patching the kernel, which isn't necessary anymore (since it uses LSM now).

      Can you confirm that the situation is still like you described? I have no clue at all (been using openSUSE for less than a month now), but I won't take any advise from anyone who points to a year old article about a project under active (heavy) development.

      --
      Free beer is never free as in speech. Free speech is always free as in beer.
    2. Re:AppArmor by Crispin+Cowan · · Score: 1
      That review is pretty thin, and IMHO quite biased. You give a very short description of what AppArmor does, and then assert (without foundation) that it there are not many scenarios where it gives a reasonable security improvement. I beg to differ:

      • Any network service (Apache, Sendmail, BIND, etc.) if compromised by a remote exploit, can give the attacker a local shell, an easy stepping stone to control of the machine. AppArmor confinement blocks this.
      • Web applications, such as things like PHP Nuke, can often be induced to load PHP code from some other server and run it. AppArmor's unique change_hat confinement can block this, providing AppArmor-style confinement for entities as small as a single PHP page, even though it never appeared in the kernel process table.
      • Any network client (Firefox, Thunderbird, Gaim/Pidgin, etc.) can be compromised by remote vulnerabilities and malicious content, giving the attacker total control of your user account. AppArmor confinement of your clients makes it safe to e.g. IRC to strangers.
      So to claim that there aren't many is just wrong. Perhaps you meant that the security improvement was not reasonable? It may not cover everything that you want, but what is unreasonable about blocking takeover?

    3. Re:AppArmor by Crispin+Cowan · · Score: 1

      Can you confirm that the situation is still like you described? I have no clue at all (been using openSUSE for less than a month now), but I won't take any advise from anyone who points to a year old article about a project under active (heavy) development. Welcome to openSUSE! Have a lot of fun :-)

      The one fact in his review that was correct is that AppArmor does not currently do network access control. We are working on a network access control, so you will be able to specify, per profile, if the program gets to do various network activities, e.g. sshd can talk to eth0 (the private LAN) but not eth1 (the public Internet), or Apache can accept connections from any IP address, but can only initiate connections to 10.0.0.0/24 (private backend servers).

      Join irc.oftc.net/#apparmor for real time discussion of future AppArmor features.

    4. Re:AppArmor by Nevyn · · Score: 1

      AppArmor's unique change_hat confinement can block this

      change_hat is not a feature ... it's a horrible bug, real security solutions like SELinux have explicitly rejected bugs like this. Please don't pretend you've done something useful.

      Any network client (Firefox, Thunderbird, Gaim/Pidgin, etc.) can be compromised by remote vulnerabilities and malicious content, giving the attacker total control of your user account. AppArmor confinement of your clients makes it safe to e.g. IRC to strangers.

      Do you plan on shipping Firefox with a useful profile that will stop it doing this? This is on the roadmap for SELinux, and they can do useful confinment because they aren't limited to pathnames ... and guessing and hoping based on trial runs. Also have you at least worked out why AppArmor thinks thunderbird needs setuid()?

      --
      ustr: Managed string API with ave. 44% overhead over strdup(), for 0-20B
    5. Re:AppArmor by Nevyn · · Score: 1

      I'm sorry, but your review is more than a year old. For example: it talks about patching the kernel, which isn't necessary anymore (since it uses LSM now).

      But it's still not upstream, and that's not because the developers have some political/technical reason ... just that it's so horrible the majority of the upstream developers don't want it. SELinux has been in the upstream kernel for years, and so is distributed by basically everybody now. Is supported by at least 4 different distributions.

      So, yeh, well done ... you don't need to patch anymore, you just need to load a module that has to be compatible with your kernel and is likely to always be distributed seperately and thus. by a very small number of distributors. Sounds great!

      --
      ustr: Managed string API with ave. 44% overhead over strdup(), for 0-20B
    6. Re:AppArmor by Crispin+Cowan · · Score: 1

      change_hat is not a feature ... it's a horrible bug, real security solutions like SELinux have explicitly rejected bugs like this. Please don't pretend you've done something useful. More unsubstantiated opinion.

      change_hat() is very useful. It is the only technique I am aware of that can useufully confine mod_perl and mod_php code. We stipulate that hats are less secure than full process profiles, but escaping a hat requires the presence of very particular classes of vulnerabilities, and at most it gets you to the containing process profile.

      Do you plan on shipping Firefox with a useful profile that will stop it doing this? We do ship Firefox profiles with every SUSE release. You'll find them in /etc/apparmor/profiles/extras

      Also have you at least worked out why AppArmor thinks thunderbird needs setuid()? SELinux advocates love to throw that at me, but it makes no sense. If you want to know wny Thunderbird, or any given application, does a silly thing, go ask the developers of that program. AppArmor just faithfully noted that it did it. How is this a problem with AppArmor?

      AppArmor in learning mode is actually quite good at generating 'WtF?' moments as you observe what your software is doing. This is a strength of AppArmor, not a defect.

    7. Re:AppArmor by Crispin+Cowan · · Score: 1
      The upstream effort is under way. The delay is because it is hard work; upstreaming has sucked up several man years of effort so far. It has also produced substantial improvements in the code, so it is not wasted effort, but it is a lot of effort, and not surprising that it takes a while. It took SELinux a while too, and they didn't have to contend with AppArmor advocates complaining about their model :)

      AS for distros, AppArmor is included in SUSE and Ubuntu; 2 of the 3 leading distros is not bad. Packages are additionally available for Slackware, Red Hat, and some specialty distributions. This could be better, but AppArmor is availabel to a lot of people now.

    8. Re:AppArmor by Nevyn · · Score: 1

      More unsubstantiated opinion.

      Not at all, setcon() has been around for a long time it's just not advertised/used for this case explicitly because it's not secure. The fact you added a stupid cookie value doesn't make change_hat secure, and the fact you are advocating it as secure means that it's insecurity is a bug.

      For instance you keep advocating it for "mod_perl security" ... except what you mean is that "if you are really lucky mod_perl will be more confined than the rest of apache-httpd, but then again maybe not", and what a lot of people want from mod_perl security is for two different users of apache-httpd using perl code to be "secure/confined from each other, and from the web server itself" ... change_hat provides neither of these.

      We do ship Firefox profiles with every SUSE release. You'll find them in /etc/apparmor/profiles/extras

      But, as I said, do they those profiles do anything useful. With SELinux you can have firefox allowed to write files everywhere you can, but they'll be labeled firefox_net_untrusted_t or whatever. You won't be allowed to overwrite files that haven't been previously downloaded from firefox, you can disable exec privilages on downloaded executables etc. etc. AIUI AppArmor can do none of this "higher level, useful, things" all it can do is blanket "firefox can't write files in ~/home, etc.".

      SELinux advocates love to throw that at me, but it makes no sense. If you want to know wny Thunderbird, or any given application, does a silly thing, go ask the developers of that program. AppArmor just faithfully noted that it did it. How is this a problem with AppArmor?

      AppArmor in learning mode is actually quite good at generating 'WtF?' moments as you observe what your software is doing. This is a strength of AppArmor, not a defect.

      Of course it makes sense, as long as you continually advocate that the "best" way to generate policies is to run applications and allow them to do everything that they are doing ... that isn't confinment. SELinux also generates WtF? moments, it just also protects you while it is telling you your apps. are on crack (or using generic code which needs privs they don't, like password checking which opens /etc/shadow directly but falls back to using a secure helper -- but lucky AppArmor users just get all their passwords stolen instead).

      --
      ustr: Managed string API with ave. 44% overhead over strdup(), for 0-20B
    9. Re:AppArmor by Nevyn · · Score: 1

      It took SELinux a while too, and they didn't have to contend with AppArmor advocates complaining about their model :)

      No, we just have to contend with AppArmor advocates on every news site whenever SELinux is mentioned ... often bending the truth more than a little. Also are you seriously trying to suggest that the only kernel developers complaining about your design are SELinux advocates? Mind you I guess Richard Gooch started to get a little paranoid too, at the end -- I only hope AppArmor doesn't cause as much pain before it dies.

      --
      ustr: Managed string API with ave. 44% overhead over strdup(), for 0-20B
    10. Re:AppArmor by Crispin+Cowan · · Score: 1

      Not at all, setcon() has been around for a long time it's just not advertised/used for this case explicitly because it's not secure. The fact you added a stupid cookie value doesn't make change_hat secure, and the fact you are advocating it as secure means that it's insecurity is a bug.

      So, setcon() is more secure than change_hat() because you don't use it and don't document it? :-)

      But, as I said, do they those profiles do anything useful. With SELinux you can have firefox allowed to write files everywhere you can, but they'll be labeled firefox_net_untrusted_t or whatever. You won't be allowed to overwrite files that haven't been previously downloaded from firefox, you can disable exec privilages on downloaded executables etc. etc. AIUI AppArmor can do none of this "higher level, useful, things" all it can do is blanket "firefox can't write files in ~/home, etc.".

      That is actually kind of neat. You're correct, AppArmor cannot do that. At best, you could restrict Firefox to saving files in your Downloads directory or something.

      Question: how would the SELinux user make a file downloaded via Firefox be 'useful'? If it is labeled firefox_net_untrusted_t then no sane program will trust it. Purist tranquility requires that you shut down to re-label, and non-purist at least requires super-user and unconfined_t to re-label. So how do you recommend a user to download something and then use it?

      The AppArmor equivalent of this is to 'reclassify' your downloaded objects by moving them from your Download folder to some other place, where other programs are allowed to access it.

      Of course it makes sense, as long as you continually advocate that the "best" way to generate policies is to run applications and allow them to do everything that they are doing ... that isn't confinment.

      That is pure BS. AppArmor allows you to write your profiles by hand, or via the learning tool, and to interleave the two. SELinux also allows both hand-authored policies or audit-to-allow generated policies, so the security confinement of each system is identical with respect to 'WtF?' behavior of applications.

      The main difference is that AppArmor's learning mode actually works well :) Audit-to-allow only works to the extent that the admin has already constructed an effective labeling scheme. The fact that AppArmor's lerning mode is effective enough to actually be attractive doesn't make the model any less secure, or even any different, than SELinux with respect to quirky application behavior. The fact remains that Thunderbird asks for setuid, it is up to the policy author to decide whether to allow that, and you would have to ask the Thunderbird dev. team why they did that. But blaming AppArmor for this behavior in Thunderbird is just specious.

    11. Re:AppArmor by Nevyn · · Score: 1

      So, setcon() is more secure than change_hat() because you don't use it and don't document it? :-)

      No it isn't a security problem because it isn't said/assumed/documented to be secure when we know it isn't. Yes, SELinux could have setcon() used to go from httpd to httpd_mod_perl and back again ... but it would be smoke and mirrors, and would just confuse people instead of working on a real solution to the problem. change_hat() is a bug because you are advertising it to be secure which it clearly isn't. As with a lot of AppArmor it would be much more palatable if you advertised what it did, and not what you want it to do (of course then people aren't going to want to use it to do things it can't ... but that's life).

      If it is labeled firefox_net_untrusted_t then no sane program will trust it. Purist tranquility requires that you shut down to re-label, and non-purist at least requires super-user and unconfined_t to re-label.

      I'm not sure where you get this from, maybe you should try using/understanding SELinux? Normal users regularly change permissions (via. the change context commands: chcon or nautilus) so that httpd/samba/ftp can/cannot read files. Much as they change permissions (via. the unix mode commands: chmod and nautilus) to make things readable/executable etc.

      The AppArmor equivalent of this is to 'reclassify' your downloaded objects by moving them from your Download folder to some other place, where other programs are allowed to access it.

      Again, you speak as though that's a good thing ... as though that maps to any kind of normal behaviour that any sane person would expect.

      That is pure BS. AppArmor allows you to write your profiles by hand, or via the learning tool, and to interleave the two. SELinux also allows both hand-authored policies or audit-to-allow generated policies, so the security confinement of each system is identical with respect to 'WtF?' behavior of applications.

      The main difference is that AppArmor's learning mode actually works well :)

      No the difference is that you, and AppArmor supporters in general, keep saying the GUI learning tools is "the one true way" often at least heavily implying you don't need to do anything else if not outright saying SELinux sucks because you can't just run one tool and be done. So, yeh, technically with AppArmor you can "have it be secure, just write/review it all by hand" in the real world that isn't happening with AppArmor profiles.

      The SELinux people keep trying to inform everyone that no matter what you do you need to "write" most of the policy seperately from the application. Sure, you can have GUI tools create most/all of it for you (Eg. select a drop down for: I'd like a normal networking daemon that binds to port X, and logs data in directory Y). You can even do "fixups", where you react to a couple of messages like "X permission is disallowed for Y" by a command that changes the policies. This way you find out thunderbird wants setuid() not when someone sees that permission granted in it's profile and thinks "wtf, does someone own my machine", but when someone sees that permission denied and thinks "wtf, but who cares it's denied".

      --
      ustr: Managed string API with ave. 44% overhead over strdup(), for 0-20B
  31. SELinux locks out self-modifying code by Myria · · Score: 1

    Sorry, but I don't want to have to get the administrator's permission to write my own program that makes self-modifying code. This is also why a user-local install of Wine is impossible when SELinux is enabled.

    Of course, SELinux does nothing about the problem that a rogue program could pipe out to gdb, a program flagged for ptrace(), and do that stuff anyway.

    --
    "Screw Sun, cross-platform will never work. Let's move on and steal the Java language." - Visual J++ Product Manager
  32. The only SELinux tip you will ever need: by skinfitz · · Score: 0, Troll


    Edit /etc/selinux/config

    Make sure you have this line:
    SELINUX=Disabled

    Save the file and reboot.

    Discover that all those things you couldn't get working on Linux suddenly start working meaning no, you don't have to go back to Windows.

    1. Re:The only SELinux tip you will ever need: by Slashcrap · · Score: 1

      Discover that all those things you couldn't get working on Linux suddenly start working meaning no, you don't have to go back to Windows.

      If you were considering going back to Windows because additional security made your life difficult, I think it's fair to say that you probably belong there anyway. Please, don't let us detain you further.

    2. Re:The only SELinux tip you will ever need: by jobsagoodun · · Score: 1

      Parent isn't actually much of a troll. I spent half a day trying to work out the magic incantation to get AWstats running on centos yesterday and SELINUX=disabled did the job very nicely!

    3. Re:The only SELinux tip you will ever need: by skinfitz · · Score: 1

      If you were considering going back to Windows because additional security made your life difficult Security is one thing. Having an unknown and obscure mechanism in place that stops things working and isn't particularly obvious to new users is extremely frustrating and confusing.
  33. Both right by Tom · · Score: 3, Insightful

    Why's there a "however" inbetween. It's both right. SELinux is complex and hard to understand. Heck, I should know I've given speeches at half a dozen conferences about it. And at the same time, it is the most secure option Linux has at this time.

    Yes, there are alternatives.
    Yes, some of them are easier to understand.
    No, none of them give you the level and sophistication of SELinux, not even close.
    No, that's not likely to change very much. Security is hard to do.

    --
    Assorted stuff I do sometimes: Lemuria.org
  34. Not just yet, I have a lot to do today! by Anonymous Coward · · Score: 0

    LOL!

    Sorry, NO!

    (I have too much to do today!)

    However... maybe later, ok? I just have to find time to fit it into my "itinerary"...

    -> :)

    APK

  35. Forgotten lessons from the past by alien_life_form · · Score: 1

    SELinux appears to be an overengineered, overflexible, poorly deployed, poorly documented, jargon wrapped pieces of software with the dubious distinction of having taken the obscurity of Windows' security model to Linux, with a vengeance.
    In fact, its design reminds me of the good ol' Motif apps (maybe this IS a Unix philsophy argh), which popped up in all their blue black and square white glory and could become OH-SO-BEAUTIFUL, you just had to write an app-default file for them: remember the easy syntax, the breezy deployment (just copy it over in 15 different locations, with slight changes in capitalization and name hyphenation), and joyful surprise of the oh-so-totally-unpredictable effects that could be achieved. Users that turned to Windows and its GUI where called stupid lazy lusers then. The type of supporting arguments that are being used runs close to the ones of yore, just replace lusers with admin.

    Another (forgotten) lessons from the past would be sendmail.cf which hardworking admins were supposed to write from scratch ($1 ). Now sendmail is much ridiculed, even after a sane configuration system makes it possible to never look at sendmail.cf. xauth and its worthy is another fond memory of something that could neither be understood or made to work (xhost +) until it was made fairly transparent.

    ssh and X11 tunnelling, which used to require tens of arcane cli commands and a small chart of the involved IP adresses... Same tune, lazy-admins-i-d-fire-them-if-they-worked-for-me.

    Hint: when the vast majority of the perspective users of something DO NOT WANT to even hear about it, then it is not them that should be faulted.

    Cheers,
    alf

  36. BSD is dying by Anonymous Coward · · Score: 0

    You must be new here.

    NetCraft confirms it: BSD is dying.

  37. Basic idea by Z00L00K · · Score: 1
    behind SELinux is good, and it seems to do the job when correctly configured.

    The big problem here is that SELinux is overly cryptic to configure and that the logging regarding access failures are extremely cryptic. This results in a situation where SELinux is often considered more of a problem than an enhancement. The designers of SELinux seems to have forgotten that the log files often are read by humans and that humans act upon the data from the log files and responses from commands issued.

    One such example is the log event below. It obviously tells me that there was an access denied to an object, but it is still rather tricky to figure out which context that I have to adjust (or if I even CAN adjust anything).

    Jun 3 13:50:12 spix kernel: audit(1180871412.944:291): avc: denied { search } for pid=19556 comm="smbd" name="home" dev=hda3 ino=1822465 scontext=system_u:system_r:smbd_t:s0 tcontext=system_u:object_r:home_root_t:s0 tclass=dir

    And anyway, the information about SELinux that you can get hold of still has some rather deep cracks that seems to originate from the fact that the person writing the documentation thinks it's obvious.

    Another problem is that SELinux is riddled with a lot of new terms and it takes time to inhale them, or as you say 'grok' them and their use. To make matters worse you can also look into the sub-realm of SELinux called MLS.

    And still - SELinux is still only good for addressing issues of security between different applications. Internal application security is still not addressed. Often this isn't a big issue, but when it comes to complex software as web browsers and their plugins it's really an issue. A web browser of today is practically a virtual machine that executes HTML and other code and allows for remote installations.

    This results in problems where malicious people can install their features in this environment to get hold of personal information that the user enters when accessing for example bank services online. This is of course not limited to web browsers but also to other intelligent applications like email applications, word processors etc.

    It's not unlikely that a virus like 'Melissa' will appear again, next time utilizing a new hole. Not all viruses are of malicious intent either.

    --
    If builders built buildings the way programmers wrote programs, then the first woodpecker would destroy civilization.
    1. Re:Basic idea by WuphonsReach · · Score: 1

      The big problem here is that SELinux is overly cryptic to configure and that the logging regarding access failures are extremely cryptic. This results in a situation where SELinux is often considered more of a problem than an enhancement. The designers of SELinux seems to have forgotten that the log files often are read by humans and that humans act upon the data from the log files and responses from commands issued.

      That's my biggest peeve with it as well. They give you all the information, but don't do a good job of explaining it (yet).

      On the upside, I can hope that by RedHat pushing this harder that the tools will mature sooner. (Red Hat's interest in improvement would be so they don't have to deal with as many support calls?)

      --
      Wolde you bothe eate your cake, and have your cake?
  38. Turn it off by kurokaze · · Score: 1

    SELinux when in enforcing mode doesn't even trust me as root. Trying to work with it is/was an exercise in Frustration for me and almost gave me reason enough to dump CentOS 5 and go and install Win2000 to create an Oracle db server in VMware.

    In summary, turn SELinux off and my life is much happier.

  39. UPDATED - More information that can secure you! by Anonymous Coward · · Score: 0

    (THIS IS AN AMENDED & IMPROVED MODEL OF MY ORIGINAL PARENT POST FROM HERE -> http://it.slashdot.org/comments.pl?sid=237507&cid= 19408273 )

    INTRODUCTION:

    Windows CAN be secured very well, but, you have to go thru some "GYRATIONS/EFFORT" to do it, but, it IS doable (but not to any 100% levels, because again - see what I stated last paragraph of mine above).

    BACKGROUND & INFORMATION + TOOLS YOU CAN USE TO HELP YOU SECURE YOUR SYSTEM:

    Here I am running Windows Server 2003 SP #2, fully current patched by MS update pages, here (I check it every 2nd Tuesday of the month of course, on "Patch Tuesday's"):

    http://www.microsoft.com/downloads/Results.aspx?Di splayLang=en&nr=50&sortCriteria=date

    It is a personally 'security-hardened' model I have been working on for many years, using principals I learned & used since the NT 3.5x days onward to this version of the OS: As is now?

    I score an 84.735 on the CIS Tool 1.x currently as of 06/01/2007!

    (For CIS Tool - There are Linux, MacOS X, Solaris, & other OS models ports of this are available too by the way - not really "ports" strictly speaking, they require JAVA to run)

    DOWNLOAD URL FOR CIS TOOL (for multiple platforms), from "The Center for Internet Security" here:

    http://www.cisecurity.org/bench.html

    (IMPORTANT: This tool IS invaluable in guiding you to a more secure OS, on any OS platform really!)

    APK 14 STEPS TO FOLLOW TO SECURE YOUR WINDOWS NT-BASED SYSTEM (2000/XP/SERVER 2003/VISTA):

    1.) Windows Server 2003's SCW was run over it FIRST (this only exists on Windows Server 2003, not on 2000/XP (you have to install this, it does NOT install by default) first to help security it (SCW = security configuration wizard, & it's pretty damn good believe-it-or-not, (@ least, as as starting point))...

    Directions for its installation are as follows:

    Start the Add or Remove Programs Control Panel applet.

    Click Add/Remove Windows Components.

    On the Windows Components Wizard screen, select the "Security Configuration Wizard" check box, as the figure shows. Click Next.

    The Windows Components Wizard builds a list of files to be copied and finishes installing SCW. Click Finish.

    DONE! Now, run it... it is very simple to use, and will help even TRIM services you do not need running (which saves Memory, other resources, & I/O to cpu/ram/disk etc. AS WELL AS PROVIDING SECURITY should any services you disable turn up vulnerabilities (this has happened before)).

    Then, @ that point? I pull ANY Networking clients &/or Protocols in the Local Area Connection, other than Tcp/IP typically (& disable NetBIOS as well, because I don't need it here), on a stand-alone machine that is not dependent on Microsoft's File Sharing etc. on a LAN/WAN. I also disable that too!

    2.) Disable Microsoft "File & Print Sharing" as well as "Client for Microsoft Networks" in your LOCAL AREA CONNECTION (if you do not need them that is for say, running your home LAN)!

    3.) Use IP security policies (modded AnalogX one, very good for starters, you can edit & add/remove from it as needed) - Download url link is here for that:

    http://www.analogx.com/contents/articles/ipsec.htm

    (Search "AnalogX Public Server IPSec Configuration v1.00 (29k zip file)" on that page & follow the directions on the page!)

    NOTE: This can be 'troublesome' though, for folks that run filesharing clients though. An alternative to this is using IP Ports Filtrations, in combination with a GOOD software firewall &/or NAT

  40. SeLinux uses file attributes in context rules. by caldaan · · Score: 1

    You don't change the Selinux rules you update the context of the new location. You use the command chcon to change the context of the files.

    ls -Z will help you find out which one to use.

    for instance..

    $ ls -lZ
    drwxr-xr-x root root system_u:object_r:httpd_sys_script_exec_t cgi-bin
    drwxr-xr-x root root system_u:object_r:httpd_sys_content_t error
    drwxr-xr-x root root system_u:object_r:httpd_sys_content_t html
    drwxr-xr-x root root system_u:object_r:httpd_sys_content_t icons
    drwxr-xr-x root root system_u:object_r:httpd_sys_content_t manual
    drwxr-xr-x webalizer root system_u:object_r:httpd_sys_content_t usage

    You can either explicitly say what context to use or say you modified apache to use /test instead of /var/www/html you could use /var/www/html as a reference.

    chcon test --reference=/var/www/html

    ls -lZ
    drwxr-xr-x root root system_u:object_r:httpd_sys_content_t test

    Most mysql problems are solved the same way. SeLinux can be very complex, but the default rules provided in RHEL typically just require context changes on files and directories to make non RedHat packages work.

  41. Real-World SELinux article in Linux Journal by rbulling · · Score: 1

    Linux Journal just published a case study I wrote on how SELinux protected a Red Hat Enterprise Linux 4 server from an attack on a Mambo installation:

    http://www.linuxjournal.com/xstatic/abstracts/2007 -07/bt9176

    You can find the article in the July 2007 issue of the print magazine, or read it on the web if you are a Linux Journal subscriber. Linux Journal typically opens up their archives to public access a couple months after publication, also, though I would encourage people interested in Linux to subscribe to support this quality magazine.

    Since writing the article, I've also helped another company with a postmortem analysis of a different Mambo exploit that RHEL 4's SELinux implementation also stopped.

  42. Commands for fixing SE Linux problems by Anonymous Coward · · Score: 0

    root@host# restorecon -r /directoryThatContainsModifiedFiles

    You can run the command above on / if you have lots of time to kill.

    root@host# system-config-selinux

    The GUI tool above shows you all the SELinux booleans that affect server applications (e.g. there are some Samba booleans you have to flip to enable the sharing of home directories) and will actually allow you to disable it for specific pieces of software if you need to get something up and running quickly while leaving SELinux in Enforce mode.

  43. RSBAC by Anonymous Coward · · Score: 0

    I don't understand why RSBAC is never mentioned on slashdot, some sort of pro fedora bias?

    RSBAC is far more versatile, and more in line with the UNIX mindset, far more stable, and generally better.

    Thoughts?

    www.rsbac.org