Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release of v1r12 #275

Merged
merged 42 commits into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
0945bc3
ruleid updates for v1r12 refer changelog
uk-bolly Oct 25, 2023
7dbe85d
updated
uk-bolly Oct 25, 2023
e7edfc1
updated PRELIM in title
uk-bolly Oct 25, 2023
00c2ab8
updated the workflow version and galaxy setup
uk-bolly Oct 31, 2023
805b774
fix typo
uk-bolly Nov 2, 2023
9ff31ad
Oraclelinux updated thanks to @BillSkiCO
uk-bolly Jan 26, 2024
141f134
updated task 20030 thanks to @BillSkiCO
uk-bolly Jan 26, 2024
7acd113
updated 40321 thanks to @whitehat237
uk-bolly Jan 26, 2024
574d4c1
updated after feedback from #245
uk-bolly Feb 20, 2024
52f0cae
added issue #248 fix
uk-bolly Feb 20, 2024
1d23663
Added fix for #254
uk-bolly Feb 20, 2024
7879a03
fix syntax
uk-bolly Feb 21, 2024
ad7e0a2
Squashed commit of the following:
uk-bolly Feb 21, 2024
20661be
fix typo line 020030
uk-bolly Feb 21, 2024
ccd1285
updated due to galaxy_ng changes
uk-bolly Mar 4, 2024
756c791
Revert "fixed gnutls as per issue 196 thansk to @jmalpede"
qwestduck Oct 24, 2023
20fa953
Update main.yml
BillSkiCO Nov 9, 2023
303c3d8
[pre-commit.ci] pre-commit autoupdate
pre-commit-ci[bot] Dec 4, 2023
180e9b0
[pre-commit.ci] pre-commit autoupdate
pre-commit-ci[bot] Feb 20, 2024
9fb6548
updated Readme credits
uk-bolly Mar 4, 2024
35eca32
updated credits
uk-bolly Mar 4, 2024
3edbf29
Merge branch 'devel' into stig_v1r12
uk-bolly Mar 11, 2024
1c4b7db
Merge pull request #259 from ansible-lockdown/stig_v1r12
uk-bolly Mar 12, 2024
97dd517
[pre-commit.ci] pre-commit autoupdate
pre-commit-ci[bot] Mar 18, 2024
239fd40
Merge pull request #260 from ansible-lockdown/pre-commit-ci-update-co…
uk-bolly Mar 20, 2024
5ee5bf2
Updated RHEL-08-020050 to loop over stdout_lines. Fixes issue #261.
Phenix66 Mar 20, 2024
7c42617
Merge pull request #262 from Phenix66/fix-issue-261
uk-bolly Mar 21, 2024
384dd10
[pre-commit.ci] pre-commit autoupdate
pre-commit-ci[bot] Apr 8, 2024
0b8ea7f
Merge pull request #264 from ansible-lockdown/pre-commit-ci-update-co…
uk-bolly Apr 9, 2024
b6ecf05
addressing #251
uk-bolly Apr 9, 2024
0881806
fix issue #263
uk-bolly Apr 9, 2024
6f485da
Address issues #242
uk-bolly Apr 9, 2024
ac7520f
housekeeping lint
uk-bolly Apr 9, 2024
98a7120
Meet fix text of V-244546
fallenpixel Apr 10, 2024
9872968
issue #267
uk-bolly Apr 11, 2024
51943d7
Merge pull request #266 from fallenpixel/v-244546
uk-bolly Apr 11, 2024
40b5070
[pre-commit.ci] pre-commit autoupdate
pre-commit-ci[bot] Apr 15, 2024
6c1dcaa
Merge pull request #268 from ansible-lockdown/pre-commit-ci-update-co…
uk-bolly Apr 22, 2024
e821948
Merge branch 'devel' into April_24
uk-bolly Apr 22, 2024
469a4a9
Merge pull request #269 from ansible-lockdown/April_24
uk-bolly Apr 22, 2024
db1b008
fixed error in conditional rhel-08-020022
uk-bolly Apr 25, 2024
4d0b593
Merge pull request #272 from ansible-lockdown/issue_271
uk-bolly Apr 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .config/.gitleaks-report.json

This file was deleted.

120 changes: 0 additions & 120 deletions .config/.secrets.baseline

This file was deleted.

7 changes: 2 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ci:

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
# Safety
- id: detect-aws-credentials
Expand All @@ -33,17 +33,14 @@ repos:
rev: v1.4.0
hooks:
- id: detect-secrets
args: [ '--baseline', '.config/.secrets.baseline' ]
exclude: .config/.gitleaks-report.json

- repo: https://github.com/gitleaks/gitleaks
rev: v8.18.2
hooks:
- id: gitleaks
args: ['--baseline-path', '.config/.gitleaks-report.json']

- repo: https://github.com/ansible-community/ansible-lint
rev: v24.2.0
rev: v24.2.2
hooks:
- id: ansible-lint
name: Ansible-lint
Expand Down
20 changes: 19 additions & 1 deletion Changelog.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,25 @@
# Changes to RHEL8STIG

## 3.1 - STIG V1R12 - 25th Oct 2023

ruleid updated

- 010020
- 010471
- 030741
- 030742
- 040400

- added SSH validation
- added ansible_facts for variable usage

- AUDIT
- Audit_only ability now added to run standalone audit
- audit_only: true
- Related Audit repo updated to improve tests audit binary(goss updated to latest version)

## 3.0.3 - Stig V1R11 - 26th July 2023
q

- updates to collections since galaxy updated
- updates to audit

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Configure a RHEL8 based system to be complaint with Disa STIG

This role is based on RHEL 8 DISA STIG: [Version 1, Rel 11 released on July 26, 2023](https://dl.dod.cyber.mil/wp-content/uploads/stigs/zip/U_RHEL_8_V1R11_STIG.zip).
This role is based on RHEL 8 DISA STIG: [Version 1, Rel 12 released on Oct 25, 2023](https://dl.dod.cyber.mil/wp-content/uploads/stigs/zip/U_RHEL_8_V1R12_STIG.zip).

---

Expand Down
98 changes: 37 additions & 61 deletions defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
## metadata for Audit benchmark
benchmark_version: 'v1r11'
benchmark_version: 'v1r12'

## Benchmark name used by audting control role
# The audit variable found at the base
Expand Down Expand Up @@ -56,24 +56,46 @@ rhel8stig_skip_reboot: true
# Defined will change if control requires
change_requires_reboot: false

### Goss is required on the remote host
##########################################
### Goss is required on the remote host ###
## Refer to vars/auditd.yml for any other settings ##

# Allow audit to setup the requirements including installing git (if option chosen and downloading and adding goss binary to system)
setup_audit: false

# enable audits to run - this runs the audit and get the latest content
run_audit: false

# Only run Audit do not remediate
audit_only: false
# As part of audit_only
# This will enable files to be copied back to control node
fetch_audit_files: false
# Path to copy the files to will create dir structure
audit_capture_files_dir: /some/location to copy to on control node

# How to retrieve audit binary
# Options are copy or download - detailed settings at the bottom of this file
# you will need to access to either github or the file already dowmloaded
get_audit_binary_method: download

## if get_audit_binary_method - copy the following needs to be updated for your environment
## it is expected that it will be copied from somewhere accessible to the control node
## e.g copy from ansible control node to remote host
audit_bin_copy_location: /some/accessible/path

# how to get audit files onto host options
# options are git/copy/get_url other e.g. if you wish to run from already downloaded conf
audit_content: git

# enable audits to run - this runs the audit and get the latest content
run_audit: false
# archive or copy:
audit_conf_copy: "some path to copy from"

# get_url:
audit_files_url: "some url maybe s3?"

# Run heavy tests - some tests can have more impact on a system enabling these can have greater impact on a system
audit_run_heavy_tests: true
# Timeout for those cmds that take longer to run where timeout set
audit_cmd_timeout: 60000

### End Goss enablements ####
#### Detailed settings found at the end of this document ####
Expand Down Expand Up @@ -856,20 +878,26 @@ rhel8stig_ntp_server_name: 0.us.pool.ntp.mil
# rhel8stig_fapolicy_white_list is the whitelist for fapolicyd, the last item in the list must be dyny all all
rhel8stig_fapolicy_white_list:
- 'deny_audit perm=any pattern=ld_so : all'
- deny all all
- 'deny perm=any all : all'

# RHEL-08-040090
# rhel8stig_custom_firewall_zone is the desired name for the new customer firewall zone
rhel8stig_custom_firewall_zone: "new_fw_zone"

# rhel8stig_copy_existing_zone - if you wish to copy an existing zones rules to the new zone
rhel8stig_copy_existing_zone: true
# rhel8stig_existing_zone_to_copy - name of the zone that you wish to copy from
rhel8stig_existing_zone_to_copy: public

# RHEL-08-040090
# rhel8stig_white_list_services is the services that you want to allow through initially for teh new firewall zone
# This designed not work with rhel8stig_existing_zone_to_copy and when deploy new rules
# rhel8stig_white_list_services is the services that you want to allow through initially for the new firewall zone
# http and ssh need to be enabled for the role to run.
# This can also be a port number if no service exists
rhel8stig_white_list_services:
- ssh
- http
- https
- ssh

# RHEL-08-010290
# RHEL-08-010290
Expand Down Expand Up @@ -900,55 +928,3 @@ rhel8stig_tmux_lock_after_time: 900
# The value given to Defaults timestamp timeout= in the sudo file.
# Value must be greater than 0 to conform to STIG standards
rhel8stig_sudo_timestamp_timeout: 1

#### Goss Configuration Settings ####
# Set correct env for the run_audit.sh script from https://github.com/ansible-lockdown/{{ benchmark }}-Audit.git"
audit_run_script_environment:
AUDIT_BIN: "{{ audit_bin }}"
AUDIT_FILE: 'goss.yml'
AUDIT_CONTENT_LOCATION: "{{ audit_out_dir }}"

### Goss binary settings ###
audit_bin_version:
release: v0.3.23
checksum: 'sha256:9e9f24e25f86d6adf2e669a9ffbe8c3d7b9b439f5f877500dea02ba837e10e4d'
audit_bin_path: /usr/local/bin/
audit_bin: "{{ audit_bin_path }}goss"
audit_format: json

# if get_audit_binary_method == download change accordingly
audit_bin_url: "https://github.com/goss-org/goss/releases/download/{{ audit_bin_version.release }}/goss-linux-amd64"

## if get_audit_binary_method - copy the following needs to be updated for your environment
## it is expected that it will be copied from somewhere accessible to the control node
## e.g copy from ansible control node to remote host
audit_bin_copy_location: /some/accessible/path

#### Goss Audit Benchmark file ###
## managed by the control audit_content
# git
audit_file_git: "https://github.com/ansible-lockdown/{{ benchmark }}-Audit.git"
audit_git_version: "benchmark_{{ benchmark_version }}_rh8"

# archive or copy:
audit_conf_copy: "some path to copy from"

# get_url:
audit_files_url: "some url maybe s3?"

## Goss configuration information
# Where the goss configs and outputs are stored
audit_out_dir: '/opt'
# Where the goss audit configuration will be stored
audit_conf_dir: "{{ audit_out_dir }}/{{ benchmark }}-Audit"

# If changed these can affect other products
pre_audit_outfile: "{{ audit_out_dir }}/{{ ansible_hostname }}-{{ benchmark }}-{{ benchmark_version }}_pre_scan_{{ ansible_date_time.epoch }}.{{ audit_format }}"
post_audit_outfile: "{{ audit_out_dir }}/{{ ansible_hostname }}-{{ benchmark }}-{{ benchmark_version }}_post_scan_{{ ansible_date_time.epoch }}.{{ audit_format }}"

## The following should not need changing
audit_vars_path: "{{ audit_conf_dir }}/vars/{{ ansible_hostname }}.yml"
audit_results: |
The pre remediation results are: {{ pre_audit_summary }}.
The post remediation results are: {{ post_audit_summary }}.
Full breakdown can be found in {{ audit_out_dir }}
13 changes: 9 additions & 4 deletions handlers/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
---

- name: change_requires_reboot
ansible.builtin.set_fact:
change_requires_reboot: true

- name: systemctl daemon-reload
ansible.builtin.systemd:
daemon_reload: true
Expand All @@ -16,6 +21,7 @@
when:
- not rhel8stig_system_is_chroot
- "'openssh-server' in ansible_facts.packages"
- not change_requires_reboot

- name: restart sssd
ansible.builtin.service:
Expand All @@ -30,6 +36,7 @@
state: restarted
when:
- not rhel8stig_system_is_chroot
- not change_requires_reboot

- name: restart rsyslog
ansible.builtin.service:
Expand Down Expand Up @@ -82,6 +89,7 @@
- not rhel8stig_skip_for_travis
- not rhel8stig_system_is_chroot
- not system_is_container
- not change_requires_reboot

- name: update auditd
ansible.builtin.template:
Expand All @@ -98,6 +106,7 @@
- not rhel8stig_skip_for_travis
- not rhel8stig_system_is_chroot
- not system_is_container
- not change_requires_reboot

- name: rebuild initramfs
ansible.builtin.shell: dracut -f
Expand Down Expand Up @@ -146,7 +155,3 @@
ansible.builtin.debug:
msg: "Post-run OpenSCAP score is {{ rhel8stig_postscanresults.Benchmark.TestResult.score['#text'] }}"
when: rhel8stig_oscap_scan

- name: change_requires_reboot
ansible.builtin.set_fact:
change_requires_reboot: true
Loading