Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×
Security

Additional Security in the Linux Kernel? 315

nyx asks: "Recently, I was looking for some way to improve security on my linux boxes. I found few linux patches like grsecurity, LIDS (now also as Linux Security Module), Medusa DS9. I'm testing grsecurity (and it's ACLs) now and I'm quite satisfied with it, but I wonder, what are pros and cons of other solutions. Anybody tried them and can share his experience with us?"
This discussion has been archived. No new comments can be posted.

Additional Security in the Linux Kernel?

Comments Filter:
  • by SpanishInquisition ( 127269 ) on Wednesday July 24, 2002 @02:13PM (#3946036) Homepage Journal
    Lock the door when you leave the computer room.
    • Remove the boot floppy from the disk drive.
    • One of my favorite dysfunctional security guidelines documents involved "hide the keyboard". Apparently the concept was that a keyboard visible from a room's entrance would act as a magnet and draw in wiley hackers. Hiding the keyboard was the first step to twarting such riff-raff.
    • Lock the door when you leave the computer room.

      And don't leave the thing logged in as root!! If they're going to make a physical compromise, at least make them work for it to increase the chance they get caught.


    • Lock the door when you leave the computer room.

      This got modded up as funny, but those of you out there who are new to network security and administration need to take note - this one is pretty fundamental.

      No matter what patches you install, services you disable, firewalls you configure, or holes you plug; if I can get unrestriced (private) console access for < 1 hour, U R probly 0wn3d. I might not even need to r00t your box right away - I'll just image the hard drive to a spare I keep in my backpack and walk out with your data -- I'll have all the time I need to dig out the interesting bits later.

      Encrypted filesystems *should* invalidate this approach, but we'll see.

    • Actually on a serious note, it's a good idea to put this in ~/.bashrc, especially /root/.bashrc:

      TMOUT=1800

      It makes bash logout after half an hour (1800 secs) idle at the prompt. This is good if you _forget_ to lock the door when you leave the computer room. I usually have several remote terminals open on my desktop. If I step away for a few minutes to attend to something else, they start closing automatically.
  • GRSecurity (Score:1, Informative)

    by ClickWir ( 166927 )
    I've been useing the grsecurity patch on the medium level. Seems to help out a bit, haven't had any problems. Performance does not seem to be affected.
  • zerg (Score:3, Funny)

    by Lord Omlette ( 124579 ) on Wednesday July 24, 2002 @02:17PM (#3946066) Homepage
    Let's hear it for NSA Security Enhanced Linux! Whoo!

    If the NSA security enhanced your machine, would you even know about it? Suspect it?
  • I suggest vserver (Score:5, Informative)

    by WetCat ( 558132 ) on Wednesday July 24, 2002 @02:18PM (#3946084)
    http://www.solucorp.qc.ca
    You can create virtual servers on your machine, tailored for specific tasks.
    For example, you can create virtual server where you'll work on your project, virtual server which will run apache, virtual server in which you'll browse web and read mail.
    You then can put them on different IP addresses (or no addresses at all) and make them indepedent, changing information only by means YOU approve (shared directory, TCP sockets under firewall, etc).
    It's a kernel patch and some user-mode programs.
    Virtual servers can share binaries for saving disk space.
    • Re:I suggest vserver (Score:2, Interesting)

      by Anonymous Coward
      Also check out User Mode Linux [sourceforge.net]. Its an open source project which does similar things. Rather than creating a whole new virtual machine, this allows you to run a linux kernel as a user space process, giving a whole virtual linux system inside it. And it does have a "jail" mode for increased security (separation between virtual server and host).

  • nsa linux (selinux) (Score:1, Informative)

    by Anonymous Coward
    http://www.nsa.gov/selinux/

    adds some intresting security features, but doesnt support x so i didnt install it on my workcomputer.

    Also adds the question do we trust the NSA even if the source is avalible
  • I'm currently using OpenBSD in a work-related project. It's quite good, if not well documented.
  • Bastille (Score:3, Funny)

    by pauly_thumbs ( 416028 ) on Wednesday July 24, 2002 @02:18PM (#3946089)
    I seem to remember kernel patches happening in Bastille Linux... but then again in these autumnal years .... i remember things that never happened more and more....
    • by RadioheadKid ( 461411 ) on Wednesday July 24, 2002 @02:28PM (#3946173)
      Bastille Linux [bastille-linux.org] is user space hardening (e.g. changing file permissions, disabling telnet and other vulnerable services, setting up IPTables and various other security features), no kernel patches as far as I remember.

  • by daserver ( 524964 ) on Wednesday July 24, 2002 @02:19PM (#3946093) Homepage
    The Linux Security Model has been included in the upcomming 2.6
  • Small thing... (Score:3, Informative)

    by Jetifi ( 188285 ) on Wednesday July 24, 2002 @02:21PM (#3946112) Homepage
    Linux Security module is what adds hooks into the kernel for security. LIDS uses the LSM hooks, and so does SELinux, and (I think?) others. But LIDS != LSM.
    • Re:Small thing... (Score:5, Informative)

      by kylus ( 149953 ) on Wednesday July 24, 2002 @02:33PM (#3946205) Homepage
      Yeah there are other components that use the LSM hooks aside from SELinux and LIDS. There's Domain Type Enforcement (I believe).

      Back to the original question I've used LIDS, SELinux, and GRSecurity and I've found them all to have their strengths and their weaknesses. The common problem with all of them is there is usually something you forget to configure properly the first time which can really be a pain to fix. SELinux and GRSecurity both solved this by adding a toggle mode and a /proc entry respectively to change the enforcement of their code.

      With SELinux, the major advantage is that you gain a VERY flexible architecture you can use to create nearly any type of Mandatory Access policy you need. The specifications of the system make it able to use policies based on Type Enforcement (putting the bitchy SCC patent issues aside for the moment...), Role-Based Access Control, or Multi-Level Security and likely a host of other things. The drawback is that creating a policy that covers the whole system is not a trivial thing...look at the example security policy included with the distribution (http://www.nsa.gov/selinux [nsa.gov]) and you'll see what I mean.

      GRSecurity is not exactly related to SELinux; they do different things. I like GRSecurity because most of its options do not require a lot of extra configuration, they don't break any existing applications (those that do are clearly marked), and they add a lot of small protections without a great deal of overhead to the vanilla kernel. Plus their ACL system is quite well-developed and extremely secure.

      Ultimately I think it comes down to figuring out what you need for your box and then going with the option that will provide it to you with the least amount of interference (unless you like fixing things, of course ;) ).
    • I'd looked on and off at LIDS for a while, and one day decided to go for it. Brought it down to my desktop and began following instructions. The intent was to build the LIDS kernel and utilities on the desktop, and then scp them over to the firewall.

      Except that LIDS seems to want to be built on the machine where it's going to be run. So what if your firewall doesn't have a compiler, build environment, etc?

      Perhaps I should have RTFM further, but the available time ran out.

      I've also read a little about SELinux, but there appears to be one common thing about all of these security enhancements: They make it possible to have tight enforcement of a security policy, but it appears that none of them ship any sort of policies. It would be nice to have a few to choose from, and begin learning. How about a policy that's very little more secure than the pre-LSM box, with a bunch of commented options to tighten down the screws. I guess I've seen some of that with GRSecurity.

      But trying to evaluate and use any of these packages for a home system turns into a massive time-sink to do properly. WIBNI Bastille would add LSM to what they already do so well? (I know, join and do it, myself. Maybe when the big-time real world projects are in control.)
      • Except that LIDS seems to want to be built on the machine where it's going to be run.

        What sort of problem were you having?

        But trying to evaluate and use any of these packages for a home system turns into a massive time-sink to do properly.

        I'd agree. I devoted perhaps three days to installing and trying the major ones last year, and it was a pain.

        Personally, I settled on LIDS, which, although it is a little squirrely, has worked happily for me. But for casual users these are not ready for prime time; every time I install a new daemon I need to set up a set of matching LIDS entries so that things work properly. This isn't much of a pain for me, but for novices it would probably make their eyeballs bleed.
  • St. Jude Kernel IDS (Score:3, Interesting)

    by ActMatrix ( 246577 ) on Wednesday July 24, 2002 @02:21PM (#3946113) Homepage
    You might want to check out Saint Jude - a kernel intrusion detection and response system which detects and blocks 'anomalous' behavior (such as root exploits). The developer first presented it at Defcon 8 and it looked pretty cool. It's been in development for over a year - see its SourceForge page [sourceforge.net] for more.
  • Stack Guard (Score:2, Interesting)

    by dusanv ( 256645 )
    While we are at the topic of security I was wondering whether there are any similar products to StackGuard (www.immunix.org) available for a newer gcc? StackGuard is commercial and only works with older gcc's. If there were such a thing one could probably do a whole system recompile with it (a la Gentoo). That would beef up the security considerably. The Immunix FormatGuard also looks interesting.

    D.
    • Locate the routines in the C library that do not force you to explicitly specify the size of the buffer that you are copying (or autoallocate the buffer for you) and remove them. Dump any apps that don't recompile.

      VC++ 7 comes with /Gs switch which kinda sorta does stack smash checking but it comes with caveats.
    • Re:Stack Guard (Score:2, Informative)

      by mccrew ( 62494 )
      > I was wondering whether there are any similar products to StackGuard

      Um, how about libsafe [avayalabs.com]?

      -Steve

  • Neat Security Trick (Score:5, Interesting)

    by CONTROL_ALT_F4 ( 585063 ) on Wednesday July 24, 2002 @02:22PM (#3946119)
    I had a friend who ran all of his INET services through a VMWARE instance on his Linux box. He would get hit by a script kiddie, and then use the ROLLBACK feature to undo the damage. He would patch the hole on the virtual machine and start up the site as if nothing happened.
    • How often would this happen? It's sort of a novel idea, say if you're just learning about the fundamentals of security and networking, but if you're frequently getting cracked by kiddies, maybe you should take a deeper look at what you're doing right and wrong.
  • There is also SElinux,

    Mandatory Access Control, is also a better security Model than
    Discretionary Access Control, of witch is the current model of most network OS's "out of the Box"

    With MAC you have policey's the control access to services,files anything and if "something' trys to access a services it must be part of the policey that tells it what it is aloud to do, if it trys something out side the policey it fails:

    kind of like a firewall's deny by policey,

    here is a link to some more info about it:
    http://www.nsa.gov/selinux/docs.html

    Nex6
  • by captain_craptacular ( 580116 ) on Wednesday July 24, 2002 @02:29PM (#3946183)
    It's obvious that the only answer to this question is for all kernel developers to stop all productive activities for one month in order to sit through long and boring security lectures in groups of 500. After this month linux will be fully compliant with the "trusted security initiative" and will be magically bug free. Until such time as another bug is discovered.
  • Snort (Score:2, Informative)

    There's a program called Snort that does packet sniffing and intrusion detection, among other things. It's at snort.org [snort.org].
    That and good ol' P.G.P.
  • ACLs (Score:5, Insightful)

    by Black Parrot ( 19622 ) on Wednesday July 24, 2002 @02:31PM (#3946197)

    ACLs (access control lists) are a wonderful technology, but for non-trivial systems they become an administrative pain in the @ss. In principle you would set them up and forget about them, or at least let users maintain their own, but in practice users can't maintain their own, and they will pester you to death with requests for changes.

    They also tend to drag the sysadmin into office politics. E.g., Secretary A is out on vacation and Secretary B calls you and says Secretary A did not set up her ACLs correctly and would you please give B access to certain of A's files. In addition to the annoyance of having to babysit the users, there's really no correct response to such a request.

    ACLs would be great on a system where everyone is a power user. In practice that usually means your home system where you are the only user, so ACLs aren't very helpful anyway.

    Conclusion: wonderful technology, hope I never see it again.

    BTW, I speak from personal experience, having formerly managed VAXen with their wonderful ACL implementation. I don't object to ACLs on Linux, I just don't want them.

    • Re:ACLs (Score:5, Interesting)

      by WetCat ( 558132 ) on Wednesday July 24, 2002 @02:41PM (#3946263)
      BTW,it's theoretically proven that security provided by Discretory Access Control systems (in which ACL's and unix protection schemes belong to) is algoritmically unprovable - you cannot deduct that system is secure based on system and DAC rules.
      That proof is possible if are using mandatory access control or may be other security means.
      So DAC are not only pain in the ... - it's also a nonreliable means of security.
      • > BTW,it's theoretically proven that security provided by Discretory Access Control systems (in which ACL's and unix protection schemes belong to) is algoritmically unprovable - you cannot deduct that system is secure based on system and DAC rules.

        Thanks, I'd never heard that. Do you know whether government security certification levels take that into account?

        • Re: ACLs (Score:3, Insightful)

          by WetCat ( 558132 )
          Probably it's the reason that system that implement only DAC cannot be given more than class C in Orange Book.
          For class B and A you have to have Mandatory Access control.
      • Re:ACLs (Score:5, Informative)

        by ts0003 ( 240556 ) on Wednesday July 24, 2002 @05:20PM (#3947375)
        The parent post in incomplete at best, and if viewed less charitably it is misleading.

        1. The 1976 Harrison, Ruzzo and Ullman result (from "Protection in Operating Systems") pertains to "safety" in the access-matrix model. Inferences about security need to verify the implementation of the model as well.

        2. The result only applies to a system where an infinite number of subjects and objects can be created. An implementation on a typical OS does not suffer from this limitation since resources of the host that are used for the digital representation are finite.

        3. Their proof reduces a Turing machine to the access-matrix model, introducing a mapping between decidability and the leakage of a right in the access-matrix. Deciding whether a specific leak occurs is the equivalent, then, of solving the Halting problem. This proof, however, says nothing for a system where more specific knowledge of the system is used, where you *can* make stronger inferences. Look to the mono-operational system for a concrete, albeit impractical, example.

        4. Their results hold for any model that uses an access-matrix, regardless of whether it is Discretionary or Mandatory.
        • 1) I never said anything about access-matrix
          Access matrix system do not have anything related to DAC or MAC, as you already said in your "4."
          2) I didn't use 1976 Harrison, Ruzzo and Ullman result.

          3) Main security problem with DAC system is that they can introduce troyans, because they generally allow changing rights between users without restrictions
          MAC systems are not allowing troyans since changing rights between users is prohibited by rule system (role based etc...)

          • Re:ACLs (Score:3, Insightful)

            by ts0003 ( 240556 )
            1. While you did not introduce the notion of an access-matrix, you referenced a theoretic proof regarding the security of DAC. Acess Control models implicitly build on the access-matrix or a transformation of it.

            2. It's true that you did not use the HRU result. If you could point to the work that you did base your claim on, it would be helpful. Alternatively, summarize the insight of the proof so we can understand the merit of your assertion.

            3. Again, a statement you make borders on misleading. Your 3rd point is untrue. MAC forces labels and sensitivity designations. The actual policy is responsible for stating the information flow rules.

            The trojan of your example can easily be transferred between processes with the same clearance belonging to different subjects.

            Apart from that, MAC and DAC refer to *models*. Errors in *implementation* and configuration still abound, and a MAC system will not help in this case.
    • Re:ACLs (Score:3, Insightful)

      by MrResistor ( 120588 )
      From my (very limited) experience with ACLs on HP-UX I thought they were wonderful. You could totally ignore them and function just fine in every way that you can function in the default Linux permissions model. Basically, the only time you needed to deal with ACLs at all was when you wanted to specifically (dis)allow access for certain individuals. Doing that through groups is a pain, since then the user has to change groups to access certain stuff, etc.

      ACLs made it really easy to give permission to only the people you wanted to, and you could totally ignore them if you didn't want to use them. I would be really happy about a similar implementation being a part of Linux and not just a patch.

      • you could totally ignore them if you didn't want to use them

        You can't "totally ignore them", in particular when it comes to system security. ACLs allow people to get additional access to files relative to standard UNIX permissions, and that is something that needs to be checked. With ACLs, not only do I have to check whether /etc/passwd is owned by root, I also have to check whether someone has snuck in and given themselves write access to it through ACLs.

        I would be really happy about a similar implementation being a part of Linux and not just a patch.

        It should probably be in the kernel, but I think it should not be enabled by default because it creates security holes and because the functionality just isn't needed for many applications. Desktop users of Linux often don't need a complex permission system at all, and neither do many server applications (dedicated web server, dedicated database server, etc.).

        Where ACLs will be most useful will be for Linux clients accessing network file systems that have them. That's the reason why they should be in the kernel, but they should be enabled only for specific file systems. But in that case, ACLs are there for interoperability, not for additional security.

        • The ACL implementations of all the major Unix vendors (Sun, HP, SGI, IBM, DEC/Compaq etc.) are unfortunately completely incompatible with each other despite a POSIX draft (and I won't even mention Windows ACLs). In addition the commands/library calls to use/change ACLs all have different names and options.

          So unless you have a completely homogenous network there is currently no way to my knowledge that you can use ACLs across machines via NFS.

          As already mentioned, ACLs give users working in groups more flexibility to share file access, rather than having the admin create a new group for each new permutation. They don't really enhance security.

          • You assumed, but I didn't say anything specifically either about NFS or about using POSIX APIs to implement ACLs on networked file systems.

            Obviously, in order to be useful for a networked file system, the ACL APIs you need to support on the client are those required by the network file system used by the server. Those can be different from the ACL APIs either used by the local file system or by the server's file system. Take a look, for example, at what AFS does (I'm not endorsing it, merely pointing out what it does).

    • Let me second that. Having had to untangle ACLs as a system manager when converting file systems to UNIX, my observation is that they often don't do what users intend. Furthermore, systems I have used that have had ACLs may have passed various security certifications but were very easy to break into in practice because in real life, ACLs were never set up right.

      The traditional UNIX user/group system requires some advance thought and effort in setting up groups for an organization. That leads to a more manageable set of possible permissions.

      ACLs are an important check-list item for Linux because there are some people who swear by them. But I also hope that as a system manager, I will never have to deal with them again--I think they are much more trouble than they are worth in the real world.

  • Don't forget (Score:1, Interesting)

    by Anonymous Coward
    People often forget that the things that make unix multiuser are great security tools. For example, for local security, people who should be able to run certain suid programs can be put in special groups, and then the admin can chown and chmod the executables appropriately.
    Running applications in a chroot'ed environment is also helpful. A bit hard to setup, but once you do it, no problems.
    Use tools such as iptables to restrict access. For instance, if you know that all your connections will come from *.host.com, change the rules accordingly.
    Kernel patches are ugly. They try to get at the root of the problem, but they miss it completely.
    The point is that vulnerable code is written by bad coders, who for some unknown reasons think that C is the best language in the universe. Clearly, they can't handle the power that C gives them and should use languages that provide memory handling for them.
  • ... you can try PitBull from Argus Systems [argus-systems.com]. It's a very good product and free for non-commercial use (I think). If you can live without the source to their module.
  • Similar to the vserver idea is the concept of running another kernel of linux in 'User Mode Linux'. This allows you to run a virtual linux machine within you current install. This allows you to test kernel modules and patches in your vitrual system with out affecting the real system. This way, if your fake system gets rooted, the underlying system is ok.
    • Re:User Mode Linux (Score:2, Informative)

      by WetCat ( 558132 )
      I tried that - that solution gives more isolation between your virtual machine and main machine, but it's much slower than vserver patch.
      I tried to use vserver patch for Mandrake 8.2 on
      P1-200MMX with Apache, DNS, Mozilla, X and it worked perfectly.
  • If you restrict strace in grsecurity you cant seem to be able to debug your application under gdb as normal user but root can still debug. Its a good idea to not to play with strace option if you are in a software engineering environment.

    Other than that it works like a charm.
  • by Pegasus ( 13291 ) on Wednesday July 24, 2002 @02:53PM (#3946333) Homepage
    Bandaids like lsm, grsecurity & co will only help you cover to some extent the holes already there. I don't feel like this is the ideal solution ... The ideal solution is to write clean and bugfree code and use that. OpenBSD [openbsd.org] will probably get you there in the quickest way.

    But on the other hand, you know what idealism is ...

    • This is valid IF
      1) All the code in OpenBSD is bugree. the recent OpenSSH hole shows this isn't the case. I'm pretty sure OpenSSH was fairly heavily audited too, and it still had a hole. The new permission separation code can help here, but OpenBSD still had a remote root exploit.

      2) You NEVER have any code running thats not in the default install. Means no Apache (which had a quickly patched hole recently), no configuring your system, cause as soon as you do, you're running other code. eg. you can configure telnet to run when it wasn't running in the default install. You can misconfigure OpenBSD just as easily as any other UNIX, it just starts with safer defaults.

      Code audits are like perimeter locks. It stops people from getting in. Security models are more like internal locks and safes. Once you get in, it limits what you can take. They aren't mutually exclusive.
  • There is something almost treasonous about a linux kernel hack whose documentation's primary format is msword+ppt. Particularly when the html links are broken.

  • by Laven ( 102436 ) on Wednesday July 24, 2002 @02:57PM (#3946354)
    ACL support was added to the kernel in Red Hat Limbo beta which will likely become Red Hat 8.0. They also include the command line tools to manipulate the ACL's.

    Read about it in the RELEASE-NOTES
    ftp://videl.ics.hawaii.edu/mirrors/redhat/linux/be ta/limbo/en/os/i386/RELEASE-NOTES [hawaii.edu]

  • by Anonymous Coward
    I say forget trying to patch up Linux, or OpenBSD and its exploitable SSH... try archetectures like the mac for trusted web servers taht are unbreakable based on historical evidence.

    The MacOS running WebStar as a server has never been exploited.

    In fact in the entire securityfocus (bugtraq) database history there has never been a Mac exploited over the internet remotely.

    That is why the US Army gave up on MS IIS and got a Mac with WebStar.

    I am not talking about BSD derived MacOS X (which already had a couple of exploits) I am talking about Mac OS 9 and earlier.

    Why is is hack proof? These reasons :

    1> No command shell. No shell means no way to hook or intercept the flow of control with many various shell oriented tricks found in Unix or NT

    2> No Root user. All mac developers know their code is always running at root. Nothing is higher (except undocumented microkernel stufff where you pass Gary Davidians birthday into certain registers and make a special call). By always being root their is no false sense of security.

    3> Pascal strings. ANSI C Strings are the number one way people exploit Linux and Wintel boxes. The mac avoids C strings historically in most of all of its OS. In fact even its roms originally used Pascal strings. As you know pascal strings are faster than C (because they have the length delimiter in the front and do not have to endlessly hunt for NULL), but the side effect is less buffer exploits.

    4> Stack return address positioned in safer location than intel. Buffer exploits take advantage of loser programmers lack of string length checking and clobber the return address to run thier exploit code instead. The Mac places return address infornt of where the buffer would overrun. Much safer.

    5 : Macs running Webstar have ability to only run CGI placed in correct lodirectoy cation and correctly file typed.

    6> Macs never run code ever merely based on how a file is named. ",exe" suffixes mean nothing. For example the file type is 4 characters of user-invisible attributes, along wiht many other invisible attributes, but these 4 bytes cannot be set by most tool oriented utilities that work with data files. For ecxample file copy utilities preserve launchable file-types, but JPEG MPEG HTML TXT etc oriented tools are physically incapable of creating an executable file. the file type is not set to executable for hte hackers needs. In fact its even more secure than that. A mac cannot run a program unless it has TWO files. The second file is an invisible file associated with the data fork file and is called a resource fork. EVERY mac program has a resource fork file containing launch information. It needs to be present. Typically JPEG, HTML, MPEG, TXT, ZIP, C, etc are merely data files and lack resource fork files, and even if the y had them they would lack launch information. but the best part is that mac web programs and server tools do not create files with resource forks usually.. TOTAL security.

    7> There are less macs, though there are huge cash prizes for craking into a MacOS based WebStar server. Less macs means less hacvker interest, butthere are millions of macs sold, and some of the most skilled programmers are well versed in systems level mac engineering and know of the cash prizes so its a moot point, but perhaps macs are never kracked because there appear to be less of them. (many macs pretend they are unix and give false headers to requests to keep up the illusion, ftp http, finger, etc).

    8> MacOS source not available traditionally, except within apple, similar to Microsoft source availability to its summer interns and such, source is rare to MacOS. This makes it hard to look for programming mistakes, but I feel the restricted source access is not the main reasons the MacOS has never been remotely broken into and exploited.

    Sure a fool can install freeware and shareware server tools and unsecure 3rd party addon tools for e-commerce, but a mac (MacOS 9) running WebStar is the most secure web server possible and webstar offers many services as is.

    One 3rd party tool created the only known exploit backdoor in mac history and that was back in 1995 and is not, nor was, a widely used tool. I do not even know its name.

    Other than that event ages ago, no mac web server has ever been rooted,defaced,owned,scanned,exploited, etc.

    I think its quite amusing that there are over 200 or 300 known vulenerabilities in RedHat over the years and not one MacOS 9.x or older remote exploit hack.

    Not one. And that includes Webstar and other web servers on the Mac.

    --- too bad the linux community is so stubborn that they refuse to understand that the Mac has always been the most secure OS.

    BugTraq concurs.
    • 1) Agreed

      2) No Root users? Bzzz...every user is a root user. This means if/when exploits do happen, the ability for them to ALWAYS be fatal is ALWAYS there.

      3) The #1 biggest reason why remote exploits will be rare. This, and only this, is the primary reason.

      4) Moot issue since pascal strings minimize that vast majority of these issues to begin with.

      6) Pretty much every real OS has this concept. Mac is hardly alone.

      7) True, being a minority does help. Other OS's play header tricks too. On the other hand, this also means much fewer selections in available applications which mean odds are automatically reduced in the number of possible exploits. Basically, zero applications means zero odds of being exploited. I think you can follow the logic from there.

      8) Security through obscurity can sometimes help but rarely is the solution. In fact, history proves that this often creates more problems than it fixes because fewer eyes ever see enough code to fix it before it becomes a problem.

  • grsecurity (Score:3, Informative)

    by bozoman42 ( 564217 ) on Wednesday July 24, 2002 @03:06PM (#3946415) Homepage
    It works marvellously when it works. Randomized pid, randomized sequence numbers, and soon to have ACL's that define resource limits on just about anything. Really powerful.

    When it works.

    I've been trying to run it on an SMP Xeon for a while now, and any time the machine exerts itself I have to go hit the big red button. And it's not really a machine I'd like to do "testing" on, so no, I won't help with debugging. What "testing" I've done so far has been nothing but infuriating.

    Another few tidbits: all the security in grsec basically completely prevents any JVM from running at all. Ditto UML. (Though UML may also have issues with SMP. But now that I've removed a big variable in my equation of horror...)

    Since Rusell Coker has package SELinux for Debian, I will definitely have to investigate that sometime in the near future. I think I'll rack some uptime first to bolster my self esteem. :)
    • Thats not true (about the JVM), you have to use the chpax utility to modify the properties of the ELF executable and the JVM works again.

      That's how I fixed it on my Grsecurity system.

    • You may want to look at the fnk (or cipherfunk) kernel tree (no this is not carried on kernel.org). The link at freshmeat for cipherfunk kernels [freshmeat.net] has connections for downloading and so on. His kernel tree contains the GRSecurity patches, a fair number of other patches (eg: FreeS/WAN), and any fixes he's made to get the lot running.

      Basically this guys motivation is security and stability. He puts the whole lot through a barrage of tests, and makes sure things work, or at least determines if there is a problem and makes note of it.
  • Systrace for *bsd (Score:3, Interesting)

    by numatrix ( 242325 ) on Wednesday July 24, 2002 @03:11PM (#3946464)
    I'm suprised no one has pointed out systrace [umich.edu] yet. Granted, it's not for linux, only OpenBSD and NetBSD at this point, but it seems to be a very promising move in the ACL world. As one other poster commented, the most difficult challenge with any heavily ACL'ed environment is configuring the ACL's and making sure you didn't miss something. It's an extremely tedious process that requires a lot of reloads until it's done right.

    Systrace eliminates much (but not all) of that initial trial period with a method of analyzing processes and watching what permissions for what resources they need and generating ACL's based on 'normal' use. This interactive mode ~greatly~ simplifies the otherwise length process of configuring the kind of security modules being discussed.
  • LIDS does a good job (Score:1, Informative)

    by Anonymous Coward
    This past January-June, I worked on a project involving LIDS. I was responsible for all the setup/maintenance. Setup for LIDS is extremely easy. The difficult part is setting up the ACL's. For a complex system with many daemons running, this might be a difficult task. Fortunately, you can find plenty of people who make their ACL lists public, so you can see how to setup common things such as Sendmail, Apache, SSH, etc. With a good ACL list, your box will be as secure as it can get. With constant attacks on our LIDS box, no one ever got total control. The one time we let someone get root (for research purposes), that person was not able to do anything (even root can be made to not have certain accesses). I highly recomend LIDS to anyone looking for a more secure linux.
  • by Animats ( 122034 ) on Wednesday July 24, 2002 @03:24PM (#3946556) Homepage
    LOMAC [nailabs.com] has some promise. They have a good idea: there are two integrity levels, high and low. Everything that comes in from the net is at low level, and can't affect anything that is at high level. Level is carried around with files, processes, etc. This severely limits what can be done from the outside.

    This has real potential for locked-down servers, kiosk systems, etc. It's a bit stringent for most desktops. But it's not too hard to use.

  • I used to run lids and grsecurity, but now I feel that the acl system in grsecurity is more powerful that that in lids.

    Grsecurity's non-acl options are awesome. No setup, and almost all programs work as before (execept some programs that nedd stack execution, but that is a piece of cace to fix.)

    BUT (and here comes my main point) the acl system (both in grsecurity and form my earlier experience from lids) needs more debugging. LIDS once released a version where you couldn't run (almost) any program because of the LD_LIBRARY flags, and grsecurity give me kernel panic every now and then. No problem on my system, it gives me and excuse for poking in the kernel source, but I would never use the acl on a production system.
  • I don't know the facts about Linux, specifically, but there is a push in the *BSD world for kernel security features to be incorporated as defaults.

    The only one I recall off the top of my head is "non-executable stacks" to keep stack overflow attacks from being quite as easy. I'm sure it has other advantages, as well.

    All this does is "raise the bar" for attackers. I'm assuming most of the Linux kernel security tweaks do the same.

  • LIDS != LSM (Score:2, Informative)

    by Great_Geek ( 237841 )
    It seems to me LSM (Linux Security Module) is the former SELinux (Security Enhanced Linux) from NSA. The LIDS (Linux IDS) is totally independent. The news is that LSM has been accepted into the development kernel tree.
  • chflags/chattr (Score:3, Informative)

    by chrysalis ( 50680 ) on Wednesday July 24, 2002 @04:29PM (#3947006) Homepage
    All these add-ons are nice, but you can easily have a very hardened server without installing nor patching anything. Linux, *BSD and probably other operating systems have extended fs attributes for ages.

    With standard commands like chflags (BSD) or chattr (Linux), you can mark files and directories read-only (immutable) or append-only.

    The point is that once you have a working system, and if you have local access to the console, you can set proper attributes to all your files.

    You then have the concept of "security levels". Once your box is in multi-user mode, the "security level" can increase, and a lot of thing will be refused by the kernel : changing firewall rules, access to kmem, to raw devices, etc. and changing extended attributes.

    So even if an attacker gets root access on your box, he won't be able to alter anything except some ever changing files (something that can be solved by using an NFS mount) . And the append-only log files are really nasty, because he won't be able to hide what he's doing. Patch your favorite shells to always log history files to an append-only file to get even more fun.

    On a properly configured box (that you have console access on), you must be able to run "rm -rf /" as root, and your system must still be up and running. No need for any integrity checker.

  • I wonder (Score:4, Interesting)

    by WetCat ( 558132 ) on Wednesday July 24, 2002 @04:31PM (#3947028)
    ... why nobody yet doesn't introduce file aging
    or shadowing techniques in Linux?
    What I mean:
    File aging:
    - If you don't use file for a week and you are now using it - that access to file go with a warning.
    - If you don't use file for a half year - your appication becomes terminated with diagnostic
    "File aging security access denied - file xxx"
    So programs that do anything unusual that you don't do regularly on your computer will be catched.
    File shadowing:
    - You can introduce a mask for a project so you'll not see any files that this project has no relation to
    and
    - Files that are not related to any project and not system accessed becomes removed to special storage. You then will not see that files in ls.
    If you access that file... then we go to file shadowing behavour...
    Is there anything similar developed?
  • http://www.rsbac.org
  • The NSA has a modification of Linux -- SE Linux -- at the kernel level. I believe its designed to deal with the very same buffer overflow issues which have given FS / OSS alot of bad press lately.
  • I've been using LIDS on various machines for between one and two years. It provides thorough protections which can make it harder for an attacker to compromise your machine and/or avoid detection.

    It does require an investment of time to get configured correctly. Essentially, it takes privileges away (the ability to bind to network ports, for example) and they must then be re-enabled for the specific programs that need them. Those programs must also be protected from write access to avoid an attacker modifying them to gain their privileges.

    Once configured, many of the standard ways that an attacker who gained access would elevate to root or modify system files are removed, and attempts to break security are logged. I have also found that it prevents some network attacks from working (e.g., wu-ftpd buffer overflow with the RH 6.2 default (vulnerable) version); this isn't (so far as I know) an advertised capability so I took it as a bonus.

    The biggest problem with LIDS is that it protects inodes, and needs to be manually kicked when file inodes update. So, for example, you can make your logs append only, grant logrotate the ability to rotate them, and then lose your append protections because the new log file has a different inode.

    In summary: Definitely an improvement in security, takes an investment of time to learn and configure, may impose administrative burden if used on a large number of hosts. Very useful for defending important or Internet-accessible resources (e.g., DMZ machines).

  • I swear by LIDS (Score:2, Interesting)

    by Brian Hatch ( 523490 )
    When configuring a machine to host www.HackingLinuxExposed.com, I was pretty paranoid. Chances are that it'd be a pretty appealing target, given it's purpose as a companion site for the book.

    I recompiled the kernel with LIDS, and turned off all the capabilities in the kernel, granting them on a program-by-program basis to the processes that actually needed them. In all, the lids.sh is probably 70-80 lines long (including comments) to get a fully functional webserver that allows Apache, inbound ssh, and outgoing email (for automated logging, just for grins.)

    It has been the target for attacks since it was put online. About ten script kiddies a day try to get in, and one or two clueful and determined individuals a day. (I'm not counting automated worms, etc, which aren't worth meantioning, given that most are looking for IIS and friends.)

    Thus far no one has gotten close, due mostly to the lack of available entry points (significant inbound and outbound IP restrictions.) However I gave the root password to a few associates and told them to break the system and they were unable to do anything interesting whatsoever, including even modifying the web content.

    If I had to do it today, with more options available to me, I'd give SELinux a whirl as well, but LIDS is still top notch - I don't have a single complaint.
  • Some kind fellow was running an SELinux box with a guest root account.

    The account was powerless. SELinux is a paranoid sys admin's dream. You have to specifically grant ifconfig permission to see properties on each interface. Ping needs raw sockets access granted for each interface it wants to send pings over. etc.

  • Absolutely necessary (Score:2, Interesting)

    by octogen ( 540500 )
    At least an authorizations/privilege security model instead of the anyone/root distinction is absolutely necessary.

    The problem is, that many daemons (like Sendmail and such) override *all* security - of course, this is absolutely unnecessary.
    For example, on Argus enhanced systems you run Sendmail with the pv_asn_port privilege instead of root privileges.
    If someone manages to hack Sendmail, then the attacker can do nothing else than just open port 25, while on other OSs (even OpenBSD) the attacker gains root privileges.
    Sendmail does not need root privileges to run, so why should we give Sendmail root privileges?

    One key to more security is the 'principle of least privilege'. Modern Unix Operating Systems like Trusted Solaris show, that it is possible to implement fine-grained privilege control in Unix kernels.

    Just securing a few dozens of applications (that's what the OpenBSD project calls OS security?) is not enough.
    What if I need to run some other application?

    An Operating System should be able to protect data even in the case, that an application gets hacked.

    Our real problem is 'root' - it should never be used for any kind of server application (daemon), but only for system administration by an authorized user. There should not be any permanent processes running as root.

    LIDS, the grsec patch, NSA's sample implementation of MAC and such things are steps into the right direction.

Math is like love -- a simple idea but it can get complicated. -- R. Drabek

Working...