Solaris基本安全配置规范_第1页
Solaris基本安全配置规范_第2页
Solaris基本安全配置规范_第3页
Solaris基本安全配置规范_第4页
Solaris基本安全配置规范_第5页
已阅读5页,还剩7页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

SolarisSolaris 基本安全配置规范基本安全配置规范 发布于 2005 05 28 被读 4869 次 字体 大 中 小 Solaris 的安全配置可以从以下几个方面来考虑 1 本地安全增强 包括 限制某些强大命令的访问 设置正确的文件权限 应用组和用户的概念 suid sgid 的文件最少 rw rw rw 的文件最少等 2 网络安全增强 包括 使用安全的协议来管理 禁止所有不需要的服务 禁止系统间的信任关系 禁止不需要的帐号 增强认证需要的密码 保护存在危险的网络服务 限制访问等 3 应用安全增强 包括 限制用户的权限 限制进程所有者的权限 检查应用相关文件权限 限制访问其他系统资源 应用所依赖的 suid sgid 文件最少 使用应用本身的安全特性 删除 samples 和其他无用的组件 4 监控与警报 包括 日志 完整性 入侵检测等一些使用工具等 下面就详细讲述具体的配置过程 一 操作系统配置 1 安装 1 1 安装最新的补丁 安装 patches 对系统稳定和安全十分重要 看系统中安装了那些补丁 showrev p 更新更安全的补丁在 1 2 初始安装时需要创建 var 分区 日志文件存在 var 分区 1 3 安装最小的系统 2 打开审计功能 审计包括很多的内容 可以根据需求设置 可以参考本文档中的日志和监控部分 3 系统参数配置 3 1 eeprom 安全 eeprom security command 系统将改变安全级别 并提示输入密码 对于一般用户 从硬盘启动 不需要输入密码 如果选择从光盘启动 则需要密码 主要防止物理接触 此项为可选配置 视具体需求而定 3 2 将 coredump 大小设置为 0 在 etc system 中加入如下一行 set sys coredumpsize 0 将每次重启产生的 coredump 大小设置为 0 不需要无用的信息 可选 3 3 修正堆栈错误 防止溢出 只对 2 6 后有效 hacker 进入系统后大部分是利用 buffer overflow 取得 root shell 为了防止基于堆栈的缓冲区溢出 在 etc system 文件中加入 set noexec user stack 1 防止在堆栈中执行 set noexec user stack log 1 当某人试图运行增加一个记录 然后改变文件权限 chmod 644 etc system 3 4 只允许 root 进行电源管理 只对 2 6 及以后版本有效 编辑 etc default sys suspend 将 PERMS console owner 改为 PERMS 并做 bin chmod 0755 usr openwin bin sys suspend 此项防止 SYN Flood 攻击 3 5 设置 tmp 目录粘滞位 mode 1777 创建文件 etc rc3 d S79tmpfix bin cat etc rc3 d S79tmpfix bin sh ident tmpfix 1 0 95 09 14 if d tmp then usr bin chmod g s tmp usr bin chmod 1777 tmp usr bin chgrp sys tmp usr bin chown sys tmp fi EOF 改变 S79tmpfix 文件权限 usr bin chmod 755 etc rc3 d S79tmpfix 此项给 tmp 加上粘滞位 只允许写而不允许删除 这样 当黑客往 tmp 写 socket 文件时不允许删除 3 6 禁止 stop A 键 在 etc default kbd 中 改变或加入 KEYBOARD ABORT disable 此项防止启动后 按 stop A 或 L1 A 得到 ok 提示符 使用启动盘可以进入单用户模式 防止黑客物理接触机器 但此项不禁止可以作为密码丢失时的应急处理 4 用户管理 4 1 禁止所有不需要的系统帐户 编辑 etc passwd 将需要禁止帐户的 用 NP 代替 Example noaccess NP 60002 60002 No Access User sbin noshell 需要禁止的帐户有 bin daemon adm lp smtp sys uucp nuucp nobody noaccess 4 2 使用强密码 4 3 设置密码相关参数 编辑 etc default passwd 设置 PWMIN 1 最短改变时间 PWMAX 13 密码最长有效时间 PWWARN 4 密码失效前几天通知用户 PWLEN 8 最短密码长度 4 4 防止 root 远程登陆 编辑 etc default login 加上 CONSOLE dev console If CONSOLE is set root can only login on that device 4 5 记录所有 root 登陆尝试 SYSLOG determines whether the syslog 3 LOG AUTH facility should be used to log all root logins at level LOG NOTICE and multiple failed login attempts at LOG C SYSLOG YES 4 6 设置 session 超时时间 编辑 etc default login 加上 TIMEOUT sets the number of seconds between 0 and 900 to wait before abandoning a login session TIMEOUT 120 4 7 设置缺省 umask 编辑 etc default login 加上 UMASK sets the initial shell file creation mode mask See umask 1 UMASK 027 权限设置为 750 rw r 对于如下文件 同样加上缺省 umask etc login etc profile etc skel local cshrc etc skel local login etc skel local profile 4 8 设置 root 的 umask 检查 root 的 profile 确保 umask 为 027 或 077 4 9 确保提示输入密码 PASSREQ determines if login requires a password PASSREQ YES 4 10 设置 Shell 环境变量 编辑 etc default login 加上 ALTSHELL determines if the SHELL environment variable should be set ALTSHELL YES 4 11 检查是否每个用户都设置了密码 检查 etc passwd 和 etc shadow 每个用户的密码栏是否为空 4 12 编辑使用 useradd 的缺省配置 满足密码策略 编辑 etc sadm defadduser 需要满足密码策略 比如 Example defgroup 15 defgname users defparent export home defskel etc skel defshell usr bin ksh definact 30 defexpire 4 13 在所有 path 中 去掉所有 路径 检查所有缺省启动脚本和 root 启动脚本 在所有路径变量中删除 路径 包括以下文件 login etc login etc default login cshrc etc skel local cshrc etc skel local login etc skel local profile profile etc profile 4 14 使用 sugroup 来限制 su 将可以 su 的用户添加到这个组 在 etc group 中创建特殊的组 sugroup 将你的管理员帐号加到这个组 改变 bin su 的权限为 r sr sr x 1 root sugroup chmod 550 bin su chmod s bin su chown root sugroup bin su ls al bin su r sr s 1 root sugroup 18360 Jan 15 1998 bin su grep sugroup etc group sugroup 600 root httpadm wspher 这样 只有 sugroup 组中的用户可以使用 su 提升为超级用户 另外一个可行的方法是使用 sudo 来替代 su 5 开放的服务 inetd 5 1 禁止所有不需要的服务 在 etc inetd conf 中注释掉左右不需要的服务 比如 name shell login exec comsat talk rusersd printer finger uucp 所有以 r 开头的服务 对必须提供的服务采用 tcpwapper 来保护 5 2 编译安装 Tcp wapper 安装 tcpd 编辑 inetd conf 中的服务为 ftp stream tcp nowait root usr local bin tcpd in ftpd telnet stream tcp nowait root usr local bin tcpd in telnetd 5 3 定义限制的地址 检查 hosts allow 和 hosts deny etc hosts deny 为 ALL ALL 提供的服务在 etc hosts allow 定义 5 4 使用 xinetd 替代 xinetd 中可以限制特殊的 inetd 服务到特定的端口 6 启动时提供的服务 rc x 6 1 禁止所有不需要的服务 在 rc x 目录中将不需要的服务改名 比如 Example mv etc rc3 d S92volmgt etc rc3 d KS92volmgt 以下服务应该禁止 根据需要自己决定 snmpdx autofs Automounter volmgt Volume Deamon lpsched LP print service nscd Name Service Cache Daemon Sendmail keyserv Keyserv Deamon is only used if NIS or NFS are installed if used start with d option so that the defaults nobody key is not allowed rpcbind 提供远程呼叫 依靠远程系统的 ip 地址和远程用户的 ID 进行验证 这样很容易伪造和改变 6 2 禁止所有 DMI 服务 禁止所有 DMI 服务 mv etc rc3 d S dmi etc rc3 d K dmi etc init d init dmi 中启动的 dmi 服务有 usr lib dmi dmispd usr lib dmi snmpXdmid etc dmi ciagent ciinvoke 6 3 去掉 mount 系统的 suid 位 在 etc rmmount conf 中加上 mount hsfs o nosuid mount ufs o nosuid 6 4 检查所有的 rhosts 文件 rhosts 允许不要密码远程访问 HOME rhosts 文件 并且设置为 0000 防止被写入 攻击者经常使用类似符号链接或者利用 ROOTSHELL 写入 预先生成 HOME rhosts 文件的一些命令 注 这种情况会导致一些如 SSH 的 RCP 命令无法使用 需要使用 touch rhosts chmod 0 rhosts rhosts 可以被普通用户所创建在个人目录下 推荐使用脚本来发现 rhosts 文件 并且利用 cron 自动检查 报告给特定用户 Script for Find rhost bin sh usr bin find home name rhosts cat HOME search 4 suid files txt 首先备份 suid 文件 mkdir opt backup suid find type f perm 4000 print cpio pudm opt backup suid 删除前建立 tar 备份 不要删除 suid files tar cd opt backup tar cvpf suid files tar opt backup suid rm r opt backup suid 去除所有 suid 文件中的 suid 位 find type f perm 4000 exec chmod s 再查一遍 find type f perm 4000 exec ls al 对一些常用文件建立 suid 位 chmod u s usr bin su chmod u s usr bin passwd chmod u s usr bin ps 8 2 删除所有不使用的 sgid 文件 列出系统中所有 suid 文件 find type f perm 2000 exec ls al find type f perm 2000 exec ls al HOME search 4 sgid files txt 首先备份 sgid 文件 mkdir opt backup sgid find type f perm 2000 print cpio pudm opt backup sgid 删除前建立 tar 备份 不要删除 sgid files tar cd opt backup tar cvpf sgid files tar opt backup sgid rm r opt backup sgid 去除所有 sgid 文件中的 sgid 位 find type f perm 2000 exec chmod s 再查一遍 find type f perm 2000 exec ls al 对一些常用文件建立 sgid 位 8 3 删除 etc 下所有组可写文件 find etc type f perm 20 exec ls al find etc type f perm 20 exec ls al search 4 group writeable in etc txt etc 下不应有组可写文件 去掉写权限 find etc type f perm 20 exec chmod g w 8 4 删除 etc 下所有 world 可写文件 find etc type f perm 2 exec xargs ls als find etc type f perm 2 exec xargs ls als search 4 world writeable in etc txt etc 下不应有 world 可写文件 去掉写权限 find etc type f perm 2 exec xargs chmod w w 8 5 将权限为 rw rw rw 的文件改为 rw r r find type f perm 666 xargs ls al perm 666 before change txt decide if one of these files are critical find type f perm 666 exec chmod 644 find type f perm 666 exec xargs ls al perm 666 after change txt 8 6 改变 rwxrwxrwx 文件的权限 find type f perm 777 exec xargs ls al perm 777 before change txt decide if one of these files are critical find type f perm 777 exec xargs chmod 755 find type f perm 777 exec xargs ls al perm 777 after change txt 8 7 查找 world group 可写的目录 find type d perm 2 print search 4 world writeable directories txt find etc type f perm 20 print search 4 group writeable dir txt 8 8 确保每个 root 启动的脚本属于 root 首先查找所有启动脚本的属主 find etc type f print grep rc egrep v skel tty mail snmp Mail xargs ls al rc files before change txt 改变属主 find etc type f print grep rc egrep v skel tty mail snmp Mail xargs chown root root find etc type f print grep rc egrep v skel tty mail snmp Mail xargs ls al rc files after change txt ls al etc init d etc init d before change txt chown root root etc init d ls al etc init d etc init d after change txt 此项用于防止木马攻击 升级或打补丁后需要重做此项 8 9 确保所有 cron 行为有记录 在 etc default cron 中 CRONLOG YES 删除 var spool cron crontabs 目录中除了 root 文件外所有文件 8 10 改变 utmp utmpx 的权限 chmod 644 var adm utmp 8 11 查找无用户文件 1 find type f nouser files nouser before change 2 find type f nouser xargs chwon nobody nobody 3 find type f nouser files nouser after change 8 12 查找无组文件 1 find type f nogroup files nogroup before change 2 find type f nogroup xargs chgrp nobody 3 find type f nogroup files nogroup after change 8 13 改变 var cron 权限 chmod 700 var cron 重定义真实用户为 local class remote guest anonymous 重定义匿名用户为 remote limit lo

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论