Describe the Issue
The when condition include win22cis_maximum_password_age instead of win22cis_minimum_password_age as shown below:
- name: "1.1.3 | PATCH | Ensure Minimum password age is set to 1 or more days"
block:
- name: "1.1.3 | AUDIT | Ensure Minimum password age is set to 1 or more days. | Warning check for minimum password age."
ansible.builtin.debug:
msg:
- "Warning!! You have an invalid age set for win22cis_maximum_password_age please read"
- "the notes for the variable and make the necessary change to the variable to be in compliance."
when:
- win22cis_maximum_password_age > 999 or
win22cis_maximum_password_age == 0
- name: "1.1.3 | AUDIT | Ensure Minimum password age is set to 1 or more days. | Set warning count."
ansible.builtin.import_tasks:
file: warning_facts.yml
vars:
warn_control_id: '1.1.3'
when:
- win22cis_maximum_password_age > 999 or
win22cis_maximum_password_age == 0
- name: "1.1.3 | PATCH | Ensure Minimum password age is set to 1 or more days. | Set Variable."
community.windows.win_security_policy:
section: System Access
key: MinimumPasswordAge
value: "{{ win22cis_minimum_password_age }}"
when:
- win22cis_maximum_password_age <= 999 or
win22cis_maximum_password_age > 0
Expected Behavior
The when condition should include win22cis_minimum_password_age as shown below:
- name: "1.1.3 | PATCH | Ensure Minimum password age is set to 1 or more days"
block:
- name: "1.1.3 | AUDIT | Ensure Minimum password age is set to 1 or more days. | Warning check for minimum password age."
ansible.builtin.debug:
msg:
- "Warning!! You have an invalid age set for win22cis_minimum_password_age please read"
- "the notes for the variable and make the necessary change to the variable to be in compliance."
when:
- win22cis_minimum_password_age > 999 or
win22cis_minimum_password_age == 1
- name: "1.1.3 | AUDIT | Ensure Minimum password age is set to 1 or more days. | Set warning count."
ansible.builtin.import_tasks:
file: warning_facts.yml
vars:
warn_control_id: '1.1.3'
when:
- win22cis_minimum_password_age > 999 or
win22cis_minimum_password_age == 1
- name: "1.1.3 | PATCH | Ensure Minimum password age is set to 1 or more days. | Set Variable."
community.windows.win_security_policy:
section: System Access
key: MinimumPasswordAge
value: "{{ win22cis_minimum_password_age }}"
when:
- win22cis_minimum_password_age <= 999 or
win22cis_minimum_password_age > 1
Environment (please complete the following information):
branch being used: devel
Additional Notes
If this issue can be fixed at earliest, that will be really great.
Possible Solution
Possible solution:
- name: "1.1.3 | PATCH | Ensure Minimum password age is set to 1 or more days"
block:
- name: "1.1.3 | AUDIT | Ensure Minimum password age is set to 1 or more days. | Warning check for minimum password age."
ansible.builtin.debug:
msg:
- "Warning!! You have an invalid age set for win22cis_minimum_password_age please read"
- "the notes for the variable and make the necessary change to the variable to be in compliance."
when:
- win22cis_minimum_password_age > 999 or
win22cis_minimum_password_age == 1
- name: "1.1.3 | AUDIT | Ensure Minimum password age is set to 1 or more days. | Set warning count."
ansible.builtin.import_tasks:
file: warning_facts.yml
vars:
warn_control_id: '1.1.3'
when:
- win22cis_minimum_password_age > 999 or
win22cis_minimum_password_age == 1
- name: "1.1.3 | PATCH | Ensure Minimum password age is set to 1 or more days. | Set Variable."
community.windows.win_security_policy:
section: System Access
key: MinimumPasswordAge
value: "{{ win22cis_minimum_password_age }}"
when:
- win22cis_minimum_password_age <= 999 or
win22cis_minimum_password_age > 1
Describe the Issue The when condition include
win22cis_maximum_password_age
instead ofwin22cis_minimum_password_age
as shown below:Expected Behavior The when condition should include
win22cis_minimum_password_age
as shown below:Environment (please complete the following information):
Additional Notes If this issue can be fixed at earliest, that will be really great.
Possible Solution Possible solution: