Forgot your password?
typodupeerror
Security Linux

Openwall Linux 3.0 — No SUIDs, Anti-Log-Spoofing 122

Posted by Soulskill
from the wouldn't-an-open-wall-be-a-gate dept.
solardiz writes "Openwall GNU/*/Linux (or Owl for short) version 3.0 is out, marking 10 years of work on the project. Owl is a small, security-enhanced Linux distro for servers, appliances, and virtual appliances. Two curious properties of Owl 3.0: no SUID programs in the default install (yet the system is usable, including password changing); and logging of who sends messages to syslog (thus, a user can't have a log message appear to come, say, from the kernel or sshd). No other distro has these. Other highlights of Owl 3.0: single live+install+source CD, i686 or x86_64, integrated OpenVZ (host and/or guest), 'make iso' & 'make vztemplate' in the included build environment, ext4 by default, xz in tar/rpm/less, 'anti-Debian' key blacklisting in OpenSSH. A full install is under 400 MB, and it can rebuild itself from source."
This discussion has been archived. No new comments can be posted.

Openwall Linux 3.0 — No SUIDs, Anti-Log-Spoofing

Comments Filter:
  • Amazing Work (Score:4, Interesting)

    by metrix007 (200091) on Friday December 17, 2010 @04:50PM (#34592368)

    While OpenWall won't see much adoption on it's own I do hope a lot of the work gets ported to other distributions so it is in common use.

    Not trolling, but Linux Security is somewhat atrocious these days with the whole security via obscurity approach, so I for one have a better state of mind when I know I can protect myself even in the result of a succusful exploit.

  • by petril (109301) * on Friday December 17, 2010 @04:53PM (#34592438) Homepage Journal
    This is pretty interesting, I just wonder what happens to Fortress Linux [fortresslinux.org]?
  • by Jeremiah Cornelius (137) on Friday December 17, 2010 @04:54PM (#34592446) Homepage Journal

    Can it do so with cross-compilation? I want this as an ARM distro...

    • Re:Rebuild itself? (Score:4, Informative)

      by zn0k (1082797) on Friday December 17, 2010 @05:33PM (#34593006)

      http://www.openwall.com/Owl/ARCHITECTURES.shtml [openwall.com]
      > Cross-builds are not supported: it is not possible to build packages for an architecture different than that of the build host, nor for a flavor of the architecture newer than that implemented in the build host's CPU.

      No, it can't do cross-compiling. And ARM is not supported.

    • by billstewart (78916) on Friday December 17, 2010 @05:43PM (#34593146) Journal

      I'm interested in this for a VMware guest OS, as a possible alternative to m0n0wall. Have the authors thought about that kind of implementation? How much RAM does it need to run adequately?

      • by JSG (82708) on Friday December 17, 2010 @06:42PM (#34593884) Homepage

        There's always pfSense as an alternative to m0n0wall. I run many of those under VMWare.

        I chose it for its easy multi external link capabilities, after I gave up on Linux for this and was pleasantly surprised by its ease of use, stability and huge range of features.

        It is nearly bullet proof as I discovered when one of a customer's VMFS died. All the other VMs fell over immediately but the pfSense router carried on running without its "hard disc" for two days before I replaced it. Internet access downtime was 2 seconds as I cut it over. Admittedly the web interface vanished but the routing, VPNs, firewall etc carried on running.

        As to OWL, its a Linux distro so it will have no problems with being a VM - that's the whole point of virtualization. You might have to select "Linux other (64 bit)" but my many Gentoo's run happily like that

        Why on earth should the devs even think about VMWare, HyperV, KVM or whatever - that's your job! Apart from considering making the guest tools pre-packaged what should they be doing? I doubt they care whether you spec your boxen from Dell. HP, IBM or PC World so why should they care whether it is physical or VM?

        As to asking about RAM requirements - I'd suggest (without even having looked at it) >=256Mb depending what you do with it. I've no doubt that fact is covered on their web site. If you are using ESXi and not just playing on your home PC then the answer would probably be "who cares, RAM is cheap as chips"

        Go on - try it, I might even do the same.

        Cheers
        Jon

        PS You have a 5 digit /.ID. Have you been moonlighting on other OSs for the last 10 years, asking such questions 8)

      • by Jeremiah Cornelius (137) on Friday December 17, 2010 @07:12PM (#34594298) Homepage Journal

        Agreed. Perfect appliance baseline. Most appliances don't want package mangement outside the scope of their platform workload, anyway.

      • by solardiz (817136) on Saturday December 18, 2010 @06:41AM (#34598562) Homepage

        I'm interested in this for a VMware guest OS, as a possible alternative to m0n0wall. Have the authors thought about that kind of implementation

        Yes, Owl 3.0 works in VMware out of the box. We mostly run it in QEMU and VirtualBox for our VM-based testing, though.

        BTW, you might find it curious that when you run Owl in a VM like this, you can further create OpenVZ containers with multiple instances of Owl and with other Linux distros inside that single running copy of Owl. Such container-based virtualization has no further performance overhead. :-)

        How much RAM does it need to run adequately?

        128 MB is plenty, probably a lot less will do. I have my QEMU set to its default of 128 MB when I do install-tests with new Owl ISOs. Also, my Owl-based router and small fileserver at home has 128 MB RAM (runs the default-enabled set of Owl services plus ntpd, named, pppd/pppoe, openvpn, squid, NFS, and a sometimes a few lftp's and ctorrent's under screen).

        On the other hand, of course you may need a lot more RAM for your specific uses of Owl - e.g., to run many OpenVZ containers, to do web hosting, etc. We currently administer several 32 GB RAM machines running Owl and one 64 GB RAM machine, as well as a countless number of 4-16 GB machines - so we know Owl has no problem with these larger RAM sizes as well (and with the many OpenVZ containers running various Linux distros actually making use of this RAM).

    • by gm.outside (1961160) on Saturday December 18, 2010 @01:13AM (#34597196)
      No, officially we don't support ARM, but I have plans to make an ARM build of a stripped down Owl since the number of ARM-based devices is rapidly growing at my home. :) A DSL modem, a NAS box, and a couple of netbooks - all are ARM based. This gives me a lot of temptation to build Owl for ARM. :)
  • Anti-debian key? (Score:4, Interesting)

    by gandhi_2 (1108023) on Friday December 17, 2010 @04:58PM (#34592506) Homepage

    Can someone explain (for real) the point of the 'anti-Debian' key blacklist?

    Is it because of the Debian-specific vulnerability in OpenSSH? I thought that was a couple years ago.

  • by ADRA (37398) on Friday December 17, 2010 @04:58PM (#34592512)

    While I'm not terribly interested in the distribution itself, its great to see a classic Slashdot story about some major or point release of a semi-well known OSS product.

  • by mangu (126918) on Friday December 17, 2010 @05:03PM (#34592588)

    The exploits named in the summary are mostly for locally connected users, which means academic environments. I mean, how would you send a message to syslog over the web?

    The kind of secure system one needs today is mostly about the web server, if it doesn't come through port 80 it never reaches the server because the router blocks it.

    • by Anonymous Coward on Friday December 17, 2010 @05:23PM (#34592882)

      how would you send a message to syslog over the web?

      If you mean over the network when you say "over the web", perhaps by faking remote logging?

      http://www.rsyslog.com/sending-messages-to-a-remote-syslog-server/ [rsyslog.com]

      I don't think this will be much help in such a case though.

      But faking logs is probably sometimes useful to do once you've gained access to a system via "the web", though.

    • by gm.outside (1961160) on Saturday December 18, 2010 @01:18AM (#34597232)
      Well, a poorly written script (and there are many of these nowadays) on a web server may allow an execution of an arbitrary process on the server -- so our hardening measures will try protect the system from the inside. Indeed, this is a quick response on your question, feel free to ask if you want me to elaborate further on this topic.
    • by solardiz (817136) on Saturday December 18, 2010 @06:12AM (#34598456) Homepage

      The exploits named in the summary are mostly for locally connected users, which means academic environments.

      Yes, local users and pseudo-users. No, this is not limited to academic environments. Think shared web hosting - hundreds or thousands of local users on a system. We're actually setting up Owl-based shared web hosting systems for our clients. Besides the different user accounts belonging to different shared hosting customers, privilege separation between the accounts is also needed because one of the websites may get compromised (via a web app vulnerability) and we would not want such a compromise to easily propagate onto all other websites hosted on the same system (not even if they're of the same customer).

      Additionally, even on a dedicated server for a single website (or, say, on a mail server) there are pseudo-users. Even the sshd service from OpenSSH uses a pseudo-user for its built-in privilege separation. This is needed to mitigate the impact of vulnerabilities in certain parts of code in those services (and in libraries that they use). You don't want any vulnerability anywhere in sshd or in parts of libc/libcrypto/libz that it uses (and in a lot of other libraries on riskier Linux distros such as RHEL/CentOS/Fedora - just see "ldd /usr/sbin/sshd" on those and be very scared) to result in a full-blown root compromise. The extra barrier between the less-privileged sub-process (doing lots of things) and the parent root-privileged process (doing fewer things) is of some help. Ditto for other services that implement privilege separation - and this is the kind of service implementations that we include in Owl (OpenSSH, vsftpd, OpenNTPD, Postfix all have privsep implemented upstream; telnetd was missing privsep, but we introduced privsep into it).

  • by Khopesh (112447) on Friday December 17, 2010 @05:04PM (#34592600) Homepage Journal

    I'm not sure I believe that. The only way I can think of permitting things like su and passwd (among many others) is by running some sort of permissions escalation daemon ("owl-control" perhaps?) as root that essentially does the same thing. This moves the vulnerability from the binary to the permissions daemon.

    There is almost no documentation on owl-control; the best I could find was a FreeBSD port [uni-marburg.de] and the (encoded) man page [openwall.com] as plucked from CVS HEAD.

    If this has been independently audited and continues to appear to be a Good Idea then perhaps it would be of interest to one of the larger distributions?

    • by verbatim_verbose (411803) on Friday December 17, 2010 @05:21PM (#34592840)

      See Fedora's page [fedoraproject.org] for the same feature.

      In short, there is a system now which gives programs certain capabilities based on tags set in the file system. With this, running as root is not needed for most things.

      • by gm.outside (1961160) on Saturday December 18, 2010 @01:38AM (#34597356)
        No, Fedora are using a different approach. We do not replace SUID/SGID with capabilities, instead we carefully design the system to take advantage of the standard Un*x OS level permissions. JFYI, all this buzz with replacing SUID/SGID binaries emerged from the recently discovered vulnerability (BTW, Owl was among few distributions which wasn't affected by that vulnerability at all), but unfortunately people are often getting things wrong, when it comes to security. Please review the following message that describes some pitfalls along Fedora or Ubuntu's ways: http://www.openwall.com/lists/oss-security/2010/11/08/3 [openwall.com] .
    • by bluefoxlucid (723572) on Friday December 17, 2010 @05:23PM (#34592886) Journal

      A curious detail is that there are no SUID programs in a default install of Owl 3.0. Instead, there are some SGIDs, where their group level access, if compromised via a vulnerability, can't be expanded into root access without finding and exploiting another vulnerability in another part of the system - e.g., a vulnerability in crontab(1) or at(1) can't result in a root compromise without a vulnerability in crond(8) or in a critical system component relied upon by crond(8).

      From some googling and the announcement.

      Basically if you exploit something with 'shadow' (i.e. passwd) you add a root user account to /etc/passwd and su to it. if you exploit crontab or at, you add a crontab that adds a root level account or runs a command as root or creates a SUID program. It requires some hacker creativity, but doesn't make anything secure.

      • Depends on the program, exploiting a setuid ping would give you root, exploiting a ping with the capability to open raw sockets would give you the ability to open raw sockets, still bad but nowhere near as critical.
        It also as you pointed out makes it harder for exploit writers, most "hackers" are script kiddies who will use exploits written by other people, which may not target things like this (and certainly don't yet).

        • by solardiz (817136) on Saturday December 18, 2010 @05:38AM (#34598346) Homepage

          Speaking of ping in particular, I have to admit that in Owl 3.0 it is simply restricted to invocation by root by default (mode 700) - not great, but usually acceptable. It can be re-enabled with "control ping public", and this setting will persist over upgrades, but it re-introduces the risk. We're working towards a better solution - specifically, we're testing a Linux kernel patch implementing non-raw ICMP sockets, which we intend to submit to LKML soon. (It already works for us, including via our patched ping, but this stuff was too cutting-edge to include it in the release.)

          traceroute just works on Owl out of the box, though - we're using an implementation that makes use of Linux-specific kernel features (upstream, no patches) such that it does not need any special privileges to run (it is installed mode 755 and it works for all users). (This is similar to what we're trying to implement for ping, but it's already a reality.)

      • by gm.outside (1961160) on Saturday December 18, 2010 @01:58AM (#34597490)

        Basically if you exploit something with 'shadow' (i.e. passwd) you add a root user account to /etc/passwd and su to it.

        This is not true. You can't do anything like this even if you acquire the shadow membership:

        server!galaxy:~$ ls -ld /etc/passwd /etc/tcb
        -rw-r--r-- 1 root root 3956 2010-06-03 21:08 /etc/passwd
        drwx--x--- 99 root shadow 4096 2010-06-03 21:08 /etc/tcb
        server!galaxy:~$

        and the structure under /etc/tcb/ is also not writable to shadow:

        server!root:~# ls -ld /etc/tcb /etc/tcb/galaxy
        drwx--x--- 99 root shadow 4096 2010-06-03 21:08 /etc/tcb
        drwx--s--- 2 galaxy auth 4096 2009-10-24 04:44 /etc/tcb/galaxy
        server!root:~#

        Re: crontab -- good luck with hijacking crontab on Owl :). The code was carefully audited for security issues and was hardened against possible abuses.

      • by solardiz (817136) on Saturday December 18, 2010 @05:47AM (#34598360) Homepage

        From some googling and the announcement.

        Basically if you exploit something with 'shadow' (i.e. passwd) you add a root user account to /etc/passwd and su to it. if you exploit crontab or at, you add a crontab that adds a root level account or runs a command as root or creates a SUID program. It requires some hacker creativity, but doesn't make anything secure.

        That's poor analysis on your part, so your conclusion is completely wrong. Please refer to our presentation slides for an explanation of how things actually work and why the attacks you describe would not work:

        http://www.openwall.com/presentations/Owl/ [openwall.com]

        BTW, the announcement specifically mentioned that "a vulnerability in crontab(1) or at(1) can't result in a root compromise without a vulnerability in crond(8) or in a critical system component relied upon by crond(8)." Did you not read that? Or do you disagree, thereby stating that we're inexperienced in the stuff we've been doing for 10 years?

        Since a lot of people are confused just like you are, I'd be happy for any suggestions on how we could explain what we do and what we have achieved better. I did include that quote in the announcement specifically because I knew of common misconceptions about our work, but apparently that was not enough? Thanks!

        • by bluefoxlucid (723572) on Monday December 20, 2010 @11:04AM (#34615392) Journal

          That's poor analysis on your part, so your conclusion is completely wrong.

          Yeah, I saw; you made passwd root-owned, which is the smart thing to do. How "passwd" works with root group r-- and no SUID is a mystery to me, I'll have to look later.

          BTW, the announcement specifically mentioned that "a vulnerability in crontab(1) or at(1) can't result in a root compromise without a vulnerability in crond(8) or in a critical system component relied upon by crond(8)." Did you not read that? Or do you disagree, thereby stating that we're inexperienced in the stuff we've been doing for 10 years?

          Theo de Radt used the argument on me once that he was more experienced than me and knew what he was talking about; he took it off-list which was good for him. The argument was whether position independent executables were "very expensive" (his words) on x86 (32-bit), and in the end I ran OProfile against the whole system and found that the slow-down was 6% (1% normally, 6% if you use -fomit-stack-pointer because it doesn't work with -fpie -fpie) in the code, but the affected code was actually running less than 2% of the time. The total cost was a 0.0012% slowdown. "Very expensive."

          I could always be wrong, but so could you. What I find suspicious about at(1) is you can make cron and at run tasks with root level privileges. This is a feature, unless you removed it (in which case cron simply won't run anything as root, good job). In typical operation, there's one file for this stuff, and the program has access to modify it; getting that access unrestricted by the security logic of the program itself is a quick sidestep of all system security.

          Of course I could be wrong. Making the relevant "files" instead "directories" with chmod u=rwx,g=rwx,o=t and reading the user by checking the owner of the crontab gives a possibility I hadn't thought of. Dropping privileges before parsing files and filenames (by iterating directories and using stat() for known-good-from-the-kernel input) eliminates the last possible foreign input vector.

          So yeah, I could be wrong.

          • by solardiz (817136) on Tuesday December 21, 2010 @02:07AM (#34625342) Homepage

            How "passwd" works with root group r-- and no SUID is a mystery to me, I'll have to look later.

            Please take a look at our presentation slides, it only takes a few minutes. Then you might have more specific questions on the implementation, which I'd be happy to answer.

            http://www.openwall.com/tcb/ [openwall.com]
            http://www.openwall.com/presentations/Owl/mgp00020.html [openwall.com]
            http://www.openwall.com/presentations/Owl/mgp00021.html [openwall.com]
            http://www.openwall.com/presentations/Owl/mgp00022.html [openwall.com]
            http://www.openwall.com/presentations/Owl/mgp00023.html [openwall.com]

            ... he was more experienced than me ...

            Please note that what I wrote in my reply to your comment was quite different. I never said anything about your experience. Now that you raised this topic, I can say that you appear to be familiar with Unix security. You simply had not looked at our stuff before you wrote your comment, that's all.

            I find your comment re: the cost of PIE interesting, thanks! It leaves many questions, though. 6% on 32-bit x86 is the number I had been aware of before. Your statement that "the affected code was actually running less than 2% of the time" is curious and potentially very useful. However, this, assuming that it's true, does not yield your claimed 0.0012%; it yields 0.12%. Of course, 0.12% may be considered acceptable (far more likely than 6% at least). I am curious about the details of your test; I guess, some systems will actually run "the affected code" 100% of the time - e.g., this happens if I build John the Ripper as PIE and run it for days (which is why I dislike Gentoo building JtR like that, and have to recommend JtR users to make their own builds). ;-) I'd appreciate it if you e-mail me (solar at openwall.com) more details on your test, and we'll discuss from there. We're considering PIE by default for post-3.0 Owl-current (and next release).

            Your comments about cron/at are similar to what we thought of when we designed the system. Just like our per-user shadow files, the crontab files are per-user (and they were prior to our changes as well). Our crond does check crontab file ownership, and then it will only run the cron jobs found in the file as the file's owner. Cron and at jobs running as root are supported - of course, as long as the corresponding files are root-owned.

            • by bluefoxlucid (723572) on Tuesday December 21, 2010 @10:51AM (#34628010) Journal

              Please take a look at our presentation slides, it only takes a few minutes. Then you might have more specific questions on the implementation, which I'd be happy to answer.

              Yes, I stopped my arguments short because I detected I have a distinct lack of information and there's too many possibilities I'm becoming cognizant of to continue without reading up some more.

              ... he was more experienced than me ...

              Please note that what I wrote in my reply to your comment was quite different. I never said anything about your experience. Now that you raised this topic, I can say that you appear to be familiar with Unix security. You simply had not looked at our stuff before you wrote your comment, that's all.

              True, but my comment was more to illustrate that anyone can be wrong, regardless of who they are. I learn new stuff all the time. Ueshiba O-sensei said failure is the key to success, and each mistake teaches us something; if I seem to know something about anything it's because at one point I was wrong about something and someone directed me to the appropriate information.

              I find your comment re: the cost of PIE interesting, thanks! It leaves many questions, though. 6% on 32-bit x86 is the number I had been aware of before. Your statement that "the affected code was actually running less than 2% of the time" is curious and potentially very useful. However, this, assuming that it's true, does not yield your claimed 0.0012%; it yields 0.12%. Of course, 0.12% may be considered acceptable (far more likely than 6% at least). I am curious about the details of your test; I guess, some systems will actually run "the affected code" 100% of the time - e.g., this happens if I build John the Ripper as PIE and run it for days (which is why I dislike Gentoo building JtR like that, and have to recommend JtR users to make their own builds).

              John might be a special case because it's run entirely in its own code. In general, however, shared objects are all -fPIC; this is an assumption I make because non-PIC relocatable libraries pose some problems under PaX (there's code to handle it, but it opens up an exploit path), and also break the virtual memory system (every page containing a pointer to another part of the binary needs modification, so those pages can't be shared between instances). So these already suffer from the performance impact of position independent code.

              X11 runs mainly in shared objects (video drivers, rendering code, X libraries...). Rhythmbox and XMMS and Totem and Xine run mostly in shared objects (liblame, libvorbis, ffmpeg, etc doing the decoding). bzip2 uses libbz2(!). In general, everything runs its heavy lifting in shared objects. Again, JtR might be a special case here; there are likely many others, i.e. anything with ALL its code in its main executable.

              Back then the kernel included a facility called OProfile that could profile the entire system. I simply measured the CPU time run in the kernel and every loaded executable object individually (shared objects and main executables appeared separately). It turned out overall the system didn't run much in main executables at all. X ran 5% of its time in the main executable and Battle for Wesnoth's dedicated server ran something like 10%, which I thought was weird; the next biggest contender was under a quarter of a percent.

              If I can dig up the thread I'll e-mail it to you. It's been half a decade since I cared about this stuff.

              Your comments about cron/at are similar to what we thought of when we designed the system.

              Then I spoke without thinking. This is how I lose when playing Go; it's no surprise I come out behind in arguments over system security designs this way too.

              • by solardiz (817136) on Tuesday December 21, 2010 @01:51PM (#34630826) Homepage

                I fully agree with you that "anyone can be wrong".

                I also agree with your comments on a large percentage of CPU time typically being spent in shared libraries, and I agree that they're normally PIC anyway. So, yes, 6% slowdown on main program code when going PIE does not translate to a 6% slowdown of the entire system. We typically use Owl rebuilds from source as our benchmark, so this is likely what we will use to see the overall effect of going PIE as well (that is, run a second rebuild on a system already rebuilt to use PIE, including gcc, etc.)

                Our bzip2 does not use shared libbz2, specifically for the reason you mention. Here's the exact text of the Owl bzip2.spec changelog entry dated Feb 1, 2002: "Package the bzip2 binary that is statically-linked against libbz2 for better performance on register-starved architectures such as the x86." IIRC, we actually ran benchmarks of both kinds of builds of bzip2 at the time. I've just double-checked - the bzip2 binary in Owl 3.0 still uses shared libc only, whereas libbz2 is linked in statically (the version of bzip2 has been updated several times since 2002, of course). :-)

                It was nice talking to you. I think you could actually contribute to post-3.0 Owl development if you wanted to (hint). ;-)

    • by Anonymous Coward on Friday December 17, 2010 @05:24PM (#34592898)

      At least theoretically some type of access list "Program X is authorized to do Y" is more secure than "Program X needs root access". But I agree that more information about owl-control would be great. Slashdot is supposed to be informative rather than just "Cool Linux product available now!!!!"

    • Well, setuid binaries were required to exploit the ptrace kernel vulnerability from a few years back, as well as the more recent vulnerability in glibc... An already running daemon which is running as root would not be vulnerable to either of these exploits.

      On the other hand, i believe they use capabilities - that is rather than granting full root privileges ala setuid, you grant only the permissions a program needs... For instance listening daemons may only need root privileges to bind to ports below 1024, ping/traceroute only need to be able to open a raw socket etc.

    • by gm.outside (1961160) on Saturday December 18, 2010 @01:27AM (#34597274)
      Yes, our distro doesn't encourage users to use su or sudo. The reason is that escalating privileges from a less privileged account to a more privileged account is bad from security standpoint. I found the following message in our mailing list. In this message Solar Designer explains the issue with su/sudo: http://www.openwall.com/lists/owl-users/2004/10/20/6 [openwall.com] An excerpt from the above message: "Presently, the only safe use for su is to switch from a more privileged account to a less privileged one (whenever this distinction can be made) in a non-interactive script (without a tty). As soon as a tty is used, there is a security problem. As soon as you su to a more privileged account, there is another security problem." I hope you'd find this useful.
      • by solardiz (817136) on Saturday December 18, 2010 @05:22AM (#34598296) Homepage

        Yes, our distro doesn't encourage users to use su or sudo. The reason is that escalating privileges from a less privileged account to a more privileged account is bad from security standpoint.

        Exactly. And our solution to the "accountability" problem when there's more than one sysadmin is multiple root accounts - we typically prefix their usernames with "r_" for clarity, and we keep the main "root" account locked. We even have our own msulogin program, replacement for sulogin, to allow for single user mode console logins under any one of multiple root accounts that might exist on the system. The rest of Linux tools happened to just work with multiple root accounts fine, with no changes needed on our part.

        That said, if anyone truly wants to use the traditional absurd approach of su'ing to root, they can re-enable su with "control su wheelonly" (there are other possible settings as well). Of course, this makes /bin/su SUID root... but you asked for it. This setting will persist over Owl upgrades. See "man control", "control" (just run it with no options for a list of facilities and their possible settings).

        • by Khopesh (112447) on Saturday December 18, 2010 @03:44PM (#34601716) Homepage Journal

          Solardiz (and/or gm.outside):

          First, thanks for participating in this thread (and for submitting the article, and for making OWL).

          Second, the documentation on owl-control is very sparse; I can't even find an HTML-rendered version of its man page (as noted in my GGP [slashdot.org]) let alone a more detailed description of its features, uses, advantages, etc. It is obviously central to the security model of the system. Please reply to the GGP with a link to more detail on owl-control (assuming you have one) as assembling it from your comments is not easy.

          • by solardiz (817136) on Saturday December 18, 2010 @04:54PM (#34602218) Homepage

            Khopesh - you're welcome, and thank you for your constructive comments. We might create a FAQ for Owl based on the questions/comments we've received.

            Agreed re: insufficient documentation on owl-control. This is something for us to improve. Also add our own web interface to our man pages, like *BSD's have - frankly, this has been on my to-do list for years... but there was always something more important or/and more urgent.

            I have replied to your comment's GGP with the info you have requested.

      • by Compaqt (1758360) on Saturday December 18, 2010 @06:00AM (#34598416) Homepage

        If you can't su or sudo, how you get anything done?

        • by gm.outside (1961160) on Saturday December 18, 2010 @07:28AM (#34598680)

          If you can't su or sudo, how you get anything done?

          This depends on the task. If you are a local user and need root powers - switch your console to a fresh one and login as root. If you were talking about getting root powers on a remote host, the best practice is to ssh as root directly (given that you are behind a trusted terminal).

        • by solardiz (817136) on Saturday December 18, 2010 @07:31AM (#34598692) Homepage

          If you can't su or sudo, how you get anything done?

          We normally login directly as a root user for sysadmin tasks (e.g., r_john for a sysadmin named John) and also directly as a non-root user (e.g., john) for other tasks. This applies to both console and remote logins (ssh). This is the approach we've been using for years, and it works well for us.

          As I have mentioned, those who prefer the traditional su approach, despite of its added risks (including compromise propagation from a sysadmin's non-root account to root), may "control su wheelonly".

    • by solardiz (817136) on Saturday December 18, 2010 @05:56AM (#34598402) Homepage

      some sort of permissions escalation daemon ("owl-control" perhaps?)

      owl-control is merely a tool to ease system administration - change settings and have your changes persist over system upgrades. It is one of the nice security-related features of Owl, but it is NOT key to running a reasonable Owl system without SUIDs (this is achieved by other means - SGIDs and changes to various system components). owl-control is not what you thought it was (not a "permissions escalation daemon", but merely a set of scripts).

      I do agree with you that we need to present our documentation (such as man pages) in a form more accessible to someone who is not an Owl user yet. The only reason why we did not do that yet is lack of time (small development team working on a mostly non-commercial project, so we constantly have to choose which of the pending tasks we make progress on).

    • by solardiz (817136) on Saturday December 18, 2010 @04:45PM (#34602154) Homepage

      You can view the formatted control(8) man page here:

      http://docs.altlinux.org/manpages/control.8.html [altlinux.org]

      (ALT Linux have imported owl-control for their distributions, and they have contributed some changes back to us. They also happen to have placed this man page on the web.)

      I'm afraid that this is not going to help you very much, though, because owl-control is very generic and abstract, and so is its man page. Perhaps we should add a few usage examples to illustrate owl-control's purpose.

      I'll try to explain what it's for. Some packages on Owl provide what we call, in owl-control terms, "facilities". An example of such facility is su, provided by the SimplePAMApps package. The package also provides the file /etc/control.d/facilities/su, which defines several possible settings for su. In this case, the settings are: public, wheel, wheelonly, restricted - as shown by "control su list". The default for su on Owl 3.0 is restricted, which corresponds to /bin/su being mode 700 (usable by root only). If you issue "control su wheelonly", /bin/su changes to mode 4710, with group wheel. Issuing "control su" then confirms that the current setting is indeed wheelonly. Other related programs are control-dump and control-restore: these are used by scriptlets of our RPM packages. For example, our SimplePAMApps.spec invokes "control-dump su" in %pre and "control-restore su" in %post. This lets a possibly customized control setting for su persist over upgrades of the SimplePAMApps package.

      Some other facilities are: bind-debug (controls whether it's possible to have BIND produce debugging logs or not), ntpd (can be set to "server" or "client"), postfix (can be set to "server" or "local"), and many others. So this is not limited to changing permissions on files - it also works for configuration file contents - but we only use it for trivial changes (a line commented-out or not) that need to persist over system upgrades. Also, such control'able changes are perfectly compatible with manual edits to the corresponding config files. If a sysadmin ends up editing a file such that control's facility script does not recognize one of the supported settings, control will start reporting "unknown" for that facility's state - but that is not any worse than not having control would have been.

      As you can see, this is a very nice security-relevant feature for sysadmins, but it is not central to the Owl security model. Things such as our tcb suite (making the passwd command run without requiring root privs) are more essential to our security model.

  • by Anonymous Coward on Friday December 17, 2010 @05:07PM (#34592656)

    Two curious properties of Owl 3.0: no SUID programs in the default install (yet the system is usable, including password changing); and logging of who sends messages to syslog (thus, a user can't have a log message appear to come, say, from the kernel or sshd). No other distro has these.

    Of all the Linux vulnerabilities in the past few years, how many would have been stopped by this?

    These things sound nice, but I'm wondering if they are actually useful or if they are just security theater.

    • by solardiz (817136) on Saturday December 18, 2010 @05:08AM (#34598248) Homepage

      Of all the Linux vulnerabilities in the past few years, how many would have been stopped by this?

      There were in fact cases where other Linux distros had to issue updates and advisories - e.g., for an issue in crontab (to use the same example that I used for some other comments here) - whereas on Owl not only the vulnerability did not exist in the first place, but also it would have been mitigated due to the greatly reduced privileges of the crontab program (to use the same example again). To give another example, the recent glibc vulnerability with LD_AUDIT and $ORIGIN (discovered by Tavis Ormandy) not only did not affect Owl for a couple of reasons (including due to a glibc hardening patch), but also would be mitigated by not having a single SUID program if the vulnerability did exist on Owl (it did exist on almost all other distros). As you can see from this, we often have multiple layers of security hardening that help (with this being one of the layers) whereas others sometimes happen to have none - and are vulnerable.

      At this point, our weakest link is the Linux kernel - large and monolithic - so that's pretty much the only place where critical vulnerabilities that do affect us are still being found... There's little we can do about this (while staying Linux), but it may be a focus area for further security hardening now that we have an almost perfect userland. Also, Owl differs from other/major distros as it relates to exposing the Linux kernel to attack - we expose less of it - e.g., we exclude kernel module auto-loading, we have saner/safer permissions on device files, and we have no SUIDs by default (which mitigates some classes of potential vulnerabilities in the Linux kernel's program startup code - such vulnerabilities were found/fixed in the past).

      That was regarding "no SUIDs". As to the detection of log record spoofing, it does not stop attacks, but it is a security feature. When you review logs, you typically want to have a way to know whether the records are genuine, at least under the assumption that the system has not been compromised yet. On traditional Unix/Linux/BSD/..., you had to assume that any (pseudo-)user could have trivially produced any of the log records, pretending to be any system service or even the kernel.

  • by mpapet (761907) on Friday December 17, 2010 @05:08PM (#34592680) Homepage

    News that matters.

    Next up, Microsoft/Symantec/Cisco security product and costs 10's of thousands more! Can't leave the point-and-click jui jitsu black belts out.

  • by fandingo (1541045) on Friday December 17, 2010 @05:23PM (#34592874)

    Here's one of the better criticisms of dropping SUID, and it's from an Openwall developer. These criticisms are echoed by almost everyone thinking about removing SUID.

    There's a lot of talk lately regarding replacing the SUID bit on program
    binaries in Linux distros with filesystem capabilities. Specifically,
    Fedora and Ubuntu are heading in that direction.

    Fedora:
    http://fedoraproject.org/wiki/Features/RemoveSETUID [fedoraproject.org]
    https://bugzilla.redhat.com/show_bug.cgi?id=646440 [redhat.com]

    Ubuntu:
    http://www.outflux.net/blog/archives/2010/02/09/easy-example-of-fscaps/ [outflux.net]
    https://wiki.ubuntu.com/Security/FilesystemCapabilties [ubuntu.com]

    While in general this is a good idea, there are issues with it, in
    arbitrary order:

    - Some currently-SUID programs are aware of them being (potentially)
    SUID, and will drop the "more privileged" euid when it is no longer
    needed, but they will probably not be aware of them possessing
    capabilities. This may result in larger parts of the programs
    (sometimes orders of magnitude larger) running with elevated privileges
    (or with allowed-to-be-elevated privileges, which is a privilege on its
    own and is usable through vulnerabilities that allow for arbitrary code
    execution). Let's consider ping, which appears to be the classical
    example of "where filesystem capabilities will help" (or so it is
    claimed). IIRC, it starts by acquiring a raw socket (NB: of a certain
    somewhat-limited type), then drops root privs (if it was installed SUID
    root and run by non-root), then proceeds to parse the command-line,
    resolve the provided hostname, and so on. If the SUID bit is replaced
    with cap_net_raw+ep, as seen in Kees' example above, will ping know to
    drop this capability? Hardly. Not without a source code patch.
    Besides, dropping the capability might [need to] require privileges
    beyond CAP_NET_RAW itself (recall the capability-dropping attack on
    sendmail from a decade ago). So does moving from SUID root to
    cap_net_raw+ep improve security? Most likely not. On the contrary, it
    results in hundreds of lines of ping's code and thousands of lines of
    library code (DNS resolver) running with elevated privileges, as
    compared to just a few lines of ping.c, which was the case with simple
    SUID root. Granted, those "elevated privileges" are a lot less than
    root privileges, but they're a lot more than having a single raw socket
    of a specific type.

    - In some cases, the capability sets being granted are (almost)
    equivalent (or expandable to) full root powers. This is seen in:

    http://people.fedoraproject.org/~dwalsh/policycoreutils_setuid.patch [fedoraproject.org]

    -%attr(4755,root,root) %{_bindir}/newrole
    +%attr(0755,root,root) %caps(cap_audit_write,cap_setuid) %{_bindir}/newrole

    -%{_sbindir}/seunshare
    +%attr(0755,root,root) %caps(cap_setuid,cap_dac_override,cap_sys_admin,cap_sys_nice) %{_sbindir}/seunshare

    This mostly just sweeps the SUID root under the rug, where the sysadmin
    will hopefully not see it and thus feel safer. However, it may expose
    more problems in the programs if they knew to drop root, but wouldn't
    know to drop the capabilities (same issue I described above for ping).

    Granted, vulnerabilities of certain classes might become unexploitable
    or be partially mitigated. For example, if no direct code execution is
    possible (not a buffer overflow, etc.), but "only" privileged access to
    an attacker-provided arbitrary pathname is possible, then "newrole"
    above would be protected, but "seunshare" above would not (because of
    cap_dac_override).

    - Completely getting rid of SUID root pro

    • by Anonymous Coward on Friday December 17, 2010 @07:46PM (#34594808)

      I wrote a program once that needed SUID for about a hundred asm instructions.

      The program was an implementation of tar.

      I needed SUID as chroot() was the fastest way to change the symlink traversal vulnerability.

      CAP would be wasted as chroot() is one of those known to grant root power.

      Sometimes a little bit of SUID is the easiest way to handle things like these.

      • by solardiz (817136) on Saturday December 18, 2010 @04:00AM (#34598018) Homepage

        > I wrote a program once that needed SUID for about a hundred asm instructions.

        Sure the program may be tiny, but it exposes parts of the dynamic linker, libc startup, and even extra parts of the Linux kernel code for attack. All of these components have historically had vulnerabilities exploitable specifically via SUID programs. The point behind not having a single SUID program in a default install of Owl is primarily to mitigate potential vulnerabilities in those components. I do agree that, as the distro level, it would otherwise be possible to live with a few tiny SUID programs, but the risk with other exposed components is very real - so we avoid it.

        > CAP would be wasted as chroot() is one of those known to grant root power.

        Right. Red Hat are going to "waste" capabilities like this. We are not doing that (we use SGIDs and changes elsewhere in the system instead). (To be fair, there is a subtle reason why even root-equivalent capability sets may be slightly better than directly running as root when we consider some specific vulnerability classes. This is just too complicated to discuss in a comment like this.)

    • by solardiz (817136) on Saturday December 18, 2010 @04:28AM (#34598148) Homepage

      > Here's one of the better criticisms of dropping SUID, and it's from an Openwall developer. These criticisms are echoed by almost everyone thinking about removing SUID.

      I am glad that you liked my criticism of Fedora's approach, however it appears that you misunderstood me. I criticized their specific approach with fs capabilities, not the idea of getting rid of SUIDs in general. The approach taken by us in Owl (many years ago, but only widely publicized now) and the one being taken by Fedora now are completely different (SGID and changes elsewhere in the system in Owl vs. fscaps in Fedora). The purpose of my criticism was to make other folks, including Fedora developers, consider the issues and the alternatives. It was not to discourage them from taking the move, but rather to give them an opportunity to consider our approach, which we consider to be the better and "real" one.

      With our approach implemented in Owl, a used-to-be-SUID program runs SGID to a group dedicated to a certain purpose - e.g., editing a user's crontab. Other parts of the system have been modified such that privileges of that group are sufficient for but can't be expanded further than its intended purpose - e.g., permissions on /var/spool/cron and extra checks in crond (for crontab file ownership and more) are such that a possible compromise of group crontab would not give the attacker almost anything - no ability to edit another user's crontabs without also finding a (second) vulnerability in crond or in system components relied upon by crond. Yes, we could as well not use SGID - just make the crontab program fully unprivileged and the /var/spool/cron directory writable by anyone (the sticky bit prevents messing with another user's existing crontabs). The reasons why we chose to use SGID and a group are: (1) this is needed to prevent some DoS attacks (such as taking up another user's would-be crontab filename) and (2) it is an extra layer of security (so direct attacks on crond are not possible without compromising crontab first). Our changes to crontab/crond have since been adopted by ALT Linux, OpenBSD, and even by upstream ISC (Vixie) cron (but most distros somehow don't hurry to make use of this functionality, continuing to install crontab SUID root...)

      Fedora's approach is to replace SUID root with fscaps - that is, the programs are still granted a lot of privilege, just somewhat less than they were with SUID root. In many cases (perhaps even in most, where ping might be the only exception), such capability sets are in fact root-equivalent, so this is sweeping SUIDs under the rug. Also, there's no second layer of security. See the difference?

    • by solardiz (817136) on Saturday December 18, 2010 @04:35AM (#34598178) Homepage

      > BTW Fedora 15 is also dropping SUID, so while Openwall is the only current distro. It's by no means the only one in development.

      Right, however Fedora's approach is (1) completely different and a lot worse than ours (in my opinion, indeed) and (2) either won't result in complete removal of SUID programs or will leave many with root-equivalent capability sets. This means that they will continue to expose the dynamic linker, libc startup, and relevant parts of the Linux kernel to the usual risks associated with SUID root program startup - something that we avoid.

      > Ubuntu is also removing SUID, but I don't know their timetable.

      They're aware of the drawbacks of Fedora's approach, so they don't hurry to implement it. They're also aware of our proposed alternative. :-)

  • by der_alte (1271174) on Saturday December 18, 2010 @09:31AM (#34598972)
    the Openwall website groans and moans imploring for a facelift. it's so poignant..
    • by gm.outside (1961160) on Saturday December 18, 2010 @03:18PM (#34601522)
      Wanna volunteer? :) Seriously, we wanted to update the site long time ago, but we are not good at web design and our team is too small and quite busy to spend time on something we aren't good at. From the pure technical point of view, the site provides all the necessary information we wanted it to provide. True, there are no whistles and bells, but every bit of info is there. We would appreciate any help with making our site better!
      • by solardiz (817136) on Saturday December 18, 2010 @05:25PM (#34602390) Homepage

        every bit of info is there

        Actually, there are at least two things I've been planning to add to the website (but we never got around to doing that): an interface to browse our man pages and another one to browse our packages (list and contents - at least the metadata). I don't know whether this is a higher priority than a mere facelift or not.

Those who can, do; those who can't, simulate.

Working...