LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-26-2005, 07:54 PM   #1
Vgui
Member
 
Registered: Apr 2005
Location: Canada
Distribution: Slackware
Posts: 496

Rep: Reputation: 31
Why even use a firewall?


Hi all,
I've been using Shorewall as a firewall for my Slackware install (as a reflex I installed it). After a while, I realized why use a firewall? Let me explain...
Firewalls (as I understand) are basically a front for iptable rules. I don't understand why a port needs to be blocked if there is nothing running on that port? If no services are running on the computer, is a firewall even needed?
What about using iptables and basically saying "deny everything, except let X, Y, Z service through". In the end, do firewalls just do this?
Any ideas / discussion would be great on this, as over time I've been wondering more and more...
 
Old 10-26-2005, 08:18 PM   #2
Moloko
Member
 
Registered: Mar 2004
Location: Netherlands
Distribution: Debian
Posts: 729

Rep: Reputation: 30
Since there is no spyware for Linux I don't think it's usefull to make iptables application based. There are some projects about this though.

Opening some ports and close the rest is a normal practice. If you open port 80 the security on that port depends upon how secure Apache or another webserver is.

With hosts.allow and hosts.deny you can configure services as well. This should be secure already. I do have a tight firewall, but I use a NAT router, so I needed iptables anyway.
 
Old 10-26-2005, 10:04 PM   #3
IBall
Senior Member
 
Registered: Nov 2003
Location: Perth, Western Australia
Distribution: Ubuntu, Debian, Various using VMWare
Posts: 2,088

Rep: Reputation: 62
iptables is a firewall (sort of). Programs like shorewall and Guarddog are frontends that create iptables rules.

It is a good idea to have a correctly setup firewall, because that just adds an extra level of security. As I understand it, you don't need to have an application listening to a port for that port to be vulnerable. You are right that it is best not to have unnesesary services running. For example, why run Apache if you don't want a web server.

--Ian
 
Old 10-26-2005, 11:16 PM   #4
amosf
Senior Member
 
Registered: Jun 2004
Location: Australia
Distribution: Mandriva/Slack - KDE
Posts: 1,672

Rep: Reputation: 46
I run a separate firewall (smoothwall) router box. That way I can have interal ports open, file sharing, ssh, etc, but have it all firewalled to the internet. I just open the ports I actually need open...
 
Old 10-26-2005, 11:20 PM   #5
tkedwards
Senior Member
 
Registered: Aug 2004
Location: Munich, Germany
Distribution: Opensuse 11.2
Posts: 1,549

Rep: Reputation: 52
You usually do have to have an appliction running on a port for it to be vulnerable, although its possible if there was a kernel vulnerability that you'd be exposed. The reason you always run a firewall is that its far easier and more reliable to just have shorewall configure iptables to say 'deny all incoming connections from the net' than it is to strip your machine down to almost nothing running in order to make sure no ports are being listened on.
 
Old 10-26-2005, 11:50 PM   #6
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
Yes, iptables is a packet filtering firewall.

You can run no services and have nothing listening on your service ports, thereby keeping them closed. Ok, that's one approach. Personally, the firewall does not take up much in the way of resources, and humans are known to err occasionally, so I run a firewall.
 
Old 10-27-2005, 12:43 AM   #7
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
Quote:
Originally posted by Moloko
With hosts.allow and hosts.deny you can configure services as well. This should be secure already.
Take note that not all applications are compiled or configured by default to use hosts.allow and deny and won't always work. A firewall in place is the better option or action to take to fully secure your system.
 
Old 10-27-2005, 12:50 AM   #8
Vgui
Member
 
Registered: Apr 2005
Location: Canada
Distribution: Slackware
Posts: 496

Original Poster
Rep: Reputation: 31
Hmm, some interesting replies, the kernel vulnerabilities was particularily interesting, as I didn't know a non-listening and non-closed port could still be a security issue.
The main thing I am trying to see is if firewalls are just used...sort of as a reflex, or "just because", or "just in case", especially if the person has moved from Windows to Linux, where not having a firewall would be unthinkable.
Using Shorewall (or another firewall) wasn't an issue of resources, it was just if it was truly needed or if everoyne just did it because everyone else was. It's too bad that a simple iptables scheme wouldn't be as effective.
Thanks for the answers everyone, keep the opinions and ideas coming!
 
Old 10-27-2005, 02:00 AM   #9
danimalz
Member
 
Registered: Jul 2005
Location: West Coast South, USA
Distribution: debian 3.1
Posts: 267

Rep: Reputation: 36
Another reason to use a firewall....

Im not an expert, at all and please everyone point out any errors in my thinking here...

From what I know, a lot of hackers (really 'crackers') out there today use automated searches, or 'scans' to identify potentially vulnerable machines. These are very, very simple 'sweeps' of blocks of IP addresses, and yours may be one of them at any given moment. The feedback from these scans are recorded and the cracker will then analyze this data and discard or keep any particular address for later attacking based on the revealed vulnerabilities.

Now, these types of scans (read up on nmap) will return different results based upon the type of scan, and the state of the machine using the IP address being scanned. For example, if you are running an IPTables-based firewall set to 'drop' all packets from the outside, then the cracker's scan wont even know that there's a computer living at that address. Very likely, the cracker will not be interested in this particular IP address and will discard it. However, a computer that is not firewalled may respond in predictable ways to certain types of scans even if there are no services running on the targeted machine. This type of return data may not appear very promising to a cracker, but he has gained at least the knowledge that there's something there - ie. a live computer. So perhaps this simple clue will be enough for the cracker to store your ip address for later, more sophisticate eavesdropping. And perhaps in the meantime you've started, then forgot to stop an FTP server. See?

Really though, it is so easy to run a simple firewall on a desktop machine - shame on anyone who isn't doing so and gets hacked.
 
Old 10-27-2005, 02:06 AM   #10
dudeman41465
Member
 
Registered: Jun 2005
Location: Kentucky
Distribution: Debian
Posts: 794

Rep: Reputation: 56
Linux kicks all azz. I use shorewall just for safety's sake because while there is no spyware/adware and very very few viruses for linux, I still like to have that one extra precaution so I installed clam antivirus and turned off every port on shorewall. I can still connect to anything I want but the only service that will allow incoming connections is bit torrent. It just makes my linux box kick even more butt.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
BSD Firewall vs Linux Firewall ? rootlinux Linux - Security 5 08-29-2007 07:38 AM
Firewall lets ips which are not in the firewall ... why ? sys7em Linux - Networking 2 06-30-2005 12:50 PM
Firewall with features of a Sidewinder firewall? abcampa Linux - Security 4 04-22-2005 04:24 PM
slackware's /etc/rc.d/rc.firewall equivalent ||| firewall script startup win32sux Debian 1 03-06-2004 09:15 PM
Firewall Builder sample firewall policy file ? (.xml) nuwanguy Linux - Networking 0 09-13-2003 12:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:53 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration