跳转到内容
搜索 Anolis OS 文档

    浏览当前文档目录

    Anolis 安全基线:从默认态到生产加固的决策路径

    默认态与操作链实测(双机 ops journey + 真实迁移产物);SELinux 策略编写(audit2allow)不在本页。

    Terminal window
    # 现状核对(三形态输出不同)
    getenforce # Disabled/Permissive/Enforcing
    systemctl is-active firewalld
    # 云镜像 Disabled→启用路径(两步:配置+重标)
    sudo sed -i 's/^SELINUX=disabled/SELINUX=enforcing/' /etc/selinux/config
    sudo touch /.autorelabel && sudo reboot # 重标可能耗时
    # 装机 permissive→enforcing(先看拒绝日志再切)
    sudo ausearch -m avc --recent | head # 无 AVC 再切
    # firewalld 收紧
    sudo firewall-cmd --list-all
    sudo firewall-cmd --permanent --remove-service=cockpit && sudo firewall-cmd --reload
    # SSH 加固(对照迁移后重置风险)
    sudo sshd -T | grep -E '^(passwordauthentication|permitrootlogin)'

    迁移器把 SELinux 重置为 Enforcing(实测)——如果迁移前是 permissive,迁移后直接 enforcing 可能触发业务 AVC:先 ausearch 核对再决定。