I installed mod_security on my bsd box.
FreeBSD 5.4-STABLE
mod_security-2.5.7_1
apache-2.2.9_5
postgresql-client-8.2.4
postgresql-server-8.2.9
when i enable the mod_security in the httpd.conf and set it
to “ON” mode, instead of “detectonly”, and loglevel to “3”,
my server is getting CPU usage problem like this.
last pid: 51183; load averages: 1.32, 6.56,
18.39 up 87+13:33:00
14:27:24
100 processes: 2 running, 98 sleeping
CPU states: 88.0% user, 0.0%
nice, 10.9% system, 1.2% interrupt, 0.0% idle
Mem: 281M Active, 2321M
Inact, 384M Wired, 162M Cache, 112M Buf, 679M Free
Swap: 6144M Total, 136K Used,
6144M Free
PID USERNAME PRI NICE SIZE RES STATE TIME
WCPU CPU COMMAND
50542 www 129 0 29024K 20000K RUN 0:22
59.12% 58.50% httpd
50921 www 97 0 25452K 16004K select 0:00
0.95% 0.83% httpd
50556 www 4 0 25116K 15788K accept 0:00
0.20% 0.20% httpd
693 root 96 0 8092K 4228K select 763:46
0.15% 0.15% snmpd
50632 www 96 0 25072K 15708K select 0:00
0.10% 0.10% httpd
51111 www 96 0 25596K 16072K select 0:00
0.19% 0.10% httpd
45916 pgsql 122 0 538M 5236K select 0:04
0.05% 0.05% postgres
50503 www 96 0 25372K 15864K select 0:00
0.05% 0.05% httpd
50540 www 96 0 25052K 15656K select 0:00
0.05% 0.05% httpd
50562 www 4 0 25084K 15692K accept 0:00
0.05% 0.05% httpd
95104 mysql 20 0 498M 159M kserel 128:04
0.00% 0.00% mysqld
8792 root 8 0 24892K 15452K nanslp 1:09
0.00% 0.00% httpd
352 root 96 0 1412K 796K select 0:51
0.00% 0.00% syslogd
679 root 96 0 2544K 1620K select 0:50
0.00% 0.00% proftpd
98545 bind 96 0 5656K 4088K select 0:31
0.00% 0.00% named
45724 root 96 0 3768K 2752K select 0:21
0.00% 0.00% sendmail
525 root 8 0 1452K 968K nanslp 0:16
0.00% 0.00% cron
At this point when i look at
the mod_security logs, i see this lines many many.
[07/Feb/2009:14:31:46 +0200] [www.mydomain.com/sid#80c4180][rid#8645058][/iem/rss/index.php][2]
Warning. Operator EQ matched 0 at REQUEST_HEADERS. [file
"/usr/local/etc/apache22/Includes/mod_security2/modsecurity_crs_21_protocol_anomalies.conf"]
[line "48"] [id "960009"] [msg "Request Missing a User
Agent Header"] [severity "WARNING"] [tag
"PROTOCOL_VIOLATION/MISSING_HEADER"]
[07/Feb/2009:14:36:02 +0200] [www.mydomain.com/sid#80c4180][rid#8630058][/iem/index.php][2]
Warning. Match of "rx ^apache.*perl" against
"REQUEST_HEADERS:User-Agent" required. [file
"/usr/local/etc/apache22/Includes/mod_security2/modsecurity_crs_35_bad_robots.conf"]
[line "29"] [id "990011"] [msg "Request Indicates an
automated program explored the site"] [severity "NOTICE"] [tag
"AUTOMATION/MISC"]
When i disable mod_security
in httpd.conf everything is OK.
last pid: 49702; load averages: 0.42, 12.41,
23.50 up 87+13:29:14
14:23:38
92 processes: 1 running, 90 sleeping, 1 zombie
CPU states: 7.0% user, 0.0% nice, 7.8% system, 0.4%
interrupt, 84.9% idle
Mem: 372M Active, 2320M Inact, 384M Wired, 162M Cache, 112M
Buf, 589M Free
Swap: 6144M Total, 136K Used, 6144M Free
PID USERNAME PRI NICE SIZE RES STATE TIME
WCPU CPU COMMAND
49438 www 96 0 29152K 20048K select 0:00
1.06% 0.93% httpd
95104 mysql 20 0 498M 159M kserel 128:03
0.29% 0.29% mysqld
693 root 96 0 8092K 4228K select 763:45
0.15% 0.15% snmpd
8792 root 8 0 24476K 15016K nanslp 1:09
0.00% 0.00% httpd
352 root 96 0 1412K 796K select 0:51
0.00% 0.00% syslogd
679 root 96 0 2544K 1620K select 0:50
0.00% 0.00% proftpd
98545 bind 96 0 5656K 4088K select 0:31
0.00% 0.00% named
45724 root 96 0 3768K 2752K select 0:21
0.00% 0.00% sendmail
525 root 8 0 1452K 968K nanslp 0:16
0.00% 0.00% cron
451 root 96 0 1328K 720K select 0:07
0.00% 0.00% usbd
45916 pgsql 112 0 538M 5236K select 0:03
0.00% 0.00% postgres
27647 mesut 96 0 5984K 2368K select 0:02
0.00% 0.00% sshd
45919 pgsql 96 0 9008K 5128K select 0:01
0.00% 0.00% postgres
46177 www 96 0 54556K 45484K select 0:01
0.00% 0.00% httpd
48236 www 96 0 31408K 22444K select 0:01
0.00% 0.00% httpd
46224 www 96 0 29160K 20184K select 0:01
0.00% 0.00% httpd
What can i do to solve this problem.
Thanks alot…