CN113946834A - 一种Linux操作系统的安全加固策略优化方法 - Google Patents

一种Linux操作系统的安全加固策略优化方法 Download PDF

Info

Publication number
CN113946834A
CN113946834A CN202111245204.8A CN202111245204A CN113946834A CN 113946834 A CN113946834 A CN 113946834A CN 202111245204 A CN202111245204 A CN 202111245204A CN 113946834 A CN113946834 A CN 113946834A
Authority
CN
China
Prior art keywords
checking
file
checking whether
password
pam
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111245204.8A
Other languages
English (en)
Inventor
芮礼等
罗义斌
司震
杨冰
孙力斌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nanjing Linkage Information Technology Co ltd
Original Assignee
Nanjing Linkage Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nanjing Linkage Information Technology Co ltd filed Critical Nanjing Linkage Information Technology Co ltd
Priority to CN202111245204.8A priority Critical patent/CN113946834A/zh
Publication of CN113946834A publication Critical patent/CN113946834A/zh
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/57Certifying or maintaining trusted computer platforms, e.g. secure boots or power-downs, version controls, system software checks, secure updates or assessing vulnerabilities
    • G06F21/577Assessing vulnerabilities and evaluating computer system security
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/30Authentication, i.e. establishing the identity or authorisation of security principals
    • G06F21/45Structures or tools for the administration of authentication
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2221/00Indexing scheme relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/03Indexing scheme relating to G06F21/50, monitoring users, programs or devices to maintain the integrity of platforms
    • G06F2221/034Test or assess a computer or a system

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Storage Device Security (AREA)

Abstract

一种Linux操作系统的安全加固策略优化方法,步骤如下:1)检查是否设置口令更改最小间隔天数;2)检查账户认证失败次数限制;3)检查是否使用PAM认证模块禁止wheel组之外的用户su为root;4)检查系统是否禁用Ctrl+Alt+Delete组合键;5)检查历史命令设置;6)检查系统openssh安全配置;7)检查用户目录缺省访问权限设置;8)检查日志文件权限设置;9)检查是否禁止root用户远程登录;10)检查是否设置命令行界面超时退出;11)检查是否设置口令生存周期;12)检查密码重复使用次数限制;13)检查是否设置SSH登录前警告Banner;14)检查设备密码复杂度策略;将以上步骤构成构成linux6.0的操作系统软件的一个优先运行的子代码,在操作系统启动时运行。

Description

一种Linux操作系统的安全加固策略优化方法
技术领域
本发明涉及Linux操作系统安全领域,具体地说是一种基于Linux操作系统的安全加固策略优化方法,提升系统加固工作效率及加强Linux操作系统的安全性。
背景技术
网络安全是一个非常重要的课题,而服务器是网络安全中最关键的环节。Linux操作系统是一个比较常用且安全的服务器操作系统,作为一种开放源代码操作系统,一旦Linux操作系统中发现有安全漏洞,互联网上来自世界各地的志愿者会踊跃修补它。然而,相对于这些系统本身的安全漏洞,更多的安全问题是由不当的配置造成的,可以通过适当的配置来防止。服务器上运行的服务越多,不当的配置出现的机会也就越多,出现安全问题的可能性就越大。
绝大多数服务器都选用Linux作为服务器的操作系统,是因为Linux操作系统相对来说比较安全,但安装完系统后若不对系统进行安全加固的话,系统某些薄弱的地方可能会被黑客利用,会造成服务器容易被攻击。
目前一般系统加固需手动检测系统相关配置文件并手动修改,这就造成一个系统加固的效率问题,当一个服务器规模较大的系统,在进行安全加固的过程中,传统的加固方法会耗时费力。现有技术中,对Linux操作系统的安全加固都是通过系统管理员手工修改相关配置文件,不仅效率较低,而且容易出现漏洞,容易有部分配置文件未及时修改或者修改不正确,本身也会造成服务器的故障和安全隐患。
CN2018104104949提出了一种Linux服务器自动化安全加固方法,包括以下步骤:Linux系统运行系统加固管理脚本,以当前时间备份原配置文件;读取原配置文件设定值,选取对应功能的配置脚本;导入配置脚本设定值参数,替换原配置文件设定值,生成新的配置文件;将新的配置文件分类写入日志文件中,完成服务器自动化安全加固。提供了一种Linux服务器自动化安全加固方法,Linux服务器采用bash脚本控制,将linux6.0的操作系统软件分为多个独立可部署可扩展的脚本控制代码段,突破人工操作过程中出现瓶颈,避免了修改工作量暴增时,管理人员操作不及时给系统带来的风险。
但导入配置脚本设定值参数过程比较繁杂,系统的工作量大。
CN2014106867284公开了一种Linux系统安全加固方法及系统,该方法包括自动检测系统中的薄弱环节,并通过检查账号安全;停止承载业务无关服务;控制数据访问;控制网络访问;限定信任主机;鉴别用户;配置审计策略进行审计一系列自动操作,完成对Linux系统安全加固自动进行的工作。把需手动执行的所有过程变为自动化执行,节省了时间,实现快速为Linux系统安全加固的方法,提高效率,增强系统安全性。
发明内容
本发明的提出的技术任务是,提供一种针对Linux操作系统进行安全加固防护策略优化,增强Linux操作系统安全防护和加固效率,用以解决现有技术中系统管理员手动修改Linux操作系统自带配置文件带来的效率低下、安全系数低的问题。资源占用少和Linux系统工作快捷的方法。
本发明的技术方案是,一种Linux操作系统的安全加固策略优化方法,包括如下步骤:
1)检查是否设置口令更改最小间隔天数;检查:/etc/login.defs文件中口令更改最小间隔天数;加固方法:将/etc/login.defs文件中的口令更改最小间隔天数设置为10天;
2)检查账户认证失败次数限制;检查方法,检查/etc/pam.d/system-auth文件中是否配置了账户认证失败的次数和锁定时间。
加固方法:在/etc/pam.d/system-auth文件中,将账户认证失败策略定义成失败5次后锁定180秒。
3)检查是否使用PAM认证模块禁止wheel组之外的用户su为root;检查方法,检查/etc/pam.d/su文件中,是否使用PAM认证模块禁止wheel组之外的用户su为root;
加固方法,在/etc/pam.d/su文件中,对PAM认证模块进行配置,禁止wheel组之外的用户su为root。
4)检查系统是否禁用Ctrl+Alt+Delete组合键;
检查方法,检查/usr/lib/systemd/system/ctrl-alt-del.target文件中,是否禁用Ctrl+Alt+Delete组合键;加固方法,在/usr/lib/systemd/system/ctrl-alt-del.target文件中,配置禁用Ctrl+Alt+Delete组合键;
5)检查历史命令设置;
检查方法,检查/etc/profile文件中,历史命令中保存命令的记录总数和命令输出的记录数;
加固方法,在/etc/profile文件中,配置历史命令的保存命令的记录总数和命令输出的记录为5
6)检查系统openssh安全配置;
检查方法,检查etc/ssh/sshd_config文件中,是否禁止了不安全的登录配置;
#加固方法,在检查etc/ssh/sshd_config文件中,禁止不安全的登录配置;
7)检查用户目录缺省访问权限设置;
检查方法,检查/etc/profile文件中用户目录缺省访问权限的umask值是否为027;
加固方法,将/etc/profile文件中用户目录缺省访问权限的umask值设置为027;
8)检查日志文件权限设置;
检查方法,检查/var/log/messages、/var/log/dmesg、/var/log/maillog、/var/log/secure、/var/log/wtmp、/var/log/cron等文件的权限设置是否符合安全认证;
加固方法,修改/var/log/messages、/var/log/dmesg、/var/log/maillog、/var/log/secure、/var/log/wtmp、/var/log/cron等文件的权限,使其符合安全认证;
9)检查是否禁止root用户远程登录;
检查方法,检查/etc/ssh/sshd文件中,是否禁止root用户远程登录
加固方法,配置/etc/ssh/sshd文件,禁止root用户远程登录
10)检查是否设置命令行界面超时退出;
检查方法,检查/etc/profile文件中,是否设置命令行界面超时退出
加固方法,将/etc/profile文件中,命令行界面超时退出的时间设置为300秒;
11)检查是否设置口令生存周期;
检查方法,检查/etc/login.defs文件中,是否设置口令生存周期;
加固方法,将/etc/login.defs文件中口令生存周期设置为90天;
12)检查密码重复使用次数限制;
检查方法,检查/etc/pam.d/system-auth文件中,是否有密码重复使用次数限制;
加固方法,将/etc/pam.d/system-auth文件密码重复使用次数限制设置为5次;
13)检查是否设置SSH登录前警告Banner;
检查方法,检查在SSH登录前,是否有警告Banner;
加固方法,配置/etc/ssh/sshd_config文件,添加SSH登录前警告Banner;
14)检查设备密码复杂度策略;
检查方法,检查/etc/pam.d/system-auth文件中,是否配置了密码复杂度策略
加固方法,在/etc/pam.d/system-auth文件中,将密码复杂度策略配置为至少一个大写字母,一个小写字母,一个数字,一个特殊符号;将以上步骤构成一个独立可部署可扩展的脚本控制代码段固化,构成linux6.0的操作系统软件的一个优先运行的子代码,并在操作系统启动时运行。
以上步骤1-13)的先后均可;步骤1-13)的先后顺序变化仍未超出本发明的范围。
有益效果:步骤1)-13)基本上给出了现有Linux操作系统进行安全加固防护策略优化的主要和特有步骤,加上步骤14)更好。实施第1)2)3)4)9)11)12)13)14)几个步骤可以对Linux安全基线有显著的加固效果,并且在现有的操作系统初始状态下都未进行有效加固配置。
(1)检查是否设置口令更改最小间隔天数
1)检查方法
检查/etc/login.defs文件中口令更改最小间隔天数
cat/etc/login.defs|grep-v"^[[:space:]]*#"|grep-E'^\s*PASS_MIN_DAYS'
2)加固方法
将/etc/login.defs文件中的口令更改最小间隔天数设置为10天
echo y|cp-p/etc/login.defs/etc/login.defs_bak
sed-i's/^PASS_MIN_DAYS.*$/PASS_MIN_DAYS 10/g'/etc/login.defs
(2)检查账户认证失败次数限制
1)检查方法
检查/etc/pam.d/system-auth文件中是否配置了账户认证失败的次数和锁定时间。
if[-f/etc/pam.d/system-auth]
then
cat/etc/pam.d/system-auth|sed'/^#/d'|sed'/^$/d'|egrep-i"auth[[:space:]]*required[[:space:]]*pam_tally.so|auth[[:space:]]*required[[:space:]]*pam_tally2.so|account[[:space:]]*required[[:space:]]*pam_tally.so|account[[:space:]]*required[[:space:]]*pam_tally2.so"
fi
2)加固方法
在/etc/pam.d/system-auth文件中,将账户认证失败策略定义成失败5次后锁定180秒。
echo y|cp-p/etc/pam.d/system-auth/etc/pam.d/system-auth_bak
sed-i's/^auth required pam_tally2\.so.*$/auth required pam_tally2\.sodeny=5onerr=fail no_magic_root unlock_time=180/g'/etc/pam.d/system-auth
sed-i'$a\account required pam_tally2\.so'/etc/pam.d/system-auth
(3)检查是否使用PAM认证模块禁止wheel组之外的用户su为root
1)检查方法
检查/etc/pam.d/su文件中,是否使用PAM认证模块禁止wheel组之外的用户su为root
cat/etc/pam.d/su|grep-v"^[[:space:]]*#"|grep-v"^$"|grep"^auth"
2)加固方法
在/etc/pam.d/su文件中,对PAM认证模块进行配置,禁止wheel组之外的用户su为root。
usermod-G wheel用户名
echo y|cp-p/etc/pam.d/su/etc/pam.d/su_bak
sed-i'2a\auth required pam_wheel.so group=wheel'/etc/pam.d/su
#sed-i'3a\auth required pam_wheel.so use_uid'/etc/pam.d/su
(4)检查系统是否禁用Ctrl+Alt+Delete组合键
#检查方法
检查/usr/lib/systemd/system/ctrl-alt-del.target文件中,是否禁用Ctrl+Alt+Delete组合键
cat/usr/lib/systemd/system/ctrl-alt-del.target|sed'/^\s*#/d'|sed'/^\s*$/d'|egrep-i"ctrl-alt-del"
#加固方法
在/usr/lib/systemd/system/ctrl-alt-del.target文件中,配置禁用Ctrl+Alt+Delete组合键
echo y|cp-p/usr/lib/systemd/system/ctrl-alt-del.target/usr/lib/systemd/system/ctrl-alt-del.target_bak
sed-i's/^Alias=ctrl-alt-del.target/#Alias=ctrl-alt-del.target/g'/usr/lib/systemd/system/ctrl-alt-del.target
(5)检查历史命令设置
#检查方法
检查/etc/profile文件中,历史命令中保存命令的记录总数和命令输出的记录数
cat/etc/profile|grep-v"^[[:space:]]*#"|grep"HISTFILESIZE"
cat/etc/profile|grep-v"^[[:space:]]*#"|grep"HISTSIZE"
#加固方法
在/etc/profile文件中,配置历史命令的保存命令的记录总数和命令输出的记录为5
echo y|cp-p/etc/profile/etc/profile_bak
sed-i'$a\HISTFILESIZE=5'/etc/profile
sed-i's/^HISTSIZE=.*/HISTSIZE=5/g'/etc/profile
source/etc/profile
(6)检查系统openssh安全配置
#检查方法
检查etc/ssh/sshd_config文件中,是否禁止了不安全的登录配置
cat/etc/ssh/sshd_config|sed'/^\s*#/d'|sed'/^\s*$/d'|grep-i"^\s*X11Forwarding"
cat/etc/ssh/sshd_config|sed'/^\s*#/d'|sed'/^\s*$/d'|grep-i"^\s*MaxAuthTries"
cat/etc/ssh/sshd_config|sed'/^\s*#/d'|sed'/^\s*$/d'|grep-i"^\s*IgnoreRhosts"
cat/etc/ssh/sshd_config|sed'/^\s*#/d'|sed'/^\s*$/d'|grep-i"^\s*HostbasedAuthentication"
cat/etc/ssh/sshd_config|sed'/^\s*#/d'|sed'/^\s*$/d'|grep-i"^\s*PermitEmptyPasswords"
#加固方法
在检查etc/ssh/sshd_config文件中,禁止不安全的登录配置
echo y|cp-p/etc/ssh/sshd_config/etc/ssh/sshd_config_bak
sed-i's/^X11Forwarding/#X11Forwarding/g'/etc/ssh/sshd_config
sed-i's/^MaxAuthTries/#MaxAuthTries/g'/etc/ssh/sshd_config
sed-i's/^IgnoreRhosts/#IgnoreRhosts/g'/etc/ssh/sshd_config
sed-i's/^HostbasedAuthentication/#HostbasedAuthentication/g'/etc/ssh/sshd_config
sed-i's/^PermitEmptyPasswords/#PermitEmptyPasswords/g'/etc/ssh/sshd_config
sed-i'$a\X11Forwarding no'/etc/ssh/sshd_config
sed-i'$a\MaxAuthTries 4'/etc/ssh/sshd_config
sed-i'$a\IgnoreRhosts yes'/etc/ssh/sshd_config
sed-i'$a\HostbasedAuthentication no'/etc/ssh/sshd_config
sed-i'$a\PermitEmptyPasswords no'/etc/ssh/sshd_config
systemctl restart sshd
(7)检查用户目录缺省访问权限设置
#检查方法
检查/etc/profile文件中用户目录缺省访问权限的umask值是否为027
awk'{print$1":"$2}'/etc/profile|grep-v"^[[:space:]]*#"|grep-iumask|tail-n1
#加固方法
将/etc/profile文件中用户目录缺省访问权限的umask值设置为027
echo y|cp-p/etc/profile/etc/profile_bak
sed-i's/umask 0.*$/umask 027/g'/etc/profile
source/etc/profile
(8)检查日志文件权限设置
#检查方法
检查/var/log/messages、/var/log/dmesg、/var/log/maillog、/var/log/secure、/var/log/wtmp、/var/log/cron等文件的权限设置是否符合安全认证
/dev/null|grep-v"[r-][w-]-------"|grep"[r-][w-][x-][r-][w-][x-][r-][w-][x-]"
ls-alL/var/log/secure 2>/dev/null|grep-v"[r-][w-]-------"|grep"[r-][w-][x-][r-][w-][x-][r-][w-][x-]"
ls-alL/var/log/maillog 2>/dev/null|grep-v"[r-][w-]-------"|grep"[r-][w-][x-][r-][w-][x-][r-][w-][x-]"
ls-alL/var/log/dmesg 2>/dev/null|grep-v"[r-][w-]-[r-]--[r-]--"|grep"[r-][w-][x-][r-][w-][x-][r-][w-][x-]"
ls-alL/var/log/wtmp 2>/dev/null|grep-v"[r-][w-]-[r-][w-]-[r-]--"|grep"[r-][w-][x-][r-][w-][x-][r-][w-][x-]"
ls-alL/var/log/cron 2>/dev/null|grep-v"[r-][w-]-------"|grep"[r-][w-][x-][r-][w-][x-][r-][w-][x-]"
#加固方法
修改/var/log/messages、/var/log/dmesg、/var/log/maillog、/var/log/secure、/var/log/wtmp、/var/log/cron等文件的权限,使其符合安全认证
cp-p/var/log/messages/var/log/messages_bak
cp-p/var/log/dmesg/var/log/dmesg_bak
cp-p/var/log/maillog/var/log/maillog_bak
cp-p/var/log/secure/var/log/secure_bak
cp-p/var/log/wtmp/var/log/wtmp_bak
cp-p/var/log/cron/var/log/cron_bak
chmod 600/var/log/messages
chmod 644/var/log/dmesg
chmod 600/var/log/maillog
chmod 600/var/log/secure
chmod 664/var/log/wtmp
chmod 600/var/log/cron
(9)检查是否禁止root用户远程登录
#检查方法
检查/etc/ssh/sshd文件中,是否禁止root用户远程登录
grep-v"^[[:space:]]*#"/etc/ssh/sshd_config|grep-i"PermitRootLogin"
#加固方法
配置/etc/ssh/sshd文件,禁止root用户远程登录
echo y|cp-p/etc/ssh/sshd_config/etc/ssh/sshd_config_bak
sed-i's/^PermitRootLogin/#PermitRootLogin/g'/etc/ssh/sshd_config
sed-i'$a\PermitRootLogin no'/etc/ssh/sshd_config
#systemctl restart sshd
(10)检查是否设置命令行界面超时退出
#检查方法
检查/etc/profile文件中,是否设置命令行界面超时退出
cat/etc/profile|grep-v"^[[:space:]]*#"|grep-v"^$"|grep"TMOUT"
#加固方法
将/etc/profile文件中,命令行界面超时退出的时间设置为300秒
echo y|cp-p/etc/profile/etc/profile_bak
sed-i'$a\TMOUT=300'/etc/profile
sed-i'$a\export TMOUT'/etc/profile
source/etc/profile
(11)检查是否设置口令生存周期
#检查方法
检查/etc/login.defs文件中,是否设置口令生存周期
cat/etc/login.defs|grep-v"^[[:space:]]*#"|grep-E'^\s*PASS_MAX_DAYS'
#加固方法
将/etc/login.defs文件中口令生存周期设置为90天
echo y|cp-p/etc/login.defs/etc/login.defs_bak
sed-i's/^PASS_MAX_DAYS.*$/PASS_MAX_DAYS 90/g'/etc/login.defs
(12)检查设备密码复杂度策略
#检查方法
检查/etc/pam.d/system-auth文件中,是否配置了密码复杂度策略
echo"DCREDIT=`cat/etc/pam.d/system-auth|egrep-v"^#|^$"|grep-w"dcredit"|sed's/^.*dcredit=//g'|sed's/\s.*$//g'`"
echo"LCREDIT=`cat/etc/pam.d/system-auth|egrep-v"^#|^$"|grep-w"lcredit"|sed's/^.*lcredit=//g'|sed's/\s.*$//g'`"
echo"UCREDIT=`cat/etc/pam.d/system-auth|egrep-v"^#|^$"|grep-w"ucredit"|sed's/^.*ucredit=//g'|sed's/\s.*$//g'`"
echo"OCREDIT=`cat/etc/pam.d/system-auth|egrep-v"^#|^$"|grep-w"ocredit"|sed's/^.*ocredit=//g'|sed's/\s.*$//g'`"
echo"MINLEN=`cat/etc/pam.d/system-auth|egrep-v"^#|^$"|grep"minlen"|sed's/^.*minlen=//g'|sed's/\s.*$//g'`
#加固方法
在/etc/pam.d/system-auth文件中,将密码复杂度策略配置为至少一个大写字母,一个小写字母,一个数字,一个特殊符号
echo y|cp-p/etc/pam.d/system-auth/etc/pam.d/system-auth_bak
sed-i's/^password\s*requisite\s*pam_cracklib.so/#&/g'/etc/pam.d/system-auth
sed-i'$a\password requisite pam_cracklib.so try_first_pass retry=3minlen=8dcredit=-1ucredit=-1ocredit=-1lcredit=-1'/etc/pam.d/system-auth
(13)检查密码重复使用次数限制
#检查方法
检查/etc/pam.d/system-auth文件中,是否有密码重复使用次数限制
cat/etc/pam.d/system-auth|sed'/^\s*#/d'|sed'/^\s*$/d'|grep-i"password"
#加固方法
将/etc/pam.d/system-auth文件密码重复使用次数限制设置为5次
echo y|cp-p/etc/pam.d/system-auth/etc/pam.d/system-auth_bak
touch/etc/security/opasswd
chown root:root/etc/security/opasswd
chmod 600/etc/security/opasswd
sed-i's/^password\s*sufficient\s*pam_unix.so.*$/&remember=5/g'/etc/pam.d/system-auth
(14)检查是否设置SSH登录前警告Banner
#检查方法
检查在SSH登录前,是否有警告Banner
ps-ef|grep-i"ssh"|grep-v"grep"|awk'{print$NF}'
echo"banner=[`cat/etc/ssh/sshd_config|grep-v'^[[:space:]]*#'|grep-iBanner|awk'{print$2}'|while read in;do cat$in;done`]"
#加固方法
配置/etc/ssh/sshd_config文件,添加SSH登录前警告Banner
1、编辑文件/etc/ssh/sshd_config文件,修改Banner参数的值如下(如不存在则新增):
echo'Banner/etc/ssh_banner'>>/etc/ssh/sshd_config
touch/etc/ssh_banner
chmod 644/etc/ssh_banner
echo"Authorized only.All activity will be monitored and reported">/etc/ssh_banner
#systemctl restart sshd。

Claims (2)

1.一种Linux操作系统的安全加固策略优化方法,其特征是,包括如下步骤:
1)检查是否设置口令更改最小间隔天数;
2)检查账户认证失败次数限制;
3)检查是否使用PAM认证模块禁止wheel组之外的用户su为root;
4)检查系统是否禁用Ctrl+Alt+Delete组合键;
5)检查历史命令设置;
6)检查系统openssh安全配置;
7)检查用户目录缺省访问权限设置;
8)检查日志文件权限设置;
9)检查是否禁止root用户远程登录;
10)检查是否设置命令行界面超时退出;
11)检查是否设置口令生存周期;
12)检查密码重复使用次数限制;
13)检查是否设置SSH登录前警告Banner;
14)检查设备密码复杂度策略;
将以上步骤构成一个独立可部署可扩展的脚本控制代码段固化,构成linux6.0的操作系统软件的一个优先()运行的子代码,并在操作系统启动时运行。
2.根据权利要求1所述的Linux操作系统的安全加固策略优化方法,其特征是,步骤1)-14)中的检查与加固方法是:
1)检查:/etc/login.defs文件中口令更改最小间隔天数;加固方法:将/etc/login.defs文件中的口令更改最小间隔天数设置为10天;
2)检查方法,检查/etc/pam.d/system-auth文件中是否配置了账户认证失败的次数和锁定时间。
加固方法:在/etc/pam.d/system-auth文件中,将账户认证失败策略定义成失败5次后锁定180秒。
3)检查方法,检查/etc/pam.d/su文件中,是否使用PAM认证模块禁止wheel组之外的用户su为root;
加固方法,在/etc/pam.d/su文件中,对PAM认证模块进行配置,禁止wheel组之外的用户su为root。
4)检查方法,检查/usr/lib/systemd/system/ctrl-alt-del.target文件中,是否禁用Ctrl+Alt+Delete组合键;加固方法,在/usr/lib/systemd/system/ctrl-alt-del.target文件中,配置禁用Ctrl+Alt+Delete组合键;
5)检查方法,检查/etc/profile文件中,历史命令中保存命令的记录总数和命令输出的记录数;
加固方法,在/etc/profile文件中,配置历史命令的保存命令的记录总数和命令输出的记录为5
6)检查方法,检查etc/ssh/sshd_config文件中,是否禁止了不安全的登录配置;加固方法,在检查etc/ssh/sshd_config文件中,禁止不安全的登录配置;
7)检查方法,检查/etc/profile文件中用户目录缺省访问权限的umask值是否为027;
加固方法,将/etc/profile文件中用户目录缺省访问权限的umask值设置为027;
9)检查方法,检查/etc/ssh/sshd文件中,是否禁止root用户远程登录加固方法,配置/etc/ssh/sshd文件,禁止root用户远程登录
10)检查方法,检查/etc/profile文件中,是否设置命令行界面超时退出加固方法,将/etc/profile文件中,命令行界面超时退出的时间设置为300秒;
11)检查方法,检查/etc/login.defs文件中,是否设置口令生存周期;
加固方法,将/etc/login.defs文件中口令生存周期设置为90天;
12)检查方法,检查/etc/pam.d/system-auth文件中,是否有密码重复使用次数限制;
加固方法,将/etc/pam.d/system-auth文件密码重复使用次数限制设置为5次;
13)检查方法,检查在SSH登录前,是否有警告Banner;
加固方法,配置/etc/ssh/sshd_config文件,添加SSH登录前警告Banner;
14)检查方法,检查/etc/pam.d/system-auth文件中,是否配置了密码复杂度策略
加固方法,在/etc/pam.d/system-auth文件中,将密码复杂度策略配置为至少一个大写字母,一个小写字母,一个数字,一个特殊符号。
CN202111245204.8A 2021-10-26 2021-10-26 一种Linux操作系统的安全加固策略优化方法 Pending CN113946834A (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111245204.8A CN113946834A (zh) 2021-10-26 2021-10-26 一种Linux操作系统的安全加固策略优化方法

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111245204.8A CN113946834A (zh) 2021-10-26 2021-10-26 一种Linux操作系统的安全加固策略优化方法

Publications (1)

Publication Number Publication Date
CN113946834A true CN113946834A (zh) 2022-01-18

Family

ID=79332619

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111245204.8A Pending CN113946834A (zh) 2021-10-26 2021-10-26 一种Linux操作系统的安全加固策略优化方法

Country Status (1)

Country Link
CN (1) CN113946834A (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116257266A (zh) * 2022-11-22 2023-06-13 浙江御安信息技术有限公司 一种Linux系统主机自动化安全加固方法和设备

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105703925A (zh) * 2014-11-25 2016-06-22 上海天脉聚源文化传媒有限公司 一种Linux系统安全加固方法及系统
CN108664794A (zh) * 2018-04-26 2018-10-16 广东电网有限责任公司 一种Linux服务器自动化安全加固方法
CN109905403A (zh) * 2019-03-26 2019-06-18 国网甘肃省电力公司信息通信公司 一种考虑运行维护的安全性检测方法

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105703925A (zh) * 2014-11-25 2016-06-22 上海天脉聚源文化传媒有限公司 一种Linux系统安全加固方法及系统
CN108664794A (zh) * 2018-04-26 2018-10-16 广东电网有限责任公司 一种Linux服务器自动化安全加固方法
CN109905403A (zh) * 2019-03-26 2019-06-18 国网甘肃省电力公司信息通信公司 一种考虑运行维护的安全性检测方法

Non-Patent Citations (8)

* Cited by examiner, † Cited by third party
Title
吴文刚等: "信息安全等级保护Linux服务器shell脚本测评方法", 《现代工业经济和信息化》 *
李海涛: "基于Linux系统的安全策略", 《商场现代化》 *
杨雪婵: "管控Linux登录之门", 《网络安全和信息化》 *
王丽艳: "基于Linux网络操作系统的安全策略", 《中国西部科技》 *
王庆刚等: "浅谈Linux系统的安全基线研究", 《数字技术与应用》 *
秦道祥等: "基于S3A3G3三级等保标准的Linux系统主机安全加固", 《中国教育信息化》 *
章杜锡等: "国产安全操作系统的安全配置实时监测技术研究", 《电力信息与通信技术》 *
邢建民等: "增强Linux系统安全性的措施", 《河北工业科技》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116257266A (zh) * 2022-11-22 2023-06-13 浙江御安信息技术有限公司 一种Linux系统主机自动化安全加固方法和设备

Similar Documents

Publication Publication Date Title
CN106326699B (zh) 一种基于文件访问控制和进程访问控制的服务器加固方法
US9660990B2 (en) Temporarily providing higher privileges for computing system to user identifier
US9558343B2 (en) Methods and systems for controlling access to resources and privileges per process
US9531726B2 (en) Systems and methods for automatic discovery of systems and accounts
US20130283336A1 (en) Cyber security analyzer
US9143328B2 (en) System and method for providing a system management command
US20050114673A1 (en) Method and system for establishing a consistent password policy
US20050138423A1 (en) Remote provisioning of secure systems for mandatory control
US20110167260A1 (en) Computer system lock-down
KR20060130717A (ko) 파티션 액세스 제어 시스템 및 파티션 액세스 제어 방법
GB2281645A (en) Control of access to a networked system
US11475107B2 (en) Hardware security
WO2010138109A1 (en) System and method for performing a management operation
WO2006003914A1 (ja) 検疫システム
JP2015514269A (ja) 組み込まれた許可属性を用いたオフライン認証
CN114205121A (zh) 一种电网数据用的信息访问安全保护方法
CN109583206B (zh) 监控应用程序的访问进程的方法、装置、设备及存储介质
CN112615842B (zh) 基于大数据平台的网络安全实施系统及方法
CN113946834A (zh) 一种Linux操作系统的安全加固策略优化方法
CN103970540A (zh) 关键函数安全调用方法及装置
CN116257266A (zh) 一种Linux系统主机自动化安全加固方法和设备
US20200401712A1 (en) Command line interface replacement for security purposes
Napier Secure automation: achieving least privilege with SSH, Sudo and Setuid
Koropiotis CIS Microsoft Windows Server 2019 compliance
CN117235818A (zh) 基于固态硬盘的加密认证方法、装置、计算机设备及介质

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20220118

RJ01 Rejection of invention patent application after publication