首页 | 登录 | 注册 | 会员中心 | 网站地图
  当前位置:首页 >> 资讯 >> 安全 >> 在Solaris网络部署HIDS配置实战(下)
在Solaris网络部署HIDS配置实战(下)
来源:IT专家网 作者: 发布时间:2008-08-22
上文介绍IDS基础和OSSEC的技术特点,下面笔者以Solaris 10操作系统为实例介绍配置具体过程。这里包括几个方面首先是ossec-hids-1.5 在Solaris 10 服务器进行安装和配置,然后再Linux 工作站、windows工作站、BSD工作站上配置OSSEC的IDS代理。最后是基于Web的监控界面的配置。过程比较长对于初学者有一定难度。
  一、在Solaris服务器下配置ossec-hids-1.5
  系统要求:首先必须配置好C 编译器和make工具。只是Unix工作的基础,读者可以查看相关资料进行配置,笔者略过。另外硬件方面根据监控的主机数量如表-1 配置。
  服务器的推荐选型如表1

IDS代理客户端数量
IDS服务器CPU数量
IDS服务器CPU速度
IDS服务器内存容量
IDS服务器用于客户端的磁盘存储容量
1–100
1
大于1500MHZ
1024MB
20GB以上
100-200
双核或者多处理器
大于2000MHZ
1024MB以上
40GB以上

  1、软件下载安装

     #wegt http://www.ossec.net/files/ossec-hids-1.5.tar.gz
  #wegt http://www.ossec.net/files/OSSEC-GPG-KEY.asc
  # gpg --import OSSEC-GPG-KEY.asc
  # gpg --verify file.sig file

  说明通过gpg验证可以保证软件包安全。

      #gunzip ossec-hids-1.5.tar.gz
  #tar vxf ossec-hids-1.5.tar
  #cd ossec-hids-1.5
  #./install

  开始安装界面如图1 。
开始安装
  图1 开始安装
  首先是语言选择由于笔者使用Solaris 10 服务器不能支持UTF 编码格式,所以汉字显示为乱码,所以选择英文安装不过这应当是Unix 系统管理员基本功,不过在Linux 下是可以使用中文安装的。接着系统进行检测主机情况如图2 。
检测主机情况
  图2 检测主机情况
  说明OSSEC需要以root权限安装。按 ENTER 继续或 Ctrl-C 退出。
  下面是具体安装步骤,包括三大部分若干小部分:
  您希望哪一种安装 ,如图3 。
选择安装类型
  图3 选择安装类型
  说明:您可以有三种安装选项:服务器端安装(server),代理端(agent)或本地安装(local):如果选择'服务器端安装(server)', 您将可以分析所有日志,发送e-mail告警及联动,接收远端机器的syslog日志, 接收代理端发回的日志(代理端发回的日志是经过加密的).如果您选择'代理端安装(agent)', 您将可以读取本机文件(syslog, snort, apache等)并将它们发送给服务器端(加密过后)进行分析.如果选择'本地安装(local)',除了不能接收远程机器或代理端发回的信息外,你可以作服务器(server)安装能做的任何事情。如果您希望安装一个日志分析服务器,请选择'server'.,如果您已经有一台日志分析服务器并且希望将本机的日志传送给它,请选择'agent'. (这是web服务器, 数据库服务器等的理想配置方法),如果您只有一台机器要监控,那么请选择'local'。
  本章选择Server 服务器安装
  初始化安装环境
  初始化安装环境即选择安装目录,通常选择/var/ossec即可。
  配置 OSSEC HIDS
  此处是本文配置关键之处,笔者详细介绍:包括6 项内容,代码依次如下:

      - Configuring the OSSEC HIDS.
  - Do you want e-mail notification? (y/n) [y]: y
  - What's your e-mail address? youremail@yourdomain.com
  - What's your SMTP server ip/host? your smtp server address (localhost)
  - Do you want to run the integrity check daemon? (y/n) [y]: y
  - Running syscheck (integrity check daemon).
  - Do you want to run the rootkit detection engine? (y/n) [y]: y
  - Running rootcheck (rootkit detection).
  - Active response allows you to execute a specific
  command based on the events received. For example,
  you can block an IP address or disable access for
  a specific user.
  More information at:
  http://www.ossec.net/en/manual.html#active-response
  - Do you want to enable active response? (y/n) [y]: y
  - Active response enabled.
  - By default, we can enable the host-deny and the
  firewall-drop responses. The first one will add
  a host to the /etc/hosts.deny and the second one
  will block the host on iptables (if linux) or on
  ipfilter (if Solaris, FreeBSD or NetBSD).
  - They can be used to stop SSHD brute force scans,
  portscans and some other forms of attacks. You can
  also add them to block on snort events, for example.
  - Do you want to enable the firewall-drop response? (y/n) [y]: y
  - firewall-drop enabled (local) for levels >= 6
  - Default white list for the active response:
  - 192.168.2.1
  - Do you want to add more IPs to the white list? (y/n)? [n]: n
  - Setting the configuration to analyze the following logs:
  -- /var/log/messages
  -- /var/log/auth.log
  -- /var/log/syslog
  -- /var/log/mail.info
  -- /var/log/apache2/error.log (apache log)
  -- /var/log/apache2/access.log (apache log)
  - If you want to monitor any other file, just change
  the ossec.conf and add a new localfile entry.
  Any questions about the configuration can be answered
  by visiting us online at http://www.ossec.net .
  --- Press ENTER to continue ---

  中文解释如下:
  - 您希望收到e-mail告警吗? (y/n) [y]: n
  --- Email告警启用 .
  - 您希望运行系统完整性检测模块吗? (y/n) [y]:
  - 系统完整性检测模块将被部署.
  - 您希望运行 rootkit检测吗? (y/n) [y]:
  - rootkit检测将被部署.
  - 关联响应允许您在分析已接收事件的基础上执行一个已定义的命令.
  例如,你可以阻止某个IP地址的访问或禁止某个用户的访问权限.
  更多的信息,您可以访问:
  http://www.ossec.net/en/manual.html#active-response
  - 您希望开启联动(active response)功能吗? (y/n) [y]:
  - 关联响应已开启
  - 默认情况下, 我们开启了主机拒绝和防火墙拒绝两种响应.
  第一种情况将添加一个主机到 /etc/hosts.deny.
  第二种情况将在iptables(linux)或ipfilter(Solaris,FreeBSD或NetBSD)中拒绝该主机的访问.
  - 该功能可以用以阻止 SSHD 暴力攻击, 端口扫描和其他
  一些形式的攻击. 同样你也可以将他们添加到其他地方,例如将他们添加为 snort 的事件.
  - 您希望开启防火墙联动(firewall-drop)功能吗? (y/n) [y]:
  - 防火墙联动(firewall-drop)当事件级别 >= 6 时被启动
  - 联动功能默认的白名单是:
  - 192.168.40.1
  - 您希望添加更多的IP到白名单吗? (y/n)? [n]:
  - 您希望接收远程机器syslog吗 (port 514 udp)? (y/n) [y]:
  - 远程机器syslog将被接收.
  - 设置配置文件以分析一下日志:
  -- /var/log/messages
  -- /var/log/secure
  -- /var/log/maillog
  -如果你希望监控其他文件, 只需要在配置文件ossec.conf中
  添加新的一项-如果你希望监控其他文件, 只需要在配置文件ossec.conf中
  任何关于配置的疑问您都可以在 http://www.ossec.net 找到答案.
  --- 按 ENTER 以继续 ---
  配置界面如图4 。
配置界面
  图4 配置界面
(责任编辑:IORI)
网友评论
评论加载中…
友情链接 | 欢迎投稿 | 杂志发行 | 广告报价 | 人才招聘 | 服务条款 | 免责声明 | 隐私保护 | 关于网管员世界
CopyRight © 2001-2008 [网管员世界 www.365master.com] All Rights Reserved.
《网管员世界》杂志,专为网管服务的刊物!