| 加固项 | 内核信息可见性收敛 |
|---|---|
| 适用平台 | Linux(RHEL/CentOS/Debian/Ubuntu) |
| 风险等级 | 中 |
| 基线 | kernel.dmesg_restrict=1;kernel.kptr_restrict=2 |
加固
加固
cat >> /etc/sysctl.d/99-hardening.conf <<'EOF'
kernel.dmesg_restrict = 1
kernel.kptr_restrict = 2
EOF
sysctl --system验证(以普通用户视角)
验证(以普通用户视角)
sudo -u nobody dmesg 2>&1 | head -2
# 预期:Operation not permitteddmesg_restrict=1 后排障要用 sudo dmesg 或 journalctl -k;把该项写进运维手册,避免现场误判为故障。