Skip to content

Commit

Permalink
fix var typo
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Bolwell <[email protected]>
  • Loading branch information
uk-bolly committed Mar 27, 2024
1 parent 374ec20 commit 69c8ff6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -968,7 +968,7 @@ amzn2023cis_force_user_maxdays: false
amzn2023cis_force_user_mindays: false

# 4.6.1.3 Allow the interactive users not in compliance to force the warndays change
amzn2023cis_force_user_warndays: false
amzn2023cis_force_user_warnage: false

## Control 4.6.1.4 - Ensure inactive password lock is 30 days or less
amzn2023cis_inactivelock:
Expand Down
10 changes: 5 additions & 5 deletions tasks/section_4/cis_4.6.1.x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,19 +82,19 @@
regexp: '^PASS_WARN_AGE'
line: "PASS_WARN_AGE {{ amzn2023cis_pass['warn_age'] }}"

- name: "4.6.1.3 | AUDIT | Ensure password expiration warning days is 7 or more | Get existing users PASS_MIN_DAYS"
ansible.builtin.shell: "awk -F: '/^[^:]+:[^!*]/ && $6< {{ amzn2023cis_pass['warn_days'] }} {print $1}' /etc/shadow"
- name: "4.6.1.3 | AUDIT | Ensure password expiration warning days is 7 or more | Get existing users WARN_DAYS"
ansible.builtin.shell: "awk -F: '/^[^:]+:[^!*]/ && $6< {{ amzn2023cis_pass['warn_age'] }} {print $1}' /etc/shadow"
changed_when: false
failed_when: false
register: discovered_warn_days

- name: "4.6.1.3 | PATCH | Ensure password expiration warning days is 7 or more | Set existing users PASS_WARN_DAYS"
ansible.builtin.shell: "chage --warndays {{ amzn2023cis_pass['warn_days'] }} {{ item }}"
- name: "4.6.1.3 | PATCH | Ensure password expiration warning days is 7 or more | Set existing users WARN_DAYS"
ansible.builtin.shell: "chage --warndays {{ amzn2023cis_pass['warn_age'] }} {{ item }}"
loop: "{{ discovered_warn_days.stdout_lines }}"
when:
- discovered_warn_days.stdout_lines | length > 0
- item in discovered_interactive_usernames.stdout
- amzn2023cis_force_user_warndays
- amzn2023cis_force_user_warnage
when:
- amzn2023cis_rule_4_6_1_3
tags:
Expand Down

0 comments on commit 69c8ff6

Please sign in to comment.