Wilders Security Forums  

Go Back   Wilders Security Forums > Software, Hardware and General Services > all things UNIX
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread
  #1  
Old May 14th, 2010, 11:26 AM
apathy's Avatar
apathy apathy is offline
Frequent Poster
 
Join Date: Dec 2004
Location: 9th Circle of Hell(Florida)
Posts: 366
Cool Firewall in Linux: Needed or Not?

For years I ran Linux boxen with zero firewall but didn't have ssh enabled.
If I had anything like vnc enabled it was enabled only for my private virtual network. I have never once seen someone access my boxes so what's your opinion? Firewall or no firewall?
__________________
Setup For My Lenovo Ideapad Z575 12992KU
OS: Opensuse 12.3(KDE)

Spideroak | Nvpy | syncBackup(Rsync) | AirVPN | Glippy | Clementine | Thunderbird | Chromium w/ Vimium | Autokey | LFTP
  #2  
Old May 14th, 2010, 11:31 AM
linuxforall linuxforall is offline
Very Frequent Poster
 
Join Date: Feb 2010
Posts: 2,100
Default Re: Firewall in Linux: Needed or Not?

If you are behind a NAT router, you don't need one, if not you definitely need to enable IP chains either by CLI or via a GUI like GUFW etc.
__________________
Ubuntu, Chakra with Opera and Chromium
Perpetually learning Linux novice, rank amateur.
  #3  
Old May 14th, 2010, 11:58 AM
Mrkvonic Mrkvonic is online now
Linux Systems Expert
 
Join Date: May 2005
Posts: 7,467
Default Re: Firewall in Linux: Needed or Not?

Depends what you're doing. If your machine is a world-open server of some kind, some sort of access control should be in use. If not, you probably don't have any services listening to external interfaces, so you might not need one.
Mrk
__________________
http://www.dedoimedo.com

All your base are belong to us

Linux Systems Expert / Systems Programmer, Linux System Administrator, LPIC-1, LPIC-2 (WIP), GSEC, CCHD, CCHA
  #4  
Old May 14th, 2010, 12:12 PM
apathy's Avatar
apathy apathy is offline
Frequent Poster
 
Join Date: Dec 2004
Location: 9th Circle of Hell(Florida)
Posts: 366
Default Re: Firewall in Linux: Needed or Not?

Only outside connections I ever get are through Dropbox and Transmission(torrent client).

I may have attempt to setup a firewall that allows my torrents to work properly and allows me to feel somewhat safe.
__________________
Setup For My Lenovo Ideapad Z575 12992KU
OS: Opensuse 12.3(KDE)

Spideroak | Nvpy | syncBackup(Rsync) | AirVPN | Glippy | Clementine | Thunderbird | Chromium w/ Vimium | Autokey | LFTP
  #5  
Old May 14th, 2010, 12:15 PM
NoIos NoIos is offline
Frequent Poster
 
Join Date: Mar 2009
Posts: 607
Default Re: Firewall in Linux: Needed or Not?

Correct me if I'm wrong but iptables is there anyway. So firewall rules are ON even if the user does not notice. So there is a firewall and installed by default.

On servers iptables is there and it's a great tool. Usually there is an addition of an intrusion detection system like Snort and often some other software that makes the management of the iptables rules easier.

For almost all the desktop distributions I believe default installation includes iptables.
  #6  
Old May 14th, 2010, 12:22 PM
Mrkvonic Mrkvonic is online now
Linux Systems Expert
 
Join Date: May 2005
Posts: 7,467
Default Re: Firewall in Linux: Needed or Not?

Some distros ship with iptables enabled, others with disabled. The only questions are whether the module is turned on/off and what kind of rules are configured by default.
Mrk
__________________
http://www.dedoimedo.com

All your base are belong to us

Linux Systems Expert / Systems Programmer, Linux System Administrator, LPIC-1, LPIC-2 (WIP), GSEC, CCHD, CCHA
  #7  
Old May 14th, 2010, 12:38 PM
NoIos NoIos is offline
Frequent Poster
 
Join Date: Mar 2009
Posts: 607
Default Re: Firewall in Linux: Needed or Not?

Quote:
Originally Posted by Mrkvonic
Some distros ship with iptables enabled, others with disabled. The only questions are whether the module is turned on/off and what kind of rules are configured by default.
Mrk

Sincerely, most of the distros I have used have iptables installed and on with basic rules.
  #8  
Old May 14th, 2010, 01:45 PM
Mrkvonic Mrkvonic is online now
Linux Systems Expert
 
Join Date: May 2005
Posts: 7,467
Default Re: Firewall in Linux: Needed or Not?

The basic rule is default deny, but that says nothing about services that need to listen, e.g. ssh, samba etc, in which case the usage of firewall becomes relevant.
Mrk
__________________
http://www.dedoimedo.com

All your base are belong to us

Linux Systems Expert / Systems Programmer, Linux System Administrator, LPIC-1, LPIC-2 (WIP), GSEC, CCHD, CCHA
  #9  
Old May 14th, 2010, 01:51 PM
lotuseclat79 lotuseclat79 is offline
Very Frequent Poster
 
Join Date: Jun 2005
Posts: 1,958
Default Re: Firewall in Linux: Needed or Not?

Quote:
Originally Posted by NoIos
Correct me if I'm wrong but iptables is there anyway. So firewall rules are ON even if the user does not notice. So there is a firewall and installed by default.

On servers iptables is there and it's a great tool. Usually there is an addition of an intrusion detection system like Snort and often some other software that makes the management of the iptables rules easier.

For almost all the desktop distributions I believe default installation includes iptables.
Hi NoIos,

Correction: iptables and netfilter ship with the Linux kernel, but unless you initialize a set of iptables rules after bootup (hopefully before you turn on your router), then, in effect, it is as if there is no firewall between the router and your computer, although, there may be a firewall implemented by the router between it and the Internet.

-- Tom
  #10  
Old May 14th, 2010, 01:55 PM
NoIos NoIos is offline
Frequent Poster
 
Join Date: Mar 2009
Posts: 607
Default Re: Firewall in Linux: Needed or Not?

Quote:
Originally Posted by Mrkvonic
The basic rule is default deny, but that says nothing about services that need to listen, e.g. ssh, samba etc, in which case the usage of firewall becomes relevant.
Mrk

Ok, although most of those "risky" services are off or they don't "face" the outside world for the default desktop installations, I just wanted to point with my posts that a firewall exists and it's there. So the initial question of this thread gets a reply: You don't have to install a firewall specially on desktop distros because there is one already there.
They just have to use it. There are GUIs that make this easier but the firewall is there and it's powerful.
  #11  
Old May 14th, 2010, 02:02 PM
NoIos NoIos is offline
Frequent Poster
 
Join Date: Mar 2009
Posts: 607
Default Re: Firewall in Linux: Needed or Not?

Quote:
Originally Posted by lotuseclat79
Hi NoIos,

Correction: iptables and netfilter ship with the Linux kernel, but unless you initialize a set of iptables rules after bootup (hopefully before you turn on your router), then, in effect, it is as if there is no firewall between the router and your computer, although, there may be a firewall implemented by the router between it and the Internet.

-- Tom

Hi, I appreciate this. I believe most of the distros initiate iptables with some basic rules, so I think this is not the case. But please provide any more infos you have or examples. I'll be glad to learn more and get informed. Thanks.
  #12  
Old May 14th, 2010, 02:21 PM
Gullible Jones
 
Posts: n/a
Default Re: Firewall in Linux: Needed or Not?

Many distros ship with iptables installed but not enabled by default. On laptops or anything else not behind a NAT router, I'd enable it.
  #13  
Old May 14th, 2010, 02:27 PM
Ocky's Avatar
Ocky Ocky is offline
Very Frequent Poster
 
Join Date: May 2006
Location: George, S.Africa
Posts: 2,538
Default Re: Firewall in Linux: Needed or Not?

Quote:
Originally Posted by NoIos
Hi, I appreciate this. I believe most of the distros initiate iptables with some basic rules, so I think this is not the case. But please provide any more infos you have or examples. I'll be glad to learn more and get informed. Thanks.
The way I see it is that the iptables have to first be 'engaged' so to speak. Check with the command sudo iptables -nL. If you get a whole lot of entries they are 'engaged'
Chain INPUT (policy DROP)
target prot opt source destination
ufw-before-logging-input all -- 0.0.0.0/0 0.0.0.0/0
ufw-before-input all -- 0.0.0.0/0 0.0.0.0/0
ufw-after-input all -- 0.0.0.0/0 0.0.0.0/0
ufw-after-logging-input all -- 0.0.0.0/0 0.0.0.0/0
ufw-reject-input all -- 0.0.0.0/0 0.0.0.0/0
ufw-track-input all -- 0.0.0.0/0 0.0.0.0/0

Chain FORWARD (policy DROP)
target prot opt source destination
ufw-before-logging-forward all -- 0.0.0.0/0 0.0.0.0/0
ufw-before-forward all -- 0.0.0.0/0 0.0.0.0/0
ufw-after-forward all -- 0.0.0.0/0 0.0.0.0/0
ufw-after-logging-forward all -- 0.0.0.0/0 0.0.0.0/0
ufw-reject-forward all -- 0.0.0.0/0 0.0.0.0/0

Chain OUTPUT (policy ACCEPT)
target prot opt source destination
ufw-before-logging-output all -- 0.0.0.0/0 0.0.0.0/0
ufw-before-output all -- 0.0.0.0/0 0.0.0.0/0
ufw-after-output all -- 0.0.0.0/0 0.0.0.0/0
ufw-after-logging-output all -- 0.0.0.0/0 0.0.0.0/0
ufw-reject-output all -- 0.0.0.0/0 0.0.0.0/0
ufw-track-output all -- 0.0.0.0/0 0.0.0.0/0

Chain ufw-after-forward (1 references)
target prot opt source destination
etc.etc..........

And for settings you made eg.
sudo ufw status
Status: active

To Action From
-- ------ ----
135,139,445/tcp DENY Anywhere
137,138/udp DENY Anywhere
22 DENY Anywhere
__________________
Ubuntu Kubuntu Xubuntu Scientific Linux
  #14  
Old May 14th, 2010, 02:36 PM
NoIos NoIos is offline
Frequent Poster
 
Join Date: Mar 2009
Posts: 607
Default Re: Firewall in Linux: Needed or Not?

Thanks Ocky. I agree with your post, although I have to admit that I don't understand the "engaged" thing. If the iptables module is loaded then I think iptables works.

lsmod | grep ip_tables
and then
iptables -L

should be the proof. Am I wrong?
  #15  
Old May 14th, 2010, 02:43 PM
Ocky's Avatar
Ocky Ocky is offline
Very Frequent Poster
 
Join Date: May 2006
Location: George, S.Africa
Posts: 2,538
Default Re: Firewall in Linux: Needed or Not?

They are enabled by default, but all traffic is allowed. However there aren't any listening services running by default that could accept remote connections, so all ports are effectively closed, even with iptables allowing all traffic.

That's the way I see it.
__________________
Ubuntu Kubuntu Xubuntu Scientific Linux
  #16  
Old May 14th, 2010, 02:57 PM
NoIos NoIos is offline
Frequent Poster
 
Join Date: Mar 2009
Posts: 607
Default Re: Firewall in Linux: Needed or Not?

Quote:
Originally Posted by Ocky
They are enabled by default, but all traffic is allowed. However there aren't any listening services running by default that could accept remote connections, so all ports are effectively closed, even with iptables allowing all traffic.

That's the way I see it.

ok, I agree. You've described the situation ( most of the users will face with a default installation of the most distros ) perfectly.
  #17  
Old May 14th, 2010, 08:16 PM
beethoven's Avatar
beethoven beethoven is offline
Frequent Poster
 
Join Date: Dec 2004
Posts: 729
Default Re: Firewall in Linux: Needed or Not?

Quote:
Originally Posted by Mrkvonic
The basic rule is default deny, but that says nothing about services that need to listen, e.g. ssh, samba etc, in which case the usage of firewall becomes relevant.
Mrk

I am still in the process of setting up samba to enable file sharing on my lan between the linux box and my windows pc. If I enable ufw, I cannot access my ubuntu folder.

What do I have to do to allow my lan to go through?
I am behind a router for internet access - so what exactly is the risk when the firewall is not enabled?
  #18  
Old May 15th, 2010, 03:05 AM
Ocky's Avatar
Ocky Ocky is offline
Very Frequent Poster
 
Join Date: May 2006
Location: George, S.Africa
Posts: 2,538
Default Re: Firewall in Linux: Needed or Not?

Did you allow Samba ? sudo ufw allow Samba
(Or with Gufw in the repos.)

https://help.ubuntu.com/community/SettingUpSamba
__________________
Ubuntu Kubuntu Xubuntu Scientific Linux

Last edited by Ocky : May 15th, 2010 at 03:12 AM.
  #19  
Old May 15th, 2010, 04:30 AM
mack_guy911's Avatar
mack_guy911 mack_guy911 is offline
Very Frequent Poster
 
Join Date: Mar 2007
Posts: 2,499
Default Re: Firewall in Linux: Needed or Not?

from control center you can install gufw and you get the gui mode for firewall

for samba

-http://www.youtube.com/watch?v=89hjWOb8qmY-

-http://www.youtube.com/watch?v=F9aLvoH4-BQ-

Last edited by JRViejo : May 15th, 2010 at 01:28 PM. Reason: De-linked YouTube URLs - JRViejo
  #20  
Old May 16th, 2010, 08:21 AM
beethoven's Avatar
beethoven beethoven is offline
Frequent Poster
 
Join Date: Dec 2004
Posts: 729
Default Re: Firewall in Linux: Needed or Not?

I have now successfully installed samba and can see the my linux folder in windows and vice versa. UFW is enabled but incoming and outgoing is allowed. Under Rules it says: 4662 tcp allow in and 4672 udp allow in.

Is this how it should be or do I need any other rules?

the whole lan is behind a router.
  #21  
Old May 16th, 2010, 08:46 AM
linuxforall linuxforall is offline
Very Frequent Poster
 
Join Date: Feb 2010
Posts: 2,100
Default Re: Firewall in Linux: Needed or Not?

Quote:
Originally Posted by beethoven
I have now successfully installed samba and can see the my linux folder in windows and vice versa. UFW is enabled but incoming and outgoing is allowed. Under Rules it says: 4662 tcp allow in and 4672 udp allow in.

Is this how it should be or do I need any other rules?

the whole lan is behind a router.


Install gufw which makes it easier, deny all except the port you wish to use for torrent or inbound, allow all outbound.
__________________
Ubuntu, Chakra with Opera and Chromium
Perpetually learning Linux novice, rank amateur.
  #22  
Old May 16th, 2010, 06:25 PM
beethoven's Avatar
beethoven beethoven is offline
Frequent Poster
 
Join Date: Dec 2004
Posts: 729
Default Re: Firewall in Linux: Needed or Not?

Sorry, should have been clearer
I have already installed the gui and the current setting mentioned is copied straight from the gui.
I am not using torrents, so currently tcp and udp are open on two ports. I am afraid in windows I never went so far as to specify port rules.
  #23  
Old May 16th, 2010, 10:20 PM
linuxforall linuxforall is offline
Very Frequent Poster
 
Join Date: Feb 2010
Posts: 2,100
Default Re: Firewall in Linux: Needed or Not?

Try denying all ports.
__________________
Ubuntu, Chakra with Opera and Chromium
Perpetually learning Linux novice, rank amateur.
  #24  
Old September 9th, 2010, 07:18 AM
tlu's Avatar
tlu tlu is offline
Very Frequent Poster
 
Join Date: Sep 2004
Posts: 2,076
Default Re: Firewall in Linux: Needed or Not?

Quote:
Originally Posted by linuxforall
Install gufw which makes it easier, deny all except the port you wish to use for torrent or inbound, allow all outbound.
There is a new alternative called ufw-frontends also available from a ppa. Looks good compared to gufw although I haven't tried it.
  #25  
Old September 9th, 2010, 07:43 AM
chronomatic chronomatic is offline
Very Frequent Poster
 
Join Date: Apr 2009
Posts: 1,324
Default Re: Firewall in Linux: Needed or Not?

OP,

Open a terminal and type:

Code:
sudo netstat -tpvnl

If you see under "Local Address" a 0.0.0.0 entry, then you need a firewall. If not, then you do not need a firewall as you have no listening services. I know that Ubuntu ships with no listening services by default.
 

Wilders Security Forums > Software, Hardware and General Services > all things UNIX « Previous Thread | Next Thread »

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 09:56 AM.


Powered by vBulletin® Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Copyright ©2002 - 2013, Wilders Security Forums