当前位置: 首页 > 图文教程 > 网络安全 > 安全基础 > 网络安全讲座之:IDS系统(6)

安全基础
实现高效安全的网络访问控制的解决方案
学会利用加密方法保障电子邮件系统安全
新手入门:常见的病毒前缀的解释
通讯录导进Gmail的经验操作技巧
保障局域网访问internet的速度与安全的技巧
局域网的网上邻居中隐藏共享文件夹
常用的防范sniffer的方法
排除无线网络安全隐患的八大主流技术
outlook或foxmail邮件转入evolution的方法
在浏览器中直接查看照片的EXIF信息
U盘病毒彻底防御办法
多余的本地连接删除的方法
v6677.cn强制设为首页后怎么办?
电脑感染木马桌面多IE图标无法删除
正版用户如何删除产品密钥
如何全面防范邮件病毒的侵蚀
局域网内部禁止修改IP地址
网络钓鱼诈骗也可以专挑有钱人?
视频文件会存在病毒怎么杀毒?
看似不起眼的小动作破坏你计算机安全策略

安全基础 中的 网络安全讲座之:IDS系统(6)


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-10-28   浏览: 93 ::
收藏到网摘: n/a

基于内核的入侵检测

  基于内核的入侵检测是一种相当巧妙的新型的Linux入侵检测系统。现在最主要的基于内核的入侵检测系统叫做LIDS。

  什么是LIDS?LIDS是一种基于Linux内核的入侵检测和预防系统。

  LIDS的保护目的是防止超级用户root的篡改系统重要部分的。LIDS主要的特点是提高系统的安全性,防止直接的端口连接或者是存储器连接,防止原始磁碟的使用,同时还要保护系统日志文件。LIDS当然也会适当制止一些特定的系统操作,譬如:安装sniffer、修改防火墙的配置文件。

  LIDS文档工程

  LIDS比安装PortSentry和LogCheck要复杂一点,但是很幸运的是,在LIDS的主页上面有详细的安装和配置手册。

  安装LIDS

  首先,在安装之前,我们需要大部分最新的LIDS软件包(我使用的是0.9)和适当的内核版本。我现在使用的是从Red Hat主页上下载的2.2.14-12版本的内核,因为其中包含一些安全补丁。同时你也需要你使用的内核的一些源代码。

  现在的LIDS主要是适用于2.2.14版本的内核。我安装的在2.2.14的内核的Red Hat Linux 6.2上面安装了LIDS。在安装LIDS之前,我在ftp.redhat.com下载了最新的内核版本,并且依照http://www.redhat.com/support/docs/howto/kernel-upgrade/kernel-upgrade.html 安装了这个内核。

  接着的事情就是升级内核源代码。这里我们是这样做的:

  rpm -Uhv kernel-source-2.2.14-12.i386.rpm然后就是编译和安装lidsadm这个程序:

  cd /usr/local/src/security/lids-0.9/lidsadm-0.9make

  make install

  生成一个RipeMD-160口令,这个以后将会在安装进内核的:

  lidsadm -P输入口令是"anypass",得到秘钥"d502d92bfead11d1ef17887c9db07a78108859e8"。接着,我把Redhat的配置文件拷贝到我的结构体系中,在/usr/src/linux目录下面:

  cd /usr/src/linux/configs/

  cp kernel-2.2.12-i686.config ..

  下面我们就使用下面的命令来安装LIDS:

  cd /usr/src

  patch -p0 同时我们应该注意到Red Hat所提供的内核和Linus发布的标准的2.2.14版本的内核有一些细微的差别,因为其中包含一些修改过的驱动程序。同样lids-0.9-2.2.14-redhat.patch文件也是和LIDS发布的标准的lids-0.9-2.2.14.patch有一些细微的差别,不过可能后者并不是特别适合于Red Hat系统。

  最后,就是配置、编译和安装内核了:

  cd /usr/src/linuxmake menuconfig

  make dep; make clean

  make

  install; make modules; make modules_install

  下面的脚本展示了在配置内核的过程中我设置的LIDS配置选项:

  [*] Linux Intrusion Detection System support (EXPERIMENTAL)--- LIDS features

  [ ] Hang up console when raising a securit alert

  [*] Security alert when execing unprotected programs before sealing

  [ ] Do not execute unprotected programs before sealing LIDS

  [*] Enable init children lock feature

  [*] Try not to flood logs

  (60) Authorised time between two identic logs (seconds)

  [*] Allow switching LIDS protections

  RipeMD-160 encrypted password: d502d92bfead11d1ef17887c9db07a78108859e8

  (3) Number of attempts to submit password

  (3) Time to wait after a fail (seconds)

  [*] Allow remote users to switch LIDS protections

  [ ] Allow any program to switch LIDS protections

  [*] Allow reloading config. file

  [ ] Hide some known processes

  [*] Port Scanner Detector in kernel

  [ ] Send security alerts through network

  --- Special authorizations

  [ ] Allow some known processes to access /dev/mem (xfree, etc.)

  [ ] Allow some known processes to access raw disk devices

  [ ] Allow some known processes to access io ports

  [ ] Allow some known processes to change routes

  --- Special UPS

  [*] Allow some known processes to unmount devices

  Allowed processes: "/etc/rc.d/init.d/halt;/etc/rc.d/init.d/netfs"

  [*] Unmounting capability is inherited

  [*] Allow some known processes to kill init children

  Allowed processes: "/etc/rc.d/init.d/halt"

  [*] Killing capability is inherited

  看得出,我没有使用UPS,同时运行的是一个需要能够远程访问的服务器,我就按照上面的文件进行了配置,但是在实际