我已经看到提及保护/ dev / shm和/ proc,我想知道你是如何做到这一点的? 我认为这涉及/etc/sysctl.conf编辑的某种权利。
像这些?
kernel.exec-shield = 1 kernel.randomize_va_space = 1
我使用的基于CIS Linux安全性基准testing的过程是修改/etc/fstab来限制/dev/shm mount上的设备创build,执行和suid priv。
shmfs /dev/shm tmpfs nodev,nosuid,noexec 0 0
对于sysctl设置,只需将其中一些添加到/etc/sysctl.conf 。 运行sysctl -p来激活。
# CIS benchmarks fs.suid_dumpable = 0 kernel.exec-shield = 1 kernel.randomize_va_space = 2 net.ipv4.conf.all.send_redirects = 0 net.ipv4.conf.default.send_redirects = 0
ewwhite已经提到了CIS Linux安全基准testing的build议,我还想增加一个值得一提的安全指南 – NSA安全configuration红帽企业Linux 5指南 。 除了为/ dev / shm添加nodev,nosuid,noexec选项外,第2.5.1节中提到了影响networking的内核参数的build议。
只有主机
net.ipv4.ip forward = 0 net.ipv4.conf.all.send redirects = 0 net.ipv4.conf.default.send redirects = 0
主机和路由器
net.ipv4.conf.all.accept_source_route = 0 net.ipv4.conf.all.accept_redirects = 0 net.ipv4.conf.all.secure_redirects = 0 net.ipv4.conf.all.log_martians = 1 net.ipv4.conf.default.accept_source_route = 0 net.ipv4.conf.default.accept_redirects = 0 net.ipv4.conf.default.secure_redirects = 0 net.ipv4.icmp_echo_ignore_broadcasts = 1 net.ipv4.icmp_ignore_bogus_error_messages = 1 net.ipv4.tcp_syncookies = 1 net.ipv4.conf.all.rp_filter = 1 net.ipv4.conf.default.rp_filter = 1