forked from ansible-lockdown/RHEL9-CIS
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
87 changed files
with
7,693 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
parseable: true | ||
quiet: true | ||
skip_list: | ||
- '204' | ||
- '305' | ||
- '303' | ||
- '403' | ||
- '306' | ||
- '602' | ||
use_default_rules: true | ||
verbosity: 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# adding github settings to show correct language | ||
*.sh linguist-detectable=true | ||
*.yml linguist-detectable=true | ||
*.ps1 linguist-detectable=true | ||
*.j2 linguist-detectable=true | ||
*.md linguist-documentation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
.env | ||
*.log | ||
*.retry | ||
.cache | ||
.vagrant | ||
tests/*redhat-subscription | ||
tests/Dockerfile | ||
*.iso | ||
*.box | ||
packer_cache | ||
delete* | ||
ignore* | ||
test_inv | ||
# VSCode | ||
.vscode | ||
|
||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# DS_Store | ||
.DS_Store | ||
._* | ||
|
||
# Linux Editors | ||
*~ | ||
\#*\# | ||
/.emacs.desktop | ||
/.emacs.desktop.lock | ||
.elc | ||
auto-save-list | ||
tramp | ||
.\#* | ||
*.swp | ||
*.swo | ||
rh-creds.env | ||
travis.env | ||
|
||
# Lockdown-specific | ||
benchparse/ | ||
*xccdf.xml | ||
*.retry | ||
|
||
# GitHub Action/Workflow files | ||
.github/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- | ||
ignore: | | ||
tests/ | ||
molecule/ | ||
.gitlab-ci.yml | ||
*molecule.yml | ||
|
||
extends: default | ||
|
||
rules: | ||
indentation: | ||
# Requiring 4 space indentation | ||
spaces: 4 | ||
# Requiring consistent indentation within a file, either indented or not | ||
indent-sequences: consistent | ||
truthy: disable | ||
braces: | ||
max-spaces-inside: 1 | ||
level: error | ||
brackets: | ||
max-spaces-inside: 1 | ||
level: error | ||
line-length: disable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
Contributing to MindPoint Group Projects | ||
======================================== | ||
|
||
Rules | ||
----- | ||
1) All commits must be GPG signed (details in Signing section) | ||
2) All commits must have Signed-off-by (Signed-off-by: Joan Doe <[email protected]>) in the commit message (details in Signing section) | ||
3) All work is done in your own branch | ||
4) All pull requests go into the devel branch. There are automated checks for signed commits, signoff in commit message, and functional testing) | ||
5) Be open and nice to eachother | ||
|
||
Workflow | ||
-------- | ||
- Your work is done in your own individual branch. Make sure to to Signed-off and GPG sign all commits you intend to merge | ||
- All community Pull Requests are into the devel branch. There are automated checks for GPG signed, Signed-off in commits, and functional tests before being approved. If your pull request comes in from outside of our repo, the pull request will go into a staging branch. There is info needed from our repo for our CI/CD testing. | ||
- 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 | ||
|
||
Signing your contribution | ||
------------------------- | ||
|
||
We've chosen to use the Developer's Certificate of Origin (DCO) method | ||
that is employed by the Linux Kernel Project, which provides a simple | ||
way to contribute to MindPoint Group projects. | ||
|
||
The process is to certify the below DCO 1.1 text | ||
:: | ||
|
||
Developer's Certificate of Origin 1.1 | ||
|
||
By making a contribution to this project, I certify that: | ||
|
||
(a) The contribution was created in whole or in part by me and I | ||
have the right to submit it under the open source license | ||
indicated in the file; or | ||
|
||
(b) The contribution is based upon previous work that, to the best | ||
of my knowledge, is covered under an appropriate open source | ||
license and I have the right under that license to submit that | ||
work with modifications, whether created in whole or in part | ||
by me, under the same open source license (unless I am | ||
permitted to submit under a different license), as indicated | ||
in the file; or | ||
|
||
(c) The contribution was provided directly to me by some other | ||
person who certified (a), (b) or (c) and I have not modified | ||
it. | ||
|
||
(d) I understand and agree that this project and the contribution | ||
are public and that a record of the contribution (including all | ||
personal information I submit with it, including my sign-off) is | ||
maintained indefinitely and may be redistributed consistent with | ||
this project or the open source license(s) involved. | ||
:: | ||
|
||
Then, when it comes time to submit a contribution, include the | ||
following text in your contribution commit message: | ||
|
||
:: | ||
|
||
Signed-off-by: Joan Doe <[email protected]> | ||
|
||
:: | ||
|
||
|
||
This message can be entered manually, or if you have configured git | ||
with the correct `user.name` and `user.email`, you can use the `-s` | ||
option to `git commit` to automatically include the signoff message. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
# Changes to rhel9CIS | ||
|
||
## 1.3.3 | ||
|
||
- update to audit script | ||
- variable for audit OS agnostic | ||
- removal of included library module (not required) | ||
|
||
- Issues included | ||
- #135 - running levels - upadted tags | ||
- #138 - auditd immutable | ||
- #139 - 5.2.13 valus updated | ||
- #140 | ||
- #141 - check mode update | ||
- #142 | ||
- #143 - labels added | ||
- #144 | ||
- #146 - undefined variable added | ||
- #147 - removed warn statement | ||
- #149 - shell timeout | ||
|
||
## 1.3.2 | ||
|
||
- issues with crypto policies on ec2 - added skip for rules if system_is_ec2 variable | ||
- cis_1.10 ## Change crypto breaks installing products | ||
- cis_1.11 ## Change crypto breaks installing products | ||
|
||
## 1.3.1 | ||
|
||
- CIS 1.0.1 updates | ||
- Added Issue and PR templates | ||
- Added better reboot logic | ||
- Added options to ensure idempotence | ||
- Enhanced flush handlers | ||
- Typo fixes | ||
- mount check improvements | ||
- Linting fixes | ||
- Added systemd tmp mount | ||
- Added systemd tmpfs block | ||
- #110 tmp.mount support | ||
- thanks to @erpadmin | ||
|
||
## 1.3 | ||
|
||
- extentions to LE audit capability | ||
- more lint and layout changes | ||
- sugroup assertion added 5.7 | ||
- added extra logic variable to authselect/config section 5.3 related | ||
- AlmaLinux and Rocky tested (comments in readme - also rsyslog installed at build or will fail) | ||
- section 1.1 mount work has been rewritten and systemd tmp mount options added | ||
|
||
## 1.2.3 | ||
|
||
- #117 sugroup enhancements | ||
- thanks to @ihotz | ||
- #112 use of dnf module not shell | ||
- thanks to @wolskie | ||
|
||
## 1.2.2 | ||
|
||
- #33 mkgrub missing variable issues - efi and bios path resolution | ||
- thanks to @mrampant & @mickey1928geo | ||
- #102 2.2.2 xorg pkg removal extended | ||
- thanks to @RosarioVinoth | ||
- #104 5.4.1 pwquality logic | ||
- thanks to @RosarioVinoth | ||
- #107 Idempotence improvement for 4.1.1.3 and 4.1.1.4 | ||
- thanks to @andreyzher | ||
- lint changes and updates to sync with ansible-galaxy | ||
|
||
## v1.2.1 | ||
|
||
- bootloader and default variables | ||
- empty strings lint updates | ||
- #87 | ||
- rule 6.1.1 - audit only - outputs file discrepancies to {{ rhel9cis_rpm_audit_file }} | ||
- #88 | ||
- checkmode_improvements added to relevant tasks | ||
- PR #96 | ||
- crypto policy idempotency | ||
|
||
## v1.2.0 | ||
|
||
- #86 | ||
- Adding on the goss auditing tool | ||
- remove deprecated warnings | ||
- format and layout | ||
- general improvements | ||
- readme updates | ||
- use ansible package_facts | ||
- #90 | ||
- cis fix - nfs-server not nfs | ||
- Thanks to danderemer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2020 Mindpoint Group / Lockdown Enterprise / Lockdown Enterprise Releases | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
# RHEL 9 CIS (predicted) - ALPHA | ||
|
||
## This is purely development and those who have access to the RH developer branches for testing | ||
|
||
### This will work on RHEL8 and derivatives currently | ||
|
||
 | ||
 | ||
 | ||
|
||
Configure RHEL 9 machine to be [CIS](https://www.cisecurity.org/cis-benchmarks/) compliant with RHEL8 settings (RHEL9 not yet released) | ||
|
||
Based on [CIS RedHat Enterprise Linux 8 Benchmark v1.0.1 - 05-19-2021 ](https://www.cisecurity.org/cis-benchmarks/) | ||
|
||
## Caution(s) | ||
|
||
This role **will make changes to the system** which may have unintended concequences. This is not an auditing tool but rather a remediation tool to be used after an audit has been conducted. | ||
|
||
This role was developed against a clean install of the Operating System. If you are implimenting to an existing system please review this role for any site specific changes that are needed. | ||
|
||
To use release version please point to main branch | ||
|
||
## Documentation | ||
|
||
- [Getting Started](https://www.lockdownenterprise.com/docs/getting-started-with-lockdown) | ||
- [Customizing Roles](https://www.lockdownenterprise.com/docs/customizing-lockdown-enterprise) | ||
- [Per-Host Configuration](https://www.lockdownenterprise.com/docs/per-host-lockdown-enterprise-configuration) | ||
- [Getting the Most Out of the Role](https://www.lockdownenterprise.com/docs/get-the-most-out-of-lockdown-enterprise) | ||
- [Wiki](https://github.com/ansible-lockdown/RHEL9-CIS/wiki) | ||
- [Repo GitHub Page](https://ansible-lockdown.github.io/RHEL9-CIS/) | ||
|
||
## Auditing (new) | ||
|
||
This can be turned on or off within the defaults/main.yml file with the variable rhel9cis_run_audit. The value is false by default, please refer to the wiki for more details. | ||
|
||
This is a much quicker, very lightweight, checking (where possible) config compliance and live/running settings. | ||
|
||
A new form of auditing has been develeoped, by using a small (12MB) go binary called [goss](https://github.com/aelsabbahy/goss) along with the relevant configurations to check. Without the need for infrastructure or other tooling. | ||
This audit will not only check the config has the correct setting but aims to capture if it is running with that configuration also trying to remove [false positives](https://www.mindpointgroup.com/blog/is-compliance-scanning-still-relevant/) in the process. | ||
|
||
Refer to [RHEL9-CIS-Audit](https://github.com/ansible-lockdown/RHEL9-CIS-Audit). | ||
|
||
## Requirements | ||
|
||
RHEL 9 - Other versions are not supported. | ||
|
||
- Access to download or add the goss binary and content to the system if using auditing (other options are available on how to get the content to the system.) | ||
|
||
**General:** | ||
|
||
- Basic knowledge of Ansible, below are some links to the Ansible documentation to help get started if you are unfamiliar with Ansible | ||
- [Main Ansible documentation page](https://docs.ansible.com) | ||
- [Ansible Getting Started](https://docs.ansible.com/ansible/latest/user_guide/intro_getting_started.html) | ||
- [Tower User Guide](https://docs.ansible.com/ansible-tower/latest/html/userguide/index.html) | ||
- [Ansible Community Info](https://docs.ansible.com/ansible/latest/community/index.html) | ||
- Functioning Ansible and/or Tower Installed, configured, and running. This includes all of the base Ansible/Tower configurations, needed packages installed, and infrastructure setup. | ||
- 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 consiquences 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/RHEL9-CIS/wiki/Main-Variables). | ||
|
||
## Dependencies | ||
|
||
- Python3 | ||
- Ansible 2.9+ | ||
- python-def (should be included in RHEL 9) | ||
- libselinux-python | ||
|
||
## Role Variables | ||
|
||
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. These variables can be found [here](https://github.com/ansible-lockdown/RHEL9-CIS/wiki/Main-Variables) in the Main Variables Wiki page. All variables are listed there along with descriptions. | ||
|
||
## Tags | ||
|
||
There are many tags available for added control precision. Each control has it's own set of tags noting what level, if it's scored/notscored, what OS element it relates to, if it's a patch or audit, and the rule number. | ||
|
||
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. | ||
|
||
```txt | ||
tags: | ||
- level1-server | ||
- level1-workstation | ||
- scored | ||
- avahi | ||
- services | ||
- patch | ||
- rule_2.2.4 | ||
``` | ||
|
||
## Example Audit Summary | ||
|
||
This is based on a vagrant image with selections enabled. e.g. No Gui or firewall. | ||
Note: More tests are run during audit as we check config and running state. | ||
|
||
```txt | ||
ok: [default] => { | ||
"msg": [ | ||
"The pre remediation results are: ['Total Duration: 5.454s', 'Count: 338, Failed: 47, Skipped: 5'].", | ||
"The post remediation results are: ['Total Duration: 5.007s', 'Count: 338, Failed: 46, Skipped: 5'].", | ||
"Full breakdown can be found in /var/tmp", | ||
"" | ||
] | ||
} | ||
PLAY RECAP ******************************************************************************************************************************************* | ||
default : ok=270 changed=23 unreachable=0 failed=0 skipped=140 rescued=0 ignored=0 | ||
``` | ||
|
||
## Branches | ||
|
||
- devel - This is the default branch and the working development branch. Community pull requests will pull into this branch | ||
- main - This is the release branch | ||
- reports - This is a protected branch for our scoring reports, no code should ever go here | ||
- all other branches** - Individual community member branches | ||
|
||
## Community Contribution | ||
|
||
We encourage you (the community) to contribute to this role. Please read the rules below. | ||
|
||
- Your work is done in your own individual branch. Make sure to Signed-off and GPG sign all commits you intend to merge. | ||
- All community Pull Requests are pulled into the devel branch | ||
- Pull Requests into devel will confirm your commits have a GPG signature, Signed-off, and a functional test before being approved | ||
- 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 |
Oops, something went wrong.