5.2 IP Forwarding (IP轉(zhuǎn)發(fā)) a. 關(guān)閉IP轉(zhuǎn)發(fā) ndd -set /dev/ip ip_forwarding 0 b. 嚴(yán)格限定多主宿主機(jī),如果是多宿主機(jī),還可以加上更嚴(yán)格的限定防止ip spoof的攻擊 ndd -set /dev/ip ip_strict_dst_multihoming 1 c. 轉(zhuǎn)發(fā)包廣播由于在轉(zhuǎn)發(fā)狀態(tài)下默認(rèn)是允許的,為了防止被用來實(shí)施smurf攻擊,關(guān)閉這一特性 ndd -set /dev/ip ip_forward_directed_broadcasts 0 5.3 路由 a. 關(guān)閉轉(zhuǎn)發(fā)源路由包 ndd -set /dev/ip ip_forward_src_routed 0 5.4 ICMP:網(wǎng)絡(luò)控制信息協(xié)議 a. 禁止響應(yīng)Echo廣播: ndd -set /dev/ip ip_respond_to_echo_broadcast 0 b. 禁止響應(yīng)時(shí)間戳廣播 ndd -set /dev/ip ip_respond_to_timestamp_broadcast 0 c. 禁止響應(yīng)地址掩碼廣播 ndd -set /dev/ip ip_respond_to_address_mask_broadcast 0 5.5 重定向錯(cuò)誤 a. 禁止接受重定向錯(cuò)誤 ndd -set /dev/ip ip_ignore_redirect 1 b. 禁止發(fā)送重定向錯(cuò)誤報(bào)文 ndd -set /dev/ip ip_send_redirects 0 c. 禁止時(shí)間戳響應(yīng) ndd -set /dev/ip ip_respond_to_timestamp 0 5.6 SYN_flood攻擊又稱半開式連接攻擊, a. 將默認(rèn)的隊(duì)列值從1024提高到4096來降低受到攻擊時(shí)的危害 ndd -set /dev/tcp tcp_conn_req_max_q0 4096 5.7 連接耗盡攻擊 a. 將核心以連接隊(duì)列參數(shù)(默認(rèn)是128)增大到1024來預(yù)防這種攻擊 ndd -set /dev/tcp tcp_conn_req_max_q 1024 5.8 防止IP 欺騙 對(duì)于solaris系統(tǒng)Tcp協(xié)議實(shí)現(xiàn)的ISN生成有三種方式。 0: 可預(yù)測(cè)的ISN 1: 增強(qiáng)的ISN 隨機(jī)生成 2: RFC 1948描述的ISN生成方式 所有版本的solaris默認(rèn)生成方式值是1。2.5.1只有 0,1兩種方式,2.6/7擁有0,1,2三種ISN生成方式。 修改/etc/default/inetinit文件來提高ISN的生成強(qiáng)度。將 TCP_STRONG_ISS=1改為 TCP_STRONG_ISS=2重起系統(tǒng)生效。 5.9 增加私有端口 一般的情況下,1-1024端口被稱為私有端口,只允許具有根權(quán)限的進(jìn)程連接。但是有些大于1 024的端口,即使需要這樣的限制, 卻無法定義,如NFS的服務(wù)器端口2049,當(dāng)然還有一些其他定義的高于1024的私有端口。
a. 自定義最小的非私有端口 ndd -set /dev/tcp tcp_smallest_nonpriv_port 2050 這樣以來,0-2049都被定義為私有端口。 b. 用來顯示已經(jīng)定義的擴(kuò)展私有端口 ndd /dev/tcp tcp_extra_priv_ports c. 單獨(dú)增加一個(gè)私有端口定義 ndd -set /dev/tcp tcp_extra_priv_ports_add 6112 d. 刪除私有端口定義 ndd -set /dev/tcp tcp_extra_priv_ports_del 6112 e. 要注意的是,不要隨便定義私有端口,因?yàn)橛行┓歉鶛?quán)限的進(jìn)程會(huì)使用這些端口。特別是改變最小非私有端口這個(gè)參數(shù), 經(jīng)常會(huì)引起問題。應(yīng)仔細(xì)分析你的需求再用擴(kuò)展私有端口定義的方式單獨(dú)增加。 f. ndd /dev/tcp tcp_extra_priv_ports 執(zhí)行結(jié)果(某系統(tǒng)) 2049 4045 9010 一共定義了3個(gè)私有端口 5.10 其他內(nèi)核參數(shù)的調(diào)整 a. – Enable stack protection 直譯為允許堆棧保護(hù),應(yīng)該使防止緩沖區(qū)溢出攻擊 You should definitely add the following two lines to your /etc/system file: set noexec_user_stack = 1 set noexec_user_stack_log = 1 b. – Prevent core dumps 避免核心內(nèi)存轉(zhuǎn)儲(chǔ) coreadm -d process c. – Set limits on processes
6. 增強(qiáng)日志記錄 Definitely tweak syslog.conf to capture auth.info and daemon.notice msgs ? Create /var/adm/loginlog ? Additional levels of logging: – System accounting (sar and friends) – Process accounting – Kernel level auditing (BSM)7. 保護(hù)文件系統(tǒng)? File systems should either be mounted "nosuid" or "ro" (read-only) ? Set "logging" option on root file system if you're running Solaris 8 or later ? Don't forget removable media devices: – Turn off vold if possible – Make sure rmmount.conf sets "nosuid"8. 設(shè)置警告信息 兩個(gè)文件 /etc/motd ;/etc/issue – /etc/default/{telnetd,ftpd} – EEPROM – GUI Login
9. 加強(qiáng)系統(tǒng)的訪問控制 9.1. 只允許root從console登陸 CONSOLE=/dev/console is set in /etc/default/login sshd_config 里面設(shè)置 PermitRootLogin no 9.2. 禁止或刪除不用的帳號(hào) 對(duì)不需要登陸的帳號(hào),可將/etc/passwd文件中的shell選項(xiàng)修改為/bin/false 或者/dev/null
9.3. 創(chuàng)建/etc/ftpusers 在該文件中未指定的用戶才能使用ftp服務(wù) 9.4. 禁止.rhosts支持 a. 刪除系統(tǒng)中的.rhosts文件 b. 使用ssh的情況下,保證sshd_config文件中("IgnoreRhosts yes") c. /etc/pam_conf and remove any lines containing rhosts_auth, even if you've disabled rlogin/rcp. 9.5. 限制對(duì)cron和at的訪問 cron.allow and at.allow列出有權(quán)運(yùn)行提交修改cron和at任務(wù)的用戶 9.6. 設(shè)置eeprom到安全模式 Setting "eeprom security-mode=command" will cause the machine to prompt for a password before boot-level commands are accepted. This prevents attackers with physical access from booting from alternate media (like a CD-ROM) and bypassing your system security. 9.7. 限制xdmcp,設(shè)置鎖定屏幕的屏保 If you're running X Windows on the machine, make sure to disable remote XDMCP access in /etc/dt/config/Xaccess. You may also want to set a default locking screensaver timeout for your users in /etc/dt/config/*/sys.resources.