cc42 PF rules for httpd - The FreeBSD Forums
The FreeBSD Forums  

Go Back   The FreeBSD Forums > Server & Networking > Firewalls

Firewalls IPFW, PF, IPF (but not limited) related discussion

Reply
 
Thread Tools Display Modes
  #1  
Old September 15th, 2012, 01:36
atmosx atmosx is offline
Junior Member
 
Join Date: Jul 2012
Location: Brno, Czech Republic
Posts: 54
Thanks: 13
Thanked 3 Times in 3 Posts
Default PF rules for httpd

Hello,

I am going to use a FreeBSD with Nginx and a ruby (unicorn) app. I cannot use jails, I have a fairly secure system, since I'm the only use who has access to it... No other users laying around.

Nginx will not feature any post form. Nginx is going server an octopress blog, which features static content and some javascript. There's no login mechanism since I do my changes locally and 'deploy' via SSH.

Are there any PF rules that would help an httpd with possible break in attempts and DOS attacks? If yes can I see some examples to start getting ideas?

thanks and best regards
__________________
People demand freedom of speech as a compensation for the freedom of thought which they seldom use. - Soren Kierkegaard
Reply With Quote
  #2  
Old September 17th, 2012, 08:01
SirDice's Avatar
SirDice SirDice is offline
Moderator
 
Join Date: Nov 2008
Location: Rotterdam, Netherlands
Posts: 13,725
Thanks: 47
Thanked 2,023 Times in 1,862 Posts
Default

Quote:
Originally Posted by atmosx View Post
Are there any PF rules that would help an httpd with possible break in attempts and DOS attacks? If yes can I see some examples to start getting ideas?
PF works on layer 3/4. Almost all web based attacks happen above layer 7, on the application. There's nothing in PF that can prevent an application based attack.

As for a DOS, you can rate limit some of the connections but with a proper DDoS your uplink will be completely saturated, no amount of filtering on your end of the pipe is going to change that.
__________________
Senior UNIX Engineer at Unix Support Nederland
Experience is something you don't get until just after you need it.
Reply With Quote
The Following User Says Thank You to SirDice For This Useful Post:
atmosx (September 21st, 2012)
  #3  
Old September 21st, 2012, 17:33
atmosx atmosx is offline
Junior Member
 
Join Date: Jul 2012
Location: Brno, Czech Republic
Posts: 54
Thanks: 13
Thanked 3 Times in 3 Posts
Default

Hello,

rate limit will work I think. I'm not sure but if httpd scripts use threads (meaning simultaneous connections) to get results asap, rate-limit is a good way to go.

Thanks for the hint
__________________
People demand freedom of speech as a compensation for the freedom of thought which they seldom use. - Soren Kierkegaard
Reply With Quote
  #4  
Old September 22nd, 2012, 14:10
shitson's Avatar
shitson shitson is offline
Member
 
Join Date: Aug 2010
Location: Australia, Wollongong
Posts: 180
Thanks: 11
Thanked 32 Times in 26 Posts
Default

Are DOS attacks are problem with your site and What is your expected number of Hits per Day?
__________________
"Virtually everything worth doing has a learning curve associated with it", anomie.
Reply With Quote
  #5  
Old September 23rd, 2012, 10:47
atmosx atmosx is offline
Junior Member
 
Join Date: Jul 2012
Location: Brno, Czech Republic
Posts: 54
Thanks: 13
Thanked 3 Times in 3 Posts
Default

Hello here are the rules that I currently use, there's a problem with dnsmasq though, it doesn't supply IP's to the local network, which might make sense... Maybe I should change that to *any* instead of *$lan*.

My httpd should not exceed 100-150 hits per day. Now receives less than 50. DOS attacks I think are not a problem, because my website is not receiving hits/notoriety of any sort so... I can hardly see it as a possible target from a bot-net or something.
__________________
People demand freedom of speech as a compensation for the freedom of thought which they seldom use. - Soren Kierkegaard
Reply With Quote
Reply

Tags
http, pf

Thread Tools
Display Modes

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Protecting HTTPd via PF APseudoUtopia Firewalls 6 February 6th, 2013 13:53
Panic in httpd Paso Web & Network Services 2 May 21st, 2010 17:37
Are there any way to add new rules to pf without write the rules to the pf.conf tanakorn Firewalls 2 February 8th, 2010 09:09
Help! I'm being exploited via httpd! digitsix General 0 February 17th, 2009 19:38
httpd.core mfaridi Web & Network Services 6 December 18th, 2008 05:11


All times are GMT +1. The time now is 12:15.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
The mark FreeBSD is a registered trademark of The FreeBSD Foundation and is used by The FreeBSD Project with the permission of The FreeBSD Foundation.
Web protection and acceleration provided by CloudFlare
0