日志收集 客户端配置,指定需要收集系统日志及日志格式。默认如下 <ossec_config> <localfile> <log_format>audit</log_format> <location>/var/log/audit/audit.log</location> </localfile> <localfile> <log_format>syslog</log_format> <location>/var/ossec/logs/active-responses.log</location> </localfile> <localfile> <log_format>syslog</log_format> <location>/var/log/messages</location> </localfile> <localfile> <log_format>syslog</log_format> <location>/var/log/secure</location> </localfile> <localfile> <log_format>syslog</log_format> <location>/var/log/maillog</location> </localfile> 系统命令 客户端配置,设置系统监控执行命令及频率。默认如下 # 系统文件 <localfile> <log_format>command</log_format> <command>df -P</command> <frequency>360</frequency> </localfile> # 端口 <localfile> <log_format>full_command</log_format> <command>netstat -tulpn | sed 's/\([[:alnum:]]\+\)\ \+[[:digit:]]\+\ \+[[:digit:]]\+\ \+\(.*\):\([[:digit:]]*\)\ \+\([0-9\.\:\*]\+\).\+\ \([[:digit:]]*\/[[:alnum:]\-]*\).*/\1 \2 == \3 = = \4 \5/' | sort -k 4 -g | sed 's/ == \(.*\) ==/:\1/' | sed 1,2d</command> <alias>netstat listening ports</alias> <frequency>360</frequency> </localfile> # 登陆日志 <localfile> <log_format>full_command</log_format> <command>last -n……
阅读全文