Correct. Look at the ossec.conf on the agent. There should be some logfiles configured by default. Look for <localfile> entries.
<active-response>
<command>firewall-drop</command>
<location>local</location>
<level>8</level>
<timeout>900</timeout>
</active-response>
<active-response>
<command>firewall-drop</command>
<location>local</location>
<rules_id>100005,100030,100032,100034,100036,100037</rules_id>
<timeout>5600</timeout> <!-- w00t -->
</active-response>
today I had several attacks that fired rule 100037
(a simple selfmade myphpadmin scanner detector):
<rule id="100037" level="8">
<if_sid>31100</if_sid>
<match>myadmin/scripts</match>
<description>phpmyadmin scanner</description>
<group>attacks,</group>
</rule>
Ossec fired Rule 100037, active response got activated, BUT
only for 15 minutes and not for 90 Minutes as I expected.
Is it possible at all to have such a multiple active-response config?
If yes, why didn't it do the 5600s timeout but instead the 900s?
It's a local installation on ubuntu server. OSSEC 2.5.1
thanks for hints.
Greets
Rainer
The order of the AR definitions matters. I think it is first match wins.
Dan:that means all the logs to be monitored have to be entered in the agent in the following location :-/var/ossec/etc/ossec.conf ?
On Jun 28, 2011 1:28 PM, "SystemAli" <syst...@gmail.com> wrote:
>
> So, That means if i need to add additional files to be monitored, all i need to do is , Edit the ossec.conf on the agent by replace the LOCATION tab with the location of the log file that i need to monitor ? ...correct ?
>
>
Don't replace it, add a new localfile for the logfile you want to monitor.
On Tue, Jun 28, 2011 at 2:10 PM, SystemAli <syst...@gmail.com> wrote:
> Chris :
> I edited the ossec.conf and added these container in it :-
> <localfile>
> <log_format>syslog</log_format>
> <location>/usr/local/apache/logs/access_log</location>
> </localfile>
This is probably in the apache format
> </ossec_config>
This </ossec_config> tag seems to be in the wrong place.
> <localfile>
> <log_format>syslog</log_format>
> <location>/usr/local/cpanel/logs/access_log</location>
> </localfile>
I haven't seen it, but I'm guessing this will also be in the apache format.
Have you ever looked at the logs?
> But when i restart ossec i get this error :-
> /var/ossec/bin/ossec-control start
> Starting OSSEC HIDS v2.5.1 (by Trend Micro Inc.)...
> 2011/06/28 23:39:58 ossec-execd(1226): ERROR: Error reading XML file
> '/var/ossec/etc/ossec.conf': XML ERR: Element not closed: <ossec_config
> (line 68).
> Can you suggest how to resolve this ?
>
Look at line 68 or above. Look for a line that says "<ossec_config"
Or, check for an <ossec_config> without an </ossec_config>.
Anything in a <> will need a corresponding </>.
<log_format>apache</log_format>
> And yes. there were additional "</ossec_config>" in the file which i have
> removed, But yet get the same error :(
> than you once again
>
There's either an extra </ossec_config> still in the file, or the
"<ossec_config" in the message you sent is causing the breakage.
Feel free to send me the ossec.conf, I can try to read it for you.
# /var/ossec/bin/ossec-logtest -t -c ./ossec.test
2011/06/28 15:10:52 ossec-config(1226): ERROR: Error reading XML file
'./ossec.test': XML ERR: End of file and some elements were not closed
(line 79).
2011/06/28 15:10:52 ossec-testrule(1202): ERROR: Configuration error
at './ossec.test'. Exiting.
# echo $?
1
## REMOVE THE EXTRA '<' ON THE LAST LINE
# /var/ossec/bin/ossec-logtest -t -c ./ossec.test
2011/06/28 15:11:15 ossec-testrule: INFO: Reading local decoder file.
# echo $?
0
This is the error:
<</ossec_config>