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

 



Forgot your password?
typodupeerror
×
Linux Software

Unix-Based Application Specific Firewalls? 29

tengwar asks: "Under Windows I use a firewall (Zone Alarm) which can prevent individual applications from gaining Internet access, restricting them either to the local network or preventing any network access at all. This can be used to prevent Microsoft software and other trojans from calling home. I also restrict Outlook so that it can talk to my email server (which is on the local network), but can't pull remote content href'ed in a HTML email - helps with cutting the virus risk. I've also set it so that Internet Explorer has to ask for permission to access the Internet each time. I'm planning to move over to Linux as my main working environment, and I will probably want to use some Windows programs under Crossover - in particular I'll need Internet Explorer occasionally for getting to my banks, and I may need Outlook for work-related reasons. I'm not interested in iptables on the client (I think) as I've already got NAT and a hardware firewall guarding the network. Have you any suggestions on how to get the application-specific filtering that I get under Zone Alarm, for Linux?"
This discussion has been archived. No new comments can be posted.

Unix-Based Application Specific Firewalls?

Comments Filter:
  • I'm not too familiar with ZoneAlarm, but couldn't you use that as part of your "security" solution?

    You said you have the hardware firewall/NAT solution -- well, you've probably multiple boxes on the network. Why not make one of those the "zonealarm" passthru box, and control all packets in and out through there? (afterwhich, you could place the hardware firewall to protect this box....) Seems like the easiest solution to me.

    And yes, I know, some people probably don't have the spare hardware to do this.....
    • Yes, I've got multiple boxes (an alarming number when I count them!) but I don't think this is the solution. The problem is that ZA has to know which application is calling out, and that pretty well means it has to run on the same box as the application. If it's running on another box, I think it would only be able to identify the protocol and ports, and unfortunately many trojans call home on otherwise innocuous ports such as 80/tcp.
      • Eaxctly, simply put, zoneAlarm does not allow you do to that kind of "filtering when my box is routing".

        For example, if you want to allow that, you have to configure zoneAlarm with "low" security settings, wich opens up way too much holes to be of any usefulness security-wise.

        It's still going to block the trojan on the machine it runs, tough., but not much else

  • by MrEfficient ( 82395 ) on Wednesday November 13, 2002 @03:04PM (#4661851)
    If your bank's website won't work in Mozilla, then try Konqueror. You'll have to tell Konq to identify itself as IE on Windows for that particular website. I do this for capitalone.com which won't allow access from Mozilla.

  • Systrace (Score:3, Informative)

    by sir99 ( 517110 ) on Wednesday November 13, 2002 @03:06PM (#4661871) Journal
    You could probably hack something together with Systrace [umich.edu]. It's a BSD thing, but it looks like they're porting it to Linux as well. There's also Syscalltrack [sourceforge.net], but it doesn't look as ready yet, and I think it's aimed at Linux 2.5.x.

    I've thought of making something like ZoneAlarm on Linux myself, but felt it was more of a novelty than something useful, since I find my applications pretty trustworthy as it is.

  • iptables can do some (Score:5, Informative)

    by ctr2sprt ( 574731 ) on Wednesday November 13, 2002 @03:09PM (#4661916)
    iptables can do some of what you want, but not all. Still, it may get you close enough to get by (at least until you find a better option). There is an iptables module called "owner" that lets you perform various tests on the owner of a packet, including its "owning command" (creator process) if the kernel supports it. This still doesn't interactively query if you want to pass a connection, but at least you can hardcode in your basic rules:

    # iptables -A OUTPUT -m owner --cmd-owner outlook ! --dport 25 -m state --state NEW -j REJECT
    It's possible that someone has used that functionality, along with userspace iptables packet queueing, to do exactly what you want, but I haven't heard of it.
    • by DrZaius ( 6588 )
      This is the way to do it. IPTables is a very powerful tool.

      I'm sure if you were really interested, you could create another module that would pop up a window to prompt you if you wanted to allow the traffic through.

      Just stick a rule with it at the end of your OUTPUT chain. It would catch all new application traffic and you could use that to set up new rules to be inserted above this rule.

    • by cowbutt ( 21077 ) on Wednesday November 13, 2002 @06:11PM (#4663757) Journal
      You could also chown root.outlook the outlook binary, then use iptables' --gid-owner to apply rules to any process spawned by that binary.

      Also nice for proxies and network daemons too.

      --

  • by Futurepower(R) ( 558542 ) on Wednesday November 13, 2002 @03:12PM (#4661943) Homepage

    "... Microsoft software and other trojans..."

    Well, not trojans, just dependency: Windows XP Shows the Direction Microsoft is Going. [hevanet.com].
  • Unfortunately, no... (Score:4, Informative)

    by joto ( 134244 ) on Wednesday November 13, 2002 @03:20PM (#4662016)
    However, there exist some alternatives. User-mode linux [sourceforge.net] allows you to sandbox a collection of linux applications in a most efficient way. Effectively, you can restrict access to anything you like. However, it's still very much a work in progress (not actually getting user-mode linux to run, that is fine, but using it as a secure sandbox is).

    A more realistic alternative in the short term might be subterfugue [subterfugue.org], which allows you to intercept any system call, and make a configuration file for each program, to see which system calls they are allowed to perform. It is also a lot slower than a uml sandbox would be.

    But both are at the moment probably best described as hackers tools. They are not in any way comparably in convenience to windows application firewalls, but they have functionality that extends them. I'd be interested to hear about anyone with real experience in using any of these (or other tools) for similar purposes.

  • by PaddyM ( 45763 ) on Wednesday November 13, 2002 @03:44PM (#4662225) Homepage
    grep -i "access internet" *.src
    Change all these lines to "!access internet"
  • by smcv ( 529383 ) on Wednesday November 13, 2002 @05:18PM (#4663255) Homepage
    (Sorry about the cryptic subject line, there's not space)

    ZoneAlarm's niche doesn't seem to exist on Linux. The assumption is that you just don't run programs you don't trust - if you have firewall-config access, a sufficiently malicious program can always reconfigure it anyway (feeding keystrokes to your logged-in-as-root terminal? inserting a trojaned su or sudo binary into your $PATH?) and presumably the idea is that if a solution is fundamentally flawed, it's not worth implementing in the first place.

    Yes, in the Real World(tm) where companies are willing to be extremely unethical but unwilling to actually break the law or suffer the backlash from taking over people's computers, ZoneAlarm has its uses, but you can't really rely on it that heavily.

    iptables on the client doesn't have any specific protection against malicious apps, but you can constrain individual users' network access, and if you're running programs you're that paranoid about, you should probably be using a separate user ID for them anyway. (I keep meaning to set up one or more separate uids for WINEified games).

    Incidentally, I've heard Explorer/Internet Explorer is a bad thing to run under WINE, since it has been known to damage the fake Windows folder WINE uses (that, and it probably uses more undocumented API calls than most third-party Windows apps). Anyone care to confirm or deny this?
    • The latest Crossover Office from Codeweavers [codeweavers.com] supports IE 5.5. I've been running it for a while with fairly good results, and it doesn't seem to have broken anything in the "fake Windows" folder at all.
    • The assumption is that you just don't run programs you don't trust

      That's fair enough if you are running a locked-down server, but this is a replacement for my desktop machine - which means I'll have a fair number of programs on it (none which I'll specifically distrust). Zone Alarm turns up some odd stuff even with programs I'd be fairly confident about - for instance its just reported that Netscape 7 has asked to be a server (seems to be something to do with DNS in this case, so it may be innocuous).

      if you have firewall-config access, a sufficiently malicious program can always reconfigure it anyway (feeding keystrokes to your logged-in-as-root terminal? inserting a trojaned su or sudo binary into your $PATH?)

      Well I'm sort of assuming I'll exercise reasonable care in not leaving root access that easily available

      and presumably the idea is that if a solution is fundamentally flawed, it's not worth implementing in the first place.

      For my own desktop use, I'm more inclined to go for the ssh approach - accept some limits in security to allow it to be used more situations.

      Using a separate user ID is a good point - I'll just have to make sure it can't read outside it's own area (chroot should do).

  • I run linux at home, but the wife and kids still wanted to use windblows apps. instead of dual booting or running wine i use VMWare. It does have some issues, but if you do get a virus on it, remove the vm folder and reinstall from your back-ups.
  • by MonMotha ( 514624 ) on Wednesday November 13, 2002 @06:10PM (#4663747)
    For apps not running on the linux firewall itself, there's not much you can do as it's just network traffic like any other at this point. Any information regarding the app that generated it is only available from the system which created the traffic. However, creative use of the iptables string match may be useful, as could the queue target to queue the packet to userspace for further analysis.

    For applications running on the box itself, the "ownercmd" module in the patch-o-matic may be useful for matching the name of the process. Unfortunately there is no guarantee that an app just hasn't changed it's process name to fake a more "trusted" app, but the base functionality is there.

    I know this isn't exactly what you were looking for, as it uses iptables, but these are what I see as the options. Others may exist of course.
  • overkill?
    you already got a hw firewall. and want to police the the network activities of linux?

    Redhat has builtin firewalling to choose what can get accessed from out side. And a few other tools that you can download as well. Lets not forget config files that we can modify so they only listen to specif interfaces (127.0.0.1) etc...

    I know being secuurity minded isn't a bad thing but this seems over the top...
    • overkill? you already got a hw firewall. and want to police the the network activities of linux?

      No, not overkill. A hardware firewall (and NAT) is almost useless as a defence against something on your system calling out. Also I don't mind trusting Linux per se, but I don't want to place unnecessary trust in applications running under Linux.

  • Easier solution:
    Don't use MS products. Don't execute trojans. Don't run an application you don't "trust." Don't accept HTML mail, or don't click on the links.
    If your security is that crucial--that you have to allow your Internet browser ask permission to use the INTERNET, just unplug your network cable.

    Simplicity is nice.
    • Don't run an application you don't "trust."

      This isn't going to be a server - it's a desktop machine. As such I'll run a fair amount of stuff, some of it for fun, some to get a job done. It's not practical to skry the source, even it it's available: as you know, there have been a few Trojans imbedded in open source software recently which remained hidden for quite some time.

      If your security is that crucial--that you have to allow your Internet browser ask permission to use the INTERNET

      I probably wasn't clear on that. I only use IE for a few sites where I have to use it (yep, I've tried altering the UA string on other browsers). I normally use Opera and Netscape, and allow those free access. Given that IE seems responsible for half the security holes on the net, this doesn't seem overly paranoid!

      • Don't run an application you don't "trust." This isn't going to be a server - it's a desktop machine. As such I'll run a fair amount of stuff, some of it for fun, some to get a job done. It's not practical to skry the source, even it it's available: as you know, there have been a few Trojans imbedded in open source software recently which remained hidden for quite some time.
        We Get that it is a Desktop Machine, still only run things that you trust. You just use a wider definition of trust. Trust that everything from your distro providers is ok. Use things that apear to be widely used, if you are paronoid do a google search to see if anyone has complained. Google searchs lots of mailing lists.

        Other than that sense you do not want to use iptables on the client where it would be able to do what ZoneAlarm/BlackIce does. You can create a seperate acount to where the app will not be able to mess with things.

        Iptables could be used to block everything to every port and then open the ports for app. that you want to have access.

  • Good enough? (Score:3, Interesting)

    by cornice ( 9801 ) on Thursday November 14, 2002 @01:55AM (#4666304)
    I don't know how to get what you're after and a number of people have already addressed this with either warnings about this (flawed) method or solutions that are currently being developed but aren't quite ready for "The Desktop". Anyway, I think that you could accomplish enough of this with iptables and some scripts. You could lock down the system except when you need a particular service. Make a few icons on your desktop that open ports when you want to browse or send mail and icons that shut down the system when you're done. (You'll have to weigh the convenience of this against the suid exposure.) You could also have a script that scans the logs for outbound requests and flashes Zone Alarm style warnings at you. There is a nice article [ibm.com]
    by Daniel Robbins of Gentto fame over at Developerworks that discusses scripts for dynamic firewalls. The focus is on inbound blocks but it should be easy enough to block outbound as well. You could also use Win4Lin or VMWare for your windows stuff and then you would get another network device which would allow you to at least see what from what OS the request came from.


    Actually what I like best about Zone Alarm is the ability to lock down a system and then peal back the port restrictions as requests are made. It's a great way to make a firewall for those who don't want to deal with iptables (Yea, I'm sure it's flawed from an absolute security perspective but it's better that no firewall). I seem to remember a project similar to this for Linux from a few years ago but I can't remember what it was called...

Friction is a drag.

Working...