Skip to content

Commit

Permalink
#243 thanks to @fnschroeder
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
  • Loading branch information
uk-bolly committed Feb 1, 2023
1 parent 807b6f0 commit 4a27601
Show file tree
Hide file tree
Showing 9 changed files with 0 additions and 34 deletions.
6 changes: 0 additions & 6 deletions handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@

- name: remount tmp
command: mount -o remount /tmp
args:
warn: false

- name: restart firewalld
service:
Expand Down Expand Up @@ -79,8 +77,6 @@
changed_when: false
check_mode: false
failed_when: false
args:
warn: false
when:
- not rhel8cis_skip_for_travis
tags:
Expand Down Expand Up @@ -128,8 +124,6 @@

- name: restart auditd
shell: service auditd restart
args:
warn: false
tags:
- skip_ansible_lint

Expand Down
2 changes: 0 additions & 2 deletions tasks/check_prereqs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
command: rpm -q python36-rpm
failed_when: ( python36_rpm_present.rc not in [ 0, 1 ] )
changed_when: false
args:
warn: false
register: python36_rpm_present

- name: Add the EPEL repository required for the python36-rpm pkg
Expand Down
8 changes: 0 additions & 8 deletions tasks/prelim.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
# List users in order to look files inside each home directory
- name: "PRELIM | List users accounts"
command: "awk -F: '{print $1}' /etc/passwd"
args:
warn: false
changed_when: false
check_mode: false
register: users
Expand Down Expand Up @@ -32,24 +30,18 @@

- name: "PRELIM | Gather accounts with empty password fields"
shell: "cat /etc/shadow | awk -F: '($2 == \"\" ) {j++;print $1; } END {exit j}'"
args:
warn: false
changed_when: false
check_mode: false
register: empty_password_accounts

- name: "PRELIM | Gather UID 0 accounts other than root"
shell: "cat /etc/passwd | awk -F: '($3 == 0 && $1 != \"root\") {i++;print $1 } END {exit i}'"
args:
warn: false
changed_when: false
check_mode: false
register: rhel8cis_uid_zero_accounts_except_root

- name: "PRELIM | Gather system-wide crypto-policy"
shell: update-crypto-policies --show
args:
warn: false
changed_when: false
check_mode: false
register: system_wide_crypto_policy
Expand Down
2 changes: 0 additions & 2 deletions tasks/section_1/cis_1.2.x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@
failed_when: false
register: dnf_configured
check_mode: false
args:
warn: false

- name: "1.2.4 | AUDIT | Ensure package manager repositories are configured | Display repo list"
debug:
Expand Down
2 changes: 0 additions & 2 deletions tasks/section_3/cis_3.1.x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,6 @@
changed_when: false
failed_when: false
check_mode: false
args:
warn: false
register: rhel_08_nmcli_available

- name: "3.1.4 | AUDIT | Ensure wireless interfaces are disabled | Check if wifi is enabled"
Expand Down
2 changes: 0 additions & 2 deletions tasks/section_3/cis_3.4.2.x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,6 @@

- name: "3.4.2.6 | PATCH | Ensure nftables base chains exist | Create chains if needed"
shell: "{{ item }}"
args:
warn: false
failed_when: false
with_items:
- nft create chain inet "{{ rhel8cis_nft_tables_tablename }}" input { type filter hook input priority 0 \; }
Expand Down
4 changes: 0 additions & 4 deletions tasks/section_5/cis_5.2.x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -261,15 +261,11 @@
- name: "5.2.14 | AUDIT | Ensure system-wide crypto policy is not over-ridden"
shell: grep -i '^\s*CRYPTO_POLICY=' /etc/sysconfig/sshd
failed_when: ( crypto_policy_override.rc not in [ 0, 1 ] )
args:
warn: false
changed_when: false
register: crypto_policy_override

- name: "5.2.14 | PATCH | Ensure system-wide crypto policy is not over-ridden"
shell: sed -ri "s/^\s*(CRYPTO_POLICY\s*=.*)$/# \1/" /etc/sysconfig/sshd
args:
warn: false
notify: restart sshd
when:
- crypto_policy_override.stdout | length > 0
Expand Down
4 changes: 0 additions & 4 deletions tasks/section_5/cis_5.4.x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@

- name: "5.4.1 | PATCH | Ensure custom authselect profile is used | Create custom profiles"
shell: authselect create-profile {{ rhel8cis_authselect['custom_profile_name'] }} -b {{ rhel8cis_authselect['default_file_to_copy'] }}
args:
warn: false
when: rhel8cis_authselect_custom_profile_create
when:
- rhel8cis_rule_5_4_1
Expand Down Expand Up @@ -47,8 +45,6 @@

- name: "5.4.2 | PATCH | Ensure authselect includes with-faillock | Create custom profiles"
shell: "authselect select custom/{{ rhel8cis_authselect['custom_profile_name'] }} with-faillock"
args:
warn: false
when: rhel8cis_authselect_custom_profile_select
when:
- rhel8cis_rule_5_4_2
Expand Down
4 changes: 0 additions & 4 deletions tasks/section_6/cis_6.1.x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
block:
- name: "6.1.1 | AUDIT | Audit system file permissions | Audit the packages"
shell: rpm -Va --nomtime --nosize --nomd5 --nolinkto
args:
warn: false
changed_when: false
failed_when: false
register: rhel8cis_6_1_1_packages_rpm
Expand Down Expand Up @@ -48,8 +46,6 @@

- name: "6.1.2 | PATCH | Ensure sticky bit is set on all world-writable directories"
shell: df --local -P | awk {'if (NR!=1) print $6'} | xargs -I '{}' find '{}' -xdev -type d -perm -0002 2>/dev/null | xargs chmod a+t
args:
warn: false
changed_when: false
failed_when: false
when:
Expand Down

0 comments on commit 4a27601

Please sign in to comment.