阿里云安骑士-Centos7系统基线合规检测-修复记录
执行命令
sysctl -w net.ipv4.conf.all.send_redirects=0
sysctl -w net.ipv4.conf.default.send_redirects=0
sysctl -w net.ipv4.conf.all.accept_redirects=0
sysctl -w net.ipv4.conf.default.accept_redirects=0
sysctl -w net.ipv4.conf.all.secure_redirects=0
sysctl -w net.ipv4.conf.default.secure_redirects=0
sysctl -w net.ipv4.conf.all.rp_filter=1
sysctl -w net.ipv4.conf.default.rp_filter=1
执行命令查看结果
sysctl net.ipv4.conf.all.send_redirects
sysctl net.ipv4.conf.default.send_redirects
sysctl net.ipv4.conf.all.accept_redirects
sysctl net.ipv4.conf.default.accept_redirects
sysctl net.ipv4.conf.all.secure_redirects
sysctl net.ipv4.conf.default.secure_redirects
sysctl net.ipv4.conf.all.rp_filter
sysctl net.ipv4.conf.default.rp_filter
修改配置文件
vi /etc/sysctl.conf
net.ipv4.conf.all.send_redirects=0
net.ipv4.conf.default.send_redirects=0
net.ipv4.conf.all.accept_redirects=0
net.ipv4.conf.default.accept_redirects=0
net.ipv4.conf.all.secure_redirects=0
net.ipv4.conf.default.secure_redirects=0
net.ipv4.conf.all.rp_filter=1
net.ipv4.conf.default.rp_filter=1
执行命令
sysctl -w net.ipv6.conf.all.accept_ra=0
sysctl -w net.ipv6.conf.default.accept_ra=0
sysctl -w net.ipv6.conf.all.accept_redirects=0
sysctl -w net.ipv6.conf.default.accept_redirects=0
执行命令查看结果
sysctl net.ipv6.conf.all.accept_ra
sysctl net.ipv6.conf.default.accept_ra
sysctl net.ipv6.conf.all.accept_redirects
sysctl net.ipv6.conf.default.accept_redirects
修改配置文件
vi /etc/sysctl.conf
net.ipv6.conf.all.accept_ra=0
net.ipv6.conf.default.accept_ra=0
net.ipv6.conf.all.accept_redirects=0
net.ipv6.conf.default.accept_redirects=0
执行命令
chmod 0600 /boot/grub2/grub.cfg
chmod 0600 /etc/crontab
chmod 0600 /etc/cron.hourly
chmod 0600 /etc/cron.daily
chmod 0600 /etc/cron.weekly
chmod 0600 /etc/cron.monthly
chmod 0600 /etc/cron.d
useradd -D -f 1095
修改配置文件(取消注释)
vi /etc/ssh/sshd_config
LogLevel INFO
MaxAuthTries
IgnoreRhosts yes
HostbasedAuthentication no
PermitEmptyPasswords no
PermitUserEnvironment no
LoginGraceTime
修改配置文件(取消注释或修改参数)
vi /etc/security/pwquality.conf
minlen=10
dcredit=-1
ucredit=-1
lcredit=-1
ocredit=-1
修改配置文件(添加配置)
vi /etc/pam.d/password-auth
password sufficient pam_unix.so remember=3
修改配置文件(添加配置)
vi /etc/pam.d/system-auth
password sufficient pam_unix.so remember=3
修改配置文件(添加配置)
vi /etc/rsyslog.conf
$FileCreateMode 0640
修改配置文件
在/etc/login.defs 设置密码修改最小间隔时间,建议值7
检查项: 禁止root直接登录
加固建议: 注意:在修改此项之前,请务必创建一个可登陆账号;在/etc/ssh/sshd_config中PermitRootLogin的值:yes设置为no
检查项: 默认登录端口检测
加固建议: 在/etc/ssh/sshd_config中取消Port 22注释符号#,并修改22为其它值
附:
风险分类:合规基线检测-Centos7系统基线合规检测
检测项说明:按照CIS-Linux Centos7最新基线标准进行系统层面基线检测
阿里云安骑士-Centos7系统基线合规检测-修复记录的更多相关文章
- 解决阿里云安骑士漏洞警告:wordpress WPImageEditorImagick 指令注入漏洞
解决:wordpress WPImageEditorImagick 指令注入漏洞 前些天在阿里云服务器上安装了wordpress,阿里云提示有wordpress WP_Image_Editor_Ima ...
- 阿里云ECS 实例Centos7系统磁盘扩容
需求:一台阿里云的数据盘磁盘空间不足,需要扩容,我这里只有一个主分区,ext4文件系统. 因为磁盘扩容场景不同,阿里云的文档比较全面一些,所以先奉上阿里云的文档,下面开始我的操作步骤: 1.登录控制台 ...
- 阿里云ECS服务器CentOS7.2安装Python2.7.13
阿里云ECS服务器CentOS7.2安装Python2.7.13 yum中最新的也是Python 2.6.6,只能下载Python 2.7.9的源代码自己编译安装. 操作步骤如下: 检查CentOS7 ...
- Kubernetes+Docker的云平台在CentOS7系统上的安装
Kubernetes+Docker的云平台在CentOS7系统上的安装 1.运行VirtualBox5. 2.安装CentOS7系统. 注意:选择Basic Server类型 安装过程略. 3.修改计 ...
- 阿里云服务器: centos7 ftp安装
阿里云服务器: centos7 ftp安装 ftp需要您参考下面链接和附件开放安全组20.21.1024-65535 后查看是否正常. 配置步骤如下, 1, 如果没有安装ftp,需要先安装 yum - ...
- Linux基线合规检查中各文件的作用及配置脚本
1./etc/motd 操作:echo " Authorized users only. All activity may be monitored and reported " ...
- Android App隐私合规检测辅助工具(Camille)
Camille Android App隐私合规检测辅助工具,项目仓库:https://github.com/zhengjim/camille 简介 现如今APP隐私合规十分重要,各监管部门不断开展AP ...
- 部署java项目到阿里云服务器(centos7版本)
一.搭建环境 1.搭建java环境(64位) 一.准备压缩包,rpm包或者tar包,将其上传到阿里云对应的文件夹(我用的工具是WinSCP,百度一下就有下载资源) 二.若是rpm包,可以通过 rpm ...
- 搭建阿里云lnmp环境 (centos7+nginx+MySQL5.7.9+PHP7)
阿里云一台服务器出现问题! 我估计是一键安装包环境的原因,所以打算重新搭建下环境! 首先,当然是先做好快照!安全第一! 对系统盘做更换系统操作,装上纯净版的centos. 装好后,进入系统 一.挂载数 ...
随机推荐
- 【Spider】学习使用XMLFeedSpider
前面写了学习CrawlSpider遇到的问题后,今天学XMLFeedSpider又出现了启动后没爬取到数据,但又不报错的情况 经过排查,发现又是一个粗心大意的错误: class SpiderUserX ...
- WeakReference 在android中的应用
转:http://my.oschina.net/u/1177694/blog/523922 首先我们来看一段代码 public class AutoActivity extends Activity ...
- PlayerPrefs Elite v1.4.3
PlayerPrefs EliteProtect your game from cheating and modification for items, levels, highscores or s ...
- http://www.bugku.com:Bugku——SQL注入1(http://103.238.227.13:10087/)
Bugku——SQL注入1(http://103.238.227.13:10087/) 过滤了几乎所有的关键字,尝试绕过无果之后发现,下面有个xss过滤代码.经搜索得该函数会去掉所有的html标签,所 ...
- mysql乐观锁总结和实践(一)
最近学习了一下数据库的悲观锁和乐观锁,根据自己的理解和网上参考资料总结如下: 悲观锁介绍(百科): 悲观锁,正如其名,它指的是对数据被外界(包括本系统当前的其他事务,以及来自外部系统的事务处理)修改持 ...
- mysql定位慢查询
mysql定位慢查询 //显示数据库的状态 show status; //显示执行了多少次插入 show status like 'com_insert'; //显示执行了多少次更新 show sta ...
- 【gRPC使用问题1】gRPC的proto内import其他proto导致的一次小坑
1.对于一些proto里面的定义,如果包含了 引入其他proto文件的 proto文件来说,生成的时候要注意.尤其是 引入的是官方框架内的 proto文件,如果自己没有提供的话,生成代码会报错! 具体 ...
- JS获取Dropdownlist选中值
var dropDownList = document.getElementById("ddl_sheng"); //获取DropDownList控件 var dropDownLi ...
- Linux移植之make uImage编译过程分析
编译出uboot可以运行的linux内核代码的命令是make uImage,下面详细介绍下生成linux-2.6.22.6/arch/arm/boot/uImage的过程: 1.vmlinux.Ima ...
- c#程序设计原则
单一职责 开闭原则:对扩展开放,对修改封闭. 方法 的职责,一个方法做的事越多,造成问题的可能性会增加. 解决的方法1:就是分拆2:写单独类