ansible-lockdown / UBUNTU22-CIS

Ansible role for Ubuntu22 CIS Baseline
https://ansible-lockdown.readthedocs.io/en/latest/
MIT License
181 stars 80 forks source link

fix(R5.4.3). Correct regexes so that they match #98

Closed raabf closed 1 year ago

raabf commented 1 year ago

Overall Review of Changes: The core is that I improved a regex which do not match:

'^(password\s*\[success=1 default=ignore\] pam_unix.so)(.*)(remember=([0-9]{1,})|)(.*$)'

to

'^(?P<begin>[^\S\n]*password[^\S\n]+.*pam_unix.so[^\S\n]+)(?P<remember>(?P<before>.+?)remember=[0-9]+[^\S\n]?)?(?P<after>.*)$'

Issue Fixes: N/A

Enhancements:

How has this been tested?:

Some manual runs of the changed task which inserted or kept remember= option correctly, and

Matching Examples to see regex in action: https://regex101.com/r/Kuxcwj