文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>日志服务配置

日志服务配置

时间:2007-01-04  来源:lqmartin

日志服务器集中负责日期的收集、分析、报告和日志安全管理,能够有效的协助系统管理人员和网络管理人员进行系统管理维护、故障定位,发现安全风险。通过日志收集代理程序收集各种平台和产品的操作系统日志、数据库日志、网络设备日志,转换成统一的格式后进行集中存储和风险,并利用预先设置的警告规则向管理员发出警告。用户可以方便的查询并生成报表、报告。安全管理员定期审阅日志,可以全面的了解网络安全形势,针对有问题的特定系统和机器采取相应措施,并将处理情况反馈领导和用户,形成一个良性循环的机制。

为了便于配置各类产品的SYSLOG服务,现就网络、安全等提出参考配置。

UNIX系统仅支持接受SYSLOG,下边的UNIX配置是配置SYSLOG服务将其他设备日志记录到UNIX主机的配置。

2. 网络设备
2.1. CISCO路由器
device(config)#logging on

device(config)#logging a.b.c.d //日志服务器的IP地址

device(config)#logging facility local1 //facility标识, RFC3164 规定的本地设备标识为 local0 - local7

device(config)#logging trap errors //日志记录级别,可用"?"查看详细内容

device(config)#logging source-interface e0 //日志发出用的源IP地址

device(config)#service timestamps log datetime localtime show-timezone //日志记录的时间戳设置,将时间标记以MMM DD HH:MM:SS的格式添加,可根据需要具体配置

device#sh logging //检验

2.2. CISCO交换机
IOS命令行交换机的配置:(同Cisco路由器配置一样)

device(config)#logging on

device(config)#logging a.b.c.d //日志服务器的IP地址

device(config)#logging facility local1 //facility标识, RFC3164 规定的本地设备标识为 local0 - local7

device(config)#logging trap errors //日志记录级别,可用"?"查看详细内容

device(config)#logging source-interface e0 //日志发出用的源IP地址

device(config)#service timestamps log datetime localtime show-timezone //日志记录的时间戳设置,将时间标记以MMM DD HH:MM:SS的格式添加,可根据需要具体配置

device#sh logging //检验

SET命令行交换机的配置:

Console> (enable) set logging server enable

Console> (enable) set logging server a.b.c.d

Console> (enable) set logging server facility local5

Console> (enable) set logging server severity 5

2.3. 华为交换机
Quidway(config)# logging on //开启日志系统

Quidway(config)# set logging host 202.38.1.10 language English //将IP地址为202.38.1.10的主机用作日志主机,设置严重等级阈值为informational,输出语言为英文

Quidway(config)# set source rstp channel 5 log level informational

Quidway(config)# set source ip channel 4 log level informational

2.4. 华为路由器
Quidway(config)# logging on //开启日志系统

Quidway(config)# logging host a.b.c.d English //将IP地址为a.b.c.d的主机用作日志主机设置严重等级阈值为informational 输出语言为英文模式

Quidway(config)#logging host <0-9> { local<0-7> | ip-address }{ emergencies | alerts | critical | errors | warningsnotifications | informational | debugging }//允许向日志主机输出带优先级的日志信息

3. UNIX操作系统
3.1. HP-UX
Before you can send system log messages to a UNIX syslog server, you must configure the syslog daemon on the UNIX server.

Make sure that your syslogd is started with -r argument. -r, this option will enable the facility to receive message from the network using an Internet domain socket with the syslog services. The default setting is not enabled.

Step 1 Add a line such as the following to the file /etc/syslog.conf:

user.debug /var/log/myfile.log

--------------------------------------------------------------------------------

Note There must be five tab characters between user.debug and /var/log/myfile.log. Refer to entries in the /etc/syslog.conf file for further examples.

--------------------------------------------------------------------------------

Step 2 Create the log file by entering these commands at the UNIX shell prompt:

$ touch /var/log/myfile.log

$ chmod 666 /var/log/myfile.log

Step 3 Make sure the syslog daemon reads the new changes by entering this command:

$ kill -HUP Qcat /etc/syslog.pid

3.2. IBM AIX
跟HP和SUN的类似。

3.3. SUN Solaris
配置示例是在SunOS 4.0 上完成的在其它厂商的Unix 操作系统上的配置

操作基本与之相同部分命令细节上的差异请参考各自的命令手册。

(1) 以root 超级用户的身份执行以下命令

# mkdir /var/log/Quidway

# touch /var/log/Quidway/config

# touch /var/log/Quidway/security

(2) 以root 的身份编辑文件/etc/syslog.conf 加入以下选择/动作组合

selector/action pairs

# Quidway configuration messages

Local4.crit /var/log/Quidway/config

说明:

在编辑/etc/syslog.conf 时应注意以下问题:注释只允许独立成行并以字符# 开头,选择/动作组合之间必须以一个制表符分隔而不能输入空格,在文件名之后不得有多余的空格。

(3) 当建立了日志文件config 和security 且/etc/syslog.conf 文件被修改了之后应通过执行以下命令给系统守护进程Syslogd 一个HUP 信号来使Syslogd 重新读取它的配置文件/etc/syslog.conf

# ps -ae | grep syslogd

147

# kill -HUP 147

进行以上操作之后路由器就可以在相应的日志文件中记录信息了。

说明:

综合配置Facility 设备名称Severity 严重等级阈值Filter 过滤器,及syslog.conf 文件可以进行相当细致的分类从而达到信息筛选的目的。

4. Linux操作系统
用vi命令编辑 /etc/sysconfig/syslog,把 SYSLOGD_OPTIONS="-m 0" 修改为 SYSLOGD_OPTIONS="-r -m 0" 然后重新启动syslog 进程 /etc/rc.d/init.d/syslog restart
vi 编辑/etc/rc.conf中添加 syslogd_enable="yes"

5. 安全设备
5.1. CISCO PIX防火墙
pix(config)#logging on

pix(config)#logging host in_if_name a.b.c.d

pix(config)#logging message level levelid

5.2. Netscreen防火墙
set syslog config a.b.c.d auth/sec local0

set syslog vpn

set syslog enable

5.3. 天融信防火墙
天融信“网络卫士”系列防火墙都配有专门的日志服务器和审计软件,这里所描述的防火墙日志是指通过防火墙查看日志,日志的内容是暂存在防火墙上的。日志所包含的内容没有专门的日志服务器所提供的内容详细,但也能供用户对通过防火墙的信息及对防火墙的操作做一个大致的了解,同时能为用户查找攻击者提供重要的信息。
相关阅读 更多 +
排行榜 更多 +
Unity Connect

Unity Connect

学习教育 下载
青橙记录本

青橙记录本

商务办公 下载
脑洞惊魂夜

脑洞惊魂夜

休闲益智 下载