Skip to content

Commit f4f971a

Browse files
committed
Updated to latest layout
Signed-off-by: Mark Bolwell <[email protected]>
1 parent 0791241 commit f4f971a

File tree

1 file changed

+192
-50
lines changed

1 file changed

+192
-50
lines changed

README.md

Lines changed: 192 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,140 @@
1-
# Ubuntu 22 CIS
1+
# UBUNTU 22 CIS
22

3-
## Configure a Ubuntu 22 machine to be [CIS](https://www.cisecurity.org/cis-benchmarks/) compliant
3+
## Configure a UBUNTU 22 machine to be [CIS](https://www.cisecurity.org/cis-benchmarks/) compliant
44

5-
### Based on CIS Ubuntu Linux 22.04 LTS Benchmark v2.0.0 [Release](https://downloads.cisecurity.org/#/)
5+
### Based on [CIS UBUNTU 22 Benchmark v2.0.0](https://www.cisecurity.org/cis-benchmarks/)
6+
7+
---
8+
9+
## Public Repository 📣
610

711
![Org Stars](https://img.shields.io/github/stars/ansible-lockdown?label=Org%20Stars&style=social)
8-
![Stars](https://img.shields.io/github/stars/ansible-lockdown/ubuntu22-cis?label=Repo%20Stars&style=social)
9-
![Forks](https://img.shields.io/github/forks/ansible-lockdown/ubuntu22-cis?style=social)
10-
![followers](https://img.shields.io/github/followers/ansible-lockdown?style=social)
12+
![Stars](https://img.shields.io/github/stars/ansible-lockdown/UBUNTU22-CIS?label=Repo%20Stars&style=social)
13+
![Forks](https://img.shields.io/github/forks/ansible-lockdown/UBUNTU22-CIS?style=social)
14+
![Followers](https://img.shields.io/github/followers/ansible-lockdown?style=social)
1115
[![Twitter URL](https://img.shields.io/twitter/url/https/twitter.com/AnsibleLockdown.svg?style=social&label=Follow%20%40AnsibleLockdown)](https://twitter.com/AnsibleLockdown)
12-
1316
![Discord Badge](https://img.shields.io/discord/925818806838919229?logo=discord)
1417

18+
![License](https://img.shields.io/github/license/ansible-lockdown/UBUNTU22-CIS?label=License)
19+
20+
## Lint & Pre-Commit Tools 🔧
21+
22+
[![Pre-Commit.ci](https://img.shields.io/endpoint?url=https://ansible-lockdown.github.io/github_linux_IaC/badges/UBUNTU22-CIS/pre-commit-ci.json)](https://results.pre-commit.ci/latest/github/ansible-lockdown/UBUNTU22-CIS/devel)
23+
![YamlLint](https://img.shields.io/badge/yamllint-Present-brightgreen?style=flat&logo=yaml&logoColor=white)
24+
![Ansible-Lint](https://img.shields.io/badge/ansible--lint-Present-brightgreen?style=flat&logo=ansible&logoColor=white)
25+
26+
## Community Release Information 📂
27+
1528
![Release Branch](https://img.shields.io/badge/Release%20Branch-Main-brightgreen)
16-
![Release Tag](https://img.shields.io/github/v/release/ansible-lockdown/UBUNTU22-CIS)
17-
![Release Date](https://img.shields.io/github/release-date/ansible-lockdown/UBUNTU22-CIS)
29+
![Release Tag](https://img.shields.io/github/v/tag/ansible-lockdown/UBUNTU22-CIS?label=Release%20Tag&&color=success)
30+
![Main Release Date](https://img.shields.io/github/release-date/ansible-lockdown/UBUNTU22-CIS?label=Release%20Date)
31+
![Benchmark Version Main](https://img.shields.io/endpoint?url=https://ansible-lockdown.github.io/github_linux_IaC/badges/UBUNTU22-CIS/benchmark-version-main.json)
32+
![Benchmark Version Devel](https://img.shields.io/endpoint?url=https://ansible-lockdown.github.io/github_linux_IaC/badges/UBUNTU22-CIS/benchmark-version-devel.json)
1833

1934
[![Main Pipeline Status](https://github.com/ansible-lockdown/UBUNTU22-CIS/actions/workflows/main_pipeline_validation.yml/badge.svg?)](https://github.com/ansible-lockdown/UBUNTU22-CIS/actions/workflows/main_pipeline_validation.yml)
2035

2136
[![Devel Pipeline Status](https://github.com/ansible-lockdown/UBUNTU22-CIS/actions/workflows/devel_pipeline_validation.yml/badge.svg?)](https://github.com/ansible-lockdown/UBUNTU22-CIS/actions/workflows/devel_pipeline_validation.yml)
22-
![Devel Commits](https://img.shields.io/github/commit-activity/m/ansible-lockdown/UBUNTU22-CIS/devel?color=dark%20green&label=Devel%20Branch%20Commits)
2337

24-
![Issues Open](https://img.shields.io/github/issues-raw/ansible-lockdown/UBUNTU22-CIS?label=Open%20Issues)
25-
![Issues Closed](https://img.shields.io/github/issues-closed-raw/ansible-lockdown/UBUNTU22-CIS?label=Closed%20Issues&&color=success)
38+
39+
![Devel Commits](https://img.shields.io/github/commit-activity/m/ansible-lockdown/UBUNTU22-CIS/devel?color=dark%20green&label=Devel%20Branch%20Commits)
40+
![Open Issues](https://img.shields.io/github/issues-raw/ansible-lockdown/UBUNTU22-CIS?label=Open%20Issues)
41+
![Closed Issues](https://img.shields.io/github/issues-closed-raw/ansible-lockdown/UBUNTU22-CIS?label=Closed%20Issues&&color=success)
2642
![Pull Requests](https://img.shields.io/github/issues-pr/ansible-lockdown/UBUNTU22-CIS?label=Pull%20Requests)
2743

28-
![License](https://img.shields.io/github/license/ansible-lockdown/UBUNTU22-CIS?label=License)
44+
---
45+
46+
## Subscriber Release Information 🔐
47+
48+
![Private Release Branch](https://img.shields.io/endpoint?url=https://ansible-lockdown.github.io/github_linux_IaC/badges/Private-UBUNTU22-CIS/release-branch.json)
49+
![Private Benchmark Version](https://img.shields.io/endpoint?url=https://ansible-lockdown.github.io/github_linux_IaC/badges/Private-UBUNTU22-CIS/benchmark-version.json)
50+
51+
[![Private Remediate Pipeline](https://img.shields.io/endpoint?url=https://ansible-lockdown.github.io/github_linux_IaC/badges/Private-UBUNTU22-CIS/remediate.json)](https://github.com/ansible-lockdown/Private-UBUNTU22-CIS/actions/workflows/main_pipeline_validation.yml)
52+
[![Private GPO Pipeline](https://img.shields.io/endpoint?url=https://ansible-lockdown.github.io/github_linux_IaC/badges/Private-UBUNTU22-CIS/gpo.json)](https://github.com/ansible-lockdown/Private-UBUNTU22-CIS/actions/workflows/main_pipeline_validation_gpo.yml)
53+
54+
![Private Pull Requests](https://img.shields.io/endpoint?url=https://ansible-lockdown.github.io/github_linux_IaC/badges/Private-UBUNTU22-CIS/prs.json)
55+
![Private Closed Issues](https://img.shields.io/endpoint?url=https://ansible-lockdown.github.io/github_linux_IaC/badges/Private-UBUNTU22-CIS/issues-closed.json)
2956

3057
---
3158

32-
## Looking for support?
59+
## Looking for support? 🤝
3360

34-
[Lockdown Enterprise](https://www.lockdownenterprise.com#GH_AL_UB22_cis)
61+
[Lockdown Enterprise](https://www.lockdownenterprise.com#GH_AL_UBUNTU22_CIS)
3562

36-
[Ansible support](https://www.mindpointgroup.com/cybersecurity-products/ansible-counselor#GH_AL_UB22_cis)
63+
[Ansible support](https://www.mindpointgroup.com/cybersecurity-products/ansible-counselor#GH_AL_UBUNTU22_CIS)
3764

38-
### Community
65+
### Community 💬
3966

40-
Join us on our [Discord Server](https://www.lockdownenterprise.com/discord) to ask questions, discuss features, or just chat with other Ansible-Lockdown users.
67+
On our [Discord Server](https://www.lockdownenterprise.com/discord) to ask questions, discuss features, or just chat with other Ansible-Lockdown users
4168

42-
## Caution(s)
69+
---
4370

44-
This role **will make changes to the system** that could break things. This is not an auditing tool but rather a remediation tool to be used after an audit has been conducted.
71+
## 🚨 Caution(s) 🚨
4572

46-
This role was developed against a clean install of the Operating System. If you are implementing on an existing system, please review this role for any site-specific changes that are needed.
73+
This role **will make changes to the system** which may have unintended consequences. This is not an auditing tool but rather a remediation tool to be used after an audit has been conducted.
4774

48-
## Documentation
75+
- Testing is the most important thing you can do.
4976

50-
- [Read The Docs](https://ansible-lockdown.readthedocs.io/en/latest/)
51-
- [Getting Started](https://www.lockdownenterprise.com/docs/getting-started-with-lockdown#GH_AL_UB22_cis)
52-
- [Customizing Roles](https://www.lockdownenterprise.com/docs/customizing-lockdown-enterprise#GH_AL_UB22_cis)
53-
- [Per-Host Configuration](https://www.lockdownenterprise.com/docs/per-host-lockdown-enterprise-configuration#GH_AL_UB22_cis)
54-
- [Getting the Most Out of the Role](https://www.lockdownenterprise.com/docs/get-the-most-out-of-lockdown-enterprise#GH_AL_UB22_cis)
77+
- Check Mode is not guaranteed! 🚫 The role will complete in check mode without errors, but it is not supported and should be used with caution.
78+
79+
- This role was developed against a clean install of the Operating System. If you are implementing to an existing system please review this role for any site specific changes that are needed.
80+
81+
- To use release version please point to main branch and relevant release for the cis benchmark you wish to work with.
82+
83+
- Did we mention testing??
84+
85+
---
86+
87+
## Coming From A Previous Release ⏪
88+
89+
CIS release always contains changes, it is highly recommended to review the new references and available variables. This have changed significantly since ansible-lockdown initial release.
90+
This is now compatible with python3 if it is found to be the default interpreter. This does come with pre-requisites which it configures the system accordingly.
5591

56-
## Requirements
92+
Further details can be seen in the [Changelog](./ChangeLog.md)
93+
94+
---
95+
96+
## Matching a security Level for CIS
97+
98+
It is possible to only run level 1 or level 2 controls for CIS.
99+
This is managed using tags:
100+
101+
- level1-server
102+
- level1-workstation
103+
- level2-server
104+
- level2-workstation
105+
106+
The control found in defaults main also need to reflect this as this control the testing that takes place if you are using the audit component.
107+
108+
---
109+
## Requirements ✅
57110

58111
**General:**
59112

60113
- Basic knowledge of Ansible, below are some links to the Ansible documentation to help get started if you are unfamiliar with Ansible
114+
61115
- [Main Ansible documentation page](https://docs.ansible.com)
62116
- [Ansible Getting Started](https://docs.ansible.com/ansible/latest/user_guide/intro_getting_started.html)
63117
- [Tower User Guide](https://docs.ansible.com/ansible-tower/latest/html/userguide/index.html)
64118
- [Ansible Community Info](https://docs.ansible.com/ansible/latest/community/index.html)
65119
- Functioning Ansible and/or Tower Installed, configured, and running. This includes all of the base Ansible/Tower configurations, needed packages installed, and infrastructure setup.
66-
- Please read through the tasks in this role to gain an understanding of what each control is doing. Some of the tasks are disruptive and can have unintended consequences in a live production system. Also, familiarize yourself with the variables in the defaults/main.yml file or the [Main Variables Wiki Page](https://github.com/ansible-lockdown/UBUNTU22-CIS/wiki/Main-Variables).
120+
- Please read through the tasks in this role to gain an understanding of what each control is doing. Some of the tasks are disruptive and can have unintended consequences in a live production system. Also familiarize yourself with the variables in the defaults/main.yml file.
67121

68122
**Technical Dependencies:**
69123

70-
- Running Ansible/Tower setup (this role is tested against Ansible version 2.12.1 and newer)
71-
- Python3 Ansible run environment
72-
- goss >= 0.4.4 (If using for audit)
124+
UBUNTU 22 - Other versions are not supported.
125+
126+
- Access to download or add the goss binary and content to the system if using auditing
127+
(other options are available on how to get the content to the system.)
128+
- Python3.8
129+
- Ansible 2.12+
130+
- python-def
131+
- libselinux-python
73132

74-
## Auditing (new)
133+
---
75134

76-
This can be turned on or off within the defaults/main.yml file with the variable run_audit. The value is false by default, please refer to the wiki for more details.
135+
## Auditing 🔍
136+
137+
This can be turned on or off within the defaults/main.yml file with the variable run_audit. The value is false by default, please refer to the wiki for more details. The defaults file also populates the goss checks to check only the controls that have been enabled in the ansible role.
77138

78139
This is a much quicker, very lightweight, checking (where possible) config compliance and live/running settings.
79140

@@ -82,40 +143,121 @@ This audit will not only check the config has the correct setting but aims to ca
82143

83144
Refer to [UBUNTU22-CIS-Audit](https://github.com/ansible-lockdown/UBUNTU22-CIS-Audit).
84145

85-
Further audit documentation can be found at [Read The Docs](https://ansible-lockdown.readthedocs.io/en/latest/)
146+
## Example Audit Summary
147+
148+
This is based on a vagrant image with selections enabled. e.g. No Gui or firewall.
149+
Note: More tests are run during audit as we check config and running state.
150+
151+
```txt
152+
153+
ok: [default] => {
154+
"msg": [
155+
"msg": [
156+
"The pre remediation audit results are: Count: 763, Failed: 234, Skipped: 4, Duration: 9.741s",
157+
"The post remediation audit results are: Count: 763, Failed: 19, Skipped: 4, Duration: 12.725s",
158+
"Full breakdown can be found in /opt",
159+
""
160+
]
161+
}
162+
163+
PLAY RECAP *******************************************************************************************************************************************
164+
default : ok=270 changed=23 unreachable=0 failed=0 skipped=140 rescued=0 ignored=0
165+
```
166+
167+
## Documentation 📖
168+
169+
- [Read The Docs](https://ansible-lockdown.readthedocs.io/en/latest/)
170+
- [Getting Started](https://www.lockdownenterprise.com/docs/getting-started-with-lockdown#GH_AL_UBUNTU22_cis)
171+
- [Customizing Roles](https://www.lockdownenterprise.com/docs/customizing-lockdown-enterprise#GH_AL_UBUNTU22_cis)
172+
- [Per-Host Configuration](https://www.lockdownenterprise.com/docs/per-host-lockdown-enterprise-configuration#GH_AL_UBUNTU22_cis)
173+
- [Getting the Most Out of the Role](https://www.lockdownenterprise.com/docs/get-the-most-out-of-lockdown-enterprise#GH_AL_UBUNTU22_cis)
174+
86175

87176
## Role Variables
88177

89-
This role is designed so the end user should not have to edit the tasks themselves. All customizing should be done via the defaults/main.yml file or with extra vars within the project, job, workflow, etc.
178+
This role is designed that the end user should not have to edit the tasks themselves. All customizing should be done via the defaults/main.yml file or with extra vars within the project, job, workflow, etc.
179+
180+
## Tags 🏷️
181+
182+
There are many tags available for added control precision. Each control has its own set of tags noting what level, what OS element it relates to, whether it's a patch or audit, and the rule number. Additionally, NIST references follow a specific conversion format for consistency and clarity.
183+
184+
### Conversion Format for NIST References:
185+
186+
1. Standard Prefix:
90187

91-
## Branches
188+
- All references are prefixed with "NIST".
92189

93-
- **devel** - This is the default branch and the working development branch. Community pull requests will be pulled into this branch
94-
- **main** - This is the release branch
95-
- **all other branches** - Individual community member branches
190+
2. Standard Types:
96191

97-
## Community Contribution
192+
- "800-53" references are formatted as NIST800-53.
193+
- "800-53r5" references are formatted as NIST800-53R5 (with 'R' capitalized).
194+
- "800-171" references are formatted as NIST800-171.
195+
196+
3. Details:
197+
198+
- Section and subsection numbers use periods (.) for numeric separators.
199+
- Parenthetical elements are separated by underscores (_), e.g., IA-5(1)(d) becomes IA-5_1_d.
200+
- Subsection letters (e.g., "b") are appended with an underscore.
201+
Below is an example of the tag section from a control within this role. Using this example if you set your run to skip all controls with the tag services, this task will be skipped. The opposite can also happen where you run only controls tagged with services.
202+
203+
```sh
204+
tags:
205+
- level1-server
206+
- level1-workstation
207+
- scored
208+
- avahi
209+
- services
210+
- patch
211+
- rule_2.2.4
212+
```
213+
214+
215+
## Community Contribution 🧑‍🤝‍🧑
98216

99217
We encourage you (the community) to contribute to this role. Please read the rules below.
100218

101-
- Your work is done in your own individual branch. Make sure to Signed-off and GPG sign all commits you intend to merge.
219+
- Your work is done in your own individual branch. Make sure to Signed-off-by and GPG sign all commits you intend to merge.
102220
- All community Pull Requests are pulled into the devel branch
103-
- Pull Requests into devel will confirm your commits have a GPG signature, Signed-off, and a functional test before being approved
221+
- Pull Requests into devel will confirm your commits have a GPG signature, Signed-off-by, and a functional test before being approved
104222
- Once your changes are merged and a more detailed review is complete, an authorized member will merge your changes into the main branch for a new release
105223

106-
## Pipeline Testing
224+
## Pipeline Testing 🔄
107225

108226
uses:
109227

110-
- ansible-core 2.16.6
111-
- ansible collections - pulls in the latest version based on the requirements file
228+
- ansible-core 2.16
229+
- ansible collections - pulls in the latest version based on requirements file
112230
- runs the audit using the devel branch
113231
- This is an automated test that occurs on pull requests into devel
232+
- self-hosted runners using OpenTofu
114233

115-
## Added Extras
234+
## Known Issues
116235

117-
- [pre-commit](https://pre-commit.com) can be tested and can be run from within the directory
118236

119-
```sh
120-
pre-commit run
237+
## Local Testing 💻
238+
239+
### example
240+
241+
```bash
242+
molecule test -s default
243+
molecule converge -s wsl -- --check
244+
molecule verify -s localhost
121245
```
246+
247+
local testing uses:
248+
249+
- ansible-core
250+
- molecule 4.0.1
251+
- molecule-docker 2.0.0
252+
- molecule-podman 2.0.2
253+
- molecule-vagrant 1.0.0
254+
- molecule-azure 0.5.0
255+
256+
257+
## Credits and Thanks 🙏
258+
259+
Massive thanks to the fantastic community and all its members.
260+
261+
This includes a huge thanks and credit to the original authors and maintainers.
262+
263+
Mark Bolwell, George Nalen, Steve Williams, Fred Witty

0 commit comments

Comments
 (0)