ansible-lockdown / UBUNTU22-CIS-Audit

Audit for Ubuntu 22 CIS
MIT License
38 stars 15 forks source link

5.4.5 (Ensure all current passwords uses the configured hashing algorithm) should accept an exit-code of '1' #17

Closed LoZZoL closed 11 months ago

LoZZoL commented 1 year ago

Describe the Issue UBUNTU2-CIS-Audit runs a check using section_5/cis_5.4/cis_5.4.5.yml which is executing cat /etc/shadow | awk -F':' '{print $2}' | grep -Ev '\$y\$|\*!|!|\*'

Expected Behavior Audit step success should be indicated when the above command returns nothing to stdout and an exit-code of '1'

[redacted]@[redacted]:/opt/UBUNTU22-CIS-Audit$ sudo cat /etc/shadow | awk -F':' '{print $2}' | grep -Ev '\$y\$|\*!|!|\*'
[redacted]@[redacted]:/opt/UBUNTU22-CIS-Audit$ echo $?
1

Actual Behavior Only an exit-code of '0' is set up to be accepted, so the audit fails this step.

Environment (please complete the following information):

uk-bolly commented 1 year ago

hi @LoZZoL

Thank you for taking the time to raise this issue and further discussions on discord if resolving these issues. Time like this really does help us to improve the product.

many thanks

uk-bolly