Skip to content

Commit 2d3b7ea

Browse files
authored
Merge pull request #149 from ansible-lockdown/nov_2022_updates
Nov 2022 updates
2 parents 8e24682 + 29fd784 commit 2d3b7ea

3 files changed

Lines changed: 17 additions & 15 deletions

File tree

defaults/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -502,8 +502,8 @@ rhel8stig_sys_commands_perm: 0755
502502

503503
# RHEL-08-010330
504504
# rhel8stig_lib_file_perm is the permissions teh library files will be set to
505-
# To conform to STIG standards this needs to be set to 0755 or more restrictive
506-
rhel8stig_lib_file_perm: 0755
505+
# To conform to STIG standards this needs to be set to 755 or more restrictive
506+
rhel8stig_lib_file_perm: 755
507507

508508
# RHEL-08-010480
509509
# rhel8stig_ssh_pub_key_perm are the permissions set to the SSH public host keys

tasks/fix-cat2.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@
299299
dest: /etc/grub.d/01_users
300300
owner: root
301301
group: root
302-
mode: 0644
302+
mode: 0755
303303
notify: confirm grub2 user cfg
304304
when:
305305
- rhel_08_010141 or
@@ -558,16 +558,16 @@
558558
- name: "MEDIUM | RHEL-08-020025 | PATCH | 8 must configure the use of the pam_faillock.so module in the /etc/pam.d/system-auth file. | Set preauth"
559559
lineinfile:
560560
path: /etc/pam.d/system-auth
561-
regexp: '^auth required pam_faillock.so preauth'
562-
line: "auth required pam_faillock.so preauth dir={{ rhel8stig_pam_faillock.dir }} silent audit deny={{ rhel8stig_pam_faillock.attempts }}{{ (rhel8stig_pam_faillock.fail_for_root) | ternary(' even_deny_root ',' ') }}fail_interval={{ rhel8stig_pam_faillock.interval }} unlock_time={{ rhel8stig_pam_faillock.unlock_time }}"
563-
insertafter: '^auth'
561+
regexp: '^auth.*required.*pam_faillock.so preauth'
562+
line: "auth required pam_faillock.so preauth dir={{ rhel8stig_pam_faillock.dir }} silent audit deny={{ rhel8stig_pam_faillock.attempts }}{{ (rhel8stig_pam_faillock.fail_for_root) | ternary(' even_deny_root ',' ') }}fail_interval={{ rhel8stig_pam_faillock.interval }} unlock_time={{ rhel8stig_pam_faillock.unlock_time }}"
563+
insertafter: '^auth\s+required\s+pam_env.so'
564564
notify: restart sssd
565565

566566
- name: "MEDIUM | RHEL-08-020025 | PATCH | 8 must configure the use of the pam_faillock.so module in the /etc/pam.d/system-auth file. | Set authfail"
567567
lineinfile:
568568
path: /etc/pam.d/system-auth
569-
regexp: '^auth required pam_faillock.so authfail'
570-
line: 'auth required pam_faillock.so authfail dir={{ rhel8stig_pam_faillock.dir }} unlock_time={{ rhel8stig_pam_faillock.unlock_time }}'
569+
regexp: '^auth.*required.*pam_faillock.so authfail'
570+
line: 'auth required pam_faillock.so authfail dir={{ rhel8stig_pam_faillock.dir }} unlock_time={{ rhel8stig_pam_faillock.unlock_time }}'
571571
insertafter: '^auth'
572572
notify: restart sssd
573573

@@ -936,9 +936,9 @@
936936
"MEDIUM | RHEL-08-010350 | PATCH | RHEL 8 library files must be group-owned by root or a system account. | Get library files not group-owned by root"
937937
file:
938938
path: "{{ item }}"
939-
owner: root
940-
group: root
941-
mode: "{{ rhel8stig_lib_file_perm }}"
939+
owner: "{{ rhel_08_010340 | ternary('root',omit) }}"
940+
group: "{{ rhel_08_010350 | ternary('root',omit) }}"
941+
mode: "{{ rhel_08_010330 | ternary(rhel8stig_lib_file_perm,omit) }}"
942942
with_items:
943943
- "{{ rhel_08_010330_library_files.stdout_lines }}"
944944
when:
@@ -6159,7 +6159,7 @@
61596159
path: /tmp
61606160
state: mounted
61616161
src: "{{ tmp_mount.device }}"
6162-
fstype: xfs
6162+
fstype: "{{ tmp_mount.fstype }}"
61636163
opts: "defaults{{ rhel_08_040123 | ternary (',nodev', '') }}{{ rhel_08_040124 | ternary (',nosuid', '') }}{{ rhel_08_040125 | ternary (',noexec', '') }}"
61646164
vars:
61656165
tmp_mount: "{{ ansible_mounts | json_query('[?mount == `/tmp`] | [0]') }}"
@@ -6206,7 +6206,7 @@
62066206
path: /var/log
62076207
state: mounted
62086208
src: "{{ var_log_mount.device }}"
6209-
fstype: xfs
6209+
fstype: "{{ var_log_mount.fstype }}"
62106210
opts: "defaults{{ rhel_08_040126 | ternary (',nodev', '') }}{{ rhel_08_040127 | ternary (',nosuid', '') }}{{ rhel_08_040128 | ternary (',noexec', '') }}"
62116211
vars:
62126212
var_log_mount: "{{ ansible_mounts | json_query('[?mount == `/var/log`] | [0]') }}"
@@ -6252,7 +6252,7 @@
62526252
path: /var/log/audit
62536253
state: mounted
62546254
src: "{{ audit_mount.device }}"
6255-
fstype: xfs
6255+
fstype: "{{ audit_mount.fstype }}"
62566256
opts: "defaults{{ rhel_08_040129 | ternary (',nodev', '') }}{{ rhel_08_040130 | ternary (',nosuid', '') }}{{ rhel_08_040131 | ternary (',noexec', '') }}"
62576257
vars:
62586258
audit_mount: "{{ ansible_mounts | json_query('[?mount == `/var/log/audit`] | [0]') }}"
@@ -6298,7 +6298,7 @@
62986298
path: /var/tmp
62996299
state: mounted
63006300
src: "{{ var_tmp_mount.device }}"
6301-
fstype: xfs
6301+
fstype: "{{ var_tmp_mount.fstype }}"
63026302
opts: "defaults{{ rhel_08_040132 | ternary (',nodev', '') }}{{ rhel_08_040133 | ternary (',nosuid', '') }}{{ rhel_08_040134 | ternary (',noexec', '') }}"
63036303
vars:
63046304
var_tmp_mount: "{{ ansible_mounts | json_query('[?mount == `/var/tmp`] | [0]') }}"

tasks/pre_remediation_audit.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
state: present
2222
when:
2323
- ansible_distribution_major_version == "8"
24+
- audit_content == "git"
2425
- "'git' not in ansible_facts.packages"
2526

2627
- name: "Pre Audit | Install git (rh7 python2)"
@@ -31,6 +32,7 @@
3132
ansible_python_interpreter: "{{ python2_bin }}"
3233
when:
3334
- ansible_distribution_major_version == "7"
35+
- audit_content == "git"
3436
- "'git' not in ansible_facts.packages"
3537

3638
- name: "Pre Audit | retrieve audit content files from git"

0 commit comments

Comments
 (0)