Solaris基本安全配置规范Word文件下载.docx

上传人:b****6 文档编号:18622437 上传时间:2022-12-29 格式:DOCX 页数:12 大小:23.87KB
下载 相关 举报
Solaris基本安全配置规范Word文件下载.docx_第1页
第1页 / 共12页
Solaris基本安全配置规范Word文件下载.docx_第2页
第2页 / 共12页
Solaris基本安全配置规范Word文件下载.docx_第3页
第3页 / 共12页
Solaris基本安全配置规范Word文件下载.docx_第4页
第4页 / 共12页
Solaris基本安全配置规范Word文件下载.docx_第5页
第5页 / 共12页
点击查看更多>>
下载资源
资源描述

Solaris基本安全配置规范Word文件下载.docx

《Solaris基本安全配置规范Word文件下载.docx》由会员分享,可在线阅读,更多相关《Solaris基本安全配置规范Word文件下载.docx(12页珍藏版)》请在冰豆网上搜索。

Solaris基本安全配置规范Word文件下载.docx

将每次重启产生的coredump大小设置为0,不需要无用的信息。

可选

3.3 

修正堆栈错误,防止溢出(只对2.6后有效)

hacker进入系统后大部分是利用buffer 

overflow取得root 

shell

为了防止基于堆栈的缓冲区溢出,在/etc/system文件中加入

noexec_user_stack=1 

&

#61664;

防止在堆栈中执行

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 

<

EOF>

/etc/rc3.d/S79tmpfix

#!

/bin/sh

#ident 

"

@(#)tmpfix 

1.0 

95/09/14"

if 

-d 

/tmp 

]

then

/usr/bin/chmod 

g-s 

/tmp

1777 

/usr/bin/chgrp 

sys 

/usr/bin/chown 

fi

EOF

改变S79tmpfix文件权限:

#/usr/bin/chmod 

755 

此项给/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:

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 

logins 

at 

level 

LOG_NOTICE 

and 

multiple 

failed 

login

attempts 

LOG_C

SYSLOG=YES

4.6 

设置session超时时间

TIMEOUT 

sets 

number 

of 

seconds 

(between 

900) 

wait 

before

abandoning 

session.

TIMEOUT=120

4.7 

设置缺省umask

编辑/etc/default/login,加上:

UMASK 

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 

requires 

password.

PASSREQ=YES

4.10设置Shell环境变量

ALTSHELL 

SHELL 

environment 

variable 

set

ALTSHELL=YES

4.11检查是否每个用户都设置了密码

检查/etc/passwd和/etc/shadow,

每个用户的密码栏是否为空。

4.12编辑使用useradd的缺省配置,满足密码策略

编辑/etc/sadm/defadduser,需要满足密码策略,比如:

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 

sugroup

550 

/bin/su

+s 

#chown 

root:

sugroup 

#ls 

-al 

-r-sr-s--- 

18360 

Jan 

15 

1998 

#grep 

/etc/group

sugroup:

:

600:

root,httpadm,wspher

这样,只有sugroup组中的用户可以使用su,提升为超级用户

另外一个可行的方法是使用sudo来替代su

5. 

开放的服务(inetd)

5.1 

在/etc/inetd.conf中注释掉左右不需要的服务,比如

name 

 

login, 

exec, 

comsat, 

talk

rusersd 

printer 

finger 

uucp 

所有以“r”开头的服务

对必须提供的服务采用tcpwapper来保护

5.2 

编译安装Tcp 

wapper

安装tcpd,编辑inetd.conf中的服务为:

ftp 

stream 

tcp 

nowait 

/usr/local/bin/tcpd 

in.ftpd

telnet 

in.telnetd

5.3 

定义限制的地址

检查hosts.allow和hosts.deny

/etc/hosts.deny 

ALL:

ALL

提供的服务在/etc/hosts.allow定义

service>

source-ip>

5.4 

使用xinetd替代

xinetd中可以限制特殊的inetd服务到特定的端口

6. 

启动时提供的服务(rc.x)

6.1 

在rc.x目录中将不需要的服务改名,比如

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 

used 

NIS+ 

or 

NFS 

are 

installed, 

start 

with

–d 

option 

so 

defaults 

“nobody” 

key 

not 

allowed)

rpcbind提供远程呼叫,依靠远程系统的ip地址和远程用户的ID进行验证,这样很容易伪造和改变

6.2 

禁止所有DMI服务

禁止所有DMI服务:

/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

ufs 

6.4 

检查所有的.rhosts文件

.rhosts允许不要密码远程访问,

$HOME/.rhosts文件,并且设置为0000,防止被写入”+ 

+”。

(攻击者经常使用类似符号链接或者利用ROOTSHELL写入)。

预先生成

$HOME/.rhosts文件的一些命令)注:

这种情况会导致一些如SSH的RCP命令无法使用(需要使用

touch 

/.rhosts 

chmod 

.rhosts可以被普通用户所创建在个人目录下。

推荐使用脚本来发现.rhosts文件。

并且利用cron自动检查,报告给特定用户。

Script 

for 

Find.rhost:

/usr/bin/find 

/home 

-name 

.rhosts 

(cat 

thisonlyfind.rhost:

cat

)|/bin/mailx-s"

Contentof.rhostsfileauditreport"

yourmailbox

6.5禁止使用.rhosts认证

在/etc/pam.conf中删除

rloginauthsufficient/usr/lib/security/pam_rhosts_auth.so.1

将rsh的行改为:

rshauthrequired/usr/lib/security/pam_unix.so.1

6.6检查信任关系

检查/etc/hosts.equiv文件,确保为空

7.网络接口调整和安全优化

7.1/etc/rc2.d/S?

inet参数调整

在/etc/rc2.d/S?

inet中做如下参数调整:

缩短ARP的cache保存时间:

ndd-set/dev/arparp_cleanup_interval60000/*1min(defaultis5min*/

缩短ARP表中特定条目的保持时间:

ndd-set/dev/ipip_ire_flush_interval60000/*1min(defaultis20min*/

关闭echo广播来防止ping攻击

ndd-set/dev/ipip_respond_to_echo_broadcast0#defaultis1

关闭原路由寻址

ndd-set/dev/ipip_forward_src_routed0#defaultis1

禁止系统转发IP包

ndd-set/dev/ipip_forwarding0#defaultis1

禁止系统转发定向广播包

ndd-set/dev/ipip_forward_directed_broadcasts0#defaultis1

使系统忽略重定向IP包

ndd-set/dev/ipip_ignore_redirect1#defaultis0

使系统限制多宿主机

ndd-set/dev/ipip_strict_dst_multihoming1#defaultis0

再次确保系统关闭ICMP广播响应

ndd-set/dev/ipip_respond_to_address_mask_broadcast=0#defaultis1

关闭系统对ICMP时戳请求的响应

ndd-set/dev/ipip_ip_respond_to_timestamp=0#defaultis1

关闭系统对ICMP时戳广播的响应

ndd-set/dev/ipip_ip_respond_to_timestamp_broadcast=0#defaultis1

禁止系统发送ICMP重定向包

ndd-set/dev/ipip_send_redirects=0#defaultis1

7.2改变TCP序列号产生参数

在/etc/default/inetinit中改变

TCP_STRONG_ISS=2

7.3设置in.routed运行在静态路由模式

创建文件/usr/sbin/in.routed为以下内容:

/bin/sh

/usr/sbin/in.routed.orig–q

改变文件属性:

chmod0755/usr/sbin/in.routed

#动态路由可能会收到错误的路由信息,所以建议使用静态路由

Considertousestaticroutes(routesaddedviatheroutecommandsinstartupfiles)

ratherthantheroutingdaemons

7.4禁止路由功能

创建空文件notrouter:

touch/etc/notrouter

7.5利用ip-filter

ip-filter是Solaris系统的内核模块,可以完成简单包过滤

8.文件权限

8.1删除所有不使用的suid文件

列出系统中所有suid文件

find/-typef\(-perm-4000\)–execls–al{}\;

>

$HOME/search-4-suid-files.txt 

首先备份 

suid 

文件:

mkdir 

/opt/backup/suid

find 

-type 

\( 

-perm 

-4000 

\) 

-print 

|cpio 

-pudm 

删除前建立tar备份,不要删除suid-files.tar!

!

cd 

/opt/backup;

tar 

–cvpf 

suid-files.tar 

/opt/backup/suid/*

rm 

–r 

去除所有suid 

文件中的suid 

–exec 

–s 

{} 

\;

再查一遍

–4000 

ls 

–al 

对一些常用文件建立suid 

u+s 

/usr/bin/su 

/usr/bin/passwd 

/usr/bin/ps 

8.2 

删除所有不使用的sgid文件

列出系统中所有 

文件

-2000 

>

$HOME/search-4-sgid-files.txt 

sgid 

/opt/backup/sgid

删除前建立tar备份,不要删除sgid-files.tar!

sgid-files.tar 

/opt/backup/sgid/*

去除所有sgid 

文件中的sgid 

–2000 

对一些常用文件建立sgid 

8.3 

删除/etc下所有组可写文件

/etc 

-20 

search-4-group-writeable-in-etc.txt

/etc下不应有组可写文件,去掉写权限

–20 

g-w 

8.4 

删除/etc下所有world可写文件

-2 

xargs 

–als 

search-4-world-writeable-in-etc.txt

/etc下不应有world可写文件,去掉写权限

–2 

w-w 

8.5 

将权限为rw-rw-rw-的文件改为rw-r—r—

666 

|xargs 

perm-666-before-change.txt

decide 

one 

these 

files 

critical

perm-666-after-change.txt

8.6 

改变rwxrwxrwx文件的权限 

777 

perm-777-before-change.txt

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 幼儿教育 > 唐诗宋词

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1