Skip to content

Commit

Permalink
Merge pull request #321 from anzoman/steampunk-spotter-fixes
Browse files Browse the repository at this point in the history
Task validation fixes (by Steampunk Spotter)
  • Loading branch information
uk-bolly authored Sep 15, 2023
2 parents 9e820c6 + aa610ce commit 21614a6
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion tasks/check_prereqs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

- name: "PREREQ | Check required packages installed | Python2"
ansible.builtin.package:
list: "{{ item }}"
name: "{{ item }}"
state: present
loop:
- rpm-python
Expand Down
3 changes: 1 addition & 2 deletions tasks/pre_remediation_audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,8 @@

- name: Pre Audit Setup | If audit ensure goss is available
ansible.builtin.assert:
that: goss_available.stat.exists
msg: "Audit has been selected: unable to find goss binary at {{ audit_bin }}"
when:
- not goss_available.stat.exists
when:
- run_audit

Expand Down
2 changes: 1 addition & 1 deletion tasks/section_1/cis_1.2.x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
- rule_1.2.4

- name: "1.2.5 | PATCH | Disable the rhnsd Daemon"
ansible.builtin.service:
ansible.builtin.systemd:
name: rhnsd
state: stopped
enabled: false
Expand Down
6 changes: 3 additions & 3 deletions tasks/section_5/cis_5.5.x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
- name: "5.5.2 | PATCH | Ensure system accounts are secured"
block:
- name: "5.5.2 | PATCH | Ensure system accounts are secured | Set nologin"
user:
ansible.builtin.user:
name: "{{ item.id }}"
shell: /usr/sbin/nologin
loop: "{{ rhel7cis_passwd }}"
Expand All @@ -19,7 +19,7 @@
- item.shell != " /usr/sbin/nologin"

- name: "5.5.2 | PATCH | Ensure system accounts are secured | Lock accounts"
user:
ansible.builtin.user:
name: "{{ item.id }}"
password_lock: true
loop: "{{ rhel7cis_passwd }}"
Expand All @@ -42,7 +42,7 @@
- rule_5.5.2

- name: "5.5.3 | PATCH | Ensure default group for the root account is GID 0"
shell: usermod -g 0 root
ansible.builtin.shell: usermod -g 0 root
changed_when: false
failed_when: false
when:
Expand Down
2 changes: 1 addition & 1 deletion tasks/section_5/cis_5.7.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
line: 'auth required pam_wheel.so use_uid {% if rhel7cis_sugroup is defined %}group={{ rhel7cis_sugroup }}{% endif %}'

- name: "5.7 | PATCH | Ensure access to the su command is restricted | wheel group contains root"
ansible.builtin.group:
ansible.builtin.user:
name: root
groups: "{{ rhel7cis_sugroup }}"
when:
Expand Down
2 changes: 1 addition & 1 deletion tasks/section_6/cis_6.2.x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
- rhel7cis_passwd | selectattr('password', '!=', 'x')

- name: "6.2.1 | PATCH | Ensure accounts in /etc/passwd use shadow passwords | Good News"
debug:
ansible.builtin.debug:
msg: "Good News!! No Unshadowed passwords have been found"
when: rhel7_6_2_1_shadow is not changed
when:
Expand Down

0 comments on commit 21614a6

Please sign in to comment.