Community discussions

MikroTik App
 
ubb
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 62
Joined: Tue Aug 29, 2006 12:14 am

Best Practices for Firewalling Servers

Thu May 17, 2007 1:19 am

I'm looking for some input and good ideas from others for firewalling my internal servers on my border router. What methods do you use in firewalling internal servers? I've basically been setting up a few rules per server IP. For example, for a web server, I'll allow port 80, established connections and related connections then drop everything else. Should I be doing anything differently? Any input would be appreciated.
 
Ghassan
Member Candidate
Member Candidate
Posts: 213
Joined: Mon May 29, 2006 11:08 pm
Location: Lebanon
Contact:

Thu May 17, 2007 10:37 am

umm , well at my MT Router , I used to open my used ports then drop everything unwanted ports , this configuration decreased my traffic also protected our customers but for the input chain :

http://www.mikrotik.com/testdocs/ros/2.9/ip/filter.php

and if you want to forward ports or to make sure your applications are protected behind a router ..

If you want to forward your outside your coutry to visit your webserver , you can use srcnat chain , another thinng for dstnat is for your cusrtomers .
 
changeip
Forum Guru
Forum Guru
Posts: 3830
Joined: Fri May 28, 2004 5:22 pm

Re: Best Practices for Firewalling Servers

Thu May 17, 2007 6:27 pm

I'm looking for some input and good ideas from others for firewalling my internal servers on my border router. What methods do you use in firewalling internal servers? I've basically been setting up a few rules per server IP. For example, for a web server, I'll allow port 80, established connections and related connections then drop everything else. Should I be doing anything differently? Any input would be appreciated.
Allow established, related, and then tcp/80 'new' connections. If you allow tcp/80 before established you can get hackers trying mess with existing connections possibly.

If you have a few web servers its nice to be able to use the address-list and setup a list of web server ips, then use that in your dst-address-list filter on the rule. Saves you from having to repeat the same rules for others.

Put some synflood filters in place. Don't allow too many syn's from a single IP address, or too many connections from a single ip address.
 
ubb
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 62
Joined: Tue Aug 29, 2006 12:14 am

Thu May 17, 2007 9:47 pm

Thanks changeip. I actually did have port 80 and then established and related. I'll switch the order of my rules.
 
changeip
Forum Guru
Forum Guru
Posts: 3830
Joined: Fri May 28, 2004 5:22 pm

Thu May 17, 2007 9:56 pm

you'll want to add connection-state=new to that port 80 rule as well ... otherwise it will hit even if someone sends you RST or other packets and they are not established.

Sam
 
ubb
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 62
Joined: Tue Aug 29, 2006 12:14 am

Thu May 17, 2007 10:01 pm

Ah, I see. Thanks.
 
ubb
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 62
Joined: Tue Aug 29, 2006 12:14 am

Thu May 17, 2007 10:14 pm

In case anyone is interested, here's an example of the way I have this set up for one of my web servers (IP address changed):

/ ip firewall filter
add chain=forward dst-address=10.0.0.2 connection-state=established action=accept comment="" disabled=no
add chain=forward dst-address=10.0.0.2 connection-state=related action=accept comment="" disabled=no
add chain=forward dst-address=10.0.0.2 protocol=tcp dst-port=80 connection-state=new action=accept comment="" disabled=no
add chain=forward dst-address=10.0.0.2 protocol=tcp dst-port=443 connection-state=new action=accept comment="" disabled=no
add chain=forward dst-address=10.0.0.2 protocol=tcp dst-port=22 connection-state=new action=accept comment="" disabled=no
add chain=forward dst-address=10.0.0.2 protocol=tcp dst-port=20 connection-state=new action=accept comment="" disabled=no
add chain=forward dst-address=10.0.0.2 protocol=tcp dst-port=21 connection-state=new action=accept comment="" disabled=no
add chain=forward dst-address=10.0.0.2 action=drop comment="" disabled=no

(FYI, I do allow pings/traceroutes/other good icmp above this, so this machine will still be pingable.)

Who is online

Users browsing this forum: AimiSayo and 83 guests