Skip to content

Commit 7d5b654

Browse files
authored
Merge pull request #200 from ansible-lockdown/devel
Release to main for bug fixes and improvements
2 parents e8063eb + 7248d29 commit 7d5b654

21 files changed

Lines changed: 845 additions & 849 deletions

.ansible-lint

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
---
2+
23
parseable: true
34
quiet: true
45
skip_list:
@@ -7,6 +8,7 @@ skip_list:
78
- 'var-spacing'
89
- 'fqcn-builtins'
910
- 'experimental'
11+
- 'name[play]'
1012
- 'name[casing]'
1113
- 'name[template]'
1214
- 'fqcn[action]'

.github/workflows/linux_benchmark_testing.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ name: linux_benchmark_pipeline
55
# Controls when the action will run.
66
# Triggers the workflow on push or pull request
77
# events but only for the devel branch
8-
on:
8+
on: # yamllint disable-line rule:truthy
99
pull_request_target:
1010
types: [opened, reopened, synchronize]
1111
branches:

.yamllint

Lines changed: 29 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,33 @@
11
---
2-
ignore: |
3-
tests/
4-
molecule/
5-
.github/
6-
.gitlab-ci.yml
7-
*molecule.yml
8-
92
extends: default
103

4+
ignore: |
5+
tests/
6+
molecule/
7+
.github/
8+
.gitlab-ci.yml
9+
*molecule.yml
10+
1111
rules:
12-
indentation:
13-
# Requiring 4 space indentation
14-
spaces: 4
15-
# Requiring consistent indentation within a file, either indented or not
16-
indent-sequences: consistent
17-
level: error
18-
braces:
19-
max-spaces-inside: 1
20-
level: error
21-
brackets:
22-
max-spaces-inside: 1
23-
level: error
24-
line-length: disable
25-
key-duplicates: enable
26-
new-line-at-end-of-file: enable
27-
new-lines:
28-
type: unix
29-
trailing-spaces: enable
30-
truthy:
31-
allowed-values: ['true', 'false']
32-
check-keys: false
12+
indentation:
13+
# Requiring 4 space indentation
14+
spaces: 4
15+
# Requiring consistent indentation within a file, either indented or not
16+
indent-sequences: consistent
17+
braces:
18+
max-spaces-inside: 1
19+
level: error
20+
brackets:
21+
max-spaces-inside: 1
22+
level: error
23+
empty-lines:
24+
max: 1
25+
line-length: disable
26+
key-duplicates: enable
27+
new-line-at-end-of-file: enable
28+
new-lines:
29+
type: unix
30+
trailing-spaces: enable
31+
truthy:
32+
allowed-values: ['true', 'false']
33+
check-keys: false

Changelog.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,27 @@
11
# Changes to RHEL8STIG
22

3-
## Relase 2.8.3
3+
## Release 2.8.6
4+
5+
- [#194](https://github.com/ansible-lockdown/RHEL8-STIG/issues/194) thanks to @JacobBuskirk
6+
- [#196](https://github.com/ansible-lockdown/RHEL8-STIG/issues/196) thanks to @jmalpede
7+
8+
- [#195](https://github.com/ansible-lockdown/RHEL8-STIG/pull/195) thanks to PoundsOfFlesh
9+
- [#197](https://github.com/ansible-lockdown/RHEL8-STIG/pull/197) thanks to PoundsOfFlesh
10+
11+
## Release 2.8.5
12+
13+
- updated to /var/log mount check
14+
- added commnets for /mnt and removeable media on Azure systems
15+
16+
## Release 2.8.4
17+
18+
- ansible version updated to 2.10.1 minimum
19+
- updated to ansible user check for passwd rule 010380
20+
- thanks to discord community member PoundsOfFlesh
21+
- update readme layout and latest audit example
22+
- changed disruptive back to false to allow users to control the settings
23+
24+
## Release 2.8.3
425

526
- improvements to openssh configs and seperated tasks
627

README.md

Lines changed: 59 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,52 @@
11
# RHEL 8 DISA STIG
22

3-
![Build Status](https://img.shields.io/github/workflow/status/ansible-lockdown/RHEL8-STIG/CommunityToDevel?label=Devel%20Build%20Status&style=plastic)
4-
![Build Status](https://img.shields.io/github/workflow/status/ansible-lockdown/RHEL8-STIG/DevelToMain?label=Main%20Build%20Status&style=plastic)
5-
![Release](https://img.shields.io/github/v/release/ansible-lockdown/RHEL8-STIG?style=plastic)
6-
7-
Configure a RHEL/Rocky 8 system to be DISA STIG compliant. All findings will be audited by default. Non-disruptive CAT I, CAT II, and CAT III findings will be corrected by default. Disruptive finding remediation can be enabled by setting `rhel8stig_disruption_high` to `yes`.
3+
## Configure a RHEL8 based system to be complaint with Disa STIG
84

95
This role is based on RHEL 8 DISA STIG: [Version 1, Rel 9 released on Jan 26, 2023](https://dl.dod.cyber.mil/wp-content/uploads/stigs/zip/U_RHEL_8_V1R9_STIG.zip).
106

11-
## Join us
7+
---
8+
9+
![Org Stars](https://img.shields.io/github/stars/ansible-lockdown?label=Org%20Stars&style=social)
10+
![Stars](https://img.shields.io/github/stars/ansible-lockdown/rhel8-stig?label=Repo%20Stars&style=social)
11+
![Forks](https://img.shields.io/github/forks/ansible-lockdown/rhel8-stig?style=social)
12+
![followers](https://img.shields.io/github/followers/ansible-lockdown?style=social)
13+
[![Twitter URL](https://img.shields.io/twitter/url/https/twitter.com/AnsibleLockdown.svg?style=social&label=Follow%20%40AnsibleLockdown)](https://twitter.com/AnsibleLockdown)
14+
15+
![Ansible Galaxy Quality](https://img.shields.io/ansible/quality/56380?label=Quality&&logo=ansible)
16+
![Discord Badge](https://img.shields.io/discord/925818806838919229?logo=discord)
17+
18+
![Devel Build Status](https://img.shields.io/github/actions/workflow/status/ansible-lockdown/rhel8-stig/linux_benchmark_testing.yml?label=Devel%20Build%20Status)
19+
![Devel Commits](https://img.shields.io/github/commit-activity/m/ansible-lockdown/rhel8-stig/devel?color=dark%20green&label=Devel%20Branch%20commits)
20+
21+
![Release Branch](https://img.shields.io/badge/Release%20Branch-Main-brightgreen)
22+
![Main Build Status](https://img.shields.io/github/actions/workflow/status/ansible-lockdown/rhel8-stig/linux_benchmark_testing.yml?label=Build%20Status)
23+
![Main Release Date](https://img.shields.io/github/release-date/ansible-lockdown/rhel8-stig?label=Release%20Date)
24+
![Release Tag](https://img.shields.io/github/v/tag/ansible-lockdown/rhel8-stig?label=Release%20Tag&&color=success)
25+
26+
![Issues Open](https://img.shields.io/github/issues-raw/ansible-lockdown/rhel8-stig?label=Open%20Issues)
27+
![Issues Closed](https://img.shields.io/github/issues-closed-raw/ansible-lockdown/rhel8-stig?label=Closed%20Issues&&color=success)
28+
![Pull Requests](https://img.shields.io/github/issues-pr/ansible-lockdown/rhel8-stig?label=Pull%20Requests)
29+
30+
![License](https://img.shields.io/github/license/ansible-lockdown/rhel8-stig?label=License)
31+
32+
---
33+
34+
## Looking for support?
35+
36+
[Lockdown Enterprise](https://www.lockdownenterprise.com#GH_AL_RH8_stig)
37+
38+
[Ansible support](https://www.mindpointgroup.com/cybersecurity-products/ansible-counselor#GH_AL_RH8_stig)
39+
40+
### Community
1241

1342
On our [Discord Server](https://discord.io/ansible-lockdown) to ask questions, discuss features, or just chat with other Ansible-Lockdown users
1443

44+
---
45+
46+
Configure a RHEL/Rocky 8 system to be DISA STIG compliant.
47+
Non-disruptive CAT I, CAT II, and CAT III findings will be corrected by default.
48+
Disruptive finding remediation can be enabled by setting `rhel8stig_disruption_high` to `true`.
49+
1550
## Updating
1651

1752
Coming from a previous release.
@@ -21,41 +56,27 @@ This contains rewrites and ID reference changes as per STIG documentation.
2156

2257
## Auditing
2358

24-
This can be turned on or off within the defaults/main.yml file with the variable rhel8stig_run_audit. The value is false by default, please refer to the wiki for more details.
59+
This can be turned on or off within the defaults/main.yml file with the variable rhel7cis_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.
2560

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

28-
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.
63+
A new form of auditing has been developed, by using a small (12MB) go binary called [goss](https://github.com/goss-org/goss) along with the relevant configurations to check. Without the need for infrastructure or other tooling.
2964
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.
3065

31-
Refer to [RHEL8-STIG-Audit](https://github.com/ansible-lockdown/RHEL8-STIG-Audit).
66+
## Documentation
67+
68+
- [Read The Docs](https://ansible-lockdown.readthedocs.io/en/latest/)
69+
- [Getting Started](https://www.lockdownenterprise.com/docs/getting-started-with-lockdown#GH_AL_RH8_stig)
70+
- [Customizing Roles](https://www.lockdownenterprise.com/docs/customizing-lockdown-enterprise#GH_AL_RH8_stig)
71+
- [Per-Host Configuration](https://www.lockdownenterprise.com/docs/per-host-lockdown-enterprise-configuration#GH_AL_RH8_stig)
72+
- [Getting the Most Out of the Role](https://www.lockdownenterprise.com/docs/get-the-most-out-of-lockdown-enterprise#GH_AL_RH8_stig)
3273

3374
## Requirements
3475

35-
- RHEL/Rocky/AlmaLinux 8 - Other versions are not supported.
76+
- RHEL/Rocky/AlmaLinux/OL 8 - Other versions are not supported.
3677
- Other OSs can be checked by changing the skip_os_check to true for testing purposes.
3778
- Access to download or add the goss binary and content to the system if using auditing. options are available on how to get the content to the system.
3879

39-
### General
40-
41-
- Basic knowledge of Ansible, below are some links to the Ansible documentation to help get started if you are unfamiliar with Ansible
42-
43-
- [Main Ansible documentation page](https://docs.ansible.com)
44-
- [Ansible Getting Started](https://docs.ansible.com/ansible/latest/user_guide/intro_getting_started.html)
45-
- [Tower User Guide](https://docs.ansible.com/ansible-tower/latest/html/userguide/index.html)
46-
- [Ansible Community Info](https://docs.ansible.com/ansible/latest/community/index.html)
47-
- Functioning Ansible and/or Tower Installed, configured, and running. This includes all of the base Ansible/Tower configurations, needed packages installed, and infrastructure setup.
48-
- 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/RHEL8-STIG/wiki/Main-Variables).
49-
50-
## Documentation
51-
52-
- [Repo GitHub Page](https://ansible-lockdown.github.io/RHEL8-STIG/)
53-
- [Getting Started](https://www.lockdownenterprise.com/docs/getting-started-with-lockdown)
54-
- [Customizing Roles](https://www.lockdownenterprise.com/docs/customizing-lockdown-enterprise)
55-
- [Per-Host Configuration](https://www.lockdownenterprise.com/docs/per-host-lockdown-enterprise-configuration)
56-
- [Getting the Most Out of the Role](https://www.lockdownenterprise.com/docs/get-the-most-out-of-lockdown-enterprise)
57-
- [Wiki](https://github.com/ansible-lockdown/RHEL8-STIG/wiki)
58-
5980
## Dependencies
6081

6182
The following packages must be installed on the controlling host/host where ansible is executed:
@@ -69,7 +90,7 @@ Package 'python-xmltodict' is required if you enable the OpenSCAP tool installat
6990

7091
## Role Variables
7192

72-
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/RHEL8-STIG/wiki/Main-Variables) in the Main Variables Wiki page. All variables are listed there along with descriptions.
93+
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.
7394

7495
### Tags
7596

@@ -91,18 +112,14 @@ This is based on a vagrant image with selections enabled. e.g. No Gui or firewal
91112
Note: More tests are run during audit as we check config and running state.
92113

93114
```sh
94-
ok: [rhel8test] => {
95-
"msg": [
96-
"The pre remediation results are: Count: 308, Failed: 156, Duration: 44.108s.",
97-
"The post remediation results are: Count: 308, Failed: 14, Duration: 37.647s.",
98-
"Full breakdown can be found in /var/tmp",
99-
""
100-
]
101-
}
102-
]
103-
}
115+
ok: [rocky8_efi] =>
116+
msg:
117+
- 'The pre remediation results are: Count: 804, Failed: 416, Duration: 6.488s.'
118+
- 'The post remediation results are: Count: 804, Failed: 28, Duration: 68.687s.'
119+
- Full breakdown can be found in /opt
120+
104121
PLAY RECAP ****************************************************************************************************************
105-
rhel8test : ok=369 changed=192 unreachable=0 failed=0 skipped=125 rescued=0 ignored=0
122+
rocky8_efi : ok=482 changed=269 unreachable=0 failed=0 skipped=207 rescued=0 ignored=0
106123
```
107124

108125
## Branches

collections/requirements.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22

33
collections:
4-
- name: community.general
4+
- name: community.general
55

6-
- name: community.crypto
6+
- name: community.crypto
77

8-
- name: ansible.posix
8+
- name: ansible.posix

defaults/main.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ rhel8stig_audit_complex: true
2626
# We've defined disruption-high to indicate items that are likely to cause
2727
# disruption in a normal workflow. These items can be remediated automatically
2828
# but are disabled by default to avoid disruption.
29-
rhel8stig_disruption_high: true
29+
rhel8stig_disruption_high: false
3030

3131
# Show "changed" for disruptive items not remediated per disruption-high
3232
# setting to make them stand out.
33-
rhel8stig_audit_disruptive: true
33+
rhel8stig_audit_disruptive: false
3434

3535
rhel8stig_skip_for_travis: false
3636

@@ -190,9 +190,12 @@ rhel_08_010571: true
190190
rhel_08_010572: true
191191
rhel_08_010580: true
192192
rhel_08_010590: true
193+
## Note Azure is currently default mounting /mnt for cloud-init this will cause issues with these controls
194+
## refer to https://github.com/Azure/WALinuxAgent/issues/1971
193195
rhel_08_010600: true
194196
rhel_08_010610: true
195197
rhel_08_010620: true
198+
##
196199
rhel_08_010630: true
197200
rhel_08_010640: true
198201
rhel_08_010650: true
@@ -477,13 +480,13 @@ rhel8stig_smartcard: false
477480
# Configure your smartcard driver
478481
rhel8stig_smartcarddriver: cackey
479482

480-
#Whether or not system uses remote automounted home directories via autofs
483+
# Whether or not system uses remote automounted home directories via autofs
481484
rhel8stig_autofs_remote_home_dirs: false
482485

483-
#The local mount point used by autofs to mount remote home directory to. This location will be excluded during getent user enumeration, if rhel8stig_autofs_remote_home_dirs is true
486+
# The local mount point used by autofs to mount remote home directory to. This location will be excluded during getent user enumeration, if rhel8stig_autofs_remote_home_dirs is true
484487
rhel8stig_auto_mount_home_dirs_local_mount_point: "/home/"
485488

486-
#The default shell command to gather local interactive user directories
489+
# The default shell command to gather local interactive user directories
487490
## NOTE: You will need to adjust the UID range in parenthesis below.
488491
## ALSO NOTE: We weed out any user with a home dir not in standard locations because interactive users shouldn't have those paths as a home dir. Add or removed directory paths as needed below.
489492
local_interactive_user_dir_command: "getent passwd { {{ rhel8stig_int_gid }}..65535} | cut -d: -f6 | sort -u | grep -v '/var/' | grep -v '/nonexistent/*' | grep -v '/run/*'"
@@ -533,7 +536,6 @@ rhel8stig_ssh_priv_key_perm: 0600
533536
rhel8stig_standard_user_path: "PATH=$PATH:$HOME/.local/bin:$HOME/bin"
534537
rhel8stig_change_user_path: false
535538

536-
537539
# RHEL-08-010700
538540
# rhel8stig_ww_dir_owner is the owenr of all world-writable directories
539541
# To conform to STIG standards this needs to be set to root, sys, bin, or an application group
@@ -794,7 +796,6 @@ rhel8stig_auditd_failure_flag: "{{ rhel8stig_availability_override | ternary(1,
794796
# REHL-08-010020
795797
rhel8stig_boot_part: "{{ rhel_08_boot_part.stdout }}"
796798

797-
798799
# RHEL-08-010740/RHEL-08-010750
799800
rhel8stig_passwd_label: "{{ (this_item | default(item)).id }}: {{ (this_item | default(item)).dir }}"
800801

@@ -878,7 +879,7 @@ rhel8stig_ssh_server_crypto_settings: "-oCiphers=aes256-ctr,aes192-ctr,aes128-ct
878879
# RHEL-08-010295
879880
# This will be teh GnuTLS ecryption packages. The task sets the +VERS-ALL: setting, the only items needed are the DoD approved encryptions
880881
# to conform to STIG standards this variable must contain +VERS-ALL:-VERS-DTLS0.9:-VERS-SSL3.0:-VERS-TLS1.0:-VERS-TLS1.1:-VERS-DTLS1.0
881-
rhel8stig_gnutls_encryption: "+VERS-ALL:-VERS-DTLS0.9:-VERS-SSL3.0:-VERS-TLS1.0:-VERS-TLS1.1:-VERS-DTLS1.0"
882+
rhel8stig_gnutls_encryption: "-VERS-DTLS0.9:-VERS-SSL3.0:-VERS-TLS1.0:-VERS-TLS1.1:-VERS-DTLS1.0"
882883

883884
# RHEL-08-020070
884885
# This is the value for the tmux lock after setting. To conform to STIG standards value needs to be set to 900 or less
@@ -889,7 +890,6 @@ rhel8stig_tmux_lock_after_time: 900
889890
# Value must be greater than 0 to conform to STIG standards
890891
rhel8stig_sudo_timestamp_timeout: 1
891892

892-
893893
#### Goss Configuration Settings ####
894894
# Set correct env for the run_audit.sh script from https://github.com/ansible-lockdown/{{ benchmark }}-Audit.git"
895895
audit_run_script_environment:

0 commit comments

Comments
 (0)