合规性即代码
本文档提供了有关使用 Ansible 剧本运行合规性即代码修复的深入信息。
有关使用 bash 脚本运行合规性即代码修复的详细信息,请参见修复。
1. 安装 SCAP 安全指南软件包
要执行修复,您需要在 Ansible 控制节点上安装 SCAP 安全指南软件包。
- 
在中选择客户端。然后单击。 
- 
搜索 scap-security-guide并安装适合您系统的软件包。有关软件包分发要求,请参见下表:Table 1. SCAP 安全指南软件包要求 软件包名称 支持的系统 scap-security-guide openSUSE、SLES12、SLES15 scap-security-guide-redhat CentOS 7、CentOS 8、Fedora、Oracle Linux 7、Oracle Linux 8、RHEL7、RHEL8、RHEL9、Red Hat OpenStack Platform 10、Red Hat OpenStack Platform 13、Red Hat Virtualization 4、Scientific Linux scap-security-guide-debian Debian 12 scap-security-guide-ubuntu Ubuntu 20.04、Ubuntu 22.04 
2. 使用 Ansible 剧本进行修复
需要一个 Ansible 控制节点。有关详细信息,请参见 设置 Ansible 控制节点。
The following procedure will guide you through running remediation using an Ansible playbook.
- 
From the control node system menu select . 
- 
In Add a Playbook directoryfield, enter the path to the OpenSCAP playbooks, for example:/usr/share/scap-security-guide/ansible
- 
Confirm with Save. 
- 
Navigate Go , expand the folder you just declared, and click a playbook, for example: sle15-playbook-stig.yml
- 
To run the playbook, select the Inventory Pathfor the clients, for example:/etc/ansible/sles15单击 日程安排。 
- 
在 事件选项卡下检查已安排事件的状态。