LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 02-06-2011, 02:23 AM   #1
mario.almeida
Member
 
Registered: May 2008
Location: India
Distribution: Ubuntu 10.04, CentOS, Manjaro
Posts: 179

Rep: Reputation: 27
Question Log HTTP request


Dear All,

OS: CentOS 5.5 64bit
Application: JBOSS 4.2.3


I want to log HTTP request for all the IP which sends 700 and above request per minute.

Below rule do not work as the hit count is too high.
iptables -A INPUT -p tcp -s 0/0 --dport 8080 -m recent --set --name HTTP
iptables -A INPUT -p tcp -s 0/0 --dport 8080 -m recent --update --seconds 60 --hitcount 700 --rttl --name HTTP -j LOG
 
Old 02-06-2011, 09:12 AM   #2
ashwin_cse
Member
 
Registered: Jul 2004
Distribution: arch, rhel, ubuntu, debian, gentoo
Posts: 134

Rep: Reputation: 22
you should not be trying to log jboss request through iptables but it must be done through greping jboss server logs via shell script in cron job or which ever way you like.
 
Old 02-06-2011, 09:29 AM   #3
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
why not? If he's after specific traits of the network traffic, and not necessarily the actual application usage then I'd say iptables is the perfect place to do this. Having said that though, the request was 700 requests, not 700 packets...

looking around, you can change the hitcount values by setting ipt_pkt_list_tot when you explictly load the module in modprobe.conf, but all talk about it I see is setting it at 5o or 60 when the default is 20, and 700 is a serious amount higher. Maybe you could reduce the numbers you're tracking? Say, 50 in 5 seconds instead?

You could reduce the number of applicable hits by only tracking it on the new connections also, but then any connections being reused would not be relevant.

Last edited by acid_kewpie; 02-06-2011 at 09:38 AM.
 
Old 02-15-2011, 10:59 AM   #4
mario.almeida
Member
 
Registered: May 2008
Location: India
Distribution: Ubuntu 10.04, CentOS, Manjaro
Posts: 179

Original Poster
Rep: Reputation: 27
Question

@ashwin_cse
If it was just to log I would use log4j and yes I am using it.

what I actually meant by -j LOG is, If satisfied by the output of log then turn -j LOG to -j DROP.

I would say 700 hundred request per minute would be the ideal solution.

Why?

eg: say 50 in 5 sec

In this case a give IP would send 50 request within 5 sec and for next 55 sec it might not send any request. In this case I dont want to log. Only if the total request for 60 sec reaches 700 then it should log.
 
  


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 redirect http request in squid ? gardenair Linux - Networking 2 01-11-2011 12:14 AM
How to listen to HTTP Request using C++/C ? samuellawrence Programming 4 09-16-2009 09:07 PM
Routing http request? stiffy Linux - Server 6 02-27-2007 04:31 PM
http request mkamyar Linux - Software 5 08-30-2005 02:30 AM
HTTP::Request and CPAN support amer_58 Linux - Newbie 2 03-30-2005 11:46 AM

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

All times are GMT -5. The time now is 01:36 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