LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 12-12-2005, 07:21 PM   #1
mikesjays
Member
 
Registered: Dec 2005
Distribution: FC8, FC9, FC10
Posts: 30

Rep: Reputation: 16
Lokkit and ftp


I can't get FC4's Lokkit to play nice with vsftpd. I check the box for ftp and it will not open up a conection. Now if I select to trust eth0 it works but than I'm not firewalling anything right? Is there a way to edit iptables by hand, if so what entries should I put in? Is there a better firewall out there that works good with FC4?

Thanks,
Mike
 
Old 12-14-2005, 10:44 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
I can't get FC4's Lokkit to play nice with vsftpd. I check the box for ftp and it will not open up a conection.
Does the ftp client show any useful specific error(codes)?


Now if I select to trust eth0 it works but than I'm not firewalling anything right?
I don't know. Never used Lokkit. Doesn't the documentation tell?


Is there a way to edit iptables by hand, if so what entries should I put in?
By default the rules should be in /etc/sysconfig/iptables.
Post the contants and we'll see.


Is there a better firewall out there that works good with FC4?
There is no firewall but Iptables, you mean a better *front-end*. No recommendations from me there, I prefer to use vi from the commandline. I knwo there's lot's of front-ends, check the FC4 repositories using your favourite package management update tool (synaptic, apt-get, yum, autoupd) or search LQ or search Freshmeat.net.
 
Old 12-14-2005, 08:09 PM   #3
mikesjays
Member
 
Registered: Dec 2005
Distribution: FC8, FC9, FC10
Posts: 30

Original Poster
Rep: Reputation: 16
Here is what my iptable looks like with ftp and ssh checked and trust eth0 checked.

# Firewall configuration written by system-config-securitylevel
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:RH-Firewall-1-INPUT - [0:0]
-A INPUT -j RH-Firewall-1-INPUT
-A FORWARD -j RH-Firewall-1-INPUT
-A RH-Firewall-1-INPUT -i lo -j ACCEPT
-A RH-Firewall-1-INPUT -i eth0 -j ACCEPT
-A RH-Firewall-1-INPUT -p icmp --icmp-type any -j ACCEPT
-A RH-Firewall-1-INPUT -p 50 -j ACCEPT
-A RH-Firewall-1-INPUT -p 51 -j ACCEPT
-A RH-Firewall-1-INPUT -p udp --dport 5353 -d 224.0.0.251 -j ACCEPT
-A RH-Firewall-1-INPUT -p udp -m udp --dport 631 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 21 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited
COMMIT

This works and I can get ftp though, but it looks like it lets every thing past.

Here it is with out the eth0 box checked and ftp does not work but ssh does.

# Firewall configuration written by system-config-securitylevel
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:RH-Firewall-1-INPUT - [0:0]
-A INPUT -j RH-Firewall-1-INPUT
-A FORWARD -j RH-Firewall-1-INPUT
-A RH-Firewall-1-INPUT -i lo -j ACCEPT
-A RH-Firewall-1-INPUT -p icmp --icmp-type any -j ACCEPT
-A RH-Firewall-1-INPUT -p 50 -j ACCEPT
-A RH-Firewall-1-INPUT -p 51 -j ACCEPT
-A RH-Firewall-1-INPUT -p udp --dport 5353 -d 224.0.0.251 -j ACCEPT
-A RH-Firewall-1-INPUT -p udp -m udp --dport 631 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 21 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited

The only thing I can see different is the line:

-A RH-Firewall-1-INPUT -i eth0 -j ACCEPT

So there must be something wong with my rule for ftp.
 
Old 12-15-2005, 09:09 PM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Active FTP needs inbound (NEW) access to the control channel (tcp/21), inbound (ESTABLISHED,RELATED) for the data portion and outbound NEW (OUTPUT policy ACCEPT). In your second example they're all there, so I would try a "modprobe ip_conntrack_ftp" if that module isn't loaded. This will help Iptables track the data portion connections (ESTABLISHED,RELATED) it otherwise would not know about. If that still ain't working, and there's no router in front blocking ports, add a line above the "--reject-with icmp-host-prohibited" line:
-A RH-Firewall-1-INPUT -j LOG --log-level info --log-prefix " REJECT"
to have all traffic logged (usually to /var/log/messages) before it's dropped. Good for debugging.
 
Old 01-02-2006, 08:51 PM   #5
mikesjays
Member
 
Registered: Dec 2005
Distribution: FC8, FC9, FC10
Posts: 30

Original Poster
Rep: Reputation: 16
cool it looks like modprobe worked thank you.

Mike
 
Old 01-02-2006, 09:13 PM   #6
mikesjays
Member
 
Registered: Dec 2005
Distribution: FC8, FC9, FC10
Posts: 30

Original Poster
Rep: Reputation: 16
I lied it didn't work so I put in the other line into my iptable and this is what I ended up with in the log.

Jan 2 22:12:28 desktop kernel: REJECTIN=eth0 OUT= MAC=00:11:2f:d1:c6:a6:00:12:17:ba:82:6c:08:00 SRC=192.168.1.1 DST=192.168.1.2 LEN=60 TOS=0x00 PREC=0x00 TTL=63 ID=11559 DF PROTO=TCP SPT=52754 DPT=37717 WINDOW=5840 RES=0x00 SYN URGP=0

I'm not real sure what any of the means.

Mike
 
Old 01-03-2006, 12:58 PM   #7
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
I lied it didn't work
Can you verify the contents are still the same as when you made the changes? AFAIK if you use iptables restart it might use iptables-save to save the in-memory rules and so overwrite changes. You should use iptables start after making changes to /etc/sysconfig/iptables.

I'm not real sure what any of the means.
In short a TCP traffic initiation request from 192.168.1.1 (port 52754) to 192.168.1.2 (port 37717) was rejected. Doesn't seem FTP related to me.

From your second example, add two lines below "-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT". Note spaces in the logline are intentional else itll fsck up your syslog:
-A RH-Firewall-1-INPUT -s 192.168.1.0/24 -j LOG --log-level info --log-prefix " ALLOW_LAN "
-A RH-Firewall-1-INPUT -s 192.168.1.0/24 -j ACCEPT
What this will do is just allow any traffic from your 192.168.1.0 LAN. It's not what you want, but it'll work.
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to activate lokkit esdee Linux - Security 1 08-25-2004 12:26 PM
Is there anything else like lokkit? Rotwang Linux - Networking 3 05-28-2004 12:15 PM
RH-Lokkit-0-50 problem florin Linux - Security 3 05-31-2003 11:17 AM
Lokkit stew Linux - Networking 3 05-23-2003 10:01 AM
Bypassing lokkit, gnome-lokkit and redhat-config-securitylevel on RedHat 8.0 Son77 Linux - Security 3 10-18-2002 03:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 07:22 PM.

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