hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Hosting Security and Technology : APF rules keep reseting?!!
Reply

Hosting Security and Technology Configuring and optimizing web hosting servers and operating systems, developing administration scripts, building servers, protecting against hackers, and general security (SSL certificates, etc.)
Forum Jump

APF rules keep reseting?!!

Reply Post New Thread In Hosting Security and Technology Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 11-15-2007, 01:46 AM
best_wish best_wish is offline
Junior Guru Wannabe
 
Join Date: Mar 2006
Posts: 42

APF rules keep reseting?!!


I got on one of my dedi server apf firewall installed and it keep reseting every 24 hours?!


btw i put the devile mode to 0 and styill no help.

any idea why thi keep hapening?

btw i have cpanel 11 and centos 4 runing

Reply With Quote


Sponsored Links
  #2  
Old 11-15-2007, 01:49 AM
blessen blessen is offline
Web Hosting Master
 
Join Date: Aug 2003
Location: Gods Own Country
Posts: 850
Make sure that you dont have any cron to flush iptables rules. APF actually uses iptables to act as a firewall. So if iptables rules are flushed then apf will not be effective. So check if you have any such cron setup with the command /usr/bin/iptables or /path /iptables -F

__________________
Blessen Cherian
Follow me on twitter.com/blessenonly
Over a decade plus in the Hosting Industry

Reply With Quote
  #3  
Old 11-15-2007, 01:58 AM
best_wish best_wish is offline
Junior Guru Wannabe
 
Join Date: Mar 2006
Posts: 42
Quote:
Originally Posted by blessen View Post
Make sure that you dont have any cron to flush iptables rules. APF actually uses iptables to act as a firewall. So if iptables rules are flushed then apf will not be effective. So check if you have any such cron setup with the command /usr/bin/iptables or /path /iptables -F
Thanks Mr. Blessen for kind reply.

but i get error on those commands.

root@ [~]# /path /iptables -F
-bash: /path: No such file or directory
root@ [~]# /usr/bin/iptables
-bash: /usr/bin/iptables: No such file or directory

Reply With Quote
Sponsored Links
  #4  
Old 11-15-2007, 02:04 AM
blessen blessen is offline
Web Hosting Master
 
Join Date: Aug 2003
Location: Gods Own Country
Posts: 850
You have to find the path to iptables....thats what i meant by /path /iptables

You can find path by executing the command " whereis iptables "

Also, if execute the command " iptables -F " it will flush all your iptables rules. I do not understand why you want to execute it. What i meant was to check your cron files to see if there is any cron which is set to flush the iptables rules on a daily basis.

__________________
Blessen Cherian
Follow me on twitter.com/blessenonly
Over a decade plus in the Hosting Industry

Reply With Quote
  #5  
Old 11-15-2007, 02:12 AM
best_wish best_wish is offline
Junior Guru Wannabe
 
Join Date: Mar 2006
Posts: 42
Quote:
Originally Posted by blessen View Post
You have to find the path to iptables....thats what i meant by /path /iptables

You can find path by executing the command " whereis iptables "

Also, if execute the command " iptables -F " it will flush all your iptables rules. I do not understand why you want to execute it. What i meant was to check your cron files to see if there is any cron which is set to flush the iptables rules on a daily basis.
ah ok i got it.

I checked cron.daly and cron.hourly they both empty.

Reply With Quote
  #6  
Old 11-15-2007, 02:14 AM
david510 david510 is offline
Web Hosting Master
 
Join Date: Oct 2004
Location: Kerala, India
Posts: 4,617
Path to iptables will be /sbin/iptables. Configure the APF as seen here. It will be fine.

http://www.webhostgear.com/61.html

__________________
David | www.cliffsupport.com
Affordable Server Management Solutions sales AT cliffsupport DOT com
iWebManager | Access WHM from iPhone and Android

Reply With Quote
  #7  
Old 11-15-2007, 02:21 AM
best_wish best_wish is offline
Junior Guru Wannabe
 
Join Date: Mar 2006
Posts: 42
hi mr. David

I done exactly the same on my other server it works fine. but on this one not.

it was working some months ago fine.

I add today some ips to be blocked and the next day the deny_hosts.rules is empty!

Reply With Quote
  #8  
Old 11-15-2007, 02:37 AM
david510 david510 is offline
Web Hosting Master
 
Join Date: Oct 2004
Location: Kerala, India
Posts: 4,617
Check the apf log file to see if the firewall is getting flushed.

grep flushing /var/log/apf_log*

__________________
David | www.cliffsupport.com
Affordable Server Management Solutions sales AT cliffsupport DOT com
iWebManager | Access WHM from iPhone and Android

Reply With Quote
  #9  
Old 11-15-2007, 02:41 AM
best_wish best_wish is offline
Junior Guru Wannabe
 
Join Date: Mar 2006
Posts: 42
yeh i get such a output.

/var/log/apf_log:Nov 14 08:15:54 sms apf(27433): {glob} flushing & zeroing chain
policies
/var/log/apf_log:Nov 14 08:16:37 sms apf(29386): {glob} flushing & zeroing chain
policies
/var/log/apf_log:Nov 15 00:00:01 sms apf(10711): {glob} flushing & zeroing chain
policies
/var/log/apf_log:Nov 15 00:00:02 sms apf(10949): {glob} flushing & zeroing chain
policies
/var/log/apf_log:Nov 15 04:02:07 sms apf(25556): {glob} flushing & zeroing chain
policies

Reply With Quote
  #10  
Old 11-15-2007, 03:30 AM
david510 david510 is offline
Web Hosting Master
 
Join Date: Oct 2004
Location: Kerala, India
Posts: 4,617
check for the crons that runs at the same time.

__________________
David | www.cliffsupport.com
Affordable Server Management Solutions sales AT cliffsupport DOT com
iWebManager | Access WHM from iPhone and Android

Reply With Quote
  #11  
Old 11-15-2007, 05:35 AM
best_wish best_wish is offline
Junior Guru Wannabe
 
Join Date: Mar 2006
Posts: 42
Quote:
Originally Posted by david510 View Post
check for the crons that runs at the same time.
sorry but where to check them as i checked in etc/cron.daily they were empty.

Reply With Quote
  #12  
Old 11-15-2007, 06:58 AM
-Edward- -Edward- is offline
Web Hosting Master
 
Join Date: Aug 2000
Posts: 2,745
crontab -e

Reply With Quote
  #13  
Old 11-15-2007, 07:02 AM
best_wish best_wish is offline
Junior Guru Wannabe
 
Join Date: Mar 2006
Posts: 42
here is what i see in crontab

0 0 * * * echo '' > /etc/apf/deny_hosts.rules;/etc/apf/apf -f;/etc/apf/apf -r;/$

shoould i delete that line?

Reply With Quote
  #14  
Old 11-15-2007, 07:03 AM
arbet arbet is offline
Web Hosting Evangelist
 
Join Date: Dec 2004
Location: Lebanon
Posts: 452
Make sure that your APF config settings are not in development mode.

Code:
open /etc/apf/conf.apf, 
change the DEVEL_MODE="1" to DEVEL_MODE="0"
This will stop flushing your firewall.
Code:
apf -r
to restart your firewall, it should work.


Last edited by arbet; 11-15-2007 at 07:04 AM. Reason: Missed restart firewall.
Reply With Quote
  #15  
Old 11-15-2007, 07:18 AM
best_wish best_wish is offline
Junior Guru Wannabe
 
Join Date: Mar 2006
Posts: 42
Quote:
Originally Posted by arbet View Post
Make sure that your APF config settings are not in development mode.

Code:
open /etc/apf/conf.apf, 
change the DEVEL_MODE="1" to DEVEL_MODE="0"
This will stop flushing your firewall.
Code:
apf -r
to restart your firewall, it should work.
no its not in dev mod as i mantioned in my first post.

Reply With Quote
Reply

Related posts from TheWhir.com
Title Type Date Posted
NetDNA Gives Site Managers Granular Control over Content with New EdgeRules Service Web Hosting News 2013-01-22 13:35:47
US Military Weighing New Cyber-Security Powers Web Hosting News 2012-08-13 12:35:54
2012 WHIR Reader Survey Extended - take a few minutes to complete and win Blog 2012-04-30 11:14:58
New Accounting Rules Could Hurt Cloud Hosting Resellers Web Hosting News 2012-03-29 14:16:43
ICANN CEO Emphasizes Rules to Ensure Fair Rollout of New Top Level Domains Web Hosting News 2012-03-13 17:41:28


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

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

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?