Ubuntu1804-CIS 项目使用教程
Ubuntu1804-CISUbuntu CIS Hardening Ansible Role项目地址:https://gitcode.com/gh_mirrors/ub/Ubuntu1804-CIS
1. 项目的目录结构及介绍
Ubuntu1804-CIS 项目的目录结构如下:
Ubuntu1804-CIS/
├── defaults
│ └── main.yml
├── handlers
│ └── main.yml
├── meta
│ └── main.yml
├── tasks
│ ├── section1.yml
│ ├── section2.yml
│ ├── section3.yml
│ ├── section4.yml
│ ├── section5.yml
│ ├── section6.yml
│ └── main.yml
├── templates
│ ├── banner_message_text_file.j2
│ ├── issue.j2
│ ├── issue.net.j2
│ └── sysctl.conf.j2
├── tests
│ ├── inventory
│ └── test.yml
└── vars
└── main.yml
目录介绍:
- defaults: 包含默认配置文件
main.yml
,定义了项目的默认变量。 - handlers: 包含处理程序文件
main.yml
,定义了触发特定操作的处理程序。 - meta: 包含元数据文件
main.yml
,定义了项目的依赖关系和其他元数据。 - tasks: 包含任务文件,按 CIS 标准分为不同部分(section1 到 section6),以及主任务文件
main.yml
。 - templates: 包含模板文件,用于生成配置文件。
- tests: 包含测试文件,用于测试项目的正确性。
- vars: 包含变量文件
main.yml
,定义了项目的变量。
2. 项目的启动文件介绍
项目的启动文件主要是 tasks/main.yml
,它负责调用各个部分的任务文件来执行安全配置。
---
# tasks file for Ubuntu1804-CIS
- include: section1.yml
- include: section2.yml
- include: section3.yml
- include: section4.yml
- include: section5.yml
- include: section6.yml
3. 项目的配置文件介绍
项目的配置文件主要位于 defaults/main.yml
和 vars/main.yml
中。
defaults/main.yml
这个文件定义了项目的默认变量,例如:
ubuntu1804cis_section1: true
ubuntu1804cis_section2: true
ubuntu1804cis_section3: true
ubuntu1804cis_section4: true
ubuntu1804cis_section5: true
ubuntu1804cis_section6: true
vars/main.yml
这个文件定义了项目的变量,例如:
ubuntu1804cis_time_synchronization_servers:
- uri: "0.pool.ntp.org"
config: "minpoll 8"
- uri: "1.pool.ntp.org"
config: "minpoll 8"
- uri: "2.pool.ntp.org"
config: "minpoll 8"
- uri: "3.pool.ntp.org"
config: "minpoll 8"
通过这些配置文件,用户可以根据自己的需求调整项目的配置。
Ubuntu1804-CISUbuntu CIS Hardening Ansible Role项目地址:https://gitcode.com/gh_mirrors/ub/Ubuntu1804-CIS