Slashdot Mirror


Additional Security in the Linux Kernel?

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?"

83 of 300 comments (clear)

  1. Additional Security by SpanishInquisition · · Score: 5, Funny

    Lock the door when you leave the computer room.

    --
    Je t'aime Stéphanie
    1. Re:Additional Security by dirvish · · Score: 3, Funny

      Remove the boot floppy from the disk drive.

    2. Re:Additional Security by Iguanaphobic · · Score: 2

      Remove the boot floppy from the disk drive.

      Remove the floppy drive.

      --
      Fascism should more properly be called corporatism, since it is the merger of state and corporate power.
    3. Re:Additional Security by _Sprocket_ · · Score: 2

      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.

    4. Re:Additional Security by zCyl · · Score: 2

      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.

    5. Re:Additional Security by Asprin · · Score: 2


      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.

      --
      "Lawyers are for sucks."
      - Doug McKenzie
    6. Re:Additional Security by CoolVibe · · Score: 2

      And disconnect it from the network. Oh better yet, leave it turned off...

    7. Re:Additional Security by martinflack · · Score: 2

      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.

    8. Re:Additional Security by martinflack · · Score: 2

      See if you can get some ideas by looking at section 3.7.1 in this doc:

      http://www.signaltonoise.net/library/Adv-Bash-Sc r- HOWTO/variables2.html

      I think you have a statement in your setup that you might need to alter.

  2. zerg by Lord+Omlette · · Score: 3, Funny

    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?

    --
    [o]_O
  3. I suggest vserver by WetCat · · Score: 5, Informative

    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.

    1. Re:I suggest vserver by Anonymous Coward · · Score: 2, Interesting

      Also check out User Mode Linux. 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).

    2. Re:I suggest vserver by WetCat · · Score: 2

      For RAW you need NET_CAP_RAW, this can be blocked by main server, not by you, by not giving you that CAP...
      You cannot change your address to anything but
      the list of allowed for your vserver...

    3. Re:I suggest vserver by jelle · · Score: 3, Informative

      Actually, I run Debian (woody) and I've been running a pristine RedHat7.2 install in a vserver on it for a couple of weeks now. I'm running two distributions in parallel. No more upgrading of distributions, just install new ones additionally. I can always still use the old version (as long as they all accept a common 2.4 kernel)

      howto? Simple, install redhat7.2 on an empty disk, and copy all the files including permissions to /vservers/01 (or mount the disk there).

      The vserver sources are easy to deb-make (man deb-make) (tip: "RPM_BUILD_ROOT=$(DESTDIR)" in the Makefile).

      "vserver 01 start" to boot rh72, and "vserver 01 enter" to enter it as root. edit the ListenAddress in /etc/ssh/sshd_config of your debian to only bind to one IP instead of 0.0.0.0, and then you can start an ssh in the rh72 vserver and there you are, as if you had an extra computer running rh72.

      (did I mention the whole thing is diskless remote boot too?)

      --
      --- Hindsight is 20/20, but walking backwards is not the answer.
  4. Current Project with PF_KEY by mrphish697 · · Score: 2, Informative

    I'm currently using OpenBSD in a work-related project. It's quite good, if not well documented.

    --
    You can't ride two horses with one ass
    1. Re:Current Project with PF_KEY by CoolVibe · · Score: 3, Informative

      Also, if you're condemned to Solaris, like me, then Pappillon is another option.

  5. Bastille by pauly_thumbs · · Score: 3, Funny

    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....

  6. LSM has been included in 2.5.27 by daserver · · Score: 5, Informative

    The Linux Security Model has been included in the upcomming 2.6

  7. Small thing... by Jetifi · · Score: 3, Informative

    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.

    1. Re:Small thing... by kylus · · Score: 5, Informative

      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) 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 ;) ).

      --
      --Kylus
      Idiot-proof something, and Life will build a better Idiot.
  8. St. Jude Kernel IDS by ActMatrix · · Score: 3, Interesting

    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 for more.

  9. Stack Guard by dusanv · · Score: 2, Interesting

    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.

    1. Re:Stack Guard by Lord+Omlette · · Score: 2

      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.

      --
      [o]_O
    2. Re:Stack Guard by mccrew · · Score: 2, Informative
      > I was wondering whether there are any similar products to StackGuard

      Um, how about libsafe?

      -Steve

      --
      Hey, Windows users, there is no such thing as "forward" slash, there is only slash and backslash.
  10. Neat Security Trick by CONTROL_ALT_F4 · · Score: 5, Interesting

    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.

    1. Re:Neat Security Trick by dohcvtec · · Score: 3, Insightful

      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.

      --
      -- Never hit a man with glasses. Hit him with a baseball bat.
  11. Re:Bastille - No Kernel Patches by RadioheadKid · · Score: 5, Informative

    Bastille Linux 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.

    --
    "Karma can only be portioned out by the cosmos." -Homer Simpson
  12. Stop writing code! by captain_craptacular · · Score: 5, Funny

    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.

    --
    They who would give up an essential liberty for temporary security, deserve neither liberty nor security
  13. Snort by Quantum+Singularity · · Score: 2, Informative

    There's a program called Snort that does packet sniffing and intrusion detection, among other things. It's at snort.org.
    That and good ol' P.G.P.

  14. ACLs by Black+Parrot · · Score: 5, Insightful

    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.

    --
    Sheesh, evil *and* a jerk. -- Jade
    1. Re:ACLs by WetCat · · Score: 5, Interesting

      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.

    2. Re:ACLs by MrResistor · · Score: 3, Insightful

      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.

      --
      Under capitalism man exploits man. Under communism it's the other way around.
    3. Re: ACLs by WetCat · · Score: 3, Insightful

      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.

    4. Re:ACLs by ts0003 · · Score: 5, Informative

      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.

    5. Re:ACLs by g4dget · · Score: 2
      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.

    6. Re:ACLs by g4dget · · Score: 2
      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.

    7. Re:ACLs by WetCat · · Score: 2

      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...)

    8. Re:ACLs by ts0003 · · Score: 3, Insightful

      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.

    9. Re:ACLs by g4dget · · Score: 2
      You are missing the point. Of course, you could somehow check even if GNU ls did't do that. The point is: it's one more thing to go wrong. And it's not just that people need to pay attention--security audit tools need to deal with this, and they need to be configured to interpret the ACLs correctly.

      ACLs just make things much more complex, in many cases unnecessarily so. And it certainly doesn't make things more secure.

    10. Re:ACLs by MrResistor · · Score: 2

      That's exactly what I said. That's why I put the 'dis' in parentheses. Personally, I have only used them for allowing access, but I put the (dis) in there to avoid a response saying "You know you can use them to prevent access, too."

      --
      Under capitalism man exploits man. Under communism it's the other way around.
  15. Re:It's a bit of a challenge, and one to be avoide by gwernol · · Score: 3

    This is such an obvious troll. What a shame it got modded up. Just a few of the more glaring errors:

    C, a language that provides no security features such as garbage collection

    In what sense is garbage collection a security feature? That makes no sense.

    It is a very sad fact, but logically Microsoft's programmers are smarter than those in open source, simply because they're able to earn more money

    That's not true at all. As someone who makes their living programming I can tell you that there are plenty of dumb commercial programmers and plenty of smart open source programmers. And vice versa. If you really wanted to be "logical" you'll understand that money earnt is not the same as skill. Plenty of people do highly skilled work without payment - ever heard of a hobby?

    go for an operating system controlled by one company, who knows what their code does, and how to fix it if it goes wrong. The only option, in that case, is Microsoft.

    Er... or Apple?

    Like I said, blatant troll.

    --
    Sailing over the event horizon
  16. Re:Simple security improvements by Budgreen · · Score: 2, Funny

    isn't this how M$ got NT certified?

    all the above steps.. maybe not in that order :)

    --
    The greatest right given is the right to be wrong...
  17. If you don't mind proprietary stuff... by MajorBurrito · · Score: 2, Informative

    ... you can try PitBull from Argus Systems. It's a very good product and free for non-commercial use (I think). If you can live without the source to their module.

  18. actually yes by johnjones · · Score: 2

    the major problem today is people useing tools

    to this end you can use a mac
    (big endian so defeats alot of stack smashing targeted at x86)

    use bsd
    (THE network stack -problems in MS TCP/IP stack have been solved years ago in BSD)

    and dont run any silly daemons

    http://www.

    does a nice job of sorting out things config wise where most problems live

    regards

    John Jones

  19. Re:User Mode Linux by WetCat · · Score: 2, Informative

    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.

  20. Re:FUD alert! by bgeiger · · Score: 2, Interesting

    Isn't this ingenious? Taking potshots at Linux by appearing to support it? ...clients are willing to reduce their servers' feature set, flexibility, and ease of maintainence by switching from Win2k...

    I won't rehash the manyfold reasons you're wrong about those assertions (it's been discussed to death already), but I will point out that you're wrong, and you're just trolling. Knock it off.

    Besides, while Linux's security is excellent, it can (and should) be improved. It's good, but by no means perfect. (It's much better than anything M$ can put out, though.)

    --
    o/~ All God's children shall be free in Pirates of the Caribbean, when we reach that Magic Kingdom in the sky... o/~
  21. use only trusted code by Pegasus · · Score: 3, Informative
    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 will probably get you there in the quickest way.

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

    1. Re:use only trusted code by cant_get_a_good_nick · · Score: 2

      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.

  22. Re:security by RinkSpringer · · Score: 3, Informative

    From http://www.trustedbsd.org:

    The TrustedBSD project provides a set of trusted operating system extensions to the FreeBSD operating system

    In other words, it's not an OS, it's a set of patches and extensions... please, check your facts before you post something.

  23. Re:It's a bit of a challenge, and one to be avoide by jc42 · · Score: 2, Interesting

    > go for an operating system controlled by one company, who knows what their code does, and how to fix it if it goes wrong. The only option, in that case, is Microsoft.

    Er... or Apple?


    Yeah. Or, for that matter, RedHat.

    And with RedHat (or any of the other linux vendors), not only do they know what their code does, but there are also thousands of programmers scattered around the world who know a lot about it.

    So if you have a problem, you don't have to beg and plead with a disinterested CS department of a giant corporation. You don't even have to deal with your vendor.

    If it's a small problem, you can probably hire one or two of the linux hackers at your local college. For bigger projects that take experience, you can hire a few of the local linux professionals.

    You'll be up and running in far less time than it takes to persuade Microsoft to support your needs.

    --
    Those who do study history are doomed to stand helplessly by while everyone else repeats it.
  24. ACL's in Red Hat Limbo beta by Laven · · Score: 5, Interesting
    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

  25. Adding LIDS to a firewall... / SELinux by dpilot · · Score: 2

    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.)

    --
    The living have better things to do than to continue hating the dead.
    1. Re:Adding LIDS to a firewall... / SELinux by dubl-u · · Score: 2

      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.

  26. grsecurity by bozoman42 · · Score: 3, Informative

    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. :)

  27. Systrace for *bsd by numatrix · · Score: 3, Interesting

    I'm suprised no one has pointed out systrace 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.

  28. Use a stylesheet by KMSelf · · Score: 2

    Sample here.

    --

    What part of "gestalt" don't you understand?

  29. Re:Neat Security -- just stupid.. use a mac by RzUpAnmsCwrds · · Score: 2

    So why aren't we all using Mac OS for webservers? (excluding OS X)

    - It's a major PITA to do any kind of remote management. While the lack of a command prompt may make it hard to hack, it also makes it nearly impossible to administer remotely (unless you resort to a VNC-like solution, in which case you are subject to all the flaws of that solution)

    - Macs are expensive. Look at XServe. Look at comparable Linux servers. XServe is expensive.

    - Lack of software: Mac OS wasn't traditionally a server OS, so many of the tools that we know and love in Linux and even Win32 are missing

    - Mac OS 9 Sucks: Memory management, swap maangment, networking, etc. Mac OS 9 makes Windows 98 look like a reliable, stable system.

    This is not to say that Mac OS doesn't have a place as a server. For applications where security is critical and remote access, cost, or performance isn't a priority, it's certainly a viable option. It's perfect for the Army: cost and performance are not issues (they have a $300 billion/year budget, and if it's too slow they can just invest in better hardware), but security is a MUST.

  30. LOMAC - Perl tainting for Linux by Animats · · Score: 3, Interesting
    LOMAC 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.

  31. Not funny - Sad!!!!!! by hughk · · Score: 2

    Unfortunately this seems to have been the principle result of Microsoft's much vaunted house-keeping. Net result does not seem to be a reduction in the number of existing security bugs.

    --
    See my journal, I write things there
    1. Re:Not funny - Sad!!!!!! by felipeal · · Score: 2

      Not sad - sarcastic (and hence funny :)

  32. Re:MacOS far more secure than LINUX, proof is BugT by GooberToo · · Score: 2

    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.

  33. debugging security patches by Goodbyte · · Score: 2, Interesting

    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.

  34. BSD is concerning itself with kernel security by c13v3rm0nk3y · · Score: 2, Informative

    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.

    --
    -- clvrmnky
    1. Re:BSD is concerning itself with kernel security by __past__ · · Score: 2

      One nice project is TrustedBSD, parts of which will appear in FreeBSD 5.0.

    2. Re:BSD is concerning itself with kernel security by cant_get_a_good_nick · · Score: 2

      Linus used to refuse the non-executable stack patch. Scattered discussions make it seem he's opening to it. I see his point that it doesn't prevent all smashes, but it makes it harder. You might as well take what you can get.

      Solaris has had this ability since 2.6, but you an bypass this. I'm not so sure you could do this with a remote exploit tho, it seems you may need soem code running locally, so it would help agaisnt remote exploits, but not local.

  35. LIDS != LSM by Great_Geek · · Score: 2, Informative

    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.

  36. The less you know, the more money you make. by cpeterso · · Score: 2
    1. time = money
    2. knowledge = power
    3. power = work / time
    4. knowledge = work / money
    5. knowledge * money = work
    6. money = work / knowledge
    7. therefore, as knowledge --> 0, money --> infinity!
    QED


  37. I am surprised noone's mentioned it yet by Salsaman · · Score: 2

    www.kerneli.org

  38. chflags/chattr by chrysalis · · Score: 3, Informative

    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.

    --
    {{.sig}}
    1. Re:chflags/chattr by someonehasmyname · · Score: 2, Interesting

      in FreeBSD you have a "kernel security level" man securelevel

      The kernel runs with four different levels of security. Any super-user process can raise the security level, but no process can lower it. The security levels are:

      -1 Permanently insecure mode - always run the system in level 0 mode. This is the default initial value.

      0 Insecure mode - immutable and append-only flags may be turned off. All devices may be read or written subject to their permissions.

      1 Secure mode - the system immutable and system append-only flags may not be turned off; disks for mounted filesystems, /dev/mem, and /dev/kmem may not be opened for writing; kernel modules (see kld(4)) may not be loaded or unloaded.

      2 Highly secure mode - same as secure mode, plus disks may not be opened for writing (except by mount(2)) whether mounted or not. This level precludes tampering with filesystems by unmounting them, but also inhibits running newfs(8) while the system is multi-user. In addition, kernel time changes are restricted to less than or equal to one second. Attempts to change the time by more than this will log the message ``Time adjustment clamped to +1 second''.

      3 Network secure mode - same as highly secure mode, plus IP packet filter rules (see ipfw(8) and ipfirewall(4)) cannot be changed and dummynet(4) configuration cannot be adjusted.

      --
      Common sense is not so common.
    2. Re:chflags/chattr by doorbot.com · · Score: 2

      What stops an attacker with root privs from removing the attributes?

      I may have misunderstood chrysalis, but the attributes can only be changed in single user mode. So you absolutely have to have local console access to set (or change) the attributes. But at that point you've got physical security issues which outweigh any sort of ACL/attribute-based protections you have.

  39. Security != Security? by FreeUser · · Score: 2

    Patching the Linux kernel (grsecurity, etc.) and implimenting ACLs is one level of security enhancement one can emply.

    Userspace hardening (e.g. Bastille) is another.

    Virtual servers sounds like an interesting approach as well (virtual servers running a grsecured, hardenend system anyone?)


    But, security for things like web services do not end with kernel patches or even userspace hardening utilities.

    As [...] noted here, the 'security' of Slashdot's moderation system has been shot to hell (astroturfers of various ilks, most commonly but not exclusively Microsoft paid lackeys, and outright trolls are posting at +2 and being granted moderator priveleges on a daily basis). As to whether the above troll you reference was moderated up by trolls, Microsoft Astroturfers, or a combination is anyone's guess.

    The fix is obviously for the slashdot editors to begin creating a web of trust in a similar fashion to how GPG/PGP keys are managed (complete with revokation if that trust is abused). Initially only the slashdot moderators and some well known friends of theirs would be in the ring of trust, then gradually others (based upon posting content, relationships, what have you). This would at least allow the Astroturfers and trolls to have their moderation and/or +2 posting priveleges removed when they do occasionally slip through.

    In the meantime, until such an approach is taken, I'm afraid the astroturfers and trolls will continue to abuse the moderation system for the foreseeable future. Numerical benchmarks such as karma simply do not cut it when trying to filter for quality of content, discussion, moderation, and meta-moderation.


    Slashdot security in a discussion of security now rates a -3 Offtopic?

    So, by pointing out that security for a web server doesn't stop at kernel patches, and pointing to a real world example to underscore that point (this very site), the comment is somehow now offtopic? I think this thread makes the aforementinoed example even more pointed than it already was.

    Or is self-criticism now a taboo subject on this forum? Remarkable.

    --
    The Future of Human Evolution: Autonomy
  40. Re:Bastille - No Kernel Patches by mkettler · · Score: 2

    I wouldn't say it secures *nothing*. In fact, I'd say it secures a lot of things many people don't even think about. But you are right, it's not as strong in the "prevent the buffer overflows" category, and most of the things it does a good admin would do by hand anyway.

    It's got some pretty good file permission changes that work very well for server environments. And yes, file permissions really do matter. Even on the simplest level it will ask you to remove SUID permissions from ping, dump, traceroute, at, etc. I know for sure there's been at least one local user -> root user exploit for dump that would be foiled if it were non-suid. There was even one this year for at which allowed the same privilege elevation on RedHat versions prior to 7.2:

    http://rhn.redhat.com/errata/RHSA-2002-015.html

    Of course, a good admin should go through and audit which files are SUID him or herself and kill off ones which aren't used by non-root users. But this makes it a bit easier.

    And yes, removing the SUID bits does make fewer commands available to non-root users, but let's face it, do non-root users really need to be able to run traceroutes and backups from your webserver?

    --
    -Matt
  41. Re:It's a bit of a challenge, and one to be avoide by dubl-u · · Score: 2
    Generally, the guy your beating on needs to be whacked. But this makes sense:

    C, a language that provides no security features such as garbage collection
    In what sense is garbage collection a security feature? That makes no sense.

    It's not garbage collection as much as direct memory access and management. In C, it's very easy to accidentally write something that allows for the execution of arbitrary code. In Java, it's very hard.

    This is similar to the way one should write banking code. For most of the programmers, there should be no way to add money to an account or remove money from an account. Instead, you just give them an API that allows transfers. That way you eliminate a whole class of possible errors.

    The OP's confusion probably comes from the fact, that once you remove free(), garbage collection is the common solution.
  42. Re:grsecurity - fnk kernel tree by Cef · · Score: 2

    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 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.

  43. Re:nsa linux (selinux) by Abreu · · Score: 2

    Any Open source proyect with more than n lines of code is for almost all practical purposes equally suceptible to backdoors if you dont trust the provider.

    Where n is a number that varies depending on the computer language used, the coding styles enforced, the number of people reading the code, etc, etc, etc...

    --
    No sig for the moment.
  44. SELinux is the solution for the paranoid by defile · · Score: 2

    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.

  45. Re:seems that EVERYTHING by karlm · · Score: 2

    Ehh... any idea how long most Mac or MS software is in development before it's made public? The main difference you see is that 1) most projects at Sourceforge are public even in the pre-pre-pre-alpha stage and 2) the realease-soon, release-often model looks like continuous change when compared to the snapshots you get every two years from MS. In reality, very few software projects, commercial or otherwise, ever declair themselves to be the pinacle of software completeness. Also, very few OSS projects ever officially cancel themselves, so you may see a lot of dormant projects that would have been canceled pre-beta at MS.

    --
    Copyright Violation:"theft, piracy"::Anti-Trust Violation:"thermonuclear price terrorism"<-Overly dramatic language.
  46. Absolutely necessary by octogen · · Score: 2, Interesting

    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.

  47. NFS (Re:ACLs) by osolemirnix · · Score: 2
    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.

    --

    Idempotent operation: Like MS software, wether you run it once or often, that doesn't make it any better.
    1. Re:NFS (Re:ACLs) by g4dget · · Score: 2
      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).

  48. Not specific to FreeBSD by chrysalis · · Score: 2

    This is not specific to FreeBSD. Every BSD variant has this feature for ages AFAIK.

    --
    {{.sig}}
  49. forgot to mention this... by jelle · · Score: 2

    for those actually following this as a guideline (if anybody): I forgot to mention: make a /etc/vservers/01.conf and you need IP aliasing support in the kernel (and of course a kernel with the vservers/ctx patch).

    --
    --- Hindsight is 20/20, but walking backwards is not the answer.