關(guān)于Linux內(nèi)核安全入侵偵察系統(tǒng)的使用問題
在簡(jiǎn)單介紹Linux內(nèi)核安全入侵偵察系統(tǒng)中介紹了Linux系統(tǒng)暴露的問題,和入侵偵察系統(tǒng)的特點(diǎn),那么我們?cè)趺磥硗瓿梢粋€(gè)相對(duì)相對(duì)高級(jí)別的Linux內(nèi)核安全。
下載LIDS補(bǔ)丁和相關(guān)正式的Linux內(nèi)核
可以從LIDS Home,LIDS Ftp Home或最近的LIDS Mirror獲得LIDS補(bǔ)丁和系統(tǒng)管理工具。
補(bǔ)丁名稱是lids-x.xx-y.y.y.tar.gz, x.xx代表lids的版本, y.y.y代表Linux內(nèi)核版本.例如, lids-0.9.9-2.2.17.tar.gz代表lids 版本是0.9.9 以及相關(guān)的內(nèi)核版本是2.2.17.。
必須下載相關(guān)的內(nèi)核版本。例如,你下載了lids-0.9.9-2.2.17.tar.gz,那你就應(yīng)該下載Linux內(nèi)核2.2.17的原代碼。可以從Kernel FTP Site或其他鏡象獲得內(nèi)核原碼。
然后,將內(nèi)核原碼和LIDS tar解壓.例如,從 www.lids.org得到lids-0.9.9-2.2.17.tar.gz,從ftp.us.kernel.org得到linux-2.2.17.tar.bz2后: 1. uncompress the Linux kernel source code tree.# cd linux_install_path/# bzip2 -cd linux-2.2.17.tar.bz2 tar -xvf -2. uncompress the lids source code and install the lidsadm tool.# cd lids_install_path# tar -zxvf lids-0.9.8-2.2.17.tar.gz
在正式的linux內(nèi)核上打LIDS補(bǔ)丁,Linux內(nèi)核原碼打LIDS補(bǔ)丁 # cd linux_install_path/linux# patch -p1/* link the default source path to lids patched version# rm -rf /usr/src/linux# ln -s linux_install_patch/linux /usr/src/linux
配置Linux內(nèi)核,現(xiàn)在,配置Linux內(nèi)核,按照以下步驟實(shí)施: Prompt for development and/or incomplete code/driversSysctl supportAfter that, you will find that a new item appear in the bottom of the configuration menu name "Linux Intrusion Detection System". Entering this menu, turn the Linux Intrusion Detection System support (EXPERIMENTAL) (NEW).
配置LIDS內(nèi)核以后.退出配置界面,編譯內(nèi)核。 # make dep# make clean# make bzImage# make modules# make modules_install
在Linux系統(tǒng)上安裝LIDS和系統(tǒng)管理工具,復(fù)制 bzImage 到 /boot/ ,編輯 /etc/lilo.conf。 # cp arch/i386/boot/bzImage /boot/bzImage-lids-0.9.9-2.2.17/*build admin tools */# cd lids-0.9.8-2.2.17/lidsadm-0.9.8/# make# make install# less /etc/lilo.confboot=/dev/hdamap=/boot/mapinstall=/boot/boot.bprompttimeout=50default=linuximage=/boot/vmlinuz-2.2.16-3label=linuxread-onlyroot=/dev/hda2image=/boot/bzImage-lids-0.9.9-2.2.17label=devread-onlyroot=/dev/hda2
運(yùn)行/sbin/lilo 來安裝新內(nèi)核: # /sbin/lilo
配置LIDS系統(tǒng)
在重新啟動(dòng)以前,必須配置lids系統(tǒng),使其符合你的安全需要.你可以定義受保護(hù)的文件,受保護(hù)的進(jìn)程等等。
缺省情況下,lidsadm將把缺省配置文件安裝到 /etc/lids/。你必須根據(jù)自己的需要重新配置。首先,可以更新缺省lids.conf的inode/dev值。 # /sbin/lidsadm -U
重新啟動(dòng)系統(tǒng)
配置完Linux系統(tǒng)后,重新啟動(dòng).當(dāng)lilo出現(xiàn)時(shí),選擇裝載the lids enable kernel。然后,你就將進(jìn)入美妙的LIDS世界。
封裝內(nèi)核
系統(tǒng)啟動(dòng)后,不要忘記用lidsadm封裝內(nèi)核,在最后/etc/rc.local加入以下命令: # /sbin/lidsadm -I
在線管理
封裝完內(nèi)核后,你的系統(tǒng)就處于LIDS的保護(hù)下??梢宰鲆恍y(cè)試來驗(yàn)證,如果想改變某些配置,例如修改權(quán)限,可以通過輸入密碼方式在線改變lids的安全等級(jí)。 # /sbin/lidsadm -S -- -LIDS
改變lids配置屬性后,例如lids.conf,lids.cap,你可以通過以下命令在內(nèi)核中重新裝載配置文件: # /sbin/lidsadm -S -- +RELOAD_CONF
配置LIDS系統(tǒng)
LIDS配置目錄 -- “/etc/lids/”
這樣我們就差不多完成了Linux內(nèi)核安全入侵偵察系統(tǒng)的建立,幫助我們更好的管理Linux內(nèi)核安全。