Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions tasks/section_5/cis_5.3.3.3.x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
failed_when: discovered_pwhistory_remember.rc not in [0, 1]

- name: "5.3.3.3.1 | PATCH | Ensure password number of changed characters is configured | Ensure remember is set"
when: discovered_pwhistory_remember.stdout | length > 0
when: discovered_pwhistory_remember.stdout | length == 0
ansible.builtin.lineinfile:
path: "/{{ ubtu24cis_pam_confd_dir }}{{ ubtu24cis_pam_pwhistory_file }}"
regexp: ^(password\s+[^#\n\r]+\s+pam_pwhistory\.so\s+)(.*)(remember=\d+)
Expand All @@ -46,7 +46,7 @@
failed_when: discovered_pwhistory_enforce_for_root.rc not in [0, 1]

- name: "5.3.3.3.2 | PATCH | Ensure password history is enforced for the root user | Ensure remember is set"
when: discovered_pwhistory_enforce_for_root.stdout | length > 0
when: discovered_pwhistory_enforce_for_root.stdout | length == 0
ansible.builtin.lineinfile:
path: "/{{ ubtu24cis_pam_confd_dir }}{{ ubtu24cis_pam_pwhistory_file }}"
regexp: ^(password\s+[^#\n\r]+\s+pam_pwhistory\.so\s+)(.*)(enforce_for_root)
Expand All @@ -73,7 +73,7 @@
failed_when: discovered_pwhistory_use_authtok.rc not in [0, 1]

- name: "5.3.3.3.3 | PATCH | Ensure pam_pwhistory includes use_authtok | Ensure remember is set"
when: discovered_pwhistory_use_authtok.stdout | length > 0
when: discovered_pwhistory_use_authtok.stdout | length == 0
ansible.builtin.lineinfile:
path: "/{{ ubtu24cis_pam_confd_dir }}{{ ubtu24cis_pam_pwhistory_file }}"
regexp: ^(password\s+[^#\n\r]+\s+pam_pwhistory\.so\s+)(.*)(use_authtok)
Expand Down
2 changes: 1 addition & 1 deletion templates/usr/share/pam-configs/pwhistory.j2
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ Default: yes
Priority: 1024
Password-Type: Primary
Password:
requisite pam_pwhistory.so enforce_for_root try_first_pass{% if ubtu24cis_rule_5_3_3_3_1 %} remember={{ ubtu24cis_pamd_pwhistory_remember }}{% endif %}{% if ubtu24cis_rule_5_3_3_3_2 %} enforce_for_root{% endif %}{% if ubtu24cis_rule_5_3_3_3_3 %} use_authtok{% endif %}
requisite pam_pwhistory.so {% if ubtu24cis_rule_5_3_3_3_1 %} remember={{ ubtu24cis_pamd_pwhistory_remember }}{% endif %}{% if ubtu24cis_rule_5_3_3_3_2 %} enforce_for_root{% endif %}{% if ubtu24cis_rule_5_3_3_3_3 %} use_authtok{% endif %}